Added setup overload to pass name. (#1483)

Co-authored-by: Dominic Pearman <dominic@phymorous.de>
This commit was merged in pull request #1483.
This commit is contained in:
Dominic Pearman
2023-05-27 10:40:24 -07:00
committed by GitHub
co-authored by Dominic Pearman
parent 64ad69c247
commit 8e961a5667
2 changed files with 5 additions and 1 deletions
+4 -1
View File
@@ -778,6 +778,10 @@ static hci_transport_config_uart_t config = {
static btstack_packet_callback_registration_t hci_event_callback_registration;
void BTstackManager::setup(void) {
setup("BTstack LE Shield");
}
void BTstackManager::setup(const char * name) {
//#ifdef PIN_LED
// pinMode(PIN_LED, OUTPUT);
@@ -826,7 +830,6 @@ void BTstackManager::setup(void) {
const uint8_t flags[] = { 0x02, 0x01, 0x02 };
memcpy(&adv_data[pos], flags, sizeof(flags));
pos += sizeof(flags);
const char * name = "BTstack LE Shield";
adv_data[pos++] = strlen(name) + 1;
adv_data[pos++] = 0x09;
memcpy(&adv_data[pos], name, strlen(name));