My application has to controll the sender number of incoming SMS, these numbers are controlled against the SIM phonebook.
If the number is NOT in the SIM phonebook, no commands is to be read from SMS.
bool number_check()
{
valid_number=FALSE;
ascii string[20];
//incoming number
wm_sprintf(string,"AT+CPBP=\"%s\"",reply_number);
//Search for number in SIM phonebook
adl_atCmdCreate(string,ADL_AT_PORT_TYPE ( ADL_PORT_UART1, FALSE ), (adl_atRspHandler_t) number_check_Handler,"+CPBP", NULL);
return valid_number;
}
bool number_check_Handler(adl_atResponse_t * response)
{
valid_number=TRUE;
return FALSE;
}
The problem is that the number_check_handler does not change the “valid_number=TRUE” fast enough. So the function never returns TRUE. Is there some way of suspending the code execution until the number_check_handler has RUN?
Or maybe a more clever solution to my problem?
Thanks!