kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
make aidl interface strongly typed
rodzic
5784138c96
commit
613e4f7ec4
|
@ -2,8 +2,7 @@
|
||||||
package com.geeksville.mesh;
|
package com.geeksville.mesh;
|
||||||
|
|
||||||
// Declare any non-default types here with import statements
|
// Declare any non-default types here with import statements
|
||||||
// import com.geeksville.mesh.DataPacket;
|
parcelable DataPacket;
|
||||||
|
|
||||||
parcelable NodeInfo;
|
parcelable NodeInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -40,14 +39,14 @@ interface IMeshService {
|
||||||
/**
|
/**
|
||||||
Get the IDs of everyone on the mesh. You should also subscribe for NODE_CHANGE broadcasts.
|
Get the IDs of everyone on the mesh. You should also subscribe for NODE_CHANGE broadcasts.
|
||||||
*/
|
*/
|
||||||
NodeInfo[] getNodes();
|
List<NodeInfo> getNodes();
|
||||||
|
|
||||||
/// This method is only intended for use in our GUI, so the user can set radio options
|
/// This method is only intended for use in our GUI, so the user can set radio options
|
||||||
/// It returns a RadioConfig protobuf.
|
/// It returns a RadioConfig protobuf.
|
||||||
byte []getRadioConfig();
|
byte []getRadioConfig();
|
||||||
|
|
||||||
/// Return an list of MeshPacket protobuf (byte arrays) which were received while your client app was offline (recent messages only)
|
/// Return an list of MeshPacket protobuf (byte arrays) which were received while your client app was offline (recent messages only)
|
||||||
List getOldMessages();
|
List<DataPacket> getOldMessages();
|
||||||
|
|
||||||
/// This method is only intended for use in our GUI, so the user can set radio options
|
/// This method is only intended for use in our GUI, so the user can set radio options
|
||||||
/// It sets a RadioConfig protobuf
|
/// It sets a RadioConfig protobuf
|
||||||
|
|
|
@ -596,7 +596,7 @@ class MainActivity : AppCompatActivity(), Logging,
|
||||||
registerMeshReceiver()
|
registerMeshReceiver()
|
||||||
|
|
||||||
// Init our messages table with the service's record of past text messages
|
// Init our messages table with the service's record of past text messages
|
||||||
model.messagesState.messages.value = (service.oldMessages as List<DataPacket>).map {
|
model.messagesState.messages.value = service.oldMessages.map {
|
||||||
TextMessage(it)
|
TextMessage(it)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1056,8 +1056,8 @@ class MeshService : Service(), Logging {
|
||||||
this@MeshService.radioConfig = MeshProtos.RadioConfig.parseFrom(payload)
|
this@MeshService.radioConfig = MeshProtos.RadioConfig.parseFrom(payload)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getNodes(): Array<NodeInfo> = toRemoteExceptions {
|
override fun getNodes(): MutableList<NodeInfo> = toRemoteExceptions {
|
||||||
val r = nodeDBbyID.values.toTypedArray()
|
val r = nodeDBbyID.values.toMutableList()
|
||||||
info("in getOnline, count=${r.size}")
|
info("in getOnline, count=${r.size}")
|
||||||
// return arrayOf("+16508675309")
|
// return arrayOf("+16508675309")
|
||||||
r
|
r
|
||||||
|
|
Ładowanie…
Reference in New Issue