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.

Global Variable not global?

Other Parts Discussed in Thread: Z-STACK

Using Z-Stack 1.4.2-1.1.0 with modified SimpleApp:

 

I declared a global variable LAST_SMS in SimpleApp.h:

static bool  LAST_SMS;                // indicating that all SMS of the session are sent

 

during the run-time I set this varibale in SimpleCoordinator.c to TRUE:

LAST_SMS = TRUE;

According to the debugger in the watch-window it is changed.

 

It follows a function call to sapi.c:

zb_WriteSmsToUart ( (uint8 *)SmsContext, 5 );

where the SMS is sent out.

 

The response from the modem triggers the UART callback funtion in sapi.c, which checks if LAST_SMS is TRUE or FALSE to see if multiple SMS have to be sent out, but at this point of time the variable has changed to FALSE.There is currently only one command setting the varibale wrong in the entire project and that is during initialisation of the device and that line is not called.

Where or why is the variable set back to FALSE?

Do I use the variable wrongly? When yes, what is the right way of doing it?

 

Thanks. Appreciate EVERY reply, even the smallest!