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.
Files changed (33) hide show
  1. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/PKG-INFO +1 -1
  2. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/__init__.py +1 -1
  3. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/transports/ble.py +14 -4
  4. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/pyproject.toml +1 -1
  5. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/uv.lock +1 -1
  6. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/.gitignore +0 -0
  7. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/.python-version +0 -0
  8. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/README.md +0 -0
  9. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/analog.py +0 -0
  10. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/ble.py +0 -0
  11. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/bridge.py +0 -0
  12. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/cli.py +0 -0
  13. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/compat/__init__.py +0 -0
  14. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/compat/blinka.py +0 -0
  15. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/compat/gpiozero.py +0 -0
  16. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/compat/luma.py +0 -0
  17. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/compat/rpi_gpio.py +0 -0
  18. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/compat/smbus.py +0 -0
  19. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/constants.py +0 -0
  20. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/errors.py +0 -0
  21. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/gpio.py +0 -0
  22. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/i2c.py +0 -0
  23. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/net.py +0 -0
  24. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/oled.py +0 -0
  25. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/protocol.py +0 -0
  26. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/pwm.py +0 -0
  27. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/spi.py +0 -0
  28. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/transport.py +0 -0
  29. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/transports/__init__.py +0 -0
  30. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/transports/mock.py +0 -0
  31. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/transports/serial.py +0 -0
  32. {python_esp_bridge-0.1.0 → python_esp_bridge-0.1.1}/espbridge/uart.py +0 -0
  33. {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.0
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
@@ -32,7 +32,7 @@ def find_ble_devices(timeout: float = 5.0):
32
32
 
33
33
  return _scan(timeout)
34
34
 
35
- __version__ = "0.1.0"
35
+ __version__ = "0.1.1"
36
36
 
37
37
  __all__ = [
38
38
  "Bridge",
@@ -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
- # write-without-response payload limit for this connection
121
- self._chunk = max(20, client.mtu_size - 3)
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
- for i in range(0, len(data), self._chunk):
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
- BLE_LINK_RX_UUID, data[i : i + self._chunk], response=False)
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.0"
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"
@@ -369,7 +369,7 @@ wheels = [
369
369
 
370
370
  [[package]]
371
371
  name = "python-esp-bridge"
372
- version = "0.1.0"
372
+ version = "0.1.1"
373
373
  source = { editable = "." }
374
374
  dependencies = [
375
375
  { name = "pyserial" },