Hi,
I found an issue with the Cellular Radio Module Driver.
The function SendSMS works only once.
The second call returns always with a “ModuleIsBusy” error.
I took a look at the driver and I noticed that the variable isModuleBusy is set to true by the sendSMS but never set to false again. I think that the variable should be set to false before the function returns or that it is necessary to call the function ProcessATCommandResponse (that will take care of setting the isModuleBusy to false).
Below the code with the isModuleBusy set to false before the function returns. This works for me, but I will try to call the ProcessATCommandResponse instead.
public ReturnedState SendSms(string number, string message)
{
// Check if module is on
if (!isPowerOn) return ReturnedState.ModuleIsOff;
// Check if serial line is open
if (serialLine.IsOpen)
{
//Check if module is busy
if (isModuleBusy) return ReturnedState.ModuleBusy;
isModuleBusy = true;
serialLine.Write("AT+CMGS=\"+" + number + "\"\r\n");
Thread.Sleep(100);
serialLine.Write(message);
Thread.Sleep(100);
serialLine.Write((char)26 + "\r");
//semaphore = true;
//while (semaphore) Thread.Sleep(10);
// **********************
isModuleBusy = false;
// **********************
return ReturnedState.OK;
}
else return ReturnedState.Error;
}
Hope this could be of some help to other users.
Bye!
Stefano.