diff --git a/bacnet-stack/demo/gateway/main.c b/bacnet-stack/demo/gateway/main.c index 3e5a5bf0..68376abc 100644 --- a/bacnet-stack/demo/gateway/main.c +++ b/bacnet-stack/demo/gateway/main.c @@ -83,27 +83,6 @@ /** @addtogroup GatewayDemo */ /*@{*/ -/* All included BACnet objects */ -static object_functions_t Object_Table[] = { - {DEVICE_OBJ_FUNCTIONS}, - {ANALOG_INPUT_OBJ_FUNCTIONS}, - {ANALOG_OUTPUT_OBJ_FUNCTIONS}, - {ANALOG_VALUE_OBJ_FUNCTIONS}, - {BINARY_INPUT_OBJ_FUNCTIONS}, - {BINARY_OUTPUT_OBJ_FUNCTIONS}, - {BINARY_VALUE_OBJ_FUNCTIONS}, - {LIFE_SAFETY_POINT_OBJ_FUNCTIONS}, - {LOAD_CONTROL_OBJ_FUNCTIONS}, - {MULTI_STATE_OUTPUT_OBJ_FUNCTIONS}, - {MULTI_STATE_INPUT_OBJ_FUNCTIONS}, - {TRENDLOG_OBJ_FUNCTIONS}, -#if defined(BACFILE) - {FILE_OBJ_FUNCTIONS}, -#endif - {MAX_BACNET_OBJECT_TYPE, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL} -}; - /** Buffer used for receiving */ static uint8_t Rx_Buf[MAX_MPDU] = { 0 }; @@ -156,16 +135,19 @@ void Devices_Init( static void Init_Service_Handlers( uint32_t first_object_instance) { - Device_Init(&Object_Table[0]); + Device_Init(NULL); Routing_Device_Init(first_object_instance); /* we need to handle who-is to support dynamic device binding - * For the gateway, we want the routing handlers, and we will use the - * unicast variety so we can get back through switches to different subnets */ + * For the gateway, we will use the unicast variety so we can + * get back through switches to different subnets. + * Don't need the routed versions, since the npdu handler calls + * each device in turn. + */ apdu_set_unconfirmed_handler(SERVICE_UNCONFIRMED_WHO_IS, - handler_who_is_unicast_for_routing); + handler_who_is_unicast); apdu_set_unconfirmed_handler(SERVICE_UNCONFIRMED_WHO_HAS, - handler_who_has_for_routing); + handler_who_has); /* set the handler for all the services we don't implement */ /* It is required to send the proper reject message... */ apdu_set_unrecognized_service_handler_handler diff --git a/bacnet-stack/demo/handler/h_whohas.c b/bacnet-stack/demo/handler/h_whohas.c index fff0f8bf..37f61238 100644 --- a/bacnet-stack/demo/handler/h_whohas.c +++ b/bacnet-stack/demo/handler/h_whohas.c @@ -110,7 +110,7 @@ void handler_who_has( } -#ifdef BAC_ROUTING +#ifdef DEPRECATED /* was for BAC_ROUTING - delete in 2/2012 if still unused */ /** Handler for Who-Has requests in the virtual routing setup, * with broadcast I-Have response. * Will respond if the device Object ID matches, and we have diff --git a/bacnet-stack/demo/handler/h_whois.c b/bacnet-stack/demo/handler/h_whois.c index 438bdee7..9e843cc0 100644 --- a/bacnet-stack/demo/handler/h_whois.c +++ b/bacnet-stack/demo/handler/h_whois.c @@ -95,6 +95,7 @@ void handler_who_is_unicast( len = whois_decode_service_request(service_request, service_len, &low_limit, &high_limit); + /* If no limits, then always respond */ if (len == 0) Send_I_Am_Unicast(&Handler_Transmit_Buffer[0], src); else if (len != -1) { @@ -112,7 +113,7 @@ void handler_who_is_unicast( } -#ifdef BAC_ROUTING +#ifdef DEPRECATED /* was for BAC_ROUTING - delete in 2/2012 if still unused */ /** Local function to check Who-Is requests against our Device IDs. * Will check the gateway (root Device) and all virtual routed * Devices against the range and respond for each that matches. diff --git a/bacnet-stack/demo/handler/s_iam.c b/bacnet-stack/demo/handler/s_iam.c index 26906768..b8f02d02 100644 --- a/bacnet-stack/demo/handler/s_iam.c +++ b/bacnet-stack/demo/handler/s_iam.c @@ -133,7 +133,7 @@ int iam_unicast_encode_pdu( BACNET_ADDRESS my_address; /* The destination will be the same as the src, so copy it over. */ memcpy(dest, src, sizeof(BACNET_ADDRESS)); - dest->net = 0; + /* dest->net = 0; - no, must direct back to src->net to meet BTL tests */ datalink_get_my_address(&my_address); /* encode the NPDU portion of the packet */ diff --git a/bacnet-stack/include/dlenv.h b/bacnet-stack/include/dlenv.h index 09e3e4f2..217c1e1a 100644 --- a/bacnet-stack/include/dlenv.h +++ b/bacnet-stack/include/dlenv.h @@ -37,10 +37,10 @@ extern "C" { uint16_t elapsed_seconds); /* Simple setters and getter. */ - void set_bbmd_address( long address ); - void set_bbmd_port( int port ); - void set_bbmd_ttl( int ttl_secs ); - int get_bbmd_result( void ); + void dlenv_bbmd_address_set( long address ); + void dlenv_bbmd_port_set( int port ); + void dlenv_bbmd_ttl_set( int ttl_secs ); + int dlenv_bbmd_result( void ); #ifdef __cplusplus }