Inconsistent data received (Bluetooth classic, RFComm, Serialport)
See original GitHub issueHi, I am trying to connect to a medica device using Visual Studio + MAUI + InTheHand.Net.Bluetooth.
I successfully pair the device, then connect using the BluetoothService.SerialPort service, but whatever I receive is:
CALL c4:62:ea:98:ce:08 1103 RFCOMM
where c4:62:ea:98:ce:08 is the address of my device. If I try to connect using BluetoothService.DialupNetworking (1103) the connection do not succeed. What I do is:
stream = client.GetStream();
StreamWriter sw = new StreamWriter(stream, System.Text.Encoding.ASCII); (this will be needed later)
StreamReader sr = new StreamReader(stream, System.Text.Encoding.ASCII);
char[] buffer = new char[10000];
await sr.ReadAsync(buffer, 0, (int)stream.Length);
Is something I am doing wrong?
Thanks, Michele
Issue Analytics
- State:
- Created 9 months ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Bluetooth communication using serialports and windows ...
My best guess is that RFCOMM refers to Serial Port Profile SPP, which basically emulates serial port through the Bluetooth.
Read more >Inconsistent values with Bluetooth and Serial.Read
I have gotten Arduino to Arduino communication setup. However I am getting inconsistent values when printing the incoming master data.
Read more >Bluetooth Framework and RFCOMM Protocol
Bluetooth Framework natively supports Bluetooth Classic RFCOMM protocol in client and server modes. That means that Bluetooth Framework can act as RFCOMM client ......
Read more >Can't use Bluetooth COM ports from Windows 10
1 Answer. The first thing to mention is that rfcomm was deprecated back in 2017 by the BlueZ project so if you are...
Read more >Strange behaviour using serial port and bluetooth
I'm trying to connect via serial port, a wearable device to a processing IDE using ... Once this is done, if I use...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello Enrique and Michele,
Enrique I also tried using your approach (was a lot nicer than mine lol), but still can’t seem to read anything from the stream. Not really sure what I am doing with this bluetooth stuff to be honest. Having a MAUI cross platform sample in this repo would be really helpful.
Thank you Enrique, I tried to use the same pattern you used here: https://github.com/inthehand/32feet/issues/252 to read from the device, but the result doesn’t change at all.
About your issue, I am experiencing the same problem. The “.Connected” property gets false only after a read timeout, even if I turn off the device after I connect it.
Regards, Michele