Skip to content

Commit

Permalink
Prefix XNCP config
Browse files Browse the repository at this point in the history
  • Loading branch information
puddly committed May 29, 2024
1 parent 273a53d commit 9f92e1f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/ncp-uart-hw/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ typedef struct ManualSourceRoute {
uint16_t relays[EMBER_MAX_SOURCE_ROUTE_RELAY_COUNT];
} ManualSourceRoute;

ManualSourceRoute manual_source_routes[MANUAL_SOURCE_ROUTE_TABLE_SIZE];
ManualSourceRoute manual_source_routes[XNCP_MANUAL_SOURCE_ROUTE_TABLE_SIZE];

//----------------------
// Implemented Callbacks
Expand All @@ -67,7 +67,7 @@ void emberAfRadioNeedsCalibratingCallback(void)
*/
void emberAfMainInitCallback(void)
{
for (uint8_t i = 0; i < MANUAL_SOURCE_ROUTE_TABLE_SIZE; i++) {
for (uint8_t i = 0; i < XNCP_MANUAL_SOURCE_ROUTE_TABLE_SIZE; i++) {
manual_source_routes[i].active = false;
}
}
Expand Down Expand Up @@ -106,7 +106,7 @@ void nc_zigbee_override_append_source_route(EmberNodeId destination,
{
uint8_t index = 0xFF;

for (uint8_t i = 0; i < MANUAL_SOURCE_ROUTE_TABLE_SIZE; i++) {
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;
Expand Down Expand Up @@ -169,10 +169,10 @@ EmberStatus emberAfPluginXncpIncomingCustomFrameCallback(uint8_t messageLength,
}

// If we don't find a better index, pick one at random to replace
uint8_t insertion_index = emberGetPseudoRandomNumber() % MANUAL_SOURCE_ROUTE_TABLE_SIZE;
uint8_t insertion_index = emberGetPseudoRandomNumber() % XNCP_MANUAL_SOURCE_ROUTE_TABLE_SIZE;
uint16_t node_id = BUILD_UINT16(messagePayload[2], messagePayload[3]);

for (uint8_t i = 0; i < MANUAL_SOURCE_ROUTE_TABLE_SIZE; i++) {
for (uint8_t i = 0; i < XNCP_MANUAL_SOURCE_ROUTE_TABLE_SIZE; i++) {
ManualSourceRoute *route = &manual_source_routes[i];

if (route->active == false) {
Expand Down
2 changes: 1 addition & 1 deletion src/ncp-uart-hw/config/xncp_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
// Table entries are ephemeral and are expected to be populated before a request is sent.
// This is not the size of any source route table! Rather, this controls how many unique
// destinations can be concurrently contacted with source routing enabled.
#define MANUAL_SOURCE_ROUTE_TABLE_SIZE (20)
#define XNCP_MANUAL_SOURCE_ROUTE_TABLE_SIZE (20)

#endif /* CONFIG_XNCP_CONFIG_H_ */

0 comments on commit 9f92e1f

Please sign in to comment.