diff --git a/src/ncp-uart-hw/app.c b/src/ncp-uart-hw/app.c index f273aac0..c93e7a83 100644 --- a/src/ncp-uart-hw/app.c +++ b/src/ncp-uart-hw/app.c @@ -163,22 +163,13 @@ void nc_zigbee_override_append_source_route(EmberNodeId destination, EmberMessageBuffer *header, bool *consumed) { - uint8_t index = 0xFF; - - for (uint8_t i = 0; i < XNCP_MANUAL_SOURCE_ROUTE_TABLE_SIZE; i++) { - if (manual_source_routes[i].active && (manual_source_routes[i].destination == destination)) { - index = i; - break; - } - } + ManualSourceRoute *route = get_manual_source_route(destination); - if (index == 0xFF) { + if (route == NULL) { *consumed = false; return; } - ManualSourceRoute *route = &manual_source_routes[index]; - uint8_t relay_index = 0; *consumed = true;