Skip to main content

Module sys

Module sys 

Source
Expand description

The Bluetooth socket family.

Both Linux transports here are AF_BLUETOOTH sockets, so the address layout, the address parsing and the libc externs live once rather than once per transport.

Structs§

SockAddrL2
struct sockaddr_l2 from bluetooth/l2cap.h.

Enums§

Ready
Whether a descriptor became ready, timed out, or failed.

Constants§

AF_BLUETOOTH
BDADDR_ANY
BDADDR_ANY — let the kernel pick the adapter.
BDADDR_LE_PUBLIC
BDADDR_LE_RANDOM
BTPROTO_HCI
BTPROTO_L2CAP
EINTR
EINTR — a syscall interrupted by a signal, which is a retry not a failure.
POLLIN
POLLOUT
SHUT_RDWR
SOCK_RAW
SOCK_SEQPACKET

Functions§

address_type
The address type byte for an LE peer.
bind⚠
Takes a *const c_void because both socket families here bind with their own sockaddr shape, and one extern declaration has to serve both — two declarations of the same symbol with different pointer types do not compile.
bind_le_source
Bind an L2CAP socket to the local side of an LE link before connecting.
close⚠
connect⚠
errno
The current errno.
format_address
Format a wire-order address as it is written.
parse_address
Parse AA:BB:CC:DD:EE:FF into wire order.
read⚠
shutdown⚠
socket⚠
wait_ready
Wait for fd to be ready, for at most timeout_ms.
write⚠