Browse Source
Merge pull request #74 from ddmunhoz/add-bool-meshcore-prefix
add: BLE_NAME_PREFIX flag
pull/94/head
ripplebiz
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
14 additions and
2 deletions
-
examples/companion_radio/main.cpp
|
|
|
@ -1287,7 +1287,13 @@ void setup() { |
|
|
|
|
|
|
|
#ifdef BLE_PIN_CODE |
|
|
|
char dev_name[32+10]; |
|
|
|
sprintf(dev_name, "MeshCore-%s", the_mesh.getNodeName()); |
|
|
|
const char* prefix = |
|
|
|
#ifdef BLE_NAME_PREFIX |
|
|
|
BLE_NAME_PREFIX; |
|
|
|
#else |
|
|
|
"MeshCore-"; |
|
|
|
#endif |
|
|
|
sprintf(dev_name, "%s%s", prefix, the_mesh.getNodeName()); |
|
|
|
serial_interface.begin(dev_name, the_mesh.getBLEPin()); |
|
|
|
#else |
|
|
|
pinMode(WB_IO2, OUTPUT); |
|
|
|
@ -1303,7 +1309,13 @@ void setup() { |
|
|
|
serial_interface.begin(TCP_PORT); |
|
|
|
#elif defined(BLE_PIN_CODE) |
|
|
|
char dev_name[32+10]; |
|
|
|
sprintf(dev_name, "MeshCore-%s", the_mesh.getNodeName()); |
|
|
|
const char* prefix = |
|
|
|
#ifdef BLE_NAME_PREFIX |
|
|
|
BLE_NAME_PREFIX; |
|
|
|
#else |
|
|
|
"MeshCore-"; |
|
|
|
#endif |
|
|
|
sprintf(dev_name, "%s%s", prefix, the_mesh.getNodeName()); |
|
|
|
serial_interface.begin(dev_name, the_mesh.getBLEPin()); |
|
|
|
#else |
|
|
|
serial_interface.begin(Serial); |
|
|
|
|