btbricks 0.2.3__tar.gz → 0.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {btbricks-0.2.3 → btbricks-0.2.4}/PKG-INFO +1 -1
- {btbricks-0.2.3 → btbricks-0.2.4}/btbricks/__init__.py +17 -3
- {btbricks-0.2.3 → btbricks-0.2.4}/btbricks/bt.py +5 -6
- {btbricks-0.2.3 → btbricks-0.2.4}/btbricks.egg-info/PKG-INFO +1 -1
- {btbricks-0.2.3 → btbricks-0.2.4}/pyproject.toml +1 -1
- {btbricks-0.2.3 → btbricks-0.2.4}/.readthedocs.yaml +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/CHANGELOG.md +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/LICENSE +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/MANIFEST.in +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/README.md +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/btbricks/bthub.py +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/btbricks/ctrl_plus.py +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/btbricks.egg-info/SOURCES.txt +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/btbricks.egg-info/dependency_links.txt +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/btbricks.egg-info/requires.txt +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/btbricks.egg-info/top_level.txt +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/docs/Makefile +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/docs/conf.py +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/docs/index.rst +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/examples/ble-midi-esp/main.py +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/examples/ble_uart_light_matrix_client.py +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/examples/ble_uart_light_matrix_server.py +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/examples/ble_uart_simple_central.py +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/examples/ble_uart_simple_peripheral.py +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/examples/inventor_ble_midi_guitar.py +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/examples/midi_controller_example.py +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/examples/rc_batmobile_spike_wheel.py +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/examples/rc_extreme_offroader_spike_wheel.py +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/examples/rc_hotrod_car_receiver.py +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/examples/rc_hotrod_transmitter.py +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/examples/rc_mecanum_wheels.py +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/examples/rc_multi_snake_head.py +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/examples/rc_multi_snake_seg_1.py +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/examples/rc_receiver_example.py +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/examples/rc_snake.py +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/examples/rc_snake_with_simple_remote.py +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/examples/rc_snake_with_spike_steering_wheel.py +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/examples/rc_transmitter_example.py +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/examples/uart_central_example.py +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/examples/uart_peripheral_example.py +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/setup.cfg +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/setup.py +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/tests/__init__.py +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/tests/test_bthub.py +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/tests/test_constants.py +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/tests/test_imports.py +0 -0
- {btbricks-0.2.3 → btbricks-0.2.4}/tests/test_precommit_checks.py +0 -0
|
@@ -7,7 +7,7 @@ use it to create custom Bluetooth peripherals like RC controllers or MIDI
|
|
|
7
7
|
devices compatible with LEGO hubs.
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
|
-
__version__ = "0.2.
|
|
10
|
+
__version__ = "0.2.4"
|
|
11
11
|
__author__ = "Anton Vanhoucke"
|
|
12
12
|
__license__ = "MIT"
|
|
13
13
|
|
|
@@ -28,8 +28,22 @@ from .bt import (
|
|
|
28
28
|
SETTING1,
|
|
29
29
|
SETTING2,
|
|
30
30
|
)
|
|
31
|
-
from .bthub import
|
|
32
|
-
|
|
31
|
+
from .bthub import (
|
|
32
|
+
BtHub,
|
|
33
|
+
OFF,
|
|
34
|
+
PINK,
|
|
35
|
+
PURPLE,
|
|
36
|
+
DARK_BLUE,
|
|
37
|
+
BLUE,
|
|
38
|
+
TEAL,
|
|
39
|
+
GREEN,
|
|
40
|
+
YELLOW,
|
|
41
|
+
ORANGE,
|
|
42
|
+
RED,
|
|
43
|
+
WHITE,
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
from .bthub import BtHub as SmartHub
|
|
33
47
|
|
|
34
48
|
__all__ = [
|
|
35
49
|
"BLEHandler",
|
|
@@ -299,7 +299,6 @@ class BLEHandler:
|
|
|
299
299
|
|
|
300
300
|
def __init__(self, debug=False):
|
|
301
301
|
self._ble = ubluetooth.BLE()
|
|
302
|
-
self._ble.config(rxbuf=TARGET_MTU)
|
|
303
302
|
self._ble.active(True)
|
|
304
303
|
try:
|
|
305
304
|
self._ble.gap_disconnect(1025) # Disconnect in case of previous crash
|
|
@@ -1103,16 +1102,16 @@ class RCReceiver(UARTPeripheral):
|
|
|
1103
1102
|
|
|
1104
1103
|
"""
|
|
1105
1104
|
try:
|
|
1106
|
-
|
|
1105
|
+
state = struct.unpack("bbbbBBhhB", self.read_buffer)
|
|
1107
1106
|
except:
|
|
1108
|
-
|
|
1107
|
+
state = [0] * 9
|
|
1109
1108
|
if indices:
|
|
1110
1109
|
if len(indices) == 1:
|
|
1111
|
-
return
|
|
1110
|
+
return state[indices[0]]
|
|
1112
1111
|
else:
|
|
1113
|
-
return [
|
|
1112
|
+
return [state[i] for i in indices]
|
|
1114
1113
|
else:
|
|
1115
|
-
return
|
|
1114
|
+
return state
|
|
1116
1115
|
|
|
1117
1116
|
|
|
1118
1117
|
class RCTransmitter(UARTCentral):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|