Skip to content

BLEClient

A model of a BLE client.

詳細情報

メンバー

m_appId

uint16_t BLEClient::m_appId

BLEClient()

BLEClient::BLEClient()

~BLEClient()

Destructor.

BLEClient::~BLEClient()

connect()

Add overloaded function to ease connect to peer device with not public address

bool BLEClient::connect(BLEAdvertisedDevice *device)

引数

  • BLEAdvertisedDevice* device

戻り値

bool

connect()

Connect to the partner (BLE ).

bool BLEClient::connect(BLEAddress address, esp_ble_addr_type_t type=BLE_ADDR_TYPE_PUBLIC)

引数

  • BLEAddress address The address of the partner.
  • esp_ble_addr_type_t type

戻り値

bool True on success.

disconnect()

Disconnect from the peer.

void BLEClient::disconnect()

getPeerAddress()

Retrieve the address of the peer.

Returns the Bluetooth device address of the BLE peer to which this client is connected.

BLEAddress BLEClient::getPeerAddress()

戻り値

BLEAddress

getRssi()

Ask the BLE server for the RSSI value.

int BLEClient::getRssi()

戻り値

int The RSSI value.

getServices()

Ask the remote BLE server for its services. A BLE exposes a set of services for its partners. Here we ask the server for its set of services and wait until we have received them all.

std::map< std::string, BLERemoteService * > * BLEClient::getServices()

戻り値

std::map< , * > * N/A

getService()

Get the service BLE Remote Service instance corresponding to the uuid.

BLERemoteService * BLEClient::getService(const char *uuid)

引数

  • constchar * uuid The UUID of the service being sought.

戻り値

BLERemoteService* A reference to the Service or nullptr if don't know about it.

getService()

Get the service object corresponding to the uuid.

BLERemoteService * BLEClient::getService(BLEUUID uuid)

引数

  • BLEUUID uuid The UUID of the service being sought.

戻り値

BLERemoteService* A reference to the Service or nullptr if don't know about it.

getValue()

Get the value of a specific characteristic associated with a specific service.

std::string BLEClient::getValue(BLEUUID serviceUUID, BLEUUID characteristicUUID)

引数

  • BLEUUID serviceUUID The service that owns the characteristic.
  • BLEUUID characteristicUUID The characteristic whose value we wish to read.

戻り値

std::string

handleGAPEvent()

Handle a received GAP event.

void BLEClient::handleGAPEvent(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param)

引数

  • esp_gap_ble_cb_event_t event
  • esp_ble_gap_cb_param_t* param

isConnected()

Are we connected to a partner?

bool BLEClient::isConnected()

戻り値

bool True if we are connected and false if we are not connected.

setClientCallbacks()

Set the callbacks that will be invoked.

void BLEClient::setClientCallbacks(BLEClientCallbacks *pClientCallbacks)

引数

  • BLEClientCallbacks* pClientCallbacks

setValue()

Set the value of a specific characteristic associated with a specific service.

void BLEClient::setValue(BLEUUID serviceUUID, BLEUUID characteristicUUID, std::string value)

引数

  • BLEUUID serviceUUID The service that owns the characteristic.
  • BLEUUID characteristicUUID The characteristic whose value we wish to write.
  • std::string value

toString()

Return a string representation of this client.

std::string BLEClient::toString()

戻り値

std::string A string representation of this client.

getConnId()

uint16_t BLEClient::getConnId()

戻り値

uint16_t

getGattcIf()

esp_gatt_if_t BLEClient::getGattcIf()

戻り値

esp_gatt_if_t

getMTU()

uint16_t BLEClient::getMTU()

戻り値

uint16_t