0

I am using GSMCOMM http://www.scampers.org/steve/sms/libraries.htmlibrary in C# to send and receive SMS.

So I need check Sim is inserted or not in the modem.

Is there any way to check this in C# ?

Thanks in advance.

Freelancer
  • 9,008
  • 7
  • 42
  • 81
Atish Kumar Dipongkor
  • 10,220
  • 9
  • 49
  • 77

2 Answers2

1

You could try to read the IMSI number with the AT command line AT+CMEE=1; +CIMI, that should give you +CME ERROR: 10 (SIM not inserted) if there is no sim card.

See 27.007 for more details on the commands.

hlovdal
  • 26,565
  • 10
  • 94
  • 165
0

Use the Windows Mobile Broadband API (supported from Windows 7 onwards). For example if you get the connection state using IMbnConnection::GetConnectionState, and there is no SIM inserted, you will get E_MBN_SIM_NOT_INSERTED as the return value.

user1725145
  • 3,993
  • 2
  • 37
  • 58