make BLE name build time configurable

This commit is contained in:
Morgan 'ARR\!' Allen 2020-10-28 17:08:55 -07:00
parent faa6c62260
commit 2a44e2ea37
3 changed files with 8 additions and 44 deletions

View File

@ -1,44 +1,5 @@
menu "LoRComm Config"
menuconfig LORCOMM_GPS_ENABLED
bool "Enable GPS receiver"
help
Enables attached GPS receiver
if LORCOMM_GPS_ENABLED
config LORCOMM_GPS_RX
int "GPS RX Pin"
default 13
help
GPIO to receive data from GPS receiver
endif
choice LORCOMM_BUTTON_ACTION
bool "User Button Action"
default LORCOMM_BUTTON_ACTION_HELO
help
Selection action to be performed when the user button
is pressed.
config LORCOMM_BUTTON_ACTION_NONE
bool "Do nothing"
help
Do nothing
config LORCOMM_BUTTON_ACTION_HELO
bool "Send HELO"
help
Send out a HELO packet and listen for response
if LORCOMM_GPS_ENABLED
config LORCOMM_BUTTON_ACTION_GPS
bool "Send GPS"
help
Sends GPS coordinates and listens for ACK.
endif
endchoice
config LORCOMM_BUTTON_ACTION_ENABLED
bool
default n if LORCOMM_BUTTON_ACTION_NONE
default y
menu "Barback"
config BARBACK_ID
string "BLE Device Name"
default "Barback"
endmenu

View File

@ -426,7 +426,9 @@ void ble_init() {
err = ble_gatts_add_svcs(service_defs);
ESP_ERROR_CHECK(err);
err = ble_svc_gap_device_name_set(device_name);
ESP_LOGI(TAG, "Setting device name: %s", CONFIG_BARBACK_ID);
err = ble_svc_gap_device_name_set(CONFIG_BARBACK_ID);
ESP_ERROR_CHECK(err);
nimble_port_freertos_init(nimble_host_task);

View File

@ -1,2 +1,3 @@
BARBACK_ID=Barback
CONFIG_BT_ENABLED=y
CONFIG_BT_NIMBLE_ENABLED=y