Moved the iam_send to demo/handler/s_iam.c to keep application code out of the core encode/decode library.
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -44,7 +44,7 @@
|
||||
#include "bits.h"
|
||||
#include "bacaddr.h"
|
||||
/* special optimization - I-Am response in this module */
|
||||
#include "iam.h"
|
||||
#include "client.h"
|
||||
#include "txbuf.h"
|
||||
|
||||
/* This file has been customized for use with small microprocessors */
|
||||
@@ -277,7 +277,7 @@ void dlmstp_fill_bacnet_address(
|
||||
}
|
||||
|
||||
/* I Am from handler */
|
||||
extern bool Send_I_Am;
|
||||
extern bool Send_I_Am_Flag;
|
||||
|
||||
/* look at any of the unconfirmed message bits and encode if set */
|
||||
static uint16_t dlmstp_encode_unconfirmed_frame(
|
||||
@@ -287,8 +287,8 @@ static uint16_t dlmstp_encode_unconfirmed_frame(
|
||||
BACNET_NPDU_DATA npdu_data;
|
||||
uint16_t len = 0;
|
||||
|
||||
if (Send_I_Am) {
|
||||
Send_I_Am = false;
|
||||
if (Send_I_Am_Flag) {
|
||||
Send_I_Am_Flag = false;
|
||||
TransmitPacket = Handler_Transmit_Buffer;
|
||||
len = iam_encode_pdu(&TransmitPacket[0], &dest, &npdu_data);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "client.h"
|
||||
#include "txbuf.h"
|
||||
|
||||
bool Send_I_Am = true;
|
||||
bool Send_I_Am_Flag = true;
|
||||
|
||||
void handler_who_is(
|
||||
uint8_t * service_request,
|
||||
@@ -54,7 +54,7 @@ void handler_who_is(
|
||||
whois_decode_service_request(service_request, service_len, &low_limit,
|
||||
&high_limit);
|
||||
if (len == 0) {
|
||||
Send_I_Am = true;
|
||||
Send_I_Am_Flag = true;
|
||||
} else if (len != -1) {
|
||||
/* is my device id within the limits? */
|
||||
target_device = Device_Object_Instance_Number();
|
||||
@@ -63,7 +63,7 @@ void handler_who_is(
|
||||
/* BACnet wildcard is the max instance number - everyone responds */
|
||||
((BACNET_MAX_INSTANCE >= (uint32_t) low_limit) &&
|
||||
(BACNET_MAX_INSTANCE <= (uint32_t) high_limit))) {
|
||||
Send_I_Am = true;
|
||||
Send_I_Am_Flag = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "av.h"
|
||||
|
||||
/* From the WhoIs hander - performed by the DLMSTP module */
|
||||
extern bool Send_I_Am;
|
||||
extern bool Send_I_Am_Flag;
|
||||
/* local version override */
|
||||
const char *BACnet_Version = "1.0";
|
||||
|
||||
@@ -134,7 +134,7 @@ static void input_switch_read(
|
||||
dlmstp_set_mac_address(Address_Switch);
|
||||
#endif
|
||||
Device_Set_Object_Instance_Number(86000 + Address_Switch);
|
||||
Send_I_Am = true;
|
||||
Send_I_Am_Flag = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user