public static interface RouterGroupClient.GroupHandler
It exposes the following groups of callback methods in accordance with GroupHandler aidl api:
void onPeerJoin(DeviceInfo peerInfo) void onPeerLeave(DeviceInfo peerInfo) void onSelfJoin(DeviceInfo[] peersInfo) void onSelfLeave()
void onReceive(DeviceInfo src, byte[] msg)
void onGetPeerDevices(DeviceInfo[] devices)
Modifier and Type | Method and Description |
---|---|
void |
onError(java.lang.String errInfo)
Notify clients about two kinds of errors:
errors happening at server processing.
|
void |
onGetPeerDevices(DeviceInfo[] devices)
Reply to client info of peer devices in group; this is the response to getPeerDevices() api call.
|
void |
onPeerJoin(DeviceInfo peerInfo)
notify client that a peer device joined the group.
|
void |
onPeerLeave(DeviceInfo peerInfo)
notify client that a peer device has left the group.
|
void |
onReceive(DeviceInfo src,
byte[] msg)
notify client that a message arrived from a peer device.
|
void |
onSelfJoin(DeviceInfo[] peersInfo)
notify clients that it has joined the group successfully; and returning the info
of peer devices in this group.
|
void |
onSelfLeave()
notify client that it finished leaving the group.
|
void onError(java.lang.String errInfo)
errInfo
- the detailed error messagevoid onSelfJoin(DeviceInfo[] peersInfo)
peersInfo
- info of peer devices in this group.void onPeerJoin(DeviceInfo peerInfo)
peerInfo
- info of peer device which just joined.void onSelfLeave()
void onPeerLeave(DeviceInfo peerInfo)
peerInfo
- info of peer device which just left.void onReceive(DeviceInfo src, byte[] msg)
src
- info of device sending the message.msg
- message received.void onGetPeerDevices(DeviceInfo[] devices)
devices
-