mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2026-01-27 17:42:24 +01:00
Add ==,!= operators to NimBLEAddress, pass parameters by const reference.
This commit is contained in:
@@ -33,7 +33,7 @@ static const char* LOG_TAG = "NimBLEUtils";
|
||||
* @param [in] source The source of the copy
|
||||
* @param [in] size The number of bytes to copy
|
||||
*/
|
||||
void NimBLEUtils::memrcpy(uint8_t* target, uint8_t* source, uint32_t size) {
|
||||
void NimBLEUtils::memrcpy(uint8_t* target, const uint8_t* source, uint32_t size) {
|
||||
assert(size > 0);
|
||||
target += (size - 1); // Point target to the last byte of the target data
|
||||
while (size > 0) {
|
||||
@@ -394,7 +394,7 @@ const char* NimBLEUtils::advTypeToString(uint8_t advType) {
|
||||
* @param [in] length The length of the data to convert.
|
||||
* @return A pointer to the formatted buffer.
|
||||
*/
|
||||
char* NimBLEUtils::buildHexData(uint8_t* target, uint8_t* source, uint8_t length) {
|
||||
char* NimBLEUtils::buildHexData(uint8_t* target, const uint8_t* source, uint8_t length) {
|
||||
// Guard against too much data.
|
||||
if (length > 100) length = 100;
|
||||
|
||||
@@ -698,4 +698,4 @@ void print_addr(const void *addr)
|
||||
u8p[5], u8p[4], u8p[3], u8p[2], u8p[1], u8p[0]);
|
||||
}
|
||||
|
||||
#endif //CONFIG_BT_ENABLED
|
||||
#endif //CONFIG_BT_ENABLED
|
||||
|
||||
Reference in New Issue
Block a user