This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

how to introduce delay inside zstack program

Hi,

   how to create a delay of 500 ms inside a collector node program of simpleApp example program..

this is how i used... but the delay is not produced using this.. is this correct..

 

sprintf(str,"%s",send_sms);
HalUARTWrite(HAL_UART_PORT_0,str,16);
memset(str,0,sizeof(str));

osal_start_timerEx( sapi_TaskID, MY_DELAY_EVT, myDelayReportPeriod );

sprintf(str,"%s",centre_no);
HalUARTWrite(HAL_UART_PORT_0,str,24);
memset(str,0,sizeof(str));

osal_start_timerEx( sapi_TaskID, MY_DELAY_EVT, myDelayReportPeriod );

sprintf(str,"%s",sim_capability);
HalUARTWrite(HAL_UART_PORT_0,str,20);
memset(str,0,sizeof(str));

 

 

  • hi,
    i have even tried using onboardwait

    but still its not working


    if (command == SENSOR_REPORT_CMD_ID)
    {

    if(pData[0]==TEMP_REPORT)
    {
    sensortmsb = pData[1]/10;
    sensortlsb = pData[1]%10;

    sensorbmsb = pData[2]/10;
    sensorblsb = pData[2]%10;

    sprintf(str,"%s",attn);
    HalUARTWrite(HAL_UART_PORT_0,str,4);
    memset(str,0,sizeof(str));

    ///delay();
    Onboard_wait(60000);

    sprintf(str,"%s",txt_mode);
    HalUARTWrite(HAL_UART_PORT_0,str,12);
    memset(str,0,sizeof(str));

    //delay();
    Onboard_wait(60000);
  • I cannot understand what you want to achieve from your code. Can you elaborate so I can understand your problem well?