Skip to content
Advertisement

Split TTY device based on packet type

I have a TTY device setup to monitor a serial port of a combined bluetooth/GPS chip. I’m using blueZ to implement the bluetooth stack and do everything bluetooth related. The data being sent across this port is all HCI packets, even the GPS data. The GPS data is wrapped in an HCI packet of type 0xXX (indicated by the first byte of the HCI Packet).

I’m wondering if there is any kernel facility already in place to split a TTY device into two separate devices. For example, I would like to read and write all HCI packets (except for the GPS ones) from /dev/ttyS0 using blueZ. Then, I would like to have another TTY device for reading all HCI packets of type 0xXX, say /dev/ttyGPS.

In the end, I’m looking for something to filter all HCI packets of a certain type to a different “pseudo” TTY device. If this is not possible I will need to parse all of HCI packets in application space using hcidump. While this is possible, having two TTY devices would greatly cut down on application development because of previously completed work.

Advertisement

Answer

The chip I’m using happens to be a TI chip. The solution that I found was provided by them as a driver inside the kernel.

http://processors.wiki.ti.com/index.php/Shared_Transport_Driver

Advertisement