0876.RAW_IO_PING.psdHi there,
I am trying to test the IOCTL_OBJ_RAW_IO (IOCTL_ACT_WRITE/ IOCTL_ACT_READ) capabilities to the AP_as_Data_Hub example (for CC2510 AP and ED) of the SimpliciTI stack. To do this, I added the following code piece to the “static void linkTo()” function of the CC2510-End Device project (main_manyEDs_autoack.c). This is simply to implement a Ping to the AP. The code on the AP side is not changed. The purpose of this code piece is to check the IOCTL_OBJ_RAW_IO (IOCTL_ACT_WRITE/ IOCTL_ACT_READ) capabilities in this AP_as_Data_Hub configuration. If the Ping is successful, the LED2 on the dev board (SmartRF04EB with CC2510EM) will toggle.
// ++++++++++++++++++++++++++++
// Test code for RAW IO (start)
pAddr.addr[0] = 0x01; // This is the address of the AP
pAddr.addr[1] = 0x56;
pAddr.addr[2] = 0x34;
pAddr.addr[3] = 0x12;
ioctl_info.send.addr = &pAddr;
ioctl_info.send.msg = msg;
ioctl_info.send.len = sizeof(msg);
ioctl_info.send.port = SMPL_PORT_PING;
/* fill in msg */
msg[PB_REQ_OS] = PING_REQ_PING;
msg[PB_TID_OS] = sTid;
SMPL_Ioctl(IOCTL_OBJ_RAW_IO, IOCTL_ACT_WRITE, &ioctl_info.send);
ioctl_info.recv.port = SMPL_PORT_PING;
ioctl_info.recv.msg = msg;
ioctl_info.recv.addr = 0;
NWK_CHECK_FOR_SETRX(radioState);
NWK_REPLY_DELAY();
NWK_CHECK_FOR_RESTORE_STATE(radioState);
if (SMPL_SUCCESS == SMPL_Ioctl(IOCTL_OBJ_RAW_IO, IOCTL_ACT_READ, &ioctl_info.recv))
{
toggleLED(2);
sTid++; /* guard against duplicates */
}
// +++++++++++++++++++++++++
// Test code for RAW IO (end)
To avoid any complication, I disabled the FREQUENCY_HOPPING, FREQUENCY_AGILITY and the radio sleep function of the End Device in the code. No other change has been made to the whole project. I run the project and found that the AP and ED work correctly on toggling the LEDs related to the autoack messages. However, the newly added Ping command using IOCTL_OBJ_RAW_IO (IOCTL_ACT_WRITE/ IOCTL_ACT_READ) doesn’t work. I cannot see the LED2 toggle on the End Device. I also used a packet sniffer to monitor the OTA packets and found that the Ping message is actually successfully sent by the ED and received/echoed by the AP (as shown below).
P.nbr 1 – 4 show the Join/Link of the End Device (78 56 34 12) to the AP (01 56 34 12).
P.nbr 5 - 6 show the autoack messages from ED to AP by pressing Button 1.
P.nbr 7 – 8 show the Ping sent from ED to AP and echoed back from AP to ED.
It seems that the Ping is successful. So why can’t I see the LED2 toggle on the End Device?
I attached the original packet sniffer file here for your reference. The source code is also attached here for your reference. Please note that I am using IAR EW8051 v8.11. The two dev boards (AP and ED) are from the CC2510-CC2511 DK rev 2.2.1 (SmartRF04EB ver 1.9).
Here are the files for packet sniffer and the source code.
5127.RAW_IO_PING.psd
7026.SimpliciTI-IAR-1.2.0_IAR EW8051_v8.11-Raw_IO_Ping.zip