Skip to content

Commit 28a9b0d

Browse files
committed
Truncate to 14 characters
1 parent cd1ec14 commit 28a9b0d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ble/ble.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,14 @@ func (k *Keyboard) Connect() error {
5959
bluetooth.SetSecParamsBonding()
6060
bluetooth.SetSecCapabilities(bluetooth.NoneGapIOCapability)
6161

62+
name := k.Name
63+
if len(name) > 14 {
64+
name = name[:14]
65+
}
66+
6267
adv := adapter.DefaultAdvertisement()
6368
adv.Configure(bluetooth.AdvertisementOptions{
64-
LocalName: "tinygo", //k.Name,
69+
LocalName: name,
6570
ServiceUUIDs: []bluetooth.UUID{
6671
bluetooth.ServiceUUIDDeviceInformation,
6772
bluetooth.ServiceUUIDBattery,

0 commit comments

Comments
 (0)