meshcore 2.1.16__tar.gz → 2.1.17__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 (60) hide show
  1. {meshcore-2.1.16 → meshcore-2.1.17}/PKG-INFO +1 -1
  2. {meshcore-2.1.16 → meshcore-2.1.17}/pyproject.toml +1 -1
  3. {meshcore-2.1.16 → meshcore-2.1.17}/src/meshcore/ble_cx.py +8 -2
  4. {meshcore-2.1.16 → meshcore-2.1.17}/src/meshcore/meshcore.py +1 -0
  5. {meshcore-2.1.16 → meshcore-2.1.17}/.github/python-test.yml +0 -0
  6. {meshcore-2.1.16 → meshcore-2.1.17}/.gitignore +0 -0
  7. {meshcore-2.1.16 → meshcore-2.1.17}/LICENSE +0 -0
  8. {meshcore-2.1.16 → meshcore-2.1.17}/README.md +0 -0
  9. {meshcore-2.1.16 → meshcore-2.1.17}/examples/ble_chat.py +0 -0
  10. {meshcore-2.1.16 → meshcore-2.1.17}/examples/ble_pin_pairing_example.py +0 -0
  11. {meshcore-2.1.16 → meshcore-2.1.17}/examples/ble_private_key_export.py +0 -0
  12. {meshcore-2.1.16 → meshcore-2.1.17}/examples/ble_t1000_chan_msg.py +0 -0
  13. {meshcore-2.1.16 → meshcore-2.1.17}/examples/ble_t1000_custom_vars.py +0 -0
  14. {meshcore-2.1.16 → meshcore-2.1.17}/examples/ble_t1000_infos.py +0 -0
  15. {meshcore-2.1.16 → meshcore-2.1.17}/examples/ble_t1000_msg.py +0 -0
  16. {meshcore-2.1.16 → meshcore-2.1.17}/examples/ble_t1000_msg_retries.py +0 -0
  17. {meshcore-2.1.16 → meshcore-2.1.17}/examples/ble_t1000_set_cv.py +0 -0
  18. {meshcore-2.1.16 → meshcore-2.1.17}/examples/connection_events_example.py +0 -0
  19. {meshcore-2.1.16 → meshcore-2.1.17}/examples/mepo_mc_gps.py +0 -0
  20. {meshcore-2.1.16 → meshcore-2.1.17}/examples/pubsub_example.py +0 -0
  21. {meshcore-2.1.16 → meshcore-2.1.17}/examples/rf_packet_monitor.py +0 -0
  22. {meshcore-2.1.16 → meshcore-2.1.17}/examples/serial_battery_monitor.py +0 -0
  23. {meshcore-2.1.16 → meshcore-2.1.17}/examples/serial_channel_manager.py +0 -0
  24. {meshcore-2.1.16 → meshcore-2.1.17}/examples/serial_chat.py +0 -0
  25. {meshcore-2.1.16 → meshcore-2.1.17}/examples/serial_contacts.py +0 -0
  26. {meshcore-2.1.16 → meshcore-2.1.17}/examples/serial_infos.py +0 -0
  27. {meshcore-2.1.16 → meshcore-2.1.17}/examples/serial_msg.py +0 -0
  28. {meshcore-2.1.16 → meshcore-2.1.17}/examples/serial_repeater_status.py +0 -0
  29. {meshcore-2.1.16 → meshcore-2.1.17}/examples/serial_repeater_telemetry.py +0 -0
  30. {meshcore-2.1.16 → meshcore-2.1.17}/examples/serial_trace.py +0 -0
  31. {meshcore-2.1.16 → meshcore-2.1.17}/examples/tcp_chat.py +0 -0
  32. {meshcore-2.1.16 → meshcore-2.1.17}/examples/tcp_login_status.py +0 -0
  33. {meshcore-2.1.16 → meshcore-2.1.17}/examples/tcp_mchome_contacts.py +0 -0
  34. {meshcore-2.1.16 → meshcore-2.1.17}/examples/tcp_mchome_infos.py +0 -0
  35. {meshcore-2.1.16 → meshcore-2.1.17}/examples/tcp_mchome_msg.py +0 -0
  36. {meshcore-2.1.16 → meshcore-2.1.17}/examples/tcp_mchome_readmsgs.py +0 -0
  37. {meshcore-2.1.16 → meshcore-2.1.17}/pytest.ini +0 -0
  38. {meshcore-2.1.16 → meshcore-2.1.17}/src/meshcore/__init__.py +0 -0
  39. {meshcore-2.1.16 → meshcore-2.1.17}/src/meshcore/commands/__init__.py +0 -0
  40. {meshcore-2.1.16 → meshcore-2.1.17}/src/meshcore/commands/base.py +0 -0
  41. {meshcore-2.1.16 → meshcore-2.1.17}/src/meshcore/commands/binary.py +0 -0
  42. {meshcore-2.1.16 → meshcore-2.1.17}/src/meshcore/commands/contact.py +0 -0
  43. {meshcore-2.1.16 → meshcore-2.1.17}/src/meshcore/commands/device.py +0 -0
  44. {meshcore-2.1.16 → meshcore-2.1.17}/src/meshcore/commands/messaging.py +0 -0
  45. {meshcore-2.1.16 → meshcore-2.1.17}/src/meshcore/connection_manager.py +0 -0
  46. {meshcore-2.1.16 → meshcore-2.1.17}/src/meshcore/events.py +0 -0
  47. {meshcore-2.1.16 → meshcore-2.1.17}/src/meshcore/lpp_json_encoder.py +0 -0
  48. {meshcore-2.1.16 → meshcore-2.1.17}/src/meshcore/packets.py +0 -0
  49. {meshcore-2.1.16 → meshcore-2.1.17}/src/meshcore/parsing.py +0 -0
  50. {meshcore-2.1.16 → meshcore-2.1.17}/src/meshcore/reader.py +0 -0
  51. {meshcore-2.1.16 → meshcore-2.1.17}/src/meshcore/serial_cx.py +0 -0
  52. {meshcore-2.1.16 → meshcore-2.1.17}/src/meshcore/tcp_cx.py +0 -0
  53. {meshcore-2.1.16 → meshcore-2.1.17}/tests/README.md +0 -0
  54. {meshcore-2.1.16 → meshcore-2.1.17}/tests/test_ble_connection.py +0 -0
  55. {meshcore-2.1.16 → meshcore-2.1.17}/tests/test_ble_pin_pairing.py +0 -0
  56. {meshcore-2.1.16 → meshcore-2.1.17}/tests/test_meshcore_ble_pin.py +0 -0
  57. {meshcore-2.1.16 → meshcore-2.1.17}/tests/unit/test_commands.py +0 -0
  58. {meshcore-2.1.16 → meshcore-2.1.17}/tests/unit/test_events.py +0 -0
  59. {meshcore-2.1.16 → meshcore-2.1.17}/tests/unit/test_private_key_export.py +0 -0
  60. {meshcore-2.1.16 → meshcore-2.1.17}/tests/unit/test_reader.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshcore
3
- Version: 2.1.16
3
+ Version: 2.1.17
4
4
  Summary: Base classes for communicating with meshcore companion radios
5
5
  Project-URL: Homepage, https://github.com/fdlamotte/meshcore_py
6
6
  Project-URL: Issues, https://github.com/fdlamotte/meshcore_py/issues
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "meshcore"
7
- version = "2.1.16"
7
+ version = "2.1.17"
8
8
  authors = [
9
9
  { name="Florent de Lamotte", email="florent@frizoncorrea.fr" },
10
10
  { name="Alex Wolden", email="awolden@gmail.com" },
@@ -18,7 +18,6 @@ UART_SERVICE_UUID = "6E400001-B5A3-F393-E0A9-E50E24DCCA9E"
18
18
  UART_RX_CHAR_UUID = "6E400002-B5A3-F393-E0A9-E50E24DCCA9E"
19
19
  UART_TX_CHAR_UUID = "6E400003-B5A3-F393-E0A9-E50E24DCCA9E"
20
20
 
21
-
22
21
  class BLEConnection:
23
22
  def __init__(self, address=None, device=None, client=None, pin=None):
24
23
  """
@@ -113,7 +112,14 @@ class BLEConnection:
113
112
  except TimeoutError:
114
113
  return None
115
114
 
116
- await self.client.start_notify(UART_TX_CHAR_UUID, self.handle_rx)
115
+ try:
116
+ await self.client.start_notify(UART_TX_CHAR_UUID, self.handle_rx)
117
+ except AttributeError :
118
+ if self.client :
119
+ await self.client.disconnect()
120
+ logger.info("Connection is not established, need to restart it")
121
+ logger.debug("in ble_cx.connect()")
122
+ return None
117
123
 
118
124
  nus = self.client.services.get_service(UART_SERVICE_UUID)
119
125
  if nus is None:
@@ -165,6 +165,7 @@ class MeshCore:
165
165
  await self.dispatcher.start()
166
166
  result = await self.connection_manager.connect()
167
167
  if result is None:
168
+ await self.dispatcher.stop()
168
169
  raise ConnectionError("Failed to connect to device")
169
170
  return await self.commands.send_appstart()
170
171
 
File without changes
File without changes
File without changes
File without changes
File without changes