Skip to content

Commit 4441123

Browse files
committed
fix minor bugs and doc typos
1 parent 9541ab2 commit 4441123

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

adafruit_ble/advertising.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
3030
"""
3131

32+
import bleio
3233
import struct
3334

3435
class AdvertisingPacket:
@@ -171,7 +172,7 @@ def add_tx_power(self, tx_power):
171172

172173
def add_appearance(self, appearance):
173174
"""Add BLE Appearance value."""
174-
self.add_field(AdvertisingPacket.APPEARANCE, struct.pack("<h", appearance))
175+
self.add_field(AdvertisingPacket.APPEARANCE, struct.pack("<H", appearance))
175176

176177

177178
class Advertisement:

adafruit_ble/current_time_client.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,9 @@
3636

3737
class CurrentTimeClient:
3838
"""
39-
Set up a peripheral that advertises for Current Time Service,
40-
and connects if found.
39+
Set up a peripheral that solicits centrals for Current Time Service,
4140
42-
:param str name: Name to advertise for server. If None, use default Peripheral name.
41+
:param str name: Name to advertise for server. If None, use default Advertisement name.
4342
4443
Example::
4544
@@ -58,9 +57,9 @@ class CurrentTimeClient:
5857
CURRENT_TIME_UUID = UUID(0x2A2B)
5958
LOCAL_TIME_INFORMATION_UUID = UUID(0x2A0F)
6059

61-
def __init__(self, name="CTSClient", tx_power=0):
62-
self._periph = Peripheral()
63-
self._advertisement = SolicitationAdvertisement(name, (self.CTS_UUID,), tx_power=tx_power)
60+
def __init__(self, name=None, tx_power=0):
61+
self._periph = Peripheral(name=name)
62+
self._advertisement = SolicitationAdvertisement(peripheral.name, (self.CTS_UUID,), tx_power=tx_power)
6463
self._current_time_char = self._local_time_char = None
6564

6665

adafruit_ble/uart_client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class UARTClient:
4040
for the first character and between subsequent characters.
4141
:param int buffer_size: buffer up to this many bytes.
4242
If more bytes are received, older bytes will be discarded.
43-
:param str name: Name to advertise for server. If None, use default Peripheral name.
4443
4544
Example::
4645

0 commit comments

Comments
 (0)