Copyright (c) 2001-2002 Maksim Yevmenkin <email@example.com> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in t...
NAMEng_h4 - Netgraph node type that is also an H4 line discipline
SYNOPSISIn sys/types.h In netgraph/bluetooth/include/ng_h4.h
DESCRIPTIONThe 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 Er EIO .
HOOKSThis node type supports the following hooks:
- single HCI frame contained in single Vt mbuf structure.
CONTROL MESSAGESThis node type supports the generic control messages, plus the following:
- Reset the node.
- Returns current receiving state for the node.
- Returns an integer containing the current debug level for the node.
- This command takes an integer argument and sets current debug level for the node.
- Returns current length of outgoing queue for the node.
- This command takes an integer argument and sets maximum length of outgoing queue for the node.
- Returns various statistic information for the node, such as: number of bytes (frames) sent, number of bytes (frames) received and number of input (output) errors.
- Reset all statistic counters to zero.