kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
update to latest protobufs
rodzic
afe4133631
commit
d57a86abcd
1
TODO.md
1
TODO.md
|
@ -41,6 +41,7 @@ nanopb binaries available here: https://jpa.kapsi.fi/nanopb/download/ use nanopb
|
||||||
Don't leave device discoverable. Don't let unpaired users do things with device
|
Don't leave device discoverable. Don't let unpaired users do things with device
|
||||||
* remove example code boilerplate from the service
|
* remove example code boilerplate from the service
|
||||||
* switch from protobuf-java to protobuf-javalite - much faster and smaller, just no JSON debug printing
|
* switch from protobuf-java to protobuf-javalite - much faster and smaller, just no JSON debug printing
|
||||||
|
* if the rxpacket queue on the device overflows (because android hasn't connected in a while) send a special packet to android which means 'X packets have been dropped because you were offline' -drop oldest packets first
|
||||||
|
|
||||||
# Low priority
|
# Low priority
|
||||||
|
|
||||||
|
|
|
@ -223,10 +223,8 @@ class MeshService : Service(), Logging {
|
||||||
destId: String,
|
destId: String,
|
||||||
initFn: MeshProtos.SubPacket.Builder.() -> Unit
|
initFn: MeshProtos.SubPacket.Builder.() -> Unit
|
||||||
): MeshPacket = newMeshPacketTo(destId).apply {
|
): MeshPacket = newMeshPacketTo(destId).apply {
|
||||||
payload = MeshProtos.MeshPayload.newBuilder().apply {
|
payload = MeshProtos.SubPacket.newBuilder().also {
|
||||||
addSubPackets(MeshProtos.SubPacket.newBuilder().also {
|
|
||||||
initFn(it)
|
initFn(it)
|
||||||
}.build())
|
|
||||||
}.build()
|
}.build()
|
||||||
}.build()
|
}.build()
|
||||||
|
|
||||||
|
@ -280,8 +278,7 @@ class MeshService : Service(), Logging {
|
||||||
// decided to pass through to us (except for broadcast packets)
|
// decided to pass through to us (except for broadcast packets)
|
||||||
val toNum = packet.to
|
val toNum = packet.to
|
||||||
|
|
||||||
val payload = packet.payload
|
val p = packet.payload
|
||||||
payload.subPacketsList.forEach { p ->
|
|
||||||
when (p.variantCase.number) {
|
when (p.variantCase.number) {
|
||||||
MeshProtos.SubPacket.POSITION_FIELD_NUMBER ->
|
MeshProtos.SubPacket.POSITION_FIELD_NUMBER ->
|
||||||
updateNodeInfo(fromNum) {
|
updateNodeInfo(fromNum) {
|
||||||
|
@ -311,7 +308,6 @@ class MeshService : Service(), Logging {
|
||||||
else -> TODO("Unexpected SubPacket variant")
|
else -> TODO("Unexpected SubPacket variant")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private fun handleReceivedNodeInfo(info: MeshProtos.NodeInfo) {
|
private fun handleReceivedNodeInfo(info: MeshProtos.NodeInfo) {
|
||||||
TODO()
|
TODO()
|
||||||
|
|
|
@ -103,7 +103,7 @@ message DenyNodeNum {
|
||||||
string macaddr = 1; // the macaddr of the node we are sending this denial to (so that the recipient can be sure the packet really as desined to them)
|
string macaddr = 1; // the macaddr of the node we are sending this denial to (so that the recipient can be sure the packet really as desined to them)
|
||||||
}
|
}
|
||||||
|
|
||||||
// A single packet might have a series of SubPacket included
|
// The payload portion fo a packet, this is the actual bytes that are sent inside a radio packet (because from/to are broken out by the comms library)
|
||||||
message SubPacket {
|
message SubPacket {
|
||||||
oneof variant {
|
oneof variant {
|
||||||
Position position = 1;
|
Position position = 1;
|
||||||
|
@ -115,18 +115,23 @@ message SubPacket {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Note: For simplicity reasons (and that we want to keep over the radio packets very small, we now assume that there is only _one_
|
||||||
|
// SubPacket in each MeshPacket). That might change in the far future, but for now that's the case.
|
||||||
// A packet sent over our mesh.
|
// A packet sent over our mesh.
|
||||||
// NOTE: this raw payload does not include the from and to addresses, which are stripped off
|
// NOTE: this raw payload does not include the from and to addresses, which are stripped off
|
||||||
// and passed into the mesh library code separately.
|
// and passed into the mesh library code separately.
|
||||||
message MeshPayload {
|
//message MeshPayload {
|
||||||
repeated SubPacket subPackets = 3;
|
// repeated SubPacket subPackets = 3;
|
||||||
}
|
//}
|
||||||
|
|
||||||
// A full packet sent/received over the mesh
|
// A full packet sent/received over the mesh
|
||||||
message MeshPacket {
|
message MeshPacket {
|
||||||
int32 from = 1;
|
int32 from = 1;
|
||||||
int32 to = 2;
|
int32 to = 2;
|
||||||
MeshPayload payload = 3;
|
|
||||||
|
// See note above:
|
||||||
|
// MeshPayload payloads = 4;
|
||||||
|
SubPacket payload = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Full settings (center freq, spread factor, pre-shared secret key etc...) needed to configure a radio
|
// Full settings (center freq, spread factor, pre-shared secret key etc...) needed to configure a radio
|
||||||
|
|
Ładowanie…
Reference in New Issue