io4edge-client 2.4.5__tar.gz → 2.6.1.dev0__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 (162) hide show
  1. io4edge_client-2.6.1.dev0/.devcontainer/devcontainer.json +20 -0
  2. io4edge_client-2.6.1.dev0/.github/copilot-instructions.md +95 -0
  3. io4edge_client-2.6.1.dev0/.github/workflows/pypi.yaml +35 -0
  4. io4edge_client-2.6.1.dev0/.gitignore +133 -0
  5. io4edge_client-2.6.1.dev0/.gitmodules +3 -0
  6. io4edge_client-2.6.1.dev0/.gitpod.yml +8 -0
  7. io4edge_client-2.6.1.dev0/.pre-commit-config.yaml +23 -0
  8. io4edge_client-2.6.1.dev0/.vscode/settings.json +3 -0
  9. io4edge_client-2.6.1.dev0/LICENSE +201 -0
  10. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/PKG-INFO +11 -20
  11. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/README.md +4 -4
  12. io4edge_client-2.6.1.dev0/examples/analogintypea/README.md +18 -0
  13. io4edge_client-2.6.1.dev0/examples/analogintypea/main.py +58 -0
  14. io4edge_client-2.6.1.dev0/examples/analogintypeb/README.md +31 -0
  15. io4edge_client-2.6.1.dev0/examples/analogintypeb/describe.py +23 -0
  16. io4edge_client-2.6.1.dev0/examples/analogintypeb/iou09_calibrate.py +133 -0
  17. io4edge_client-2.6.1.dev0/examples/analogintypeb/poll.py +30 -0
  18. io4edge_client-2.6.1.dev0/examples/analogintypeb/stream.py +107 -0
  19. io4edge_client-2.6.1.dev0/examples/binaryiotypea/README.md +19 -0
  20. io4edge_client-2.6.1.dev0/examples/binaryiotypea/main.py +87 -0
  21. io4edge_client-2.6.1.dev0/examples/binaryiotypeb/outputs/README.md +19 -0
  22. io4edge_client-2.6.1.dev0/examples/binaryiotypeb/outputs/main.py +41 -0
  23. io4edge_client-2.6.1.dev0/examples/binaryiotypeb/stream/main.py +45 -0
  24. io4edge_client-2.6.1.dev0/examples/binaryiotypec/README.md +22 -0
  25. io4edge_client-2.6.1.dev0/examples/binaryiotypec/main.py +89 -0
  26. io4edge_client-2.6.1.dev0/examples/binaryiotyped/config.py +63 -0
  27. io4edge_client-2.6.1.dev0/examples/binaryiotyped/get_channels.py +25 -0
  28. io4edge_client-2.6.1.dev0/examples/binaryiotyped/get_configuration.py +33 -0
  29. io4edge_client-2.6.1.dev0/examples/binaryiotyped/set_output.py +26 -0
  30. io4edge_client-2.6.1.dev0/examples/binaryiotyped/sq1_blinky.py +97 -0
  31. io4edge_client-2.6.1.dev0/examples/bitbussniffer/dumpstream.py +85 -0
  32. io4edge_client-2.6.1.dev0/examples/canl2/README.md +45 -0
  33. io4edge_client-2.6.1.dev0/examples/canl2/config.py +55 -0
  34. io4edge_client-2.6.1.dev0/examples/canl2/dumpstream.py +95 -0
  35. io4edge_client-2.6.1.dev0/examples/canl2/send.py +62 -0
  36. io4edge_client-2.6.1.dev0/examples/core/get_parameter.py +19 -0
  37. io4edge_client-2.6.1.dev0/examples/core/identify_firmware.py +16 -0
  38. io4edge_client-2.6.1.dev0/examples/core/identify_hardware.py +16 -0
  39. io4edge_client-2.6.1.dev0/examples/core/load_firmware.py +26 -0
  40. io4edge_client-2.6.1.dev0/examples/core/reset_reason.py +16 -0
  41. io4edge_client-2.6.1.dev0/examples/core/restart.py +16 -0
  42. io4edge_client-2.6.1.dev0/examples/core/set_parameter.py +22 -0
  43. io4edge_client-2.6.1.dev0/examples/digiwave/dumpwave.py +97 -0
  44. io4edge_client-2.6.1.dev0/examples/digiwave/sendwave.py +124 -0
  45. io4edge_client-2.6.1.dev0/examples/docker/Dockerfile +11 -0
  46. io4edge_client-2.6.1.dev0/examples/mvbsniffer/README.md +17 -0
  47. io4edge_client-2.6.1.dev0/examples/mvbsniffer/dumpstream.py +86 -0
  48. io4edge_client-2.6.1.dev0/examples/pixelDisplay/README.md +27 -0
  49. io4edge_client-2.6.1.dev0/examples/pixelDisplay/display/main.py +63 -0
  50. io4edge_client-2.6.1.dev0/examples/pixelDisplay/display_partial_image/main.py +59 -0
  51. io4edge_client-2.6.1.dev0/examples/pixelDisplay/partial_test1.jpg +0 -0
  52. io4edge_client-2.6.1.dev0/examples/pixelDisplay/partial_test2.jpg +0 -0
  53. io4edge_client-2.6.1.dev0/examples/pixelDisplay/sq3/main.py +59 -0
  54. io4edge_client-2.6.1.dev0/examples/pixelDisplay/sq3_stream/main.py +80 -0
  55. io4edge_client-2.6.1.dev0/examples/pixelDisplay/test.jpg +0 -0
  56. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/__init__.py +7 -3
  57. io4edge_client-2.6.1.dev0/io4edge_client/_version.py +3 -0
  58. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client.egg-info/PKG-INFO +11 -20
  59. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client.egg-info/SOURCES.txt +56 -2
  60. io4edge_client-2.6.1.dev0/pyproject.toml +56 -0
  61. io4edge_client-2.6.1.dev0/requirements.txt +2 -0
  62. io4edge_client-2.4.5/io4edge_client/version.py +0 -3
  63. io4edge_client-2.4.5/setup.py +0 -58
  64. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/analogintypea/__init__.py +0 -0
  65. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/analogintypea/client.py +0 -0
  66. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/analogintypeb/__init__.py +0 -0
  67. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/analogintypeb/client.py +0 -0
  68. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/analogInTypeA/python/analogInTypeA/v1alpha1/analogInTypeA_pb2.py +0 -0
  69. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/analogInTypeA/python/analogInTypeA/v1alpha1/analogInTypeA_pb2.pyi +0 -0
  70. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/analogInTypeB/python/analogInTypeB/v1/analogInTypeB_pb2.py +0 -0
  71. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/analogInTypeB/python/analogInTypeB/v1/analogInTypeB_pb2.pyi +0 -0
  72. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/binaryIoTypeA/python/binaryIoTypeA/v1alpha1/binaryIoTypeA_pb2.py +0 -0
  73. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/binaryIoTypeA/python/binaryIoTypeA/v1alpha1/binaryIoTypeA_pb2.pyi +0 -0
  74. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/binaryIoTypeB/python/binaryIoTypeB/v1alpha1/binaryIoTypeB_pb2.py +0 -0
  75. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/binaryIoTypeB/python/binaryIoTypeB/v1alpha1/binaryIoTypeB_pb2.pyi +0 -0
  76. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/binaryIoTypeC/python/binaryIoTypeC/v1alpha1/binaryIoTypeC_pb2.py +0 -0
  77. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/binaryIoTypeC/python/binaryIoTypeC/v1alpha1/binaryIoTypeC_pb2.pyi +0 -0
  78. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/binaryIoTypeD/python/binaryIoTypeD/v1/binaryIoTypeD_pb2.py +0 -0
  79. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/binaryIoTypeD/python/binaryIoTypeD/v1/binaryIoTypeD_pb2.pyi +0 -0
  80. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/bitbusSniffer/python/bitbusSniffer/v1/bitbusSniffer_pb2.py +0 -0
  81. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/bitbusSniffer/python/bitbusSniffer/v1/bitbusSniffer_pb2.pyi +0 -0
  82. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/canL2/python/canL2/v1alpha1/canL2_pb2.py +0 -0
  83. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/canL2/python/canL2/v1alpha1/canL2_pb2.pyi +0 -0
  84. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/colorLED/python/colorLED/v1alpha1/colorLED_pb2.py +0 -0
  85. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/colorLED/python/colorLED/v1alpha1/colorLED_pb2.pyi +0 -0
  86. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/digiwave/python/digiwave/v1/digiwave_pb2.py +0 -0
  87. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/digiwave/python/digiwave/v1/digiwave_pb2.pyi +0 -0
  88. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/eeprom/python/eeprom/v1alpha1/eeprom_pb2.py +0 -0
  89. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/eeprom/python/eeprom/v1alpha1/eeprom_pb2.pyi +0 -0
  90. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/google_wellknowntypes/python/google/protobuf/any_pb2.py +0 -0
  91. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/google_wellknowntypes/python/google/protobuf/any_pb2.pyi +0 -0
  92. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/google_wellknowntypes/python/google/protobuf/timestamp_pb2.py +0 -0
  93. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/google_wellknowntypes/python/google/protobuf/timestamp_pb2.pyi +0 -0
  94. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/io4edge/python/core_api/v1alpha2/io4edge_core_api_pb2.py +0 -0
  95. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/io4edge/python/core_api/v1alpha2/io4edge_core_api_pb2.pyi +0 -0
  96. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/io4edge/python/functionblock/v1alpha1/io4edge_functionblock_pb2.py +0 -0
  97. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/io4edge/python/functionblock/v1alpha1/io4edge_functionblock_pb2.pyi +0 -0
  98. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/io4edge/python/inventory/v1alpha1/io4edge_inventory_pb2.py +0 -0
  99. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/io4edge/python/inventory/v1alpha1/io4edge_inventory_pb2.pyi +0 -0
  100. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/motionSensor/python/motionSensor/v1/motionSensor_pb2.py +0 -0
  101. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/motionSensor/python/motionSensor/v1/motionSensor_pb2.pyi +0 -0
  102. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/mvbDebug/python/mvbDebug/v1/mvbDebug_pb2.py +0 -0
  103. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/mvbDebug/python/mvbDebug/v1/mvbDebug_pb2.pyi +0 -0
  104. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/mvbSniffer/python/mvbSniffer/v1/mvbSniffer_pb2.py +0 -0
  105. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/mvbSniffer/python/mvbSniffer/v1/mvbSniffer_pb2.pyi +0 -0
  106. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/mvbSniffer/python/mvbSniffer/v1/telegram_pb2.py +0 -0
  107. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/mvbSniffer/python/mvbSniffer/v1/telegram_pb2.pyi +0 -0
  108. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/pixelDisplay/python/pixelDisplay/v1alpha1/pixelDisplay_pb2.py +0 -0
  109. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/pixelDisplay/python/pixelDisplay/v1alpha1/pixelDisplay_pb2.pyi +0 -0
  110. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/programmablePsu/python/programmablePsu/v1/programmablePsu_pb2.py +0 -0
  111. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/programmablePsu/python/programmablePsu/v1/programmablePsu_pb2.pyi +0 -0
  112. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/ssm/python/ssm/v1/ssm_pb2.py +0 -0
  113. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/ssm/python/ssm/v1/ssm_pb2.pyi +0 -0
  114. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/templateInterface/python/templateInterface/v1alpha1/templateInterface_pb2.py +0 -0
  115. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/templateInterface/python/templateInterface/v1alpha1/templateInterface_pb2.pyi +0 -0
  116. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/tracelet/python/v1/tracelet_pb2.py +0 -0
  117. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/api/tracelet/python/v1/tracelet_pb2.pyi +0 -0
  118. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/base/__init__.py +0 -0
  119. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/base/client.py +0 -0
  120. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/base/connections.py +0 -0
  121. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/base/logging.py +0 -0
  122. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/base/socket_transport.py +0 -0
  123. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/binaryiotypea/__init__.py +0 -0
  124. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/binaryiotypea/client.py +0 -0
  125. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/binaryiotypeb/__init__.py +0 -0
  126. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/binaryiotypeb/client.py +0 -0
  127. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/binaryiotypec/__init__.py +0 -0
  128. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/binaryiotypec/client.py +0 -0
  129. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/binaryiotyped/__init__.py +0 -0
  130. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/binaryiotyped/client.py +0 -0
  131. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/bitbussniffer/__init__.py +0 -0
  132. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/bitbussniffer/client.py +0 -0
  133. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/canl2/__init__.py +0 -0
  134. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/canl2/client.py +0 -0
  135. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/colorLED/__init__.py +0 -0
  136. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/colorLED/client.py +0 -0
  137. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/core/__init__.py +0 -0
  138. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/core/coreclient.py +0 -0
  139. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/core/protobufcom/__init__.py +0 -0
  140. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/core/protobufcom/pbcoreclient.py +0 -0
  141. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/core/types/__init__.py +0 -0
  142. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/digiwave/__init__.py +0 -0
  143. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/digiwave/client.py +0 -0
  144. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/eeprom/__init__.py +0 -0
  145. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/eeprom/eeprom.py +0 -0
  146. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/functionblock/__init__.py +0 -0
  147. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/functionblock/client.py +0 -0
  148. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/mvbsniffer/__init__.py +0 -0
  149. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/mvbsniffer/client.py +0 -0
  150. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/pixelDisplay/__init__.py +0 -0
  151. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/pixelDisplay/client.py +0 -0
  152. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/py.typed +0 -0
  153. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/ssm/__init__.py +0 -0
  154. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/ssm/client.py +0 -0
  155. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/util/__init__.py +0 -0
  156. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/util/any.py +0 -0
  157. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client/util/exceptions.py +0 -0
  158. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client.egg-info/dependency_links.txt +0 -0
  159. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client.egg-info/requires.txt +0 -0
  160. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/io4edge_client.egg-info/top_level.txt +0 -0
  161. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/setup.cfg +0 -0
  162. {io4edge_client-2.4.5 → io4edge_client-2.6.1.dev0}/tests/test_base.py +0 -0
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "Python 3",
3
+ "image": "mcr.microsoft.com/devcontainers/python:3.12",
4
+ "features": {
5
+ "ghcr.io/devcontainers/features/node:1": {
6
+ "version": "lts"
7
+ }
8
+ },
9
+ // Use 'forwardPorts' to make a list of ports inside the container available locally.
10
+ // "forwardPorts": [],
11
+ // Use 'postCreateCommand' to run commands after the container is created.
12
+ "postCreateCommand": "pip3 install --user -r requirements.txt && pip install --user pre-commit && pre-commit install",
13
+ // Configure tool-specific properties.
14
+ // "customizations": {},
15
+ // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
16
+ // "remoteUser": "root"
17
+ "runArgs": [
18
+ "--network=host"
19
+ ]
20
+ }
@@ -0,0 +1,95 @@
1
+ # io4edge-client-python Copilot Instructions
2
+
3
+ ## Architecture Overview
4
+
5
+ This Python SDK provides client libraries for io4edge devices - intelligent I/O devices connected via network. The codebase follows a layered architecture:
6
+
7
+ - **Base Layer** (`io4edge_client/base/`): Core networking with mDNS service discovery and socket transport
8
+ - **Functionblock Layer** (`io4edge_client/functionblock/`): Generic function block client with command/stream handling
9
+ - **Device-Specific Clients**: Type-specific implementations (analogintypea, binaryiotypea, etc.)
10
+ - **Generated APIs** (`io4edge_client/api/`): Protobuf definitions and generated Python code
11
+
12
+ ## Key Patterns & Conventions
13
+
14
+ ### Client Architecture Pattern
15
+ All device clients follow this consistent pattern:
16
+ ```python
17
+ class Client:
18
+ def __init__(self, addr: str, command_timeout=5):
19
+ self._fb_client = FbClient("_io4edge_<device_type>._tcp", addr, command_timeout)
20
+ ```
21
+
22
+ Each client wraps a `functionblock.Client` instance and provides device-specific methods. See `analogintypea/client.py` as the canonical example.
23
+
24
+ ### Service Naming Convention
25
+ - mDNS services: `_io4edge_<functionblock>._tcp` (e.g., `_io4edge_analogInTypeA._tcp`)
26
+ - Address format: either mDNS name (e.g., "S101-IOU01-USB-EXT-1") or IP:port ("192.168.1.100:9999")
27
+
28
+ ### Configuration & Control Methods
29
+ Standard methods across all clients:
30
+ - `upload_configuration(config)` / `download_configuration()` - Device configuration
31
+ - `function_control_set()` / `function_control_get()` - Runtime control/status
32
+ - `start_stream()` / `stop_stream()` / `read_stream()` - Data streaming
33
+ - `close()` - Cleanup and thread termination
34
+
35
+ ### Protobuf Integration
36
+ - Import protobuf modules as `Pb` alias: `import ...analogInTypeA_pb2 as Pb`
37
+ - Use `google.protobuf.any_pb2.Any` for generic message wrapping
38
+ - Protobuf files generated from `io4edge_client/api/` subdirectory
39
+
40
+ ## Development Workflows
41
+
42
+ ### Adding New Device Support
43
+ 1. Create new module directory under `io4edge_client/`
44
+ 2. Implement `Client` class following the established pattern
45
+ 3. Import device-specific protobuf as `Pb`
46
+ 4. Add example usage in `examples/<device_type>/`
47
+ 5. Ensure service name follows `_io4edge_<type>._tcp` convention
48
+
49
+ ### Stream Handling Pattern
50
+ Streaming uses producer-consumer pattern with background thread:
51
+ ```python
52
+ # Producer thread reads socket, queues messages
53
+ # Consumer calls read_stream() with optional timeout
54
+ generic_data, specific_data = client.read_stream(timeout=1.0)
55
+ ```
56
+
57
+ ### Testing
58
+ - Unit tests in `tests/` focus on parsing and address handling
59
+ - Integration examples in `examples/` serve as functional tests
60
+ - Use `python -m unittest` for running tests
61
+
62
+ ## Critical Implementation Details
63
+
64
+ ### Thread Safety
65
+ - `functionblock.Client` uses internal threading for stream handling
66
+ - Always call `close()` to properly terminate background threads
67
+ - Command/response uses mutex protection for single-command-at-a-time
68
+
69
+ ### Error Handling
70
+ - Commands raise `RuntimeError` for protocol errors
71
+ - `TimeoutError` for command timeouts (default 5 seconds)
72
+ - Stream reads raise `TimeoutError` when no data available
73
+
74
+ ### Address Resolution
75
+ Base client automatically handles:
76
+ - Direct IP:port addresses: `"192.168.1.100:9999"`
77
+ - mDNS service names: `"S101-IOU01-USB-EXT-1"` (automatically appends service type)
78
+
79
+ ## Protobuf Code Generation
80
+
81
+ The `io4edge_client/api/` directory contains a git submodule with protobuf definitions. Use `make` in that directory to regenerate Python protobuf code when proto files change.
82
+
83
+ ## Docker Deployment
84
+
85
+ For containerized deployment, use host networking mode to access mDNS services:
86
+ ```bash
87
+ docker run --network=host <image> <script-args>
88
+ ```
89
+
90
+ ## Common Pitfalls
91
+
92
+ - Always use absolute imports for protobuf modules to avoid conflicts
93
+ - Call `client.close()` in cleanup/exception handlers to prevent thread leaks
94
+ - Check device-specific protobuf documentation for field constraints
95
+ - Service discovery requires network connectivity to device's mDNS announcements
@@ -0,0 +1,35 @@
1
+ name: Publish Python Package
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ deploy:
13
+ runs-on: ubuntu-22.04
14
+
15
+ steps:
16
+ - uses: actions/checkout@v6
17
+ with:
18
+ fetch-depth: 0
19
+ submodules: "recursive"
20
+ - uses: actions/setup-python@v6
21
+ with:
22
+ python-version: "3.12"
23
+ - name: Install dependencies
24
+ run: |
25
+ python -m pip install --upgrade pip
26
+ pip install build twine
27
+ - name: Build package
28
+ run: python -m build
29
+ - name: Check distribution metadata
30
+ run: twine check dist/*
31
+ - name: Publish to PyPI
32
+ env:
33
+ TWINE_USERNAME: __token__
34
+ TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
35
+ run: twine upload dist/*
@@ -0,0 +1,133 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ pip-wheel-metadata/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+
30
+ # PyInstaller
31
+ # Usually these files are written by a python script from a template
32
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
33
+ *.manifest
34
+ *.spec
35
+
36
+ # Installer logs
37
+ pip-log.txt
38
+ pip-delete-this-directory.txt
39
+
40
+ # Unit test / coverage reports
41
+ htmlcov/
42
+ .tox/
43
+ .nox/
44
+ .coverage
45
+ .coverage.*
46
+ .cache
47
+ nosetests.xml
48
+ coverage.xml
49
+ *.cover
50
+ *.py,cover
51
+ .hypothesis/
52
+ .pytest_cache/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ target/
76
+
77
+ # Jupyter Notebook
78
+ .ipynb_checkpoints
79
+
80
+ # IPython
81
+ profile_default/
82
+ ipython_config.py
83
+
84
+ # pyenv
85
+ .python-version
86
+
87
+ # pipenv
88
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
90
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
91
+ # install all needed dependencies.
92
+ #Pipfile.lock
93
+
94
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
95
+ __pypackages__/
96
+
97
+ # Celery stuff
98
+ celerybeat-schedule
99
+ celerybeat.pid
100
+
101
+ # SageMath parsed files
102
+ *.sage.py
103
+
104
+ # Environments
105
+ .env
106
+ .venv
107
+ env/
108
+ venv/
109
+ ENV/
110
+ env.bak/
111
+ venv.bak/
112
+
113
+ # Spyder project settings
114
+ .spyderproject
115
+ .spyproject
116
+
117
+ # Rope project settings
118
+ .ropeproject
119
+
120
+ # mkdocs documentation
121
+ /site
122
+
123
+ # mypy
124
+ .mypy_cache/
125
+ .dmypy.json
126
+ dmypy.json
127
+
128
+ # Pyre type checker
129
+ .pyre/
130
+
131
+ *.vcd
132
+
133
+ *.bin
@@ -0,0 +1,3 @@
1
+ [submodule "io4edge_client/api"]
2
+ path = io4edge_client/api
3
+ url = https://github.com/ci4rail/io4edge_api.git
@@ -0,0 +1,8 @@
1
+ # This configuration file was automatically generated by Gitpod.
2
+ # Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml)
3
+ # and commit this file to your remote git repository to share the goodness with others.
4
+
5
+ # Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart
6
+
7
+ tasks:
8
+ - init: pip install -r requirements.txt
@@ -0,0 +1,23 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v4.3.0
4
+ hooks:
5
+ - id: trailing-whitespace
6
+ - id: end-of-file-fixer
7
+ - id: check-yaml
8
+ - id: check-json
9
+ exclude: |
10
+ (?x)^(
11
+ \.devcontainer\/.*|
12
+ )$
13
+ - id: check-added-large-files
14
+ - id: no-commit-to-branch
15
+ args: [--branch, main]
16
+ - id: mixed-line-ending
17
+ args: [--fix=lf]
18
+ # - repo: https://github.com/PyCQA/flake8
19
+ # rev: 5.0.4
20
+ # hooks:
21
+ # - id: flake8
22
+ # args: [--max-line-length=180]
23
+ # additional_dependencies: ["pycodestyle==2.9.0"]
@@ -0,0 +1,3 @@
1
+ {
2
+ "python-envs.pythonProjects": []
3
+ }
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -1,27 +1,18 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: io4edge_client
3
- Version: 2.4.5
4
- Summary: A python library for io4edge devices
5
- Home-page: https://github.com/ci4rail/io4edge-client-python
6
- Author: Ci4Rail GmbH
7
- Author-email: engineering@ci4rail.com
8
- Project-URL: Source Code, https://github.com/ci4rail/io4edge-client-python.git
3
+ Version: 2.6.1.dev0
4
+ Summary: Python client for io4edge devices
5
+ Author-email: Ci4Rail GmbH <engineering@ci4rail.com>, EKF GmbH <info@ekf.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/ci4rail/io4edge-client-python
9
8
  Classifier: Programming Language :: Python :: 3
10
9
  Classifier: Operating System :: OS Independent
11
10
  Requires-Python: >=3.10
12
11
  Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
13
  Requires-Dist: protobuf
14
14
  Requires-Dist: zeroconf
15
- Dynamic: author
16
- Dynamic: author-email
17
- Dynamic: classifier
18
- Dynamic: description
19
- Dynamic: description-content-type
20
- Dynamic: home-page
21
- Dynamic: project-url
22
- Dynamic: requires-dist
23
- Dynamic: requires-python
24
- Dynamic: summary
15
+ Dynamic: license-file
25
16
 
26
17
  # io4edge-client-python
27
18
  python client sdk for io4edge.
@@ -79,12 +70,12 @@ docker run --network=host <your-docker-image-name>:<version> <parameters-to-your
79
70
  ## Releasing
80
71
 
81
72
  To release a new version of the package, follow these steps:
82
- 1. Update the version number in `io4edge-client/version.py`.
83
- 2. Create a new git tag with the same version number, e.g. `git tag v1.0.0`.
84
- 3. Push the tag to the remote repository: `git push --tags`.
73
+
74
+ 1. Create a new git tag with a version number, e.g. `git tag v1.0.0`.
75
+ 2. Push the tag to the remote repository: `git push --tags`.
85
76
 
86
77
  ## Copyright
87
78
 
88
- Copyright © 2021-2025 Ci4Rail GmbH <engineering@ci4rail.com>
79
+ Copyright © 2021-2026 Ci4Rail GmbH <engineering@ci4rail.com>
89
80
 
90
81
  io4edge_client_python package is released under Apache 2.0 License, see [LICENSE](LICENSE) for details.
@@ -54,12 +54,12 @@ docker run --network=host <your-docker-image-name>:<version> <parameters-to-your
54
54
  ## Releasing
55
55
 
56
56
  To release a new version of the package, follow these steps:
57
- 1. Update the version number in `io4edge-client/version.py`.
58
- 2. Create a new git tag with the same version number, e.g. `git tag v1.0.0`.
59
- 3. Push the tag to the remote repository: `git push --tags`.
57
+
58
+ 1. Create a new git tag with a version number, e.g. `git tag v1.0.0`.
59
+ 2. Push the tag to the remote repository: `git push --tags`.
60
60
 
61
61
  ## Copyright
62
62
 
63
- Copyright © 2021-2025 Ci4Rail GmbH <engineering@ci4rail.com>
63
+ Copyright © 2021-2026 Ci4Rail GmbH <engineering@ci4rail.com>
64
64
 
65
65
  io4edge_client_python package is released under Apache 2.0 License, see [LICENSE](LICENSE) for details.
@@ -0,0 +1,18 @@
1
+ # analogInTypeA Examples
2
+
3
+ ## main.py
4
+
5
+ Demonstrates streaming of analog input values.
6
+
7
+
8
+ On IOU01 or MIO01, supply a voltage between -10V..+10V to the analog input channel you want to use.
9
+
10
+ Run the demo with:
11
+
12
+ ```
13
+ python3 main.py [--sr <sample-rate>] <function-block-address>
14
+ ```
15
+ e.g.
16
+ ```
17
+ python3 main.py --sr 2000 S101-IOU01-USB-EXT-1-analogInTypeA1
18
+ ```
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env python3
2
+ # SPDX-License-Identifier: Apache-2.0
3
+ import io4edge_client.analogintypea as ana
4
+ import io4edge_client.functionblock as fb
5
+ import argparse
6
+
7
+
8
+ def main():
9
+ parser = argparse.ArgumentParser(description="demo for analog in type A client")
10
+ parser.add_argument(
11
+ "addr", help="MDNS address or IP:Port of the function block", type=str
12
+ )
13
+ parser.add_argument(
14
+ "--sr",
15
+ help="Sample Rate in Hz",
16
+ type=int,
17
+ default=1000,
18
+ )
19
+ args = parser.parse_args()
20
+
21
+ ana_client = ana.Client(args.addr)
22
+
23
+ # configure the function block
24
+ config = ana.Pb.ConfigurationSet(sample_rate=args.sr)
25
+ ana_client.upload_configuration(config)
26
+
27
+ # read back the configuration
28
+ config = ana_client.download_configuration()
29
+ print("Downloaded config is", config)
30
+
31
+ ana_client.start_stream(
32
+ ana.Pb.StreamControlStart(),
33
+ fb.Pb.StreamControlStart(
34
+ bucketSamples=100,
35
+ keepaliveInterval=1000,
36
+ bufferedSamples=200,
37
+ low_latency_mode=False,
38
+ ),
39
+ )
40
+
41
+ # demonstrate how to read stream
42
+ n = 0
43
+ while True:
44
+ generic_stream_data, stream_data = ana_client.read_stream()
45
+ print(
46
+ f"Received stream data {generic_stream_data.deliveryTimestampUs}, {generic_stream_data.sequence}"
47
+ )
48
+ for sample in stream_data.samples:
49
+ print(" #%d: ts=%d %.4f" % (n, sample.timestamp, sample.value))
50
+ n += 1
51
+
52
+ # not reached
53
+ # ana_client.stop_stream()
54
+ # ana_client.close()
55
+
56
+
57
+ if __name__ == "__main__":
58
+ main()