Browse Source
Merge pull request #426 from 446564/feat-GH109
allows manual BLE pin even when device has display
pull/465/head
ripplebiz
11 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with
5 additions and
5 deletions
-
examples/companion_radio/MyMesh.cpp
-
variants/heltec_v2/platformio.ini
-
variants/heltec_v3/platformio.ini
-
variants/nano_g2_ultra/platformio.ini
|
|
@ -613,10 +613,10 @@ void MyMesh::begin(bool has_display) { |
|
|
_prefs.cr = constrain(_prefs.cr, 5, 8); |
|
|
_prefs.cr = constrain(_prefs.cr, 5, 8); |
|
|
_prefs.tx_power_dbm = constrain(_prefs.tx_power_dbm, 1, MAX_LORA_TX_POWER); |
|
|
_prefs.tx_power_dbm = constrain(_prefs.tx_power_dbm, 1, MAX_LORA_TX_POWER); |
|
|
|
|
|
|
|
|
#ifdef BLE_PIN_CODE |
|
|
#ifdef BLE_PIN_CODE // 123456 by default
|
|
|
if (_prefs.ble_pin == 0) { |
|
|
if (_prefs.ble_pin == 0) { |
|
|
#ifdef DISPLAY_CLASS |
|
|
#ifdef DISPLAY_CLASS |
|
|
if (has_display) { |
|
|
if (has_display && BLE_PIN_CODE == 123456) { |
|
|
StdRNG rng; |
|
|
StdRNG rng; |
|
|
_active_ble_pin = rng.nextInt(100000, 999999); // random pin each session
|
|
|
_active_ble_pin = rng.nextInt(100000, 999999); // random pin each session
|
|
|
} else { |
|
|
} else { |
|
|
|
|
|
@ -96,7 +96,7 @@ build_flags = |
|
|
-D DISPLAY_CLASS=SSD1306Display |
|
|
-D DISPLAY_CLASS=SSD1306Display |
|
|
-D MAX_CONTACTS=100 |
|
|
-D MAX_CONTACTS=100 |
|
|
-D MAX_GROUP_CHANNELS=8 |
|
|
-D MAX_GROUP_CHANNELS=8 |
|
|
-D BLE_PIN_CODE=0 |
|
|
-D BLE_PIN_CODE=123456 |
|
|
-D BLE_DEBUG_LOGGING=1 |
|
|
-D BLE_DEBUG_LOGGING=1 |
|
|
-D OFFLINE_QUEUE_SIZE=256 |
|
|
-D OFFLINE_QUEUE_SIZE=256 |
|
|
; -D MESH_PACKET_LOGGING=1 |
|
|
; -D MESH_PACKET_LOGGING=1 |
|
|
|
|
|
@ -114,7 +114,7 @@ build_flags = |
|
|
-D MAX_CONTACTS=100 |
|
|
-D MAX_CONTACTS=100 |
|
|
-D MAX_GROUP_CHANNELS=8 |
|
|
-D MAX_GROUP_CHANNELS=8 |
|
|
-D DISPLAY_CLASS=SSD1306Display |
|
|
-D DISPLAY_CLASS=SSD1306Display |
|
|
-D BLE_PIN_CODE=0 ; dynamic, random PIN |
|
|
-D BLE_PIN_CODE=123456 ; dynamic, random PIN |
|
|
-D BLE_DEBUG_LOGGING=1 |
|
|
-D BLE_DEBUG_LOGGING=1 |
|
|
-D OFFLINE_QUEUE_SIZE=256 |
|
|
-D OFFLINE_QUEUE_SIZE=256 |
|
|
; -D MESH_PACKET_LOGGING=1 |
|
|
; -D MESH_PACKET_LOGGING=1 |
|
|
|
|
|
@ -36,7 +36,7 @@ build_flags = |
|
|
-I src/helpers/ui |
|
|
-I src/helpers/ui |
|
|
-D MAX_CONTACTS=100 |
|
|
-D MAX_CONTACTS=100 |
|
|
-D MAX_GROUP_CHANNELS=8 |
|
|
-D MAX_GROUP_CHANNELS=8 |
|
|
-D BLE_PIN_CODE=0 |
|
|
-D BLE_PIN_CODE=123456 |
|
|
-D BLE_DEBUG_LOGGING=1 |
|
|
-D BLE_DEBUG_LOGGING=1 |
|
|
-D OFFLINE_QUEUE_SIZE=256 |
|
|
-D OFFLINE_QUEUE_SIZE=256 |
|
|
-D DISPLAY_CLASS=SH1106Display |
|
|
-D DISPLAY_CLASS=SH1106Display |
|
|
|