I'm writing a framework that'll communicate with the Lego Mindstorms
NXT brick [1] over a serial port, which is created either over
Bluetooth or a USB connection (using the Bluetooth serial profile and
a USB->Serial driver respectively).
The protocol dictates that messages sent over Bluetooth have an
additional two bytes at the beginning of the message with a little
endian UInt16 describing the length of the message.
I can construct this just fine using EndianU16_NtoL et. al, but what
I'm struggling with is finding out if the serial port is a Bluetooth
one or not. The serial port has a standard BSD path like /dev/tty.NXT.