Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-pico
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-pico
Commits
1f9350dc
Unverified
Commit
1f9350dc
authored
May 30, 2024
by
Earle F. Philhower, III
Committed by
GitHub
May 30, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow setting SerialBT advertised name (#2181)
Trivial fix #2179
parent
361b4e08
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
1 deletion
+16
-1
libraries/SerialBT/examples/BTSerialUppercase/BTSerialUppercase.ino
...SerialBT/examples/BTSerialUppercase/BTSerialUppercase.ino
+1
-0
libraries/SerialBT/keywords.txt
libraries/SerialBT/keywords.txt
+1
-0
libraries/SerialBT/src/SerialBT.cpp
libraries/SerialBT/src/SerialBT.cpp
+4
-1
libraries/SerialBT/src/SerialBT.h
libraries/SerialBT/src/SerialBT.h
+10
-0
No files found.
libraries/SerialBT/examples/BTSerialUppercase/BTSerialUppercase.ino
View file @
1f9350dc
...
...
@@ -22,6 +22,7 @@
#include <SerialBT.h>
void
setup
()
{
SerialBT
.
setName
(
"PicoW UPPERCASE 00:00:00:00:00:00"
);
SerialBT
.
begin
();
}
...
...
libraries/SerialBT/keywords.txt
View file @
1f9350dc
...
...
@@ -11,6 +11,7 @@ SerialBT KEYWORD1
#######################################
# Methods and Functions (KEYWORD2)
#######################################
setName KEYWORD2
#######################################
# Constants (LITERAL1)
...
...
libraries/SerialBT/src/SerialBT.cpp
View file @
1f9350dc
...
...
@@ -76,7 +76,10 @@ void SerialBT_::begin(unsigned long baud, uint16_t config) {
gap_discoverable_control
(
1
);
gap_ssp_set_io_capability
(
SSP_IO_CAPABILITY_DISPLAY_YES_NO
);
gap_set_local_name
(
"PicoW Serial 00:00:00:00:00:00"
);
if
(
!
_name
)
{
setName
(
"PicoW Serial 00:00:00:00:00:00"
);
}
gap_set_local_name
(
_name
);
// Turn on!
hci_power_control
(
HCI_POWER_ON
);
...
...
libraries/SerialBT/src/SerialBT.h
View file @
1f9350dc
...
...
@@ -37,6 +37,14 @@ public:
SerialBT_
();
bool
setFIFOSize
(
size_t
size
);
bool
setName
(
const
char
*
name
)
{
if
(
_running
)
{
return
false
;
}
free
(
_name
);
_name
=
strdup
(
name
);
return
true
;
}
void
begin
(
unsigned
long
baud
=
115200
)
override
{
begin
(
baud
,
SERIAL_8N1
);
...
...
@@ -82,4 +90,6 @@ private:
volatile
int
_writeLen
=
0
;
const
void
*
_writeBuff
;
char
*
_name
=
nullptr
;
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment