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§
- Sock
Addr L2 struct sockaddr_l2frombluetooth/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_voidbecause both socket families here bind with their ownsockaddrshape, 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:FFinto wire order. - read⚠
- shutdown⚠
- socket⚠
- wait_
ready - Wait for
fdto be ready, for at mosttimeout_ms. - write⚠