NG_UBT(4)
π NG_UBT β the Netgraph node type that's ALSO a Bluetooth USB driver π
okay bestie, sit down, because this one is a double threat. We're talking ng_ubt β the ubt node type from the Kernel Interfaces Manual. It's giving main character energy in two whole departments at once, and honestly? obsessed. π¦
πΈ SYNOPSIS πΈ
like, just include these and you're so good:
#include <sys/types.h>
#include <netgraph/bluetooth/include/ng_ubt.h>
β¨ DESCRIPTION β¨
So the ubt node type is both a persistent Netgraph node type and a driver for Bluetooth USB devices. Two jobs, zero complaints, periodt. π
It implements a Bluetooth USB transport layer exactly as per chapter H2 of the Bluetooth Specification Book v1.1. And the cute part? A new node just appears β poof β¨ β when a supported USB device is plugged in. No ceremony, no setup, it just shows up like your bestie at your door with snacks.
The node has a single hook called hook. Here's the vibe:
- Incoming bytes that arrive on the device get re-assembled into HCI frames (according to the length). little puzzle pieces fitting together, we love to see it π§©
- Full HCI frames get sent out on the
hook. - The node will add an HCI frame indicator if the device didn't send it.
- HCI frames received on
hookget transmitted out. - The node will drop the HCI frame indicator unless the device actually requires it to be present.
so basically the node is doing the emotional labour of translating for both sides. icon behaviour, ngl. π«Ά
π₯ HARDWARE π₯
The ng_ubt driver supports all Bluetooth USB devices that conform with the Bluetooth specification v1.1, including:
- 3Com 3CREB96
- AIPTEK BR0R02
- EPoX BT-DG02
- Mitsumi Bluetooth USB adapter
- MSI MS-6967
- TDK Bluetooth USB adapter
- Broadcom Bluetooth USB adapter
that's the whole crew right there β
π HOOKS π
This node type supports the following hooks:
hookβ single HCI frame contained in a singlembufstructure.
one hook. one job. it's giving minimalism and honestly it's working for her π
π CONTROL MESSAGES π
This node type supports the generic control messages, plus the following:
NGM_UBT_NODE_GET_DEBUG(get_debug) β Returns an integer containing the current debug level for the node.NGM_UBT_NODE_SET_DEBUG(set_debug) β This command takes an integer argument and sets the current debug level for the node.NGM_UBT_NODE_GET_QLEN(get_qlen) β This command takes a parameter that specifies the queue number and returns the current maximal length of the queue for the node.NGM_UBT_NODE_SET_QLEN(set_qlen) β This command takes two parameters that specify the queue number and the maximum length of the queue and sets the maximal length of the queue for the node.NGM_UBT_NODE_GET_STAT(get_stat) β 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. numbers!! we love numbers!! πNGM_UBT_NODE_RESET_STAT(reset_stat) β Reset all statistic counters to zero. fresh start, clean slate, new era π§
π SHUTDOWN π
This node shuts down when the corresponding USB device is un-plugged. that's it. that's the whole rule. when the device leaves, the node leaves too. devastating but fair π
π SEE ALSO π
netgraph(4), ugen(4), usb(4), ngctl(8)
go read those next, iykyk π
β HISTORY β
The ubt node type was implemented in FreeBSD 5.0. a classic. an OG. we stan a legacy icon π
π AUTHORS π
Maksim Yevmenkin <m_evmenkin@yahoo.com>
shoutout to Maksim, absolute legend, no cap π«‘
β οΈ BUGS β οΈ
okay bestie, listen carefully because this part is real:
Isochronous USB transfers are broken. This means that the USB device will not be able to transfer SCO data (voice). like, actual voice. it just won't. not a vibe, but it's the truth π
Also: USB interrupt transfers are implemented as bulk-in transfers β but that's not really a bug, so don't come for her. π
That's the whole page, bestie β this one came from the Debian build of the manpage, dated December 26, 2012, and it's NG_UBT(4). go forth and Bluetooth responsibly π
β¨π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms