Skip to content

BLEDevice

詳細情報

メンバー

m_appId

uint16_t BLEDevice::m_appId

m_localMTU

uint16_t BLEDevice::m_localMTU

m_securityLevel

esp_ble_sec_act_t BLEDevice::m_securityLevel

m_customGapHandler

gap_event_handler BLEDevice::m_customGapHandler

m_customGattcHandler

gattc_event_handler BLEDevice::m_customGattcHandler

m_customGattsHandler

gatts_event_handler BLEDevice::m_customGattsHandler

createClient()

Create a new instance of a client.

BLEClient * BLEDevice::createClient()

戻り値

BLEClient* A new instance of the client.

createServer()

Create a new instance of a server.

BLEServer * BLEDevice::createServer()

戻り値

BLEServer* A new instance of the server.

getAddress()

Get the BLE device address.

BLEAddress BLEDevice::getAddress()

戻り値

BLEAddress The BLE device address.

getScan()

Retrieve the Scan object that we use for scanning.

BLEScan * BLEDevice::getScan()

戻り値

BLEScan* The scanning object reference. This is a singleton object. The caller should not try and release/delete it.

getValue()

Get the value of a characteristic of a service on a remote device.

std::string BLEDevice::getValue(BLEAddress bdAddress, BLEUUID serviceUUID, BLEUUID characteristicUUID)

引数

  • BLEAddress bdAddress
  • BLEUUID serviceUUID
  • BLEUUID characteristicUUID

戻り値

std::string

init()

Initialize the BLE environment.

void BLEDevice::init(std::string deviceName)

引数

  • std::string deviceName The device name of the device.

setPower()

Set the transmission power. The power level can be one of:

void BLEDevice::setPower(esp_power_level_t powerLevel)

引数

  • esp_power_level_t powerLevel

setValue()

Set the value of a characteristic of a service on a remote device.

void BLEDevice::setValue(BLEAddress bdAddress, BLEUUID serviceUUID, BLEUUID characteristicUUID, std::string value)

引数

  • BLEAddress bdAddress
  • BLEUUID serviceUUID
  • BLEUUID characteristicUUID
  • std::string value

toString()

Return a string representation of the nature of this device.

std::string BLEDevice::toString()

戻り値

std::string A string representation of the nature of this device.

whiteListAdd()

Add an entry to the BLE white list.

void BLEDevice::whiteListAdd(BLEAddress address)

引数

  • BLEAddress address The address to add to the white list.

whiteListRemove()

Remove an entry from the BLE white list.

void BLEDevice::whiteListRemove(BLEAddress address)

引数

  • BLEAddress address The address to remove from the white list.

setEncryptionLevel()

void BLEDevice::setEncryptionLevel(esp_ble_sec_act_t level)

引数

  • esp_ble_sec_act_t level

setSecurityCallbacks()

void BLEDevice::setSecurityCallbacks(BLESecurityCallbacks *pCallbacks)

引数

  • BLESecurityCallbacks* pCallbacks

setMTU()

esp_err_t BLEDevice::setMTU(uint16_t mtu)

引数

  • uint16_t mtu

戻り値

esp_err_t

getMTU()

uint16_t BLEDevice::getMTU()

戻り値

uint16_t

getInitialized()

bool BLEDevice::getInitialized()

戻り値

bool

getAdvertising()

BLEAdvertising * BLEDevice::getAdvertising()

戻り値

BLEAdvertising*

startAdvertising()

void BLEDevice::startAdvertising()

getPeerDevices()

std::map< uint16_t, conn_status_t > BLEDevice::getPeerDevices(bool client)

引数

  • bool client

戻り値

std::map< , >

addPeerDevice()

void BLEDevice::addPeerDevice(void *peer, bool is_client, uint16_t conn_id)

引数

  • void * peer
  • bool is_client
  • uint16_t conn_id

updatePeerDevice()

void BLEDevice::updatePeerDevice(void *peer, bool _client, uint16_t conn_id)

引数

  • void * peer
  • bool _client
  • uint16_t conn_id

removePeerDevice()

void BLEDevice::removePeerDevice(uint16_t conn_id, bool client)

引数

  • uint16_t conn_id
  • bool client

getClientByGattIf()

BLEClient * BLEDevice::getClientByGattIf(uint16_t conn_id)

引数

  • uint16_t conn_id

戻り値

BLEClient*

setCustomGapHandler()

void BLEDevice::setCustomGapHandler(gap_event_handler handler)

引数

  • gap_event_handler handler

setCustomGattcHandler()

void BLEDevice::setCustomGattcHandler(gattc_event_handler handler)

引数

  • gattc_event_handler handler

setCustomGattsHandler()

void BLEDevice::setCustomGattsHandler(gatts_event_handler handler)

引数

  • gatts_event_handler handler

deinit()

de-Initialize the BLE environment.

void BLEDevice::deinit(bool release_memory=false)

引数

  • bool release_memory release the internal BT stack memory