This commit is contained in:
pelikhan 2021-11-18 16:30:00 -08:00
Родитель db1475fb6d
Коммит f2d3eaf5df
91 изменённых файлов: 100 добавлений и 2593 удалений

4
.gitignore поставляемый
Просмотреть файл

@ -128,4 +128,6 @@ dmypy.json
# Pyre type checker
.pyre/
docs/generated/
docs/generated/
docs/autoapi/
docs/_build/

Просмотреть файл

@ -1,8 +0,0 @@
API
===
.. autosummary::
:toctree: generated
:recursive:
jacdac

Просмотреть файл

@ -32,6 +32,7 @@ release = '0.0.0'
# ones.
extensions = [
'myst_parser',
'autoapi.extension',
'sphinx.ext.duration',
'sphinx.ext.doctest',
'sphinx.ext.autodoc',
@ -45,6 +46,9 @@ intersphinx_mapping = {
}
intersphinx_disabled_domains = ['std']
autoapi_type = 'python'
autoapi_dirs = ['../jacdac']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

Просмотреть файл

@ -19,4 +19,3 @@ Contents
.. toctree::
usage
api

Просмотреть файл

@ -1,2 +1,3 @@
myst-parser
sphinx-rtd-theme
sphinx-rtd-theme
sphinx-autoapi

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.accelerometer package
============================
Submodules
----------
jacdac.accelerometer.client module
----------------------------------
.. automodule:: jacdac.accelerometer.client
:members:
:undoc-members:
:show-inheritance:
jacdac.accelerometer.constants module
-------------------------------------
.. automodule:: jacdac.accelerometer.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.accelerometer
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.arcade\_gamepad package
==============================
Submodules
----------
jacdac.arcade\_gamepad.client module
------------------------------------
.. automodule:: jacdac.arcade_gamepad.client
:members:
:undoc-members:
:show-inheritance:
jacdac.arcade\_gamepad.constants module
---------------------------------------
.. automodule:: jacdac.arcade_gamepad.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.arcade_gamepad
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.arcade\_sound package
============================
Submodules
----------
jacdac.arcade\_sound.client module
----------------------------------
.. automodule:: jacdac.arcade_sound.client
:members:
:undoc-members:
:show-inheritance:
jacdac.arcade\_sound.constants module
-------------------------------------
.. automodule:: jacdac.arcade_sound.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.arcade_sound
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.azure\_iot\_hub\_health package
======================================
Submodules
----------
jacdac.azure\_iot\_hub\_health.client module
--------------------------------------------
.. automodule:: jacdac.azure_iot_hub_health.client
:members:
:undoc-members:
:show-inheritance:
jacdac.azure\_iot\_hub\_health.constants module
-----------------------------------------------
.. automodule:: jacdac.azure_iot_hub_health.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.azure_iot_hub_health
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.barcode\_reader package
==============================
Submodules
----------
jacdac.barcode\_reader.client module
------------------------------------
.. automodule:: jacdac.barcode_reader.client
:members:
:undoc-members:
:show-inheritance:
jacdac.barcode\_reader.constants module
---------------------------------------
.. automodule:: jacdac.barcode_reader.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.barcode_reader
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,37 +0,0 @@
jacdac.barometer package
========================
Submodules
----------
jacdac.barometer.client module
------------------------------
.. automodule:: jacdac.barometer.client
:members:
:undoc-members:
:show-inheritance:
jacdac.barometer.constants module
---------------------------------
.. automodule:: jacdac.barometer.constants
:members:
:undoc-members:
:show-inheritance:
jacdac.barometer.test module
----------------------------
.. automodule:: jacdac.barometer.test
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.barometer
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.bit\_radio package
=========================
Submodules
----------
jacdac.bit\_radio.client module
-------------------------------
.. automodule:: jacdac.bit_radio.client
:members:
:undoc-members:
:show-inheritance:
jacdac.bit\_radio.constants module
----------------------------------
.. automodule:: jacdac.bit_radio.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.bit_radio
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.braille\_display package
===============================
Submodules
----------
jacdac.braille\_display.client module
-------------------------------------
.. automodule:: jacdac.braille_display.client
:members:
:undoc-members:
:show-inheritance:
jacdac.braille\_display.constants module
----------------------------------------
.. automodule:: jacdac.braille_display.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.braille_display
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,53 +0,0 @@
jacdac.button package
=====================
Submodules
----------
jacdac.button.client module
---------------------------
.. automodule:: jacdac.button.client
:members:
:undoc-members:
:show-inheritance:
jacdac.button.client\_base module
---------------------------------
.. automodule:: jacdac.button.client_base
:members:
:undoc-members:
:show-inheritance:
jacdac.button.constants module
------------------------------
.. automodule:: jacdac.button.constants
:members:
:undoc-members:
:show-inheritance:
jacdac.button.server module
---------------------------
.. automodule:: jacdac.button.server
:members:
:undoc-members:
:show-inheritance:
jacdac.button.test module
-------------------------
.. automodule:: jacdac.button.test
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.button
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.buzzer package
=====================
Submodules
----------
jacdac.buzzer.client module
---------------------------
.. automodule:: jacdac.buzzer.client
:members:
:undoc-members:
:show-inheritance:
jacdac.buzzer.constants module
------------------------------
.. automodule:: jacdac.buzzer.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.buzzer
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.capacitive\_button package
=================================
Submodules
----------
jacdac.capacitive\_button.client module
---------------------------------------
.. automodule:: jacdac.capacitive_button.client
:members:
:undoc-members:
:show-inheritance:
jacdac.capacitive\_button.constants module
------------------------------------------
.. automodule:: jacdac.capacitive_button.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.capacitive_button
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.character\_screen package
================================
Submodules
----------
jacdac.character\_screen.client module
--------------------------------------
.. automodule:: jacdac.character_screen.client
:members:
:undoc-members:
:show-inheritance:
jacdac.character\_screen.constants module
-----------------------------------------
.. automodule:: jacdac.character_screen.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.character_screen
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.codal\_message\_bus package
==================================
Submodules
----------
jacdac.codal\_message\_bus.client module
----------------------------------------
.. automodule:: jacdac.codal_message_bus.client
:members:
:undoc-members:
:show-inheritance:
jacdac.codal\_message\_bus.constants module
-------------------------------------------
.. automodule:: jacdac.codal_message_bus.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.codal_message_bus
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.color package
====================
Submodules
----------
jacdac.color.client module
--------------------------
.. automodule:: jacdac.color.client
:members:
:undoc-members:
:show-inheritance:
jacdac.color.constants module
-----------------------------
.. automodule:: jacdac.color.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.color
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.compass package
======================
Submodules
----------
jacdac.compass.client module
----------------------------
.. automodule:: jacdac.compass.client
:members:
:undoc-members:
:show-inheritance:
jacdac.compass.constants module
-------------------------------
.. automodule:: jacdac.compass.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.compass
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.dimmer package
=====================
Submodules
----------
jacdac.dimmer.client module
---------------------------
.. automodule:: jacdac.dimmer.client
:members:
:undoc-members:
:show-inheritance:
jacdac.dimmer.constants module
------------------------------
.. automodule:: jacdac.dimmer.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.dimmer
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.distance package
=======================
Submodules
----------
jacdac.distance.client module
-----------------------------
.. automodule:: jacdac.distance.client
:members:
:undoc-members:
:show-inheritance:
jacdac.distance.constants module
--------------------------------
.. automodule:: jacdac.distance.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.distance
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.dmx package
==================
Submodules
----------
jacdac.dmx.client module
------------------------
.. automodule:: jacdac.dmx.client
:members:
:undoc-members:
:show-inheritance:
jacdac.dmx.constants module
---------------------------
.. automodule:: jacdac.dmx.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.dmx
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.dot\_matrix package
==========================
Submodules
----------
jacdac.dot\_matrix.client module
--------------------------------
.. automodule:: jacdac.dot_matrix.client
:members:
:undoc-members:
:show-inheritance:
jacdac.dot\_matrix.constants module
-----------------------------------
.. automodule:: jacdac.dot_matrix.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.dot_matrix
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.e\_co2 package
=====================
Submodules
----------
jacdac.e\_co2.client module
---------------------------
.. automodule:: jacdac.e_co2.client
:members:
:undoc-members:
:show-inheritance:
jacdac.e\_co2.constants module
------------------------------
.. automodule:: jacdac.e_co2.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.e_co2
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.flex package
===================
Submodules
----------
jacdac.flex.client module
-------------------------
.. automodule:: jacdac.flex.client
:members:
:undoc-members:
:show-inheritance:
jacdac.flex.constants module
----------------------------
.. automodule:: jacdac.flex.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.flex
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.gyroscope package
========================
Submodules
----------
jacdac.gyroscope.client module
------------------------------
.. automodule:: jacdac.gyroscope.client
:members:
:undoc-members:
:show-inheritance:
jacdac.gyroscope.constants module
---------------------------------
.. automodule:: jacdac.gyroscope.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.gyroscope
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.heart\_rate package
==========================
Submodules
----------
jacdac.heart\_rate.client module
--------------------------------
.. automodule:: jacdac.heart_rate.client
:members:
:undoc-members:
:show-inheritance:
jacdac.heart\_rate.constants module
-----------------------------------
.. automodule:: jacdac.heart_rate.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.heart_rate
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.hid\_keyboard package
============================
Submodules
----------
jacdac.hid\_keyboard.client module
----------------------------------
.. automodule:: jacdac.hid_keyboard.client
:members:
:undoc-members:
:show-inheritance:
jacdac.hid\_keyboard.constants module
-------------------------------------
.. automodule:: jacdac.hid_keyboard.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.hid_keyboard
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.hid\_mouse package
=========================
Submodules
----------
jacdac.hid\_mouse.client module
-------------------------------
.. automodule:: jacdac.hid_mouse.client
:members:
:undoc-members:
:show-inheritance:
jacdac.hid\_mouse.constants module
----------------------------------
.. automodule:: jacdac.hid_mouse.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.hid_mouse
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.humidity package
=======================
Submodules
----------
jacdac.humidity.client module
-----------------------------
.. automodule:: jacdac.humidity.client
:members:
:undoc-members:
:show-inheritance:
jacdac.humidity.constants module
--------------------------------
.. automodule:: jacdac.humidity.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.humidity
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.illuminance package
==========================
Submodules
----------
jacdac.illuminance.client module
--------------------------------
.. automodule:: jacdac.illuminance.client
:members:
:undoc-members:
:show-inheritance:
jacdac.illuminance.constants module
-----------------------------------
.. automodule:: jacdac.illuminance.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.illuminance
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.indexed\_screen package
==============================
Submodules
----------
jacdac.indexed\_screen.client module
------------------------------------
.. automodule:: jacdac.indexed_screen.client
:members:
:undoc-members:
:show-inheritance:
jacdac.indexed\_screen.constants module
---------------------------------------
.. automodule:: jacdac.indexed_screen.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.indexed_screen
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.joystick package
=======================
Submodules
----------
jacdac.joystick.client module
-----------------------------
.. automodule:: jacdac.joystick.client
:members:
:undoc-members:
:show-inheritance:
jacdac.joystick.constants module
--------------------------------
.. automodule:: jacdac.joystick.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.joystick
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.led package
==================
Submodules
----------
jacdac.led.client module
------------------------
.. automodule:: jacdac.led.client
:members:
:undoc-members:
:show-inheritance:
jacdac.led.constants module
---------------------------
.. automodule:: jacdac.led.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.led
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.led\_pixel package
=========================
Submodules
----------
jacdac.led\_pixel.client module
-------------------------------
.. automodule:: jacdac.led_pixel.client
:members:
:undoc-members:
:show-inheritance:
jacdac.led\_pixel.constants module
----------------------------------
.. automodule:: jacdac.led_pixel.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.led_pixel
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.light\_bulb package
==========================
Submodules
----------
jacdac.light\_bulb.client module
--------------------------------
.. automodule:: jacdac.light_bulb.client
:members:
:undoc-members:
:show-inheritance:
jacdac.light\_bulb.constants module
-----------------------------------
.. automodule:: jacdac.light_bulb.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.light_bulb
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.light\_level package
===========================
Submodules
----------
jacdac.light\_level.client module
---------------------------------
.. automodule:: jacdac.light_level.client
:members:
:undoc-members:
:show-inheritance:
jacdac.light\_level.constants module
------------------------------------
.. automodule:: jacdac.light_level.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.light_level
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.magnetometer package
===========================
Submodules
----------
jacdac.magnetometer.client module
---------------------------------
.. automodule:: jacdac.magnetometer.client
:members:
:undoc-members:
:show-inheritance:
jacdac.magnetometer.constants module
------------------------------------
.. automodule:: jacdac.magnetometer.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.magnetometer
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.matrix\_keypad package
=============================
Submodules
----------
jacdac.matrix\_keypad.client module
-----------------------------------
.. automodule:: jacdac.matrix_keypad.client
:members:
:undoc-members:
:show-inheritance:
jacdac.matrix\_keypad.constants module
--------------------------------------
.. automodule:: jacdac.matrix_keypad.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.matrix_keypad
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.microphone package
=========================
Submodules
----------
jacdac.microphone.client module
-------------------------------
.. automodule:: jacdac.microphone.client
:members:
:undoc-members:
:show-inheritance:
jacdac.microphone.constants module
----------------------------------
.. automodule:: jacdac.microphone.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.microphone
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.midi\_output package
===========================
Submodules
----------
jacdac.midi\_output.client module
---------------------------------
.. automodule:: jacdac.midi_output.client
:members:
:undoc-members:
:show-inheritance:
jacdac.midi\_output.constants module
------------------------------------
.. automodule:: jacdac.midi_output.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.midi_output
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.model\_runner package
============================
Submodules
----------
jacdac.model\_runner.client module
----------------------------------
.. automodule:: jacdac.model_runner.client
:members:
:undoc-members:
:show-inheritance:
jacdac.model\_runner.constants module
-------------------------------------
.. automodule:: jacdac.model_runner.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.model_runner
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.motion package
=====================
Submodules
----------
jacdac.motion.client module
---------------------------
.. automodule:: jacdac.motion.client
:members:
:undoc-members:
:show-inheritance:
jacdac.motion.constants module
------------------------------
.. automodule:: jacdac.motion.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.motion
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.motor package
====================
Submodules
----------
jacdac.motor.client module
--------------------------
.. automodule:: jacdac.motor.client
:members:
:undoc-members:
:show-inheritance:
jacdac.motor.constants module
-----------------------------
.. automodule:: jacdac.motor.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.motor
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.multitouch package
=========================
Submodules
----------
jacdac.multitouch.client module
-------------------------------
.. automodule:: jacdac.multitouch.client
:members:
:undoc-members:
:show-inheritance:
jacdac.multitouch.constants module
----------------------------------
.. automodule:: jacdac.multitouch.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.multitouch
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.potentiometer package
============================
Submodules
----------
jacdac.potentiometer.client module
----------------------------------
.. automodule:: jacdac.potentiometer.client
:members:
:undoc-members:
:show-inheritance:
jacdac.potentiometer.constants module
-------------------------------------
.. automodule:: jacdac.potentiometer.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.potentiometer
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.power package
====================
Submodules
----------
jacdac.power.client module
--------------------------
.. automodule:: jacdac.power.client
:members:
:undoc-members:
:show-inheritance:
jacdac.power.constants module
-----------------------------
.. automodule:: jacdac.power.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.power
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.pressure\_button package
===============================
Submodules
----------
jacdac.pressure\_button.client module
-------------------------------------
.. automodule:: jacdac.pressure_button.client
:members:
:undoc-members:
:show-inheritance:
jacdac.pressure\_button.constants module
----------------------------------------
.. automodule:: jacdac.pressure_button.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.pressure_button
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.proto\_test package
==========================
Submodules
----------
jacdac.proto\_test.client module
--------------------------------
.. automodule:: jacdac.proto_test.client
:members:
:undoc-members:
:show-inheritance:
jacdac.proto\_test.constants module
-----------------------------------
.. automodule:: jacdac.proto_test.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.proto_test
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.pulse\_oximeter package
==============================
Submodules
----------
jacdac.pulse\_oximeter.client module
------------------------------------
.. automodule:: jacdac.pulse_oximeter.client
:members:
:undoc-members:
:show-inheritance:
jacdac.pulse\_oximeter.constants module
---------------------------------------
.. automodule:: jacdac.pulse_oximeter.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.pulse_oximeter
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.rain\_gauge package
==========================
Submodules
----------
jacdac.rain\_gauge.client module
--------------------------------
.. automodule:: jacdac.rain_gauge.client
:members:
:undoc-members:
:show-inheritance:
jacdac.rain\_gauge.constants module
-----------------------------------
.. automodule:: jacdac.rain_gauge.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.rain_gauge
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.real\_time\_clock package
================================
Submodules
----------
jacdac.real\_time\_clock.client module
--------------------------------------
.. automodule:: jacdac.real_time_clock.client
:members:
:undoc-members:
:show-inheritance:
jacdac.real\_time\_clock.constants module
-----------------------------------------
.. automodule:: jacdac.real_time_clock.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.real_time_clock
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.reflected\_light package
===============================
Submodules
----------
jacdac.reflected\_light.client module
-------------------------------------
.. automodule:: jacdac.reflected_light.client
:members:
:undoc-members:
:show-inheritance:
jacdac.reflected\_light.constants module
----------------------------------------
.. automodule:: jacdac.reflected_light.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.reflected_light
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,37 +0,0 @@
jacdac.relay package
====================
Submodules
----------
jacdac.relay.client module
--------------------------
.. automodule:: jacdac.relay.client
:members:
:undoc-members:
:show-inheritance:
jacdac.relay.constants module
-----------------------------
.. automodule:: jacdac.relay.constants
:members:
:undoc-members:
:show-inheritance:
jacdac.relay.test module
------------------------
.. automodule:: jacdac.relay.test
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.relay
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.rng package
==================
Submodules
----------
jacdac.rng.client module
------------------------
.. automodule:: jacdac.rng.client
:members:
:undoc-members:
:show-inheritance:
jacdac.rng.constants module
---------------------------
.. automodule:: jacdac.rng.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.rng
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.role\_manager package
============================
Submodules
----------
jacdac.role\_manager.client module
----------------------------------
.. automodule:: jacdac.role_manager.client
:members:
:undoc-members:
:show-inheritance:
jacdac.role\_manager.constants module
-------------------------------------
.. automodule:: jacdac.role_manager.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.role_manager
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.rotary\_encoder package
==============================
Submodules
----------
jacdac.rotary\_encoder.client module
------------------------------------
.. automodule:: jacdac.rotary_encoder.client
:members:
:undoc-members:
:show-inheritance:
jacdac.rotary\_encoder.constants module
---------------------------------------
.. automodule:: jacdac.rotary_encoder.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.rotary_encoder
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.rover package
====================
Submodules
----------
jacdac.rover.client module
--------------------------
.. automodule:: jacdac.rover.client
:members:
:undoc-members:
:show-inheritance:
jacdac.rover.constants module
-----------------------------
.. automodule:: jacdac.rover.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.rover
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,170 +0,0 @@
jacdac package
==============
Subpackages
-----------
.. toctree::
:maxdepth: 4
jacdac.accelerometer
jacdac.arcade_gamepad
jacdac.arcade_sound
jacdac.azure_iot_hub_health
jacdac.barcode_reader
jacdac.barometer
jacdac.bit_radio
jacdac.braille_display
jacdac.button
jacdac.buzzer
jacdac.capacitive_button
jacdac.character_screen
jacdac.codal_message_bus
jacdac.color
jacdac.compass
jacdac.dimmer
jacdac.distance
jacdac.dmx
jacdac.dot_matrix
jacdac.e_co2
jacdac.flex
jacdac.gyroscope
jacdac.heart_rate
jacdac.hid_keyboard
jacdac.hid_mouse
jacdac.humidity
jacdac.illuminance
jacdac.indexed_screen
jacdac.joystick
jacdac.led
jacdac.led_pixel
jacdac.light_bulb
jacdac.light_level
jacdac.magnetometer
jacdac.matrix_keypad
jacdac.microphone
jacdac.midi_output
jacdac.model_runner
jacdac.motion
jacdac.motor
jacdac.multitouch
jacdac.potentiometer
jacdac.power
jacdac.pressure_button
jacdac.proto_test
jacdac.pulse_oximeter
jacdac.rain_gauge
jacdac.real_time_clock
jacdac.reflected_light
jacdac.relay
jacdac.rng
jacdac.role_manager
jacdac.rotary_encoder
jacdac.rover
jacdac.sensor_aggregator
jacdac.servo
jacdac.settings
jacdac.seven_segment_display
jacdac.soil_moisture
jacdac.solenoid
jacdac.sound_level
jacdac.sound_player
jacdac.sound_spectrum
jacdac.speech_synthesis
jacdac.switch
jacdac.tcp
jacdac.thermocouple
jacdac.thermometer
jacdac.traffic_light
jacdac.tvoc
jacdac.uv_index
jacdac.verified_telemetry
jacdac.vibration_motor
jacdac.water_level
jacdac.weight_scale
jacdac.wifi
jacdac.wind_direction
jacdac.wind_speed
Submodules
----------
jacdac.bus module
-----------------
.. automodule:: jacdac.bus
:members:
:undoc-members:
:show-inheritance:
jacdac.constants module
-----------------------
.. automodule:: jacdac.constants
:members:
:undoc-members:
:show-inheritance:
jacdac.devtools module
----------------------
.. automodule:: jacdac.devtools
:members:
:undoc-members:
:show-inheritance:
jacdac.events module
--------------------
.. automodule:: jacdac.events
:members:
:undoc-members:
:show-inheritance:
jacdac.pack module
------------------
.. automodule:: jacdac.pack
:members:
:undoc-members:
:show-inheritance:
jacdac.packet module
--------------------
.. automodule:: jacdac.packet
:members:
:undoc-members:
:show-inheritance:
jacdac.sample module
--------------------
.. automodule:: jacdac.sample
:members:
:undoc-members:
:show-inheritance:
jacdac.transport module
-----------------------
.. automodule:: jacdac.transport
:members:
:undoc-members:
:show-inheritance:
jacdac.util module
------------------
.. automodule:: jacdac.util
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.sensor\_aggregator package
=================================
Submodules
----------
jacdac.sensor\_aggregator.client module
---------------------------------------
.. automodule:: jacdac.sensor_aggregator.client
:members:
:undoc-members:
:show-inheritance:
jacdac.sensor\_aggregator.constants module
------------------------------------------
.. automodule:: jacdac.sensor_aggregator.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.sensor_aggregator
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.servo package
====================
Submodules
----------
jacdac.servo.client module
--------------------------
.. automodule:: jacdac.servo.client
:members:
:undoc-members:
:show-inheritance:
jacdac.servo.constants module
-----------------------------
.. automodule:: jacdac.servo.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.servo
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.settings package
=======================
Submodules
----------
jacdac.settings.client module
-----------------------------
.. automodule:: jacdac.settings.client
:members:
:undoc-members:
:show-inheritance:
jacdac.settings.constants module
--------------------------------
.. automodule:: jacdac.settings.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.settings
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.seven\_segment\_display package
======================================
Submodules
----------
jacdac.seven\_segment\_display.client module
--------------------------------------------
.. automodule:: jacdac.seven_segment_display.client
:members:
:undoc-members:
:show-inheritance:
jacdac.seven\_segment\_display.constants module
-----------------------------------------------
.. automodule:: jacdac.seven_segment_display.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.seven_segment_display
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.soil\_moisture package
=============================
Submodules
----------
jacdac.soil\_moisture.client module
-----------------------------------
.. automodule:: jacdac.soil_moisture.client
:members:
:undoc-members:
:show-inheritance:
jacdac.soil\_moisture.constants module
--------------------------------------
.. automodule:: jacdac.soil_moisture.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.soil_moisture
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.solenoid package
=======================
Submodules
----------
jacdac.solenoid.client module
-----------------------------
.. automodule:: jacdac.solenoid.client
:members:
:undoc-members:
:show-inheritance:
jacdac.solenoid.constants module
--------------------------------
.. automodule:: jacdac.solenoid.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.solenoid
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.sound\_level package
===========================
Submodules
----------
jacdac.sound\_level.client module
---------------------------------
.. automodule:: jacdac.sound_level.client
:members:
:undoc-members:
:show-inheritance:
jacdac.sound\_level.constants module
------------------------------------
.. automodule:: jacdac.sound_level.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.sound_level
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.sound\_player package
============================
Submodules
----------
jacdac.sound\_player.client module
----------------------------------
.. automodule:: jacdac.sound_player.client
:members:
:undoc-members:
:show-inheritance:
jacdac.sound\_player.constants module
-------------------------------------
.. automodule:: jacdac.sound_player.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.sound_player
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.sound\_spectrum package
==============================
Submodules
----------
jacdac.sound\_spectrum.client module
------------------------------------
.. automodule:: jacdac.sound_spectrum.client
:members:
:undoc-members:
:show-inheritance:
jacdac.sound\_spectrum.constants module
---------------------------------------
.. automodule:: jacdac.sound_spectrum.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.sound_spectrum
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.speech\_synthesis package
================================
Submodules
----------
jacdac.speech\_synthesis.client module
--------------------------------------
.. automodule:: jacdac.speech_synthesis.client
:members:
:undoc-members:
:show-inheritance:
jacdac.speech\_synthesis.constants module
-----------------------------------------
.. automodule:: jacdac.speech_synthesis.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.speech_synthesis
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.switch package
=====================
Submodules
----------
jacdac.switch.client module
---------------------------
.. automodule:: jacdac.switch.client
:members:
:undoc-members:
:show-inheritance:
jacdac.switch.constants module
------------------------------
.. automodule:: jacdac.switch.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.switch
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.tcp package
==================
Submodules
----------
jacdac.tcp.client module
------------------------
.. automodule:: jacdac.tcp.client
:members:
:undoc-members:
:show-inheritance:
jacdac.tcp.constants module
---------------------------
.. automodule:: jacdac.tcp.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.tcp
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.thermocouple package
===========================
Submodules
----------
jacdac.thermocouple.client module
---------------------------------
.. automodule:: jacdac.thermocouple.client
:members:
:undoc-members:
:show-inheritance:
jacdac.thermocouple.constants module
------------------------------------
.. automodule:: jacdac.thermocouple.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.thermocouple
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.thermometer package
==========================
Submodules
----------
jacdac.thermometer.client module
--------------------------------
.. automodule:: jacdac.thermometer.client
:members:
:undoc-members:
:show-inheritance:
jacdac.thermometer.constants module
-----------------------------------
.. automodule:: jacdac.thermometer.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.thermometer
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.traffic\_light package
=============================
Submodules
----------
jacdac.traffic\_light.client module
-----------------------------------
.. automodule:: jacdac.traffic_light.client
:members:
:undoc-members:
:show-inheritance:
jacdac.traffic\_light.constants module
--------------------------------------
.. automodule:: jacdac.traffic_light.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.traffic_light
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.tvoc package
===================
Submodules
----------
jacdac.tvoc.client module
-------------------------
.. automodule:: jacdac.tvoc.client
:members:
:undoc-members:
:show-inheritance:
jacdac.tvoc.constants module
----------------------------
.. automodule:: jacdac.tvoc.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.tvoc
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.uv\_index package
========================
Submodules
----------
jacdac.uv\_index.client module
------------------------------
.. automodule:: jacdac.uv_index.client
:members:
:undoc-members:
:show-inheritance:
jacdac.uv\_index.constants module
---------------------------------
.. automodule:: jacdac.uv_index.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.uv_index
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.verified\_telemetry package
==================================
Submodules
----------
jacdac.verified\_telemetry.client module
----------------------------------------
.. automodule:: jacdac.verified_telemetry.client
:members:
:undoc-members:
:show-inheritance:
jacdac.verified\_telemetry.constants module
-------------------------------------------
.. automodule:: jacdac.verified_telemetry.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.verified_telemetry
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.vibration\_motor package
===============================
Submodules
----------
jacdac.vibration\_motor.client module
-------------------------------------
.. automodule:: jacdac.vibration_motor.client
:members:
:undoc-members:
:show-inheritance:
jacdac.vibration\_motor.constants module
----------------------------------------
.. automodule:: jacdac.vibration_motor.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.vibration_motor
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.water\_level package
===========================
Submodules
----------
jacdac.water\_level.client module
---------------------------------
.. automodule:: jacdac.water_level.client
:members:
:undoc-members:
:show-inheritance:
jacdac.water\_level.constants module
------------------------------------
.. automodule:: jacdac.water_level.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.water_level
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.weight\_scale package
============================
Submodules
----------
jacdac.weight\_scale.client module
----------------------------------
.. automodule:: jacdac.weight_scale.client
:members:
:undoc-members:
:show-inheritance:
jacdac.weight\_scale.constants module
-------------------------------------
.. automodule:: jacdac.weight_scale.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.weight_scale
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.wifi package
===================
Submodules
----------
jacdac.wifi.client module
-------------------------
.. automodule:: jacdac.wifi.client
:members:
:undoc-members:
:show-inheritance:
jacdac.wifi.constants module
----------------------------
.. automodule:: jacdac.wifi.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.wifi
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.wind\_direction package
==============================
Submodules
----------
jacdac.wind\_direction.client module
------------------------------------
.. automodule:: jacdac.wind_direction.client
:members:
:undoc-members:
:show-inheritance:
jacdac.wind\_direction.constants module
---------------------------------------
.. automodule:: jacdac.wind_direction.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.wind_direction
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,29 +0,0 @@
jacdac.wind\_speed package
==========================
Submodules
----------
jacdac.wind\_speed.client module
--------------------------------
.. automodule:: jacdac.wind_speed.client
:members:
:undoc-members:
:show-inheritance:
jacdac.wind\_speed.constants module
-----------------------------------
.. automodule:: jacdac.wind_speed.constants
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: jacdac.wind_speed
:members:
:undoc-members:
:show-inheritance:

Просмотреть файл

@ -1,7 +0,0 @@
jacdac
======
.. toctree::
:maxdepth: 4
jacdac

Просмотреть файл

@ -3,18 +3,19 @@ import random
import asyncio
import queue
import os
import time
import sys
from typing import Optional, TypeVar, Union, cast
from .constants import *
from .control.constants import *
from .system.constants import *
from .unique_brain.constants import *
from .events import *
from .packet import *
from .transport import Transport
import jacdac.util as util
from .util import now, log, logv
from .control.constants import *
from .pack import PackTuple, PackType, jdpack, jdunpack
@ -50,6 +51,17 @@ def _service_matches(dev: 'Device', serv: bytearray):
return True
class Transport:
# A base class for packet transports
on_receive: Optional[Callable[[bytes], None]] = None
# Callback to report a received packet to the bus
def send(self, pkt: bytes) -> None:
# send a packet payload over the transport layer
pass
class Bus(EventEmitter):
"""A Jacdac bus that managed devices, service client, registers...
"""
@ -100,11 +112,9 @@ class Bus(EventEmitter):
asyncio.set_event_loop(loop)
# TODO: what's the best way to import these things
from .control.server import ControlServer
ctrls = ControlServer(self) # attach control server
# TODO: make this optional.
from .unique_brain.server import UniqueBrainServer
brain = UniqueBrainServer(self)
def keep_task(t: asyncio.Task[None]):
@ -522,6 +532,80 @@ class Server(EventEmitter):
log(prefix + text, *args)
class ControlServer(Server):
def __init__(self, bus: Bus) -> None:
super().__init__(bus, JD_SERVICE_CLASS_CONTROL)
self.restart_counter = 0
def queue_announce(self):
logv("announce: %d " % self.restart_counter)
self.restart_counter += 1
ids = [s.service_class for s in self.bus. servers]
rest = self.restart_counter
if rest > 0xf:
rest = 0xf
ids[0] = (
rest |
JD_CONTROL_ANNOUNCE_FLAGS_IS_CLIENT |
JD_CONTROL_ANNOUNCE_FLAGS_SUPPORTS_ACK |
JD_CONTROL_ANNOUNCE_FLAGS_SUPPORTS_BROADCAST |
JD_CONTROL_ANNOUNCE_FLAGS_SUPPORTS_FRAMES
)
buf = jdpack("u32[]", *ids)
self.send_report(JDPacket(cmd=0, data=buf))
# auto bind
# if jacdac.role_manager_server.auto_bind:
# self.auto_bind_cnt++
# # also, only do it every two announces (TBD)
# if self.auto_bind_cnt >= 2:
# self.auto_bind_cnt = 0
# jacdac.role_manager_server.bind_roles()
# def handle_flood_ping(self, pkt: JDPacket):
# num_responses, counter, size = pkt.unpack("IIB")
# payload = bytearray(4 + size)
# for i in range(size): payload[4+i]=i
# def queue_ping():
# if num_responses <= 0:
# control.internal_on_event(
# jacdac.__physId(),
# EVT_TX_EMPTY,
# do_nothing
# )
# else:
# payload.set_number(NumberFormat.UInt32LE, 0, counter)
# self.send_report(
# JDPacket.from(ControlCmd.FloodPing, payload)
# )
# num_responses--
# counter++
# control.internal_on_event(jacdac.__physId(), EVT_TX_EMPTY, queue_ping)
# queue_ping()
def handle_packet(self, pkt: JDPacket):
if pkt.is_reg_get:
if pkt.reg_code == JD_CONTROL_REG_UPTIME:
self.send_report(JDPacket.packed(
JD_GET(JD_CONTROL_REG_UPTIME), "u64", time.monotonic_ns() // 1000))
else:
cmd = pkt.service_command
if cmd == JD_CONTROL_CMD_SERVICES:
self.queue_announce()
elif cmd == JD_CONTROL_CMD_IDENTIFY:
self.log("identify")
self.bus.emit(EV_IDENTIFY)
elif cmd == JD_CONTROL_CMD_RESET:
sys.exit() # TODO?
class UniqueBrainServer(Server):
# A unique brain server
def __init__(self, bus: Bus) -> None:
super().__init__(bus, JD_SERVICE_CLASS_UNIQUE_BRAIN)
class Client(EventEmitter):
def __init__(self, bus: Bus, service_class: int, pack_formats: dict[int, str], role: str) -> None:
super().__init__(bus)

Просмотреть файл

@ -1,75 +0,0 @@
import time
import sys
from jacdac.pack import jdpack
from .constants import *
from jacdac.bus import Server, Bus, EV_IDENTIFY
from jacdac.util import logv
from jacdac.packet import JDPacket
class ControlServer(Server):
def __init__(self, bus: Bus) -> None:
super().__init__(bus, JD_SERVICE_CLASS_CONTROL)
self.restart_counter = 0
def queue_announce(self):
logv("announce: %d " % self.restart_counter)
self.restart_counter += 1
ids = [s.service_class for s in self.bus. servers]
rest = self.restart_counter
if rest > 0xf:
rest = 0xf
ids[0] = (
rest |
JD_CONTROL_ANNOUNCE_FLAGS_IS_CLIENT |
JD_CONTROL_ANNOUNCE_FLAGS_SUPPORTS_ACK |
JD_CONTROL_ANNOUNCE_FLAGS_SUPPORTS_BROADCAST |
JD_CONTROL_ANNOUNCE_FLAGS_SUPPORTS_FRAMES
)
buf = jdpack("u32[]", *ids)
self.send_report(JDPacket(cmd=0, data=buf))
# auto bind
# if jacdac.role_manager_server.auto_bind:
# self.auto_bind_cnt++
# # also, only do it every two announces (TBD)
# if self.auto_bind_cnt >= 2:
# self.auto_bind_cnt = 0
# jacdac.role_manager_server.bind_roles()
# def handle_flood_ping(self, pkt: JDPacket):
# num_responses, counter, size = pkt.unpack("IIB")
# payload = bytearray(4 + size)
# for i in range(size): payload[4+i]=i
# def queue_ping():
# if num_responses <= 0:
# control.internal_on_event(
# jacdac.__physId(),
# EVT_TX_EMPTY,
# do_nothing
# )
# else:
# payload.set_number(NumberFormat.UInt32LE, 0, counter)
# self.send_report(
# JDPacket.from(ControlCmd.FloodPing, payload)
# )
# num_responses--
# counter++
# control.internal_on_event(jacdac.__physId(), EVT_TX_EMPTY, queue_ping)
# queue_ping()
def handle_packet(self, pkt: JDPacket):
if pkt.is_reg_get:
if pkt.reg_code == JD_CONTROL_REG_UPTIME:
self.send_report(JDPacket.packed(
JD_GET(JD_CONTROL_REG_UPTIME), "u64", time.monotonic_ns() // 1000))
else:
cmd = pkt.service_command
if cmd == JD_CONTROL_CMD_SERVICES:
self.queue_announce()
elif cmd == JD_CONTROL_CMD_IDENTIFY:
self.log("identify")
self.bus.emit(EV_IDENTIFY)
elif cmd == JD_CONTROL_CMD_RESET:
sys.exit() # TODO?

Просмотреть файл

@ -1,12 +0,0 @@
from typing import Callable, Optional
class Transport:
# A base class for packet transports
on_receive: Optional[Callable[[bytes], None]] = None
# Callback to report a received packet to the bus
def send(self, pkt: bytes) -> None:
# send a packet payload over the transport layer
pass

Просмотреть файл

@ -4,7 +4,7 @@ import queue
import random
import struct
from ..transport import Transport
from jacdac.bus import Transport
HF2_CMD_INFO = 0x0002
HF2_CMD_DMESG = 0x0010

Просмотреть файл

@ -1,6 +1,6 @@
import threading
from websocket import WebSocketApp
from ..transport import Transport
from jacdac.bus import Transport
class WebSocketTransport(Transport):

Просмотреть файл

@ -1,9 +0,0 @@
from jacdac.bus import Bus, Server
from .constants import *
class UniqueBrainServer(Server):
# A unique brain server
def __init__(self, bus: Bus) -> None:
super().__init__(bus, JD_SERVICE_CLASS_UNIQUE_BRAIN)