This project provides the source code and example code that XGPS150/XGPS160 exchanges data with iPhone device via Bluetooth connection.
The name of core SDK is Puck. You can use the puck.m and puck.h file.
Please reference the sample code how to use the Puck.
add the XGPSManager() into your appDelegate
var xGpsManager: XGPSManager = XGPSManager()
add the XGPSDelegate in your viewcontroller
public protocol XGPSDelegate: class {
func didUpdate(connected: Bool) -> Void
@objc optional func didUpdateGpsInfo(modelNumber:String, isCharging:Bool, betteryLevel:Float) -> Void
@objc optional func didUpdateSettings() -> Void
@objc optional func didUpdatePositionData(fixType: Int, latitude:Float, longitude: Float, altitude: Float,
speedAndCourseIsValid:Bool, speed: Float, heading: Float,
utcTime: String, waas: Bool,
satellitesInView:Int, satellitesInUse: Int,
glonassInView: Int, glonassInUse: Int) -> Void
}
add the observer for NotificationCenter name "SatelliteDataUpdated" for more detail option see the puck code.
let xGpsManager = AppDelegate.getDelegate().xGpsManager
if xGpsManager.isConnected() {
xGpsManager.commandGetLogList(delegate: self)
}
add logListComplete() delegate function
func deleteFromXGPS(logData: LogData) {
xGpsManager.commandLogDelete(logData: logData)
}
see the 'TripsViewController.swift
xGpsManager.commandLoggingUpdateRate(UInt8(settingValue))
see the SettingsViewController.swift it allows only XGPS160