[Ovmsdev] Any Telco engineers?

Mark Webb-Johnson mark at webb-johnson.net
Mon Mar 19 22:25:52 HKT 2012


Any Telco engineers here?

I've been working on the iOS App code to convert the GSM signal strength indicator that comes back from the car into a 5 bar display and dBm value. There doesn't seem to be a standard for this, so I picked the iPhone 4.0.1 levels, as the reportedly the same as AT&T now use and at least I can compare with my iPhone.

Code looks like this:

  // car_gsmlevel comes back from the car as the output of AT+CSQ
  // It is reportedly in the range 0..31, 99.
  int car_gsmlevel = [ovmsAppDelegate myRef].car_gsmlevel;

  // Calculate dBm from AT+CSQ signal level
  int car_gsmdbm = 0;
  if (car_gsmlevel <= 31)
    car_gsmdbm = -113 + (car_gsmlevel*2);

  // Tell the user about the dBm 
  m_gsm.text = [NSString stringWithFormat:@"%d dBm",car_gsmdbm];

  // Calculate the signal bars 0..5
  int car_signalbars = 0;
  if ((car_gsmdbm < -121)||(car_gsmdbm >= 0))
    car_signalbars = 0;
  else if (car_gsmdbm < -107)
    car_signalbars = 1;
  else if (car_gsmdbm < -98)
    car_signalbars = 2;
  else if (car_gsmdbm < -87)
    car_signalbars = 3;
  else if (car_gsmdbm < -76)
    car_signalbars = 4;
  else
    car_signalbars = 5;

Does that look ok, or can anyone with experience of this suggest anything better?

I've got a testflightapp build ready with this, and should be able to release tomorrow morning (my time). Just waiting for some device ids / testflightapp recruits to come in from interested developers who have eMailed me offering to help.

Regards, Mark.

P.S. The last 20120318 testflightapp build looks good. Crashes for the past 24 hours have gone to zero and things seem more stable.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20120319/aaaa30db/attachment.htm>


More information about the OvmsDev mailing list