# hdlc over serial?

## Progman3K

Hi,

I have a serial device which sends hdlc over a serial port, how can I read it?

I can open the tty and read the hdlc directly, of course, but this seems like it is short-circuiting something.

Is there a way to get the traffic coming in over the serial port into the network stack, like it probably should be?

Sorry for the scarcity of details but I'm sort of a noob in this particular instance.

Thanks

----------

## NeddySeagoon

Progman3K,

Here's a pointer into the kernel

There may well be some userspace bits too.

----------

## AngelKnight

Hi Progman3K,

You mentioned "you have a serial device." We can probably help more if you provide more details on what kind of "serial device", or the device on the remote end of this "serial device."

I don't have a lot of experience with HDLC on Linux, so while I believe you when you say your device is represented with a tty, I find this a little weird since HDLC typically involves a synchronously-clocked serial port, which I don't usually expect to see represented in Linux with a tty device.

----------

## Progman3K

Hello Neddy, hello AngelKnight!

Thanks for taking the time.

The device is not commercially available, it is homebrew, it apparently writes hdlc packets over /dev/ttyACM0 at 115200 kbps,N81

To go into more detail, it does not conform to synchronous HDLC, there are no timing bits.

Rather, it sends a series of HDLC packet (header, escaped-data, CRC) over the line.

I've tried using mmcli -L but this simply returns *Quote:*   

> 
> 
> [date time] [Debug] ModemManager process found at ':1.10536'
> 
> No modems were found

 

----------

## Progman3K

ModemManager[13892]: <info>  Creating modem with plugin 'Generic' and '1' ports

ModemManager[13892]: <warn>  Could not grab port (tty/ttyACM0): 'Cannot add port 'tty/ttyACM0', unhandled serial type'

ModemManager[13892]: <warn>  Couldn't create modem for device at '/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2': Failed to find primary AT port

ModemManager[13892]: <info>  (tty/ttyACM0): released by modem /sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2

ModemManager[13892]: <info>  Couldn't check support for device at '/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2': Operation was cancelled

----------

## Progman3K

At this point, I am guessing the device needs to support a specific AT-command set to be registered as an actual HDLC network interface card

----------

