Get Data from Bluetooth device in C#

前端 未结 1 426
栀梦
栀梦 2020-12-30 17:07

I\'m trying to get data from a medical BT device that I already have pairing code and communication protocol.

Looking for some code I\'ve got this code:



        
相关标签:
1条回答
  • 2020-12-30 17:30

    You want to replace the following:

    myCompleteMessage.AppendFormat("{0}", Encoding.ASCII.GetString(myReadBuffer, 0, numberOfBytesRead));
    

    with

    for (int i = 0; i < numberOfBytesRead; i++)
        myCompleteMessage.AppendFormat("0x{0:X2} ", myReadBuffer[i]);
    
    0 讨论(0)
提交回复
热议问题