update to latest protobufs

pull/8/head
geeksville 2020-02-02 18:38:01 -08:00
rodzic afe4133631
commit d57a86abcd
3 zmienionych plików z 39 dodań i 37 usunięć

Wyświetl plik

@ -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
* remove example code boilerplate from the service
* 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

Wyświetl plik

@ -223,10 +223,8 @@ class MeshService : Service(), Logging {
destId: String,
initFn: MeshProtos.SubPacket.Builder.() -> Unit
): MeshPacket = newMeshPacketTo(destId).apply {
payload = MeshProtos.MeshPayload.newBuilder().apply {
addSubPackets(MeshProtos.SubPacket.newBuilder().also {
payload = MeshProtos.SubPacket.newBuilder().also {
initFn(it)
}.build())
}.build()
}.build()
@ -280,8 +278,7 @@ class MeshService : Service(), Logging {
// decided to pass through to us (except for broadcast packets)
val toNum = packet.to
val payload = packet.payload
payload.subPacketsList.forEach { p ->
val p = packet.payload
when (p.variantCase.number) {
MeshProtos.SubPacket.POSITION_FIELD_NUMBER ->
updateNodeInfo(fromNum) {
@ -311,7 +308,6 @@ class MeshService : Service(), Logging {
else -> TODO("Unexpected SubPacket variant")
}
}
}
private fun handleReceivedNodeInfo(info: MeshProtos.NodeInfo) {
TODO()

Wyświetl plik

@ -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)
}
// 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 {
oneof variant {
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.
// NOTE: this raw payload does not include the from and to addresses, which are stripped off
// and passed into the mesh library code separately.
message MeshPayload {
repeated SubPacket subPackets = 3;
}
//message MeshPayload {
// repeated SubPacket subPackets = 3;
//}
// A full packet sent/received over the mesh
message MeshPacket {
int32 from = 1;
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