Szabolcs Tibor Kelemen

802.15.4 MAC's ASP interface : event request

Discussion created by Szabolcs Tibor Kelemen on Aug 27, 2006
Latest reply on Aug 30, 2006 by Wilson Woon
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:

 uint8_t res;
 aspMsg_t aspEvent;
 aspEventReq_t *pEventReq;
 pEventReq = &aspEvent.appToAspMsg.msgData.aspEventReq;
 // Set the type.
 aspEvent.msgType = gAppAspEventReq_c;

 pEventReq->eventTime[0] = REQDATABYTE0;  //0
 pEventReq->eventTime[1] = REQDATABYTE1;  //0xff
 pEventReq->eventTime[2] = REQDATABYTE2;  //0
 // Send the request to the ASP SAP.

     res = MSG_Send(APP_ASP, &aspEvent);     
     if (res == gSuccess_c)
      // break; 
     if (res == gInvalidParameter_c)
       Uart_Print("No success\n");

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.
Kelemen Szabolcs