Skip to content

Commit 1c28c1e

Browse files
committed
Add connection_interval
1 parent 036b65f commit 1c28c1e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

adafruit_ble/__init__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,22 @@ def paired(self):
117117
"""True if the paired to the peer."""
118118
return self._bleio_connection.paired
119119

120+
@property
121+
def connection_interval(self):
122+
"""Time between transmissions in milliseconds. Will be multiple of 1.25ms. Lower numbers
123+
increase speed and decrease latency but increase power consumption.
124+
125+
When setting connection_interval, the peer may reject the new interval and
126+
`connection_interval` will then remain the same.
127+
128+
Apple has additional guidelines that dictate should be a multiple of 15ms except if HID
129+
is available. When HID is available Apple devices may accept 11.25ms intervals."""
130+
return self._bleio_connection.connection_interval
131+
132+
@connection_interval.setter
133+
def connection_interval(self, value):
134+
self._bleio_connection.connection_interval = value
135+
120136
def pair(self, *, bond=True):
121137
"""Pair to the peer to increase security of the connection."""
122138
return self._bleio_connection.pair(bond=bond)

0 commit comments

Comments
 (0)