Close

Nothing Good Comes Easy

A project log for SubPos Positioning System

A "dataless" Wi-Fi positioning system that can be used anywhere GPS can't.

BleckyBlecky 03/27/2015 at 13:590 Comments

I wrote a simple Android application to decode the SSID and display it, unfortunately I am having a slight issue. Some control characters are handled incorrectly by the ScanResult class.

Original string:

\x53\x50\x53\x3a\x41\x55\x53\x00\x00\x63\x3b\x15\x0b\x07\x3b\x76\xff\x31\x07\x5b\xcd\x15\x9c\x80\x07\x00\x00\x20\x04\x00\x00

Android values:

It looks like the UTF-8 decoder in String is replacing these invalid byte sequences.

Update: the octets can be obtained from the object's "wifiSsid.octets" buffer:

Unfortunately his value is hidden and problematically so is WifiSsid:

 /**
* Ascii encoded SSID. This will replace SSID when we deprecate it. @hide
*/
public WifiSsid wifiSsid;

We cannot just straight out use Java reflection as we get a classNotFoundException when trying to use the internal API during development as explained here.


Discussions