gsm signal quality - ril device

  • Thread starter Thread starter DM
  • Start date Start date
D

DM

Hello.

I'm trying in my app to get an information on gsm signal strength.
Searching archives of this group and
microsoft.public.pocketpc.developer
resulted in the following code, which I believe should give me
required info:

FileHandle = FileEx.CreateFile("RIL1:",FileAccess.Read |
FileAccess.Write, FileShare.ReadWrite,FileCreateDisposition.OpenExisting,0);
ASCIIEncoding enc = new System.Text.ASCIIEncoding();
byte[] buf = enc.GetBytes("AT+CSQ");
int written=0;
FileEx.WriteFile(FileHandle,buf,buf.Length, ref written);
if (written != buf.Length )
MessageBox.Show("Hmm ");
byte[] readBuffer = new byte[200];
int read = 0;
FileEx.ReadFile(FileHandle,readBuffer,readBuffer.Length,ref read);
string result = enc.GetString(readBuffer,0,read);
textBox2.Text = result;

Unfortunately - WriteFile reports that 0 bytes is written to the
device - the same refers to read.
I would be grateful for any help.
 
Is there any reason why you can't just use:
SystemState.PhoneSignalStrength instead of accessing the RIL directly?

Matt
 
Back
Top