Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
openlcb::BLEAdvertisement Class Reference

OpenLCB BLE advertisement defintion. More...

#include <BLEAdvertisement.hxx>

Inheritance diagram for openlcb::BLEAdvertisement:
ble::Advertisement

Public Member Functions

 BLEAdvertisement (NodeID node_id, const char *node_name, uint32_t pip)
 Constructor.
 
- Public Member Functions inherited from ble::Advertisement
 Advertisement (bool extended=false)
 Constructor.
 
 Advertisement (size_t data_reserve, size_t scan_data_reserve)
 Constructor which reserves data and scan data space.
 
 Advertisement (size_t data_reserve, size_t dummy, bool extended)
 Constructor which reserves data space.
 
std::basic_string< uint8_t > concat_service_data_128 (const uint8_t uuid[16], const void *buf, size_t size)
 Concatenate a 128-bit (16-byte) UUID with provided data.
 
std::basic_string< uint8_t > concat_service_data_128 (const uint8_t uuid[16], std::basic_string< uint8_t > &buf)
 Concatenate a 128-bit (16-byte) UUID with provided data.
 
int prepend (Field field, Defs::AdvType type, const void *buf, size_t size, bool clip=false)
 Add to the beginning of the advertisement.
 
int prepend (Field field, Defs::AdvType type, std::basic_string< uint8_t > &buf, bool clip=false)
 Add to the beginning of the advertisement.
 
int prepend_name (Field field, std::string &name)
 Add name to the beginning of the advertisement.
 
int append (Field field, Defs::AdvType type, const void *buf, size_t size, bool clip=false)
 Add to the end of the advertisement.
 
int append (Field field, Defs::AdvType type, std::basic_string< uint8_t > &buf, bool clip=false)
 Add to the end of the advertisement.
 
int append_name (Field field, std::string &name)
 Add name to the end of the advertisement.
 
int update (Field field, Defs::AdvType type, const void *buf, size_t size, unsigned instance=1, bool exact_size=true, bool clip=false)
 Update existing advertisement.
 
int update (Field field, Defs::AdvType type, std::basic_string< uint8_t > &buf, unsigned instance=1, bool exact_size=true, bool clip=false)
 Update existing advertisement.
 
bool is_extended ()
 Test if extended advertisement or not.
 
uint8_t * get_data ()
 Get the advertisement data.
 
size_t get_data_size ()
 Get the advertisement data size in bytes.
 
uint8_t * get_scan_data ()
 Get the advertisement data.
 
size_t get_scan_data_size ()
 Get the advertisement data size in bytes.
 

Additional Inherited Members

- Public Types inherited from ble::Advertisement
enum  Field { DATA , SCAN_DATA }
 Data fields that make up an advertisement. More...
 
enum class  Flags : uint8_t {
  LE_LIMITED_DISC_MODE = 0x01 , LE_GENERAL_DISC_MODE = 0x02 , BR_EDR_NOT_SUPPORTED = 0x04 , LE_BR_EDR_CONTROLLER = 0x08 ,
  LE_BR_EDR_HOST = 0x10 , LE_ONLY_LIMITED_DISC_MODE = 0x05 , LE_ONLY_GENERAL_DISC_MODE = 0x06
}
 Flag values. More...
 
- Static Public Attributes inherited from ble::Advertisement
static constexpr size_t MAX_DATA_PAYLOAD_SIZE = 31
 Maximum payload size of data.
 
static constexpr size_t MAX_SCAN_DATA_PAYLOAD_SIZE = 31
 Maximum payload size of scan data.
 
static constexpr size_t MAX_EXT_DATA_PAYLOAD_SIZE = 254
 Maximum payload size of extended data.
 

Detailed Description

OpenLCB BLE advertisement defintion.

Definition at line 38 of file BLEAdvertisement.hxx.

Constructor & Destructor Documentation

◆ BLEAdvertisement()

openlcb::BLEAdvertisement::BLEAdvertisement ( NodeID  node_id,
const char *  node_name,
uint32_t  pip 
)

Constructor.

Parameters
node_idDevice node ID that will be used in the advertisement.
node_namenode name that will be used in the advertisement.
pipsupported OpenLCB protocols

Definition at line 40 of file BLEAdvertisement.cxx.


The documentation for this class was generated from the following files: