mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-03-29 11:13:41 -04:00
make aidl interface strongly typed
This commit is contained in:
@@ -2,8 +2,7 @@
|
||||
package com.geeksville.mesh;
|
||||
|
||||
// Declare any non-default types here with import statements
|
||||
// import com.geeksville.mesh.DataPacket;
|
||||
|
||||
parcelable DataPacket;
|
||||
parcelable NodeInfo;
|
||||
|
||||
/**
|
||||
@@ -40,14 +39,14 @@ interface IMeshService {
|
||||
/**
|
||||
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
|
||||
/// It returns a RadioConfig protobuf.
|
||||
byte []getRadioConfig();
|
||||
|
||||
/// 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
|
||||
/// It sets a RadioConfig protobuf
|
||||
|
||||
@@ -596,7 +596,7 @@ class MainActivity : AppCompatActivity(), Logging,
|
||||
registerMeshReceiver()
|
||||
|
||||
// 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)
|
||||
}
|
||||
|
||||
|
||||
@@ -1056,8 +1056,8 @@ class MeshService : Service(), Logging {
|
||||
this@MeshService.radioConfig = MeshProtos.RadioConfig.parseFrom(payload)
|
||||
}
|
||||
|
||||
override fun getNodes(): Array<NodeInfo> = toRemoteExceptions {
|
||||
val r = nodeDBbyID.values.toTypedArray()
|
||||
override fun getNodes(): MutableList<NodeInfo> = toRemoteExceptions {
|
||||
val r = nodeDBbyID.values.toMutableList()
|
||||
info("in getOnline, count=${r.size}")
|
||||
// return arrayOf("+16508675309")
|
||||
r
|
||||
|
||||
Reference in New Issue
Block a user