kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
feat: add getChannelSet method to IMeshService
rodzic
967e4634a8
commit
566fdd3344
|
@ -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.
|
||||
*/
|
||||
|
|
|
@ -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<NodeInfo> = toRemoteExceptions {
|
||||
val r = nodeDBbyID.values.toMutableList()
|
||||
info("in getOnline, count=${r.size}")
|
||||
|
|
Ładowanie…
Reference in New Issue