|
Open Model Railroad Network (OpenMRN)
|
Miscellaneous BLE definitions. More...
#include <Defs.hxx>
Public Types | |
| enum class | GATTPerm : uint8_t { READ = 0x01 , WRITE = 0x02 , AUTHEN_READ = 0x04 , AUTHEN_WRITE = 0x08 , AUTHOR_READ = 0x10 , AUTHOR_WRITE = 0x20 , ENCRYPT_READ = 0x40 , ENCRYPT_WRITE = 0x80 } |
| GATT Permisions. More... | |
| enum | { UUID_LEN_16 = 2 , UUID_LEN_32 = 4 , UUID_LEN_128 = 16 } |
| UUID Sizes. More... | |
| enum class | AdvType : uint8_t { FLAGS = 0x01 , NAME_SHORT = 0x08 , NAME_COMPLETE = 0x09 , SERVICE_DATA_128 = 0x21 } |
| Advertising types. More... | |
| typedef uint8_t | Addr[ADDR_LEN] |
| BLE address. | |
| typedef uint8_t | AddrType |
| Address Type. | |
| typedef uint16_t | ConnHandle |
| Connection handle. | |
| typedef uint16_t | AttHandle |
Static Public Member Functions | |
| static ssize_t | adv_find_data (std::basic_string< uint8_t > &adv, AdvType type, uint8_t *size, unsigned instance=1) |
| Find an advertisment data within an advertisement set. | |
| static std::string | adv_find_name_short (std::basic_string< uint8_t > &adv, unsigned instance=1) |
| Find an advertisment name short type within an advertisement set. | |
| static std::string | adv_find_name_complete (std::basic_string< uint8_t > &adv, unsigned instance=1) |
| Find an advertisment name complete type within an advertisement set. | |
| static std::basic_string< uint8_t > | adv_find_service_data_128 (std::basic_string< uint8_t > &adv, const uint8_t service_uuid[16], unsigned instance=1) |
| Find an advertisment service data 128 type within an advertisement set. | |
Static Public Attributes | |
| static constexpr uint16_t | ATTR_HANDLE_INVALID = 0 |
| The value of an invalid or unitialized attribute handle. | |
| static constexpr uint16_t | CONN_HANDLE_INVALID = 0xFFFF |
| The value of an invalid or unitialized connection handle. | |
| static constexpr uint8_t | ADDR_LEN = 6 |
| The length of an address. | |
| static const uint8_t | PRIMARY_SERVICE_UUID [2] = {0x00, 0x28} |
| Primary service UUID. | |
| static const uint8_t | SECONDARY_SERVICE_UUID [2] = {0x01, 0x28} |
| Secondary service UUID. | |
| static const uint8_t | CHAR_DECLARATOIN_UUID [2] = {0x03, 0x28} |
| Characteristic UUID. | |
| static const uint8_t | CHAR_CLIENT_CONFIG_UUID [2] = {0x02, 0x29} |
| Characterisitic Client Config Descriptor (CCCD) UUID. | |
| static const uint8_t | CHAR_PROP_READ_WRITE_NOTIFY [1] |
| Characteristic read/write/notify property. | |
| static const uint8_t | CHAR_PROP_READ_NOTIFY_ACK [1] |
| Characteristic read/write/notify property. | |
| static const uint8_t | CHAR_PROP_WRITE [1] |
| Characteristic read/write/notify property. | |
Miscellaneous BLE definitions.
Definition at line 39 of file ble/Defs.hxx.
| typedef uint8_t ble::Defs::Addr[ADDR_LEN] |
BLE address.
Definition at line 73 of file ble/Defs.hxx.
| typedef uint8_t ble::Defs::AddrType |
Address Type.
Definition at line 76 of file ble/Defs.hxx.
| typedef uint16_t ble::Defs::AttHandle |
Definition at line 81 of file ble/Defs.hxx.
| typedef uint16_t ble::Defs::ConnHandle |
Connection handle.
Definition at line 79 of file ble/Defs.hxx.
| anonymous enum |
UUID Sizes.
| Enumerator | |
|---|---|
| UUID_LEN_16 | length in bytes of a 16-bit UUID |
| UUID_LEN_32 | length in bytes of a 32-bit UUID |
| UUID_LEN_128 | length in bytes of a 128-bit UUID |
Definition at line 97 of file ble/Defs.hxx.
|
strong |
Advertising types.
| Enumerator | |
|---|---|
| FLAGS | GAP discovery modes. |
| NAME_SHORT | shortened local name |
| NAME_COMPLETE | complete local name |
| SERVICE_DATA_128 | 128-bit service UUID folloed by data |
Definition at line 105 of file ble/Defs.hxx.
|
strong |
GATT Permisions.
Definition at line 84 of file ble/Defs.hxx.
|
static |
Find an advertisment data within an advertisement set.
| adv | contents of the advertisement set |
| type | the data type to find |
| size | location to place the data size, size excludes type byte |
| instance | which instance, starting from the front, to find |
Definition at line 59 of file ble/Defs.cxx.
|
static |
Find an advertisment name complete type within an advertisement set.
| adv | contents of the advertisement set |
| instance | which instance, starting from the front, to find |
Definition at line 104 of file ble/Defs.cxx.
|
static |
Find an advertisment name short type within an advertisement set.
| adv | contents of the advertisement set |
| instance | which instance, starting from the front, to find |
Definition at line 88 of file ble/Defs.cxx.
|
static |
Find an advertisment service data 128 type within an advertisement set.
| adv | contents of the advertisement set |
| service_uuid | 128-bit UUID of the service to extract data from |
| instance | which instance, starting from the front, to find |
Definition at line 120 of file ble/Defs.cxx.
|
staticconstexpr |
The length of an address.
Definition at line 49 of file ble/Defs.hxx.
|
staticconstexpr |
The value of an invalid or unitialized attribute handle.
Definition at line 43 of file ble/Defs.hxx.
|
static |
Characterisitic Client Config Descriptor (CCCD) UUID.
Definition at line 61 of file ble/Defs.hxx.
|
static |
Characteristic UUID.
Definition at line 58 of file ble/Defs.hxx.
|
static |
Characteristic read/write/notify property.
Definition at line 67 of file ble/Defs.hxx.
|
static |
Characteristic read/write/notify property.
Definition at line 64 of file ble/Defs.hxx.
|
static |
Characteristic read/write/notify property.
Definition at line 70 of file ble/Defs.hxx.
|
staticconstexpr |
The value of an invalid or unitialized connection handle.
Definition at line 46 of file ble/Defs.hxx.
|
static |
Primary service UUID.
Definition at line 52 of file ble/Defs.hxx.
|
static |
Secondary service UUID.
Definition at line 55 of file ble/Defs.hxx.