Skip to content

Commit

Permalink
Add access to remote address in BLERemoteCharacteristic
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Keppeler committed Dec 14, 2018
1 parent 8a5a789 commit ab386db
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cpp_utils/BLERemoteCharacteristic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -582,5 +582,13 @@ void BLERemoteCharacteristic::writeValue(uint8_t* data, size_t length, bool resp
uint8_t* BLERemoteCharacteristic::readRawData() {
return m_rawData;
}
/**
* @brief Get the address of the remote server
* @return RemoteAddress
*/
BLEAddress BLERemoteCharacteristic::getRemoteAddress(){
return m_pRemoteService->getClient()->getPeerAddress();
}


#endif /* CONFIG_BT_ENABLED */
1 change: 1 addition & 0 deletions cpp_utils/BLERemoteCharacteristic.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class BLERemoteCharacteristic {
void writeValue(uint8_t newValue, bool response = false);
std::string toString();
uint8_t* readRawData();
BLEAddress getRemoteAddress();

private:
BLERemoteCharacteristic(uint16_t handle, BLEUUID uuid, esp_gatt_char_prop_t charProp, BLERemoteService* pRemoteService);
Expand Down

0 comments on commit ab386db

Please sign in to comment.