mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-03-29 03:03:05 -04:00
track # of text messages received/sent
This commit is contained in:
@@ -271,6 +271,15 @@ class MeshService : Service(), Logging {
|
||||
connectedRadio.sendToRadio(b)
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a mesh packet to the radio, if the radio is not currently connected this function will throw NotConnectedException
|
||||
*/
|
||||
private fun sendMeshPacket(packet: MeshPacket) {
|
||||
sendToRadio(ToRadio.newBuilder().apply {
|
||||
this.packet = packet
|
||||
})
|
||||
}
|
||||
|
||||
override fun onBind(intent: Intent?): IBinder? {
|
||||
return binder
|
||||
}
|
||||
@@ -689,6 +698,11 @@ class MeshService : Service(), Logging {
|
||||
else -> TODO()
|
||||
}
|
||||
|
||||
GeeksvilleApplication.analytics.track(
|
||||
"num_data_receive",
|
||||
DataPair(1)
|
||||
)
|
||||
|
||||
GeeksvilleApplication.analytics.track(
|
||||
"data_receive",
|
||||
DataPair("num_bytes", bytes.size),
|
||||
@@ -1079,18 +1093,7 @@ class MeshService : Service(), Logging {
|
||||
handleReceivedPosition(myNodeInfo!!.myNodeNum, position)
|
||||
|
||||
// send the packet into the mesh
|
||||
sendToRadio(ToRadio.newBuilder().apply {
|
||||
this.packet = packet.build()
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a mesh packet to the radio, if the radio is not currently connected this function will throw NotConnectedException
|
||||
*/
|
||||
private fun sendMeshPacket(packet: MeshPacket) {
|
||||
sendToRadio(ToRadio.newBuilder().apply {
|
||||
this.packet = packet
|
||||
})
|
||||
sendMeshPacket(packet.build())
|
||||
}
|
||||
|
||||
private val binder = object : IMeshService.Stub() {
|
||||
@@ -1164,6 +1167,11 @@ class MeshService : Service(), Logging {
|
||||
DataPair("type", typ)
|
||||
)
|
||||
|
||||
GeeksvilleApplication.analytics.track(
|
||||
"num_data_sent",
|
||||
DataPair(1)
|
||||
)
|
||||
|
||||
connectionState == ConnectionState.CONNECTED
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user