Add ==,!= operators to NimBLEAddress, pass parameters by const reference.

This commit is contained in:
h2zero
2020-05-10 07:21:46 -06:00
parent fba7e0fd68
commit f0191eb1e6
41 changed files with 217 additions and 183 deletions

View File

@@ -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