mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
add: BLE_NAME_PREFIX flag
This commit is contained in:
parent
808d3933c1
commit
a5fb3acc9b
1 changed files with 14 additions and 2 deletions
|
|
@ -1272,7 +1272,13 @@ void setup() {
|
||||||
|
|
||||||
#ifdef BLE_PIN_CODE
|
#ifdef BLE_PIN_CODE
|
||||||
char dev_name[32+10];
|
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());
|
serial_interface.begin(dev_name, the_mesh.getBLEPin());
|
||||||
#else
|
#else
|
||||||
pinMode(WB_IO2, OUTPUT);
|
pinMode(WB_IO2, OUTPUT);
|
||||||
|
|
@ -1288,7 +1294,13 @@ void setup() {
|
||||||
serial_interface.begin(TCP_PORT);
|
serial_interface.begin(TCP_PORT);
|
||||||
#elif defined(BLE_PIN_CODE)
|
#elif defined(BLE_PIN_CODE)
|
||||||
char dev_name[32+10];
|
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());
|
serial_interface.begin(dev_name, the_mesh.getBLEPin());
|
||||||
#else
|
#else
|
||||||
serial_interface.begin(Serial);
|
serial_interface.begin(Serial);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue