Organizational Research By

Surprising Reserch Topic

Question:Sending binary data over Bluetooth/RFCOMM/SPP converts 0x0A to 0x0D 0x0A

I have a Bluetooth RFCOMM service running on Linux via the commands:

sdptool add --channel 1 SP
rfcomm watch hci0 1 "$COMMAND" {}
# ^ here

The $COMMAND will write binary data to the file passed as a parameter. I have tested that it behaves correctly by doing:

mkfifo "$FIFO"
cat "$FIFO" | hexdump -C # <- output is correct

However, when connecting to the service from a different device via SPP/RFCOMM discovery (UUID 00001101-0000-1000-8000-00805F9B34FB), I see that every instance of 0x0A (LF) is replaced by 0x0D 0x0A (CR LF) in the stream. The issue isn't on the receiving end, because I have tried connecting to a hardware serial device that also sends binary data, and there the conversion doesn't happen. It must be the command in the first snippet (above the # ^ here line) that performs the replacement.

Why does the rfcomm tool do this replacement and how can I disable it?

asked Sep 13, 2013 in LINUX by anonymous
edited Sep 12, 2013
0 votes

Related Hot Questions

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.