Skyhook Precision Location Embedded Client Development Kit
This repo provides a C source code development kit which allows you to add Skyhook's WiFi and 3GPP network-based location capabilities to your embedded device. It includes a simple, generic, and buildable sample client (sky_client.c) that can be modified and adapted as necessary for your particular platform.
The steps required by an embedded client to determine its location are the following:
- Scan local WiFi access points and/or 3GPP cell towers using whatever mechanism is available for doing so on your device platform
- Create a request message with the scan results using the functions provided by the development kit. The resulting binary request message is bandwidth-efficient, and is protected using the AES encryption protocol
- Create a TCP connection and send the request message to the Skyhook Embedded Location Gateway (ELG) Service using whatever mechanism is available for doing so on the client platform
- Read the TCP response message from the network and close the connection. Then use the functions provided by the development kit to decrypt and parse the resulting latitude and longitude
- Use the result in whatever way makes sense for your device. (Note that you can optionally arrange to have the Skyhook service forward ("echo") location responses in XML format to your web server, in addition to returning the response to the device itself. Contact Skyhook customer service for more information)
Your embedded client needs to be configured with a Skyhook partner ID and AES (encryption) key. You can obtain these parameters via the following steps:
- Register a new account on http://my.skyhookwireless.com
- Once registration is completed you will be placed immediately into the “Start a new project” workflow.
- Create a new Precision Location project and name the project whatever you like.
- After creating the project, in the platform selection screen, select the “ELG” embedded project type which can be found below the standard OS selection icons.
- Once your new embedded project has been created, your partner ID and AES key will be visible on the right side of your project home screen.
Note that the sample client included in this repo specifies these parameters as #defines near the top of sky_client.c. You'll need to change the sample values there to the values obtained via the above procedure.
Cloning the Repo
Since this repo contains a git submodule, you'll need to clone it using the
--recursive option to the git clone command. E.g.,
$ git clone --recursive firstname.lastname@example.org:SkyhookWireless/embedded-client.git Cloning into 'embedded-client'... remote: Counting objects: 134, done. remote: Compressing objects: 100% (3/3), done. remote: Total 134 (delta 0), reused 0 (delta 0), pack-reused 131 Receiving objects: 100% (134/134), 719.18 KiB | 0 bytes/s, done. Resolving deltas: 100% (48/48), done. Checking connectivity... done. Submodule 'common' (email@example.com:SkyhookWireless/ELG-Common.git) registered for path 'common' Cloning into 'common'... remote: Counting objects: 435, done. remote: Total 435 (delta 0), reused 0 (delta 0), pack-reused 435 Receiving objects: 100% (435/435), 119.07 KiB | 0 bytes/s, done. Resolving deltas: 100% (192/192), done. Checking connectivity... done. Submodule path 'common': checked out 'c8ec80681799e1a237ea68c637aba9bbbba78034' $
Alternatively, if you cloned the repo without specifying the
--recursive option, you'll need to explicitly update and initialize the submodule:
$ cd embedded-client $ git submodule update --init Submodule 'common' (firstname.lastname@example.org:SkyhookWireless/ELG-Common.git) registered for path 'common' Cloning into 'common'... remote: Counting objects: 435, done. remote: Total 435 (delta 0), reused 0 (delta 0), pack-reused 435 Receiving objects: 100% (435/435), 119.07 KiB | 0 bytes/s, done. Resolving deltas: 100% (192/192), done. Checking connectivity... done. Submodule path 'common': checked out 'c8ec80681799e1a237ea68c637aba9bbbba78034'
Building the Sample Client
To build the sample client ("sky_client.c") under Linux, type "make" in the root directory of the repo. This will compile and link the sample client and all of the necessary library code, resulting in a single executable, which will be placed in the bin directory. Note that this sample client uses "canned" WiFi scan data; as noted above, you'll need to modify it to obtain real WiFi and/or 3GPP cellular scan data. The details of how this is done depend on your device hardware and software platform.