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 = 0x01; // This is the address of the AP
pAddr.addr = 0x56;
pAddr.addr = 0x34;
pAddr.addr = 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;
if (SMPL_SUCCESS == SMPL_Ioctl(IOCTL_OBJ_RAW_IO, IOCTL_ACT_READ, &ioctl_info.recv))
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.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.