diff --git a/app/src/main/aidl/com/geeksville/mesh/IMeshService.aidl b/app/src/main/aidl/com/geeksville/mesh/IMeshService.aidl index a33b3800e..99a8934a3 100644 --- a/app/src/main/aidl/com/geeksville/mesh/IMeshService.aidl +++ b/app/src/main/aidl/com/geeksville/mesh/IMeshService.aidl @@ -116,6 +116,9 @@ interface IMeshService { /// Send NodedbReset admin packet to nodeNum void requestNodedbReset(in int idNum); + /// Returns a ChannelSet protobuf + byte []getChannelSet(); + /** Is the packet radio currently connected to the phone? Returns a ConnectionState string. */ 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 ef4593db3..e1e9f8a30 100644 --- a/app/src/main/java/com/geeksville/mesh/service/MeshService.kt +++ b/app/src/main/java/com/geeksville/mesh/service/MeshService.kt @@ -252,6 +252,8 @@ class MeshService : Service(), Logging { .launchIn(serviceScope) localConfigRepository.localConfigFlow.onEach { localConfig = it } .launchIn(serviceScope) + channelSetRepository.channelSetFlow.onEach { channelSet = it } + .launchIn(serviceScope) // the rest of our init will happen once we are in radioConnection.onServiceConnected } @@ -364,6 +366,7 @@ class MeshService : Service(), Logging { var myNodeInfo: MyNodeInfo? = null private var localConfig: LocalConfig = LocalConfig.getDefaultInstance() + private var channelSet: AppOnlyProtos.ChannelSet = AppOnlyProtos.ChannelSet.getDefaultInstance() /// True after we've done our initial node db init @Volatile @@ -1721,6 +1724,10 @@ class MeshService : Service(), Logging { }) } + override fun getChannelSet(): ByteArray = toRemoteExceptions { + this@MeshService.channelSet.toByteArray() + } + override fun getNodes(): MutableList = toRemoteExceptions { val r = nodeDBbyID.values.toMutableList() info("in getOnline, count=${r.size}")