File tree 2 files changed +36
-6
lines changed 2 files changed +36
-6
lines changed Original file line number Diff line number Diff line change 23
23
24
24
# include < algorithm>
25
25
26
+ # ifdef CONFIG_NIMBLE_CPP_ADDR_FMT_EXCLUDE_DELIMITER
27
+ # define NIMBLE_CPP_ADDR_DELIMITER " :"
28
+ # else
29
+ # define NIMBLE_CPP_ADDR_DELIMITER " "
30
+ # endif
31
+
32
+ # ifdef CONFIG_NIMBLE_CPP_ADDR_FMT_UPPERCASE
33
+ # define NIMBLE_CPP_ADDR_FMT " %02X%s%02X%s%02X%s%02X%s%02X%s%02X"
34
+ # else
35
+ # define NIMBLE_CPP_ADDR_FMT " %02x%s%02x%s%02x%s%02x%s%02x%s%02x"
36
+ # endif
37
+
26
38
static const char * LOG_TAG = " NimBLEAddress" ;
27
39
28
40
/* ************************************************
@@ -211,12 +223,12 @@ NimBLEAddress::operator std::string() const {
211
223
char buffer[18 ];
212
224
snprintf (buffer,
213
225
sizeof (buffer),
214
- " %02x:%02x:%02x:%02x:%02x:%02x " ,
215
- this ->val [5 ],
216
- this ->val [4 ],
217
- this ->val [3 ],
218
- this ->val [2 ],
219
- this ->val [1 ],
226
+ NIMBLE_CPP_ADDR_FMT ,
227
+ this ->val [5 ], NIMBLE_CPP_ADDR_DELIMITER,
228
+ this ->val [4 ], NIMBLE_CPP_ADDR_DELIMITER,
229
+ this ->val [3 ], NIMBLE_CPP_ADDR_DELIMITER,
230
+ this ->val [2 ], NIMBLE_CPP_ADDR_DELIMITER,
231
+ this ->val [1 ], NIMBLE_CPP_ADDR_DELIMITER,
220
232
this ->val [0 ]);
221
233
return std::string{buffer};
222
234
} // operator std::string
Original file line number Diff line number Diff line change 155
155
*/
156
156
// #define CONFIG_NIMBLE_CPP_FREERTOS_TASK_BLOCK_BIT 31
157
157
158
+ /**
159
+ * @brief Un-comment to disable showing colon characters when printing address.
160
+ */
161
+ // #define CONFIG_NIMBLE_CPP_ADDR_FMT_EXCLUDE_DELIMITER 1
162
+
163
+ /**
164
+ * @brief Un-comment to use uppercase letters when printing address.
165
+ */
166
+ //#define CONFIG_NIMBLE_CPP_ADDR_FMT_UPPERCASE 1
167
+
158
168
/**********************************
159
169
End Arduino user-config
160
170
**********************************/
361
371
#define CONFIG_NIMBLE_CPP_FREERTOS_TASK_BLOCK_BIT 31
362
372
#endif
363
373
374
+ #ifndef CONFIG_NIMBLE_CPP_ADDR_FMT_EXCLUDE_DELIMITER
375
+ #define CONFIG_NIMBLE_CPP_ADDR_FMT_INCLUDE_DELIMITER 0
376
+ #endif
377
+
378
+ #ifndef CONFIG_NIMBLE_CPP_ADDR_FMT_UPPERCASE
379
+ #define CONFIG_NIMBLE_CPP_ADDR_FMT_UPPERCASE 0
380
+ #endif
381
+
364
382
#if CONFIG_NIMBLE_CPP_DEBUG_ASSERT_ENABLED && !defined NDEBUG
365
383
void nimble_cpp_assert (const char * file , unsigned line ) __attribute((weak , noreturn ));
366
384
# define NIMBLE_ATT_VAL_FILE (__builtin_strrchr(__FILE__, '/') ? \
You can’t perform that action at this time.
0 commit comments