public void onConnecting(DeviceInfo device, byte[] token) { Message m = Message.obtain(null, MsgId.CONNECTING); Bundle b = Utils.device2Bundle(device); b.putByteArray(Router.MsgKey.AUTHENTICATION_TOKEN, token); m.setData(b); recvMsg(m); }
public void onPeerLeave(DeviceInfo dev) { Bundle b = Utils.device2Bundle(dev); b.putString(Router.MsgKey.GROUP_ID, groupId); Message m = Message.obtain(null, MsgId.PEER_LEAVE); m.setData(b); recvMsg(m); }
public void onSearchFoundDevice(DeviceInfo device, boolean useSSL) { Message m = Message.obtain(null, MsgId.SEARCH_FOUND_DEVICE); Bundle b = Utils.device2Bundle(device); b.putBoolean(Router.MsgKey.USE_SSL, useSSL); m.setData(b); recvMsg(m); }
public void onConnectionFailed(DeviceInfo device, int rejectCode) { Message m = Message.obtain(null, MsgId.CONNECTION_FAILED); Bundle b = Utils.device2Bundle(device); b.putInt(Router.MsgKey.CONN_DENY_CODE, rejectCode); m.setData(b); recvMsg(m); }
public void onSearchStart(DeviceInfo leader) { Message m = Message.obtain(null, MsgId.SEARCH_START); m.setData(Utils.device2Bundle(leader)); recvMsg(m); }
public void onGetDeviceInfo(DeviceInfo device) { Message m = Message.obtain(null, MsgId.GET_DEVICE_INFO); m.setData(Utils.device2Bundle(device)); recvMsg(m); }
public void onDisconnected(DeviceInfo dev) { Message m = Message.obtain(null, MsgId.DISCONNECTED); m.setData(Utils.device2Bundle(dev)); recvMsg(m); }