python-esp-bridge 0.1.0__tar.gz → 0.1.1__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.
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/PKG-INFO +1 -1
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/__init__.py +1 -1
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/transports/ble.py +14 -4
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/pyproject.toml +1 -1
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/uv.lock +1 -1
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/.gitignore +0 -0
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/.python-version +0 -0
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/README.md +0 -0
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/analog.py +0 -0
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/ble.py +0 -0
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/bridge.py +0 -0
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/cli.py +0 -0
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/compat/__init__.py +0 -0
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/compat/blinka.py +0 -0
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/compat/gpiozero.py +0 -0
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/compat/luma.py +0 -0
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/compat/rpi_gpio.py +0 -0
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/compat/smbus.py +0 -0
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/constants.py +0 -0
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/errors.py +0 -0
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/gpio.py +0 -0
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/i2c.py +0 -0
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/net.py +0 -0
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/oled.py +0 -0
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/protocol.py +0 -0
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/pwm.py +0 -0
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/spi.py +0 -0
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/transport.py +0 -0
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/transports/__init__.py +0 -0
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/transports/mock.py +0 -0
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/transports/serial.py +0 -0
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/uart.py +0 -0
- {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/wifi.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-esp-bridge
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: Control every ESP32 peripheral from Python over USB serial or Bluetooth — GPIO, ADC, DAC, PWM, touch, I2C, SPI, UART, Wi-Fi sockets, BLE
|
|
5
5
|
Project-URL: Homepage, https://github.com/HamzaYslmn/python-esp-bridge
|
|
6
6
|
Author: HamzaYslmn
|
|
@@ -107,6 +107,8 @@ class BleTransport:
|
|
|
107
107
|
return fut.result(timeout)
|
|
108
108
|
|
|
109
109
|
async def _connect(self, address: str, timeout: float) -> None:
|
|
110
|
+
import asyncio
|
|
111
|
+
|
|
110
112
|
from bleak import BleakClient
|
|
111
113
|
from bleak.exc import BleakError
|
|
112
114
|
|
|
@@ -117,16 +119,24 @@ class BleTransport:
|
|
|
117
119
|
except BleakError as e:
|
|
118
120
|
raise NoDeviceError(f"BLE connect to {address} failed: {e}") from None
|
|
119
121
|
self._client = client
|
|
120
|
-
|
|
121
|
-
|
|
122
|
+
self._rx_char = client.services.get_characteristic(BLE_LINK_RX_UUID)
|
|
123
|
+
# The write-without-response limit starts at 20 and jumps after the
|
|
124
|
+
# MTU exchange (bleak docs); wait briefly so frames are not shredded
|
|
125
|
+
# into 20-byte writes during the handshake.
|
|
126
|
+
for _ in range(20):
|
|
127
|
+
if self._rx_char.max_write_without_response_size > 20:
|
|
128
|
+
break
|
|
129
|
+
await asyncio.sleep(0.1)
|
|
122
130
|
|
|
123
131
|
def _on_notify(self, _char, data: bytearray) -> None:
|
|
124
132
|
self._rx.put(bytes(data))
|
|
125
133
|
|
|
126
134
|
async def _write(self, data: bytes) -> None:
|
|
127
|
-
|
|
135
|
+
# Re-read per write: the limit can grow once the MTU exchange lands.
|
|
136
|
+
chunk = max(20, self._rx_char.max_write_without_response_size)
|
|
137
|
+
for i in range(0, len(data), chunk):
|
|
128
138
|
await self._client.write_gatt_char(
|
|
129
|
-
|
|
139
|
+
self._rx_char, data[i : i + chunk], response=False)
|
|
130
140
|
|
|
131
141
|
async def _disconnect(self) -> None:
|
|
132
142
|
if self._client is not None:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "python-esp-bridge"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.1"
|
|
4
4
|
description = "Control every ESP32 peripheral from Python over USB serial or Bluetooth — GPIO, ADC, DAC, PWM, touch, I2C, SPI, UART, Wi-Fi sockets, BLE"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.10"
|
|
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
|