CellularRadio events don't fire in pure NETMF code

I have a static CellularRadio gsmModem; defined in my Program class and I create it as follows in Main().


gsmModem = new CellularRadio(virtualSocket.SocketNumber);

I am using a virtual socket to make this work under Pure NETMF code. The modem is responding to AT commands so I know the driver is opening the correct ports etc.

I then create the following to get the signal strength.


gsmModem.SignalStrengthRequested += gsmModem_SignalStrengthRequested;
gsmModem.RequestSignalStrength();

I can step into the driver and see the AT+CSQ reply and then the CheckAndInvoke call but my event handler never gets called.

What am I missing?

Gadgeteer, you’re missing Gadgeteer.

Given the Gadgeteer “you must wait for programstarted() to finish” edict, there’s obviously dispatcher type activities that are dealt with post ProgramStarted() in Main() that you could look at the code for…

Pffft. Gadgeteer smadgeteer!! :stuck_out_tongue:

I’ve edited the code to remove the CheckAndInvoke calls and now all is working fine for me :slight_smile:

As the library is not thread safe, I’ve implemented locks and use a number of state machines to handle the SMS.

Things are all fine and dandy when using Gadgeteer but you quickly realise the quirks needed when not using it.

1 Like