Implemented separate Who-Is and Who-Has handlers for the routed case, where we loop through all the Devices looking for matches.
Tested and improved the routing code. Gateway demo now sends I-Am as each Device is added. Added test for valid Network number when routing, and only send Reject message if this fails (and not if we just can't find a Device match). Test the hop_count and discard the packet if would reach 0 and a destination Network is called for.
This commit is contained in:
@@ -331,7 +331,10 @@ extern "C" {
|
||||
BACNET_ADDRESS * dest,
|
||||
int * DNET_list,
|
||||
int * cursor );
|
||||
|
||||
bool Routed_Device_Is_Valid_Network(
|
||||
uint16_t dest_net,
|
||||
int * DNET_list );
|
||||
|
||||
uint32_t Routed_Device_Index_To_Instance(
|
||||
unsigned index);
|
||||
bool Routed_Device_Valid_Object_Instance_Number(
|
||||
|
||||
@@ -70,11 +70,26 @@ extern "C" {
|
||||
uint16_t service_len,
|
||||
BACNET_ADDRESS * src);
|
||||
|
||||
void handler_who_is_bcast_for_routing(
|
||||
uint8_t * service_request,
|
||||
uint16_t service_len,
|
||||
BACNET_ADDRESS * src);
|
||||
|
||||
void handler_who_is_unicast_for_routing(
|
||||
uint8_t * service_request,
|
||||
uint16_t service_len,
|
||||
BACNET_ADDRESS * src);
|
||||
|
||||
void handler_who_has(
|
||||
uint8_t * service_request,
|
||||
uint16_t service_len,
|
||||
BACNET_ADDRESS * src);
|
||||
|
||||
void handler_who_has_for_routing(
|
||||
uint8_t * service_request,
|
||||
uint16_t service_len,
|
||||
BACNET_ADDRESS * src);
|
||||
|
||||
void handler_i_am_add(
|
||||
uint8_t * service_request,
|
||||
uint16_t service_len,
|
||||
|
||||
Reference in New Issue
Block a user