|
| enum class | hf_bluetooth_err_t : hf_u8_t {
BLUETOOTH_SUCCESS = 0
, BLUETOOTH_ERR_FAILURE = 1
, BLUETOOTH_ERR_INVALID_PARAM = 2
, BLUETOOTH_ERR_NOT_INITIALIZED = 3
,
BLUETOOTH_ERR_ALREADY_INITIALIZED = 4
, BLUETOOTH_ERR_NOT_ENABLED = 5
, BLUETOOTH_ERR_ALREADY_ENABLED = 6
, BLUETOOTH_ERR_NOT_CONNECTED = 7
,
BLUETOOTH_ERR_ALREADY_CONNECTED = 8
, BLUETOOTH_ERR_CONNECTION_FAILED = 9
, BLUETOOTH_ERR_DISCONNECTION_FAILED = 10
, BLUETOOTH_ERR_SCAN_FAILED = 11
,
BLUETOOTH_ERR_PAIR_FAILED = 12
, BLUETOOTH_ERR_UNPAIR_FAILED = 13
, BLUETOOTH_ERR_TIMEOUT = 14
, BLUETOOTH_ERR_NO_MEMORY = 15
,
BLUETOOTH_ERR_INVALID_ADDRESS = 16
, BLUETOOTH_ERR_DEVICE_NOT_FOUND = 17
, BLUETOOTH_ERR_SERVICE_NOT_FOUND = 18
, BLUETOOTH_ERR_CHARACTERISTIC_NOT_FOUND = 19
,
BLUETOOTH_ERR_AUTHENTICATION_FAILED = 20
, BLUETOOTH_ERR_AUTHORIZATION_FAILED = 21
, BLUETOOTH_ERR_ENCRYPTION_FAILED = 22
, BLUETOOTH_ERR_OPERATION_NOT_SUPPORTED = 23
,
BLUETOOTH_ERR_GATT_ERROR = 24
, BLUETOOTH_ERR_INVALID_STATE = 25
, BLUETOOTH_ERR_PERMISSION_DENIED = 26
, BLUETOOTH_ERR_BUSY = 27
,
BLUETOOTH_ERR_SECURITY_ERROR = 28
, BLUETOOTH_ERR_INIT_FAILED = 29
, BLUETOOTH_ERR_NOT_SUPPORTED = 30
, BLUETOOTH_ERR_ALREADY_STARTED = 31
,
BLUETOOTH_ERR_CONFIG_FAILED = 32
, BLUETOOTH_ERR_START_FAILED = 33
, BLUETOOTH_ERR_STOP_FAILED = 34
, BLUETOOTH_ERR_CONNECTION_NOT_FOUND = 35
,
BLUETOOTH_ERR_MAX_CONNECTIONS_REACHED = 36
, BLUETOOTH_ERR_SEND_FAILED = 37
, BLUETOOTH_ERR_GATT_SERVICE_ADD_FAILED = 38
, BLUETOOTH_ERR_GATT_CHAR_ADD_FAILED = 39
,
BLUETOOTH_ERR_GATT_SERVICE_NOT_FOUND = 40
, BLUETOOTH_ERR_GATT_SERVICE_START_FAILED = 41
, BLUETOOTH_ERR_UNKNOWN = 42
} |
| |
| enum class | hf_bluetooth_mode_t : hf_u8_t { hf_bluetooth_mode_t::HF_BLUETOOTH_MODE_DISABLED = 0
, hf_bluetooth_mode_t::HF_BLUETOOTH_MODE_CLASSIC = 1
, hf_bluetooth_mode_t::HF_BLUETOOTH_MODE_BLE = 2
, hf_bluetooth_mode_t::HF_BLUETOOTH_MODE_DUAL = 3
} |
| | Bluetooth operating modes. More...
|
| |
| enum class | hf_bluetooth_device_type_t : hf_u8_t { hf_bluetooth_device_type_t::HF_BLUETOOTH_DEVICE_TYPE_UNKNOWN = 0
, hf_bluetooth_device_type_t::HF_BLUETOOTH_DEVICE_TYPE_CLASSIC = 1
, hf_bluetooth_device_type_t::HF_BLUETOOTH_DEVICE_TYPE_BLE = 2
, hf_bluetooth_device_type_t::HF_BLUETOOTH_DEVICE_TYPE_DUAL = 3
} |
| | Bluetooth device types. More...
|
| |
| enum class | hf_bluetooth_state_t : hf_u8_t {
hf_bluetooth_state_t::HF_BLUETOOTH_STATE_DISABLED = 0
, hf_bluetooth_state_t::HF_BLUETOOTH_STATE_ENABLED = 1
, hf_bluetooth_state_t::HF_BLUETOOTH_STATE_SCANNING = 2
, hf_bluetooth_state_t::HF_BLUETOOTH_STATE_CONNECTING = 3
,
hf_bluetooth_state_t::HF_BLUETOOTH_STATE_CONNECTED = 4
, hf_bluetooth_state_t::HF_BLUETOOTH_STATE_DISCONNECTING = 5
, hf_bluetooth_state_t::HF_BLUETOOTH_STATE_PAIRING = 6
, hf_bluetooth_state_t::HF_BLUETOOTH_STATE_PAIRED = 7
} |
| | Bluetooth connection states. More...
|
| |
| enum class | hf_bluetooth_security_t : hf_u8_t {
hf_bluetooth_security_t::HF_BLUETOOTH_SECURITY_NONE = 0
, hf_bluetooth_security_t::HF_BLUETOOTH_SECURITY_UNAUTHENTICATED = 1
, hf_bluetooth_security_t::HF_BLUETOOTH_SECURITY_AUTHENTICATED = 2
, hf_bluetooth_security_t::HF_BLUETOOTH_SECURITY_AUTHORIZED = 3
,
hf_bluetooth_security_t::HF_BLUETOOTH_SECURITY_ENCRYPTED = 4
, hf_bluetooth_security_t::HF_BLUETOOTH_SECURITY_AUTHENTICATED_SC = 5
} |
| | Bluetooth security levels. More...
|
| |
| enum class | hf_bluetooth_scan_type_t : hf_u8_t { hf_bluetooth_scan_type_t::HF_BLUETOOTH_SCAN_TYPE_PASSIVE = 0
, hf_bluetooth_scan_type_t::HF_BLUETOOTH_SCAN_TYPE_ACTIVE = 1
} |
| | Bluetooth scan types. More...
|
| |
| enum class | hf_bluetooth_scan_mode_t : hf_u8_t { hf_bluetooth_scan_mode_t::HF_BLUETOOTH_SCAN_MODE_GENERAL_INQUIRY = 0
, hf_bluetooth_scan_mode_t::HF_BLUETOOTH_SCAN_MODE_LE_GENERAL = 1
, hf_bluetooth_scan_mode_t::HF_BLUETOOTH_SCAN_MODE_LE_LIMITED = 2
} |
| | Bluetooth scan modes. More...
|
| |
| enum class | hf_bluetooth_connection_type_t : hf_u8_t { hf_bluetooth_connection_type_t::HF_BLUETOOTH_CONNECTION_TYPE_AUTO = 0
, hf_bluetooth_connection_type_t::HF_BLUETOOTH_CONNECTION_TYPE_CLASSIC = 1
, hf_bluetooth_connection_type_t::HF_BLUETOOTH_CONNECTION_TYPE_BLE = 2
} |
| | Bluetooth connection types. More...
|
| |
| enum class | hf_bluetooth_connection_state_t : hf_u8_t {
hf_bluetooth_connection_state_t::HF_BLUETOOTH_CONNECTION_STATE_DISCONNECTED = 0
, hf_bluetooth_connection_state_t::HF_BLUETOOTH_CONNECTION_STATE_CONNECTING = 1
, hf_bluetooth_connection_state_t::HF_BLUETOOTH_CONNECTION_STATE_CONNECTED = 2
, hf_bluetooth_connection_state_t::HF_BLUETOOTH_CONNECTION_STATE_ADVERTISING = 3
,
hf_bluetooth_connection_state_t::HF_BLUETOOTH_CONNECTION_STATE_SCANNING = 4
} |
| | Bluetooth connection states. More...
|
| |
| enum class | hf_bluetooth_event_t : hf_u8_t {
hf_bluetooth_event_t::HF_BLUETOOTH_EVENT_ENABLED = 0
, hf_bluetooth_event_t::HF_BLUETOOTH_EVENT_DISABLED = 1
, hf_bluetooth_event_t::HF_BLUETOOTH_EVENT_SCAN_START = 2
, hf_bluetooth_event_t::HF_BLUETOOTH_EVENT_SCAN_STOP = 3
,
hf_bluetooth_event_t::HF_BLUETOOTH_EVENT_DEVICE_FOUND = 4
, hf_bluetooth_event_t::HF_BLUETOOTH_EVENT_PAIR_REQUEST = 5
, hf_bluetooth_event_t::HF_BLUETOOTH_EVENT_PAIR_SUCCESS = 6
, hf_bluetooth_event_t::HF_BLUETOOTH_EVENT_PAIR_FAILED = 7
,
hf_bluetooth_event_t::HF_BLUETOOTH_EVENT_UNPAIR_SUCCESS = 8
, hf_bluetooth_event_t::HF_BLUETOOTH_EVENT_CONNECT_SUCCESS = 9
, hf_bluetooth_event_t::HF_BLUETOOTH_EVENT_CONNECT_FAILED = 10
, hf_bluetooth_event_t::HF_BLUETOOTH_EVENT_DISCONNECT = 11
,
hf_bluetooth_event_t::HF_BLUETOOTH_EVENT_DATA_RECEIVED = 12
, hf_bluetooth_event_t::HF_BLUETOOTH_EVENT_DATA_SENT = 13
, hf_bluetooth_event_t::HF_BLUETOOTH_EVENT_GATT_SERVICE_DISCOVERED = 14
, hf_bluetooth_event_t::HF_BLUETOOTH_EVENT_GATT_CHARACTERISTIC_READ = 15
,
hf_bluetooth_event_t::HF_BLUETOOTH_EVENT_GATT_CHARACTERISTIC_WRITE = 16
, hf_bluetooth_event_t::HF_BLUETOOTH_EVENT_GATT_NOTIFICATION = 17
} |
| | Bluetooth event types for callback functions. More...
|
| |
Unified Bluetooth base class for all Bluetooth implementations.
This file contains the declaration of the BaseBluetooth abstract class, which provides a comprehensive Bluetooth abstraction that serves as the base for all Bluetooth implementations in the HardFOC system. It supports both Bluetooth Classic and Bluetooth Low Energy (BLE), device discovery, pairing, connection management, and works across different hardware platforms including ESP32, and other Bluetooth-capable MCUs.
- Author
- Nebiyu Tadesse
- Date
- 2025
- Copyright
- HardFOC
- Note
- This class is not thread-safe. Use appropriate synchronization if accessed from multiple contexts.