NG_H4(4) | Device Drivers Manual | NG_H4(4) |
ng_h4
— Netgraph
node type that is also an H4 line discipline
#include
<sys/types.h>
#include
<netgraph/bluetooth/include/ng_h4.h>
The h4
node type is both a persistent
Netgraph node type and a H4 line discipline. It implements a Bluetooth HCI
UART transport layer as per chapter H4 of the Bluetooth Specification Book
v1.1. A new node is created when the corresponding line discipline,
H4DISC
, is registered on a tty device (see
tty(4)).
The node has a single hook called hook
.
Incoming bytes received on the tty device are re-assembled into HCI frames
(according to the length). Full HCI frames are sent out on the hook. HCI
frames received on hook
are transmitted out on the
tty device. No modification to the data is performed in either direction.
While the line discipline is installed on a tty, the normal read and write
operations are unavailable, returning EIO
.
Information about the node is available via the netgraph
ioctl(2) command NGIOCGINFO
. This
command returns a struct nodeinfo similar to the
NGM_NODEINFO
netgraph(4) control
message.
This node type supports the following hooks:
This node type supports the generic control messages, plus the following:
NGM_H4_NODE_RESET
NGM_H4_NODE_GET_STATE
NGM_H4_NODE_GET_DEBUG
NGM_H4_NODE_SET_DEBUG
NGM_H4_NODE_GET_QLEN
NGM_H4_NODE_SET_QLEN
NGM_H4_NODE_GET_STAT
NGM_H4_NODE_RESET_STAT
This node shuts down when the corresponding device is closed (or the line discipline is uninstalled on the device).
The h4
node type was implemented in
FreeBSD 5.0.
Maksim Yevmenkin <m_evmenkin@yahoo.com>
This node still uses spltty(9) to lock tty layer. This is wrong.
June 14, 2002 | Debian |