I'm implementing a wireless sensor application based on 802.15.4 MAC/PHY MyWirelessApp application example (1.063).
I use the 13192 DSK as hardware.
My problem is the following:
I have a sensor connected to the SARD card. I have to perform a measurement with the sensor every 3 seconds.
The easiest way to schedule this would be using the RTI option of the HCS08 MCU. But as I saw in the "Low power library for MAC and ZigBee stack applications", RTI will be further used during low power operations, so the complete application (including low power comsumption) cannot use RTI for scheduling measurements.
I saw that in the 802.15.4 MAC's ASP interface there's an event request service primitive. I hoped that this can substitue the RTI.
If I'm not wrong, it will cause the ASP to send an ASP message to the application a certain time later. The time is specified in the event request primitive, and it is relative to the time when it was called.
The problem is that it doesn't work.
I've tried to place the 1st event with the following code:
pEventReq = &aspEvent.appToAspMsg.msgData.aspEventReq;
// Set the type.
aspEvent.msgType = gAppAspEventReq_c;
pEventReq->eventTime = REQDATABYTE0; //0
pEventReq->eventTime = REQDATABYTE1; //0xff
pEventReq->eventTime = REQDATABYTE2; //0
// Send the request to the ASP SAP.
res = MSG_Send(APP_ASP, &aspEvent);
if (res == gSuccess_c)
if (res == gInvalidParameter_c)
This code has no effect. Printing to the screen shows, that sending the message wasn't succesful (res == gInvalidParameter_c)
Naturally no ASP to APP message comes.
I don't know if the hardware supports this function, or there is an other problem. (Maybe some extra initialization is needed?)
Can you help me? Is there any example code for using the event request primive?
If there is an other way to schedule measurement every 3 seconds, I will accept that, too.