Corrected demo send example for whohas service.
This commit is contained in:
@@ -84,6 +84,7 @@ void Send_WhoHas_Object(int32_t low_limit,
|
|||||||
int32_t high_limit,
|
int32_t high_limit,
|
||||||
BACNET_OBJECT_TYPE object_type, uint32_t object_instance)
|
BACNET_OBJECT_TYPE object_type, uint32_t object_instance)
|
||||||
{
|
{
|
||||||
|
int len = 0;
|
||||||
int pdu_len = 0;
|
int pdu_len = 0;
|
||||||
BACNET_ADDRESS dest;
|
BACNET_ADDRESS dest;
|
||||||
int bytes_sent = 0;
|
int bytes_sent = 0;
|
||||||
@@ -95,13 +96,18 @@ void Send_WhoHas_Object(int32_t low_limit,
|
|||||||
return;
|
return;
|
||||||
/* Who-Has is a global broadcast */
|
/* Who-Has is a global broadcast */
|
||||||
datalink_get_broadcast_address(&dest);
|
datalink_get_broadcast_address(&dest);
|
||||||
|
/* encode the NPDU portion of the packet */
|
||||||
|
npdu_encode_npdu_data(&npdu_data, false, MESSAGE_PRIORITY_NORMAL);
|
||||||
|
pdu_len = npdu_encode_pdu(&Handler_Transmit_Buffer[0], &dest,
|
||||||
|
NULL, &npdu_data);
|
||||||
/* encode the APDU portion of the packet */
|
/* encode the APDU portion of the packet */
|
||||||
data.low_limit = low_limit;
|
data.low_limit = low_limit;
|
||||||
data.high_limit = high_limit;
|
data.high_limit = high_limit;
|
||||||
data.object_name = false;
|
data.object_name = false;
|
||||||
data.object.identifier.type = object_type;
|
data.object.identifier.type = object_type;
|
||||||
data.object.identifier.instance = object_instance;
|
data.object.identifier.instance = object_instance;
|
||||||
pdu_len = whohas_encode_apdu(&Handler_Transmit_Buffer[0], &data);
|
len = whohas_encode_apdu(&Handler_Transmit_Buffer[pdu_len], &data);
|
||||||
|
pdu_len += len;
|
||||||
bytes_sent = datalink_send_pdu(&dest, &npdu_data,
|
bytes_sent = datalink_send_pdu(&dest, &npdu_data,
|
||||||
&Handler_Transmit_Buffer[0], pdu_len);
|
&Handler_Transmit_Buffer[0], pdu_len);
|
||||||
#if PRINT_ENABLED
|
#if PRINT_ENABLED
|
||||||
|
|||||||
Reference in New Issue
Block a user