make aidl interface strongly typed

pull/28/head
geeksville 2020-04-19 11:56:06 -07:00
rodzic 5784138c96
commit 613e4f7ec4
3 zmienionych plików z 6 dodań i 7 usunięć

Wyświetl plik

@ -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

Wyświetl plik

@ -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)
}

Wyświetl plik

@ -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