41 NodeID node_id,
const char *node_name, uint32_t pip)
42 : Advertisement(ble::Advertisement::MAX_DATA_PAYLOAD_SIZE,
43 ble::Advertisement::MAX_SCAN_DATA_PAYLOAD_SIZE)
49 if (node_name && strlen(node_name) != 0)
51 std::string name(node_name);
57 node_id = htole64(node_id);
58 std::basic_string<uint8_t> payload =
59 std::basic_string<uint8_t>((uint8_t*)&node_id, 6) +
60 std::basic_string<uint8_t>((uint8_t*)&pip,
sizeof(pip));
@ LE_ONLY_GENERAL_DISC_MODE
BEE only general discovery mode.
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_name(Field field, std::string &name)
Add name to the end of the advertisement.
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.
@ SERVICE_DATA_128
128-bit service UUID folloed by data
@ FLAGS
GAP discovery modes.
BLEAdvertisement(NodeID node_id, const char *node_name, uint32_t pip)
Constructor.
static const uint8_t GATT_SERVICE_UUID_OPENLCB[16]
OpenLCB GATT service UUID.
uint64_t NodeID
48-bit NMRAnet Node ID type