Hi to all,
I am a noob in SimpliciTI, and I am having troubles to understand how SimpliciTI works with the reception frames. I have an AP (as data hub) and an ED. Each device with different address. I am using the supplied code by TI: "main_AP_Async_Listen_autoack.c"
Reading the documentation, SMPL_Init(scB), provide a callback function (scB) to handle received frames.
In an AP scenario, according to documentation, when first SMPL_Init(scB) (whose lid = 0) is called, it indicates that the AP should execute a SMPL_LinkListen() to receive the link frame. So, in the code, we enter in a "while (1)" waiting for a sJoinSem setting, that indicates a reception of a join frame. This "sJoinSem" is incremented on the callback function, if there is not a identification of peer as a function argument. Sometimes in my tests, this flag increments (I do not know if it is an erratic behaviour or it really establishes a connection ), but when the listening moment is reached, a SMPL_TIMEOUT is returned.
One of my problems is that, the callings to scB. The commented line up of the function definition says "Runs in ISR context", and here, my confusions start. I know that SimpliciTI only have one interrupt, the RX interrupt which goes high the GDO0 signal and this GDO0 signal runs the MRFI_GpioIsr() which, according to some threads in this forum: "part of the interrupt service between the radio and MSP430 (...). Upon this interrupt, the MSP430 will retrieve the received data from the radios FIFO memory and store it in the input queue". In other hand, the solution overview in the main_AP_... file says "The Rx callback must be implemented".
So, my doubt, and sorry if it is very basic, is scB called automatically when ISR occurs? (sJoinSem is set on my test, but it never gets a successful listening) or do I have to implement it in some place of the code? In this last case, how should I do to use the scB? If I set a breakpoint before the ISR, I watch in "mrfiIncomingPacket" the ED address, ports and other parameters sent in the packet, but I do not know how I could use them. I do not know how I can find or pass the argument to the scB function (to identify a peer) or if it is supplied automatically and where do I have to do, if it is required and not only a supposition done by me.
Sorry for this large post, but I have to try to explain it clearer as possible.
Thanks in advice.