TAD101 universal protocol

Android integration

Device type

Slugandroid_app
DriverTad101Driver
TransportPusher Android SDK over Soketi

SDK install

gradle
dependencies {
    implementation 'com.pusher:pusher-java-client:2.4.4'
    implementation 'com.google.android.gms:play-services-location:21.0.1'
}

Kotlin implementation

kotlin
import com.pusher.client.Pusher
import com.pusher.client.PusherOptions

val options = PusherOptions().apply {
    setHost("soketi.example.com")
    setWsPort(6001)
    isUseTLS = false
}
val pusher = Pusher("YOUR_APP_KEY", options)
pusher.connect()

val channel = pusher.subscribePrivate("private-device.YOUR_DEVICE_ID")
channel.bind("tad101.ping") { _, _, data ->
    // respond with telemetry
}

Sensors available on Android

SensorAndroid APITAD101 field
GPS locationLocationManager / Fusedlat, lng, alt, speed, direction
GPS accuracyLocation.accuracyhdop (approximated)
Battery %BatteryManagerbattery_pct
Battery voltageBATTERY_PROPERTY_VOLTAGEbattery_mv
GSM signalTelephonyManagergsm_signal
Cell infogetAllCellInfo()mcc, mnc, lac, cell_id
TemperatureTYPE_AMBIENT_TEMPERATUREtemperature