Skip to content

XGPS150 / XGPS160 / DashPro Software Development Kit

Notifications You must be signed in to change notification settings

dualav/XGPS-SDK-iOS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XGPS-SDK-iOS

This project provides the source code and example code that XGPS150/XGPS160/DashPro exchanges data with iPhone device via Bluetooth connection.

Installation

1. File > Add Package

2. Find 'xgps' and click 'Add Package'

3. Select XGPSSDK module. (If you Swift language, also select XGPSSDKSwift)

4. Add 'Supported external accessory protocols' key in your target.

5. Click the triangle of this key and set the value for the “Item 0” to 'com.dualav.xgps150'.

Usage

Implemention (Swift)

1. import this SDK

import XGPSSDKSwift

2. add the XGPSManager() into your appDelegate

var xgpsManager: XGPSManager = XGPSManager()

3. Use XGPSDelegate

/* this protocol is declared within SDK
public protocol XGPSDelegate: AnyObject {
    func didUpdate(connected: Bool) -> Void
    func didUpdateGpsInfo(modelNumber:String, isCharging:Bool, betteryLevel:Float) -> Void
    func didUpdateSettings() -> Void
    func didUpdatePositionData(fixType: Int, latitude:Double, longitude: Double, altitude: Float,
                                              speedAndCourseIsValid:Bool, speed: Float, heading: Float,
                                              utcTime: String, waas: Bool, dgps: Bool) -> Void
    func didUpdateSatelliteData(systemId: GnssSystemId, usedArray : NSArray,
                                systemInfo : NSDictionary,
                                averageSNR : Int) -> Void
}
*/

class ViewController: UIViewController, XGPSDelegate {
    func didUpdate(connected: Bool) {
        // Called when connection information changes.
    }
    
    func didUpdateGpsInfo(modelNumber: String, isCharging: Bool, betteryLevel: Float) {
        // Called when the status of a device's battery, etc. changes.
    }
    
    func didUpdateSettings() {
        // Called when reflection to the device is complete after setting up the setting command.
    }
    
    func didUpdatePositionData(fixType: Int, latitude: Double, longitude: Double, altitude: Float, speedAndCourseIsValid: Bool, speed: Float, heading: Float, utcTime: String, waas: Bool, dgps: Bool) {
        // GPS location information is received.
    }
    
    func didUpdateSatelliteData(systemId: XGPSSDKSwift.GnssSystemId, usedArray: NSArray, systemInfo: NSDictionary, averageSNR: Int) {
        // Satellite information is received.
    }
}

3. Use functions for logs

func logListData() -> NSMutableArray    
func logBulkDic() -> NSMutableArray     
func loggingEnabled() -> Bool     
func logOverWriteEnabled() -> Bool
func logInterval() -> Int32

4. Use command for setting

func commandGetSettings()    
func commandLogAccessMode()    
func commandStreamEnable()    
func commandStreamDisable()    
func commandGetLogList(delegate: TripLogDelegate)    
func commandGetFreeSpace()    
func commandLogDelete(logData: LogData)    
func commandGetLogBulk(logData: LogData, delegate: TripLogDelegate)    
func commandSetAlwaysRecord(isOn: Bool)    
func commandSetOverwriteOld(isOn: Bool)

Structure

This section describes the internal structure of the data in 'didUpdateSatelliteData' that sends satellite information values.

GnssSystemId

This is GNSS system id.

enum GnssSystemId: Int {
    case gps = 1
    case glonass = 2
    case galileo = 3
    case beidou = 4
    case qzss = 5
    case navic = 6
    case unknown = 7
}

usedArray (NSArray)

This value is the 'String' array of satellites ID that used in solution.

ex) usedArray : "01","08","10","27"

systemInfo (NSDictionary)

systemInfo
├── NSDictionary 
│   ├── key : Signal ID
│   │    
│   └── value : NSDictionary
│       ├── key : Satellite ID : NSNumber 
│       │    
│       └── value : NSArray
│             ├── azimuth : NSNumber
│             ├── elevation : NSNumber
│             ├── SNR : NSNumber
│             └── inUse : NSNumber 
└── NSDictionary 
    ├── key : Signal ID
    │    
    └── value : NSDictionary
        ├── key : Satellite ID : NSNumber 
        │    
        └── value : NSArray
              ├── azimuth : NSNumber
              ├── elevation : NSNumber
              ├── SNR : NSNumber
              └── inUse : NSNumber 

Trip logs

This is only for XGPS160

Getting logs

let xgpsManager = AppDelegate.getDelegate().xGpsManager
if xgpsManager.isConnected() {
    xgpsManager.commandGetLogList(delegate: self)
}

add logListComplete() delegate function

Delete log

xgpsManager.commandLogDelete(logData: logData)

see the 'TripsViewController.swift

Set the Logging rate

xgpsManager.commandLoggingUpdateRate(UInt8(settingValue))

see the SettingsViewController.swift

Product

http://gps.dualav.com/

About

XGPS150 / XGPS160 / DashPro Software Development Kit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •