Skip to content

Commit

Permalink
CommsBLE: add mtu debug
Browse files Browse the repository at this point in the history
  • Loading branch information
meee1 committed Aug 28, 2024
1 parent e2331bc commit 1bb07e7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ExtLibs/Comms/CommsBLE.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit 1bb07e7

Please sign in to comment.