Hello there,
The code in my project is based on AP_as_Data_Hub example of SimpliciTI software. The network is composed of one AP and many EDs. The situation is that AP receiving data from every EDs works fine, but if I send data from AP to a specific ED, it fails.
Basically what I did in my software is as below.
ED side:
SMPL_Init(0); SMPL_Link ($sLinkID1)
main loop start.
Collect data to "&msg" buffer.
SMPL_Ioctl( IOCTL_OBJ_RADIO, IOCTL_ACT_RADIO_AWAKE, "" );
SMPL_SendOpt(sLinkID1, msg, sizeof(msg), SMPL_TXOPTION_ACKREQ);
SMPL_Ioctl( IOCTL_OBJ_RADIO, IOCTL_ACT_RADIO_RXON, 0);
keep running function SMPL_Receive(0, msg, &len); tens of times if nothing SMPL_SUCCESS is not returned.
SMPL_Ioctl( IOCTL_OBJ_RADIO, IOCTL_ACT_RADIO_SLEEP, 0);
Sleep for 1 minute
Go to loop start.
AP side:
SMPL_Init(sCB);
main loop start.
if (sJoinSem && (sNumCurrentPeers < NUM_CONNECTIONS))
{
while (1) // listen for a new connection
{
if (SMPL_SUCCESS == SMPL_LinkListen(&sLID[sNumCurrentPeers])) break;
}
sNumCurrentPeers++;
BSP_ENTER_CRITICAL_SECTION(intState);
if (sJoinSem)
{
sJoinSem--;
}
BSP_EXIT_CRITICAL_SECTION(intState);
}
if (sPeerFrameSem) // Have we received a frame on one of the ED connections?
{
for (i=0; i<sNumCurrentPeers; ++i) /// process all frames waiting
{
if (SMPL_Receive(sLID[i], msg, &len) == SMPL_SUCCESS)
{
ioctlRadioSiginfo_t sigInfo;
sigInfo.lid = sLID[i];
SMPL_Ioctl(IOCTL_OBJ_RADIO, IOCTL_ACT_RADIO_SIGINFO, (void *)&sigInfo);
processMessage();
set test data in $msg;
SMPL_SendOpt(1, msg, sizeof(msg), SMPL_TXOPTION_ACKREQ); // Send data to ED
Go to main loop start.
As the result, the return value of function SMPL_SendOpt() in AP side is SMPL_NO_ACK.
and SMPL_Receive() in ED side does receive any data from AP.
I appreciate very much if anybody can give me some suggestions. Thank you!