From 1bb07e796fd292b260eea3236abc8bd85c025143 Mon Sep 17 00:00:00 2001 From: Michael Oborne Date: Mon, 26 Aug 2024 11:05:29 +1000 Subject: [PATCH] CommsBLE: add mtu debug --- ExtLibs/Comms/CommsBLE.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ExtLibs/Comms/CommsBLE.cs b/ExtLibs/Comms/CommsBLE.cs index e4f450b336..0ce8e85713 100644 --- a/ExtLibs/Comms/CommsBLE.cs +++ b/ExtLibs/Comms/CommsBLE.cs @@ -208,6 +208,8 @@ public void Open() bool paired = false; //while (!paired) { + mtu = simpleble_peripheral_mtu(peripheral); + Console.WriteLine("MTU: " + mtu); simpleble_peripheral_is_connected(peripheral, out paired); //simpleble_peripheral_is_paired(peripheral, out paired); Thread.Sleep(1000); @@ -616,6 +618,8 @@ private static void peripheral_on_disconnected(simpleble_peripheral_t peripheral string peripheral_address = simpleble_peripheral_address(peripheral); Console.WriteLine("Disconnected from " + peripheral_address); + + bleperiph.Close(); } private static void peripheral_on_connected(simpleble_peripheral_t peripheral, void* userdata) @@ -693,6 +697,7 @@ static byte[] GUIDtoByteArray(string guid) private static MyCallbackp _callbackperipheral_on_notify; private MyCallbackp2 _callbackperipheral_on_connected; private MyCallbackp2 _callbackperipheral_on_disconnected; + private ushort mtu; private static void Send(simpleble_peripheral_t peripheral, byte[] data, int offset, int length) {