Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccessPoint ¶
AccessPoint is the signal description of a particular WiFi access point.
func InferWiFiAccessPoints ¶
func InferWiFiAccessPoints(m map[string]interface{}) ([]AccessPoint, bool)
InferWiFiAccessPoints uses a predefined set of rules in order to infer the WiFi Access Point information from the provided map.
The function will attempt to parse the following structures: - An entry in the map called `access_points` which is an array of objects. The objects are expected to have the AP BSSID inside the `bssid` key and the RSSI in the `rssi` key. - An entry in the map called `wifi` which is an array of objects. The objects are expected to have the AP BSSID inside the `mac` key and the RSSI inside the `rssi` key.
The BSSIDs are expected to be in hexadecimal format. Separators such as - and : are stripped before the BSSID is parsed.
All numeric values are assumed to be float64.
If no access points can be inferred, this function returns false.
type Location ¶
type Location struct { Latitude, Longitude, Altitude, Accuracy float64 }
Location is a geographical location.
func InferLocation ¶
InferLocation uses a set of predefined rules to determine the location from the given map.
If the map contains a key with the format gps_#, the latitude, longitude and altitude is assumed to be value map.
Otherwise, this function checks for the following key combinations for latitude, longitude and altitude:
- lat, lon, alt
- lat, lng, alt
- lat, long, alt
- latitude, longitude, altitude
- Latitude, Longitude, Altitude
- latitudeDeg, longitudeDeg, altitude
- latitudeDeg, longitudeDeg, height
- gps_lat, gps_lng, gps_alt
- gps_lat, gps_lng, gpsalt
And the following keys for accuracy in metres:
- acc
- accuracy
- hacc
HDOP and satellite count are currently not used.
All numeric values are assumed to be float64.
If no location can be inferred, this function returns false.