diff --git a/app/src/main/java/com/geeksville/mesh/service/MeshService.kt b/app/src/main/java/com/geeksville/mesh/service/MeshService.kt index 4eb3f459..501f6cc7 100644 --- a/app/src/main/java/com/geeksville/mesh/service/MeshService.kt +++ b/app/src/main/java/com/geeksville/mesh/service/MeshService.kt @@ -1323,9 +1323,22 @@ class MeshService : Service(), Logging { */ private fun sendRadioConfig(c: MeshProtos.RadioConfig) { // Update our device - sendToRadio(ToRadio.newBuilder().apply { - this.setRadio = c - }) + val payload = AdminProtos.AdminMessage.newBuilder().also { + it.setRadio = c + }.build() + + // encapsulate our payload in the proper protobufs and fire it off + val packet = newMeshPacketTo(myNodeNum) + + packet.decoded = MeshProtos.Data.newBuilder().also { + + // Use the new position as data format + it.portnumValue = Portnums.PortNum.ADMIN_APP_VALUE + it.payload = payload.toByteString() + }.build() + + // send the packet into the mesh + sendToRadio(packet.build()) // Update our cached copy this@MeshService.radioConfig = c @@ -1365,9 +1378,22 @@ class MeshService : Service(), Logging { handleReceivedUser(myNode.myNodeNum, user) // set my owner info - sendToRadio(ToRadio.newBuilder().apply { - this.setOwner = user - }) + val payload = AdminProtos.AdminMessage.newBuilder().also { + it.setOwner = user + }.build() + + // encapsulate our payload in the proper protobufs and fire it off + val packet = newMeshPacketTo(myNodeNum) + + packet.decoded = MeshProtos.Data.newBuilder().also { + + // Use the new position as data format + it.portnumValue = Portnums.PortNum.ADMIN_APP_VALUE + it.payload = payload.toByteString() + }.build() + + // send the packet into the mesh + sendToRadio(packet.build()) } } else throw Exception("Can't set user without a node info") // this shouldn't happen diff --git a/app/src/main/proto b/app/src/main/proto index 83e00e56..564b4886 160000 --- a/app/src/main/proto +++ b/app/src/main/proto @@ -1 +1 @@ -Subproject commit 83e00e564d3973b594a46e786b62eed2823e02ed +Subproject commit 564b488695da6bee7bb9c4553872268595a0f77d