diff --git a/iot_wireless_communication/src/main/java/inc/osips/iot_wireless_communication/wireless_comms_module/remote_comms/p2p_comms/P2pConnection.java b/iot_wireless_communication/src/main/java/inc/osips/iot_wireless_communication/wireless_comms_module/remote_comms/p2p_comms/P2pConnection.java index b8993f5..0db3e78 100644 --- a/iot_wireless_communication/src/main/java/inc/osips/iot_wireless_communication/wireless_comms_module/remote_comms/p2p_comms/P2pConnection.java +++ b/iot_wireless_communication/src/main/java/inc/osips/iot_wireless_communication/wireless_comms_module/remote_comms/p2p_comms/P2pConnection.java @@ -109,7 +109,17 @@ public void sendInstructionsToRemoteDevice(@Nullable String deviceAddress, p2pService.writeInstructions(instructions); } - private ServiceConnection mConnection = + @Override + public void sendInstructionsToConnectedDevice(String deviceAddr, @Nullable UUID charxDescriptor, byte[] data) { + p2pService.writeInstructions(data); + } + + @Override + public void sendInstructionsToConnectedDevice(String deviceAddr, byte[] data) { + p2pService.writeInstructions(data); + } + + private final ServiceConnection mConnection = /* * Defines callbacks for p2pService binding, passed to bindService() */ diff --git a/iot_wireless_communication/src/main/java/inc/osips/iot_wireless_communication/wireless_comms_module/remote_comms/p2p_comms/service/P2pDataTransferService.java b/iot_wireless_communication/src/main/java/inc/osips/iot_wireless_communication/wireless_comms_module/remote_comms/p2p_comms/service/P2pDataTransferService.java index 9bfe6f4..55bffe4 100644 --- a/iot_wireless_communication/src/main/java/inc/osips/iot_wireless_communication/wireless_comms_module/remote_comms/p2p_comms/service/P2pDataTransferService.java +++ b/iot_wireless_communication/src/main/java/inc/osips/iot_wireless_communication/wireless_comms_module/remote_comms/p2p_comms/service/P2pDataTransferService.java @@ -117,6 +117,11 @@ public void writeInstructions(String instruct) { sendReceive.write(instruct.getBytes()); } + public void writeInstructions(byte[] data) { + if(sendReceive!=null) + sendReceive.write(data); + } + private void disconnect() { p2pManager.cancelConnect(p2pChannel, new WifiP2pManager.ActionListener() { @Override