Skip to content

Commit 8e961a5

Browse files
djpearmanDominic Pearman
andauthored
Added setup overload to pass name. (#1483)
Co-authored-by: Dominic Pearman <[email protected]>
1 parent 64ad69c commit 8e961a5

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

libraries/BTstackLib/src/BTstackLib.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,10 @@ static hci_transport_config_uart_t config = {
778778
static btstack_packet_callback_registration_t hci_event_callback_registration;
779779

780780
void BTstackManager::setup(void) {
781+
setup("BTstack LE Shield");
782+
}
783+
784+
void BTstackManager::setup(const char * name) {
781785

782786
//#ifdef PIN_LED
783787
// pinMode(PIN_LED, OUTPUT);
@@ -826,7 +830,6 @@ void BTstackManager::setup(void) {
826830
const uint8_t flags[] = { 0x02, 0x01, 0x02 };
827831
memcpy(&adv_data[pos], flags, sizeof(flags));
828832
pos += sizeof(flags);
829-
const char * name = "BTstack LE Shield";
830833
adv_data[pos++] = strlen(name) + 1;
831834
adv_data[pos++] = 0x09;
832835
memcpy(&adv_data[pos], name, strlen(name));

libraries/BTstackLib/src/BTstackLib.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ extern "C" {
135135
public:
136136
BTstackManager(void);
137137
void setup(void);
138+
void setup(const char * name);
138139
void loop(void);
139140

140141
void setPublicBdAddr(bd_addr_t addr);

0 commit comments

Comments
 (0)