Tool/software:
Hi,
I am trying to port our code from 15.4 FH mode to FH Low Latency Broadcast (FH-LLB) mode. So far I was able to get network joining, sending data from sensor to collector to work, but hit a snag when trying to send data from collector to a specific sensor node.
According to the documentation available here, collector sends data to sensor through broadcast, each sensor node receives a copy of the message and discards messages without matching address. Programming wise, how do we go about this?
I assume we can use the same function in `collector.c` as we do in other network modes
// collector.c static bool sendMsg(Smsgs_cmdIds_t type, uint16_t dstShortAddr, bool rxOnIdle, uint16_t len, uint8_t *pData, uint8_t *frameIdPtr);
So far none of the messages sent via this function is received by sensor nodes.
There is also a function to broadcast messages:
static void sendBroadcastMsg(Smsgs_cmdIds_t type, uint16_t len, uint8_t *pData)
This seems to be the function used by example collector project to send data to sensor nodes in FH-LLB mode. Destination address is manually assembled into payload, sensor nodes then perform a manual check if destination address matches its own.
/* Collector generate a broadcast command message for FH mode */ if(Collector_events & COLLECTOR_BROADCAST_TIMEOUT_EVT) { /* Clear the event */ Util_clearEvent(&Collector_events, COLLECTOR_BROADCAST_TIMEOUT_EVT); if(FH_BROADCAST_INTERVAL > 0 && (!CERTIFICATION_TEST_MODE)) { #ifdef FH_LOW_LATENCY_BROADCAST if(broadcastQueue < 1) { uint8_t buffer[SMSGS_BROADCAST_CMD_LENGTH]; uint8_t *pBuf = buffer; /* Build the message */ if(sendCamCmd) { *pBuf++ = (uint8_t)Smgs_cmdIds_broadcastCtrlMsg; *pBuf++ = Util_loUint16(destDevAddr); *pBuf++ = Util_hiUint16(destDevAddr); *pBuf = 0x1; sendCamCmd -= 1; } else { *pBuf++ = (uint8_t)Smgs_cmdIds_broadcastCtrlMsg; *pBuf++ = 0xF; *pBuf++ = 0xF; *pBuf = 0xF; } broadcastQueue += 1; sendBroadcastMsg(Smgs_cmdIds_broadcastCtrlMsg, SMSGS_BROADCAST_CMD_LENGTH, buffer); } /* set clock for next broadcast command */ Csf_setBroadcastClock(FH_BROADCAST_INTERVAL / 2); #else // FH_LOW_LATENCY_BROADCAST generateBroadcastCmd(); /* set clock for next broadcast command */ Csf_setBroadcastClock(FH_BROADCAST_INTERVAL); #endif // FH_LOW_LATENCY_BROADCAST } }
My question is, can the address check done by MAC layer? Or is there a different way to do it?
Thanks,
ZL