|
发表于 2024-9-10 16:46:52
|
显示全部楼层
Hi,
When the A light try to join into the network, it will choose a best parent to associate.
Because of the B light is closer so the A light choose the B light as a parent to join into the network to increase the probability of successful network access.
If you only want A lights to select coordinator as the parent node, you can register callback function to do filtering.
You can register the macAppIndCbList in stack_init, and add the code below in zb_appCb.c.
bool sampleLight_beaconIndHandler(void *arg);
mac_appIndCb_t macAppIndCbList = {NULL, sampleLight_beaconIndHandler, NULL};
bool sampleLight_beaconIndHandler(void *arg){
u8* payload = arg;
u16 fcf = ((*(payload+1)) << 8) | (*payload);
u16 srcAddr = 0;
if((fcf & 0x8000) == 0x8000){
srcAddr = ((*(payload+6)) << 8) | (*(payload+5));
if(srcAddr == 0x0000){ //the network address of the coordinator
return TRUE;
}
}
return FALSE;
} |
|