|
| 1 | +# Introduction |
| 2 | + |
| 3 | +<!-- Provide a single sentence or a short paragraph describing the module's purpose. When using the documentation inside repository, add link to the README and vice versa - link the README to this documentation. --> |
| 4 | + |
| 5 | +This module serves as an example for module maintainers to implement their own modules outside reserved range of modules and does not serve any role in the production environment. For usage of this module, see the [README](../README.md). |
| 6 | + |
| 7 | +# Identification and supported devices |
| 8 | + |
| 9 | +<!-- Provide a list of supported devices and their identification. --> |
| 10 | + |
| 11 | +The module number/ID: `1000`. |
| 12 | + |
| 13 | +## Devices |
| 14 | + |
| 15 | +| **Device Name** | **Device Type** | **Device Roles** | Comment | |
| 16 | +| --------------- | --------------- | ---------------- | ------------------------------------------- | |
| 17 | +| button1 | 0 | test | Button driving a state of a dedicated LED | |
| 18 | +| button1 | 10 | test | Button driving a state of a dedicated LED | |
| 19 | +| button2 | 0 | test2 | Button driving a state of a dedicated LED | |
| 20 | + |
| 21 | + |
| 22 | +# Messages |
| 23 | + |
| 24 | +<!-- Describe all types of messages handled by the module (including status, status error and command). For each type, describe the message contents, structure and example of the message. --> |
| 25 | + |
| 26 | +## Status |
| 27 | + |
| 28 | +Each device (button) expects a status message containing a single key `pressed` with a boolean value indicating whether the button is pressed. |
| 29 | + |
| 30 | +### Example |
| 31 | + |
| 32 | +``` json |
| 33 | +{ |
| 34 | + "pressed": true |
| 35 | +} |
| 36 | +``` |
| 37 | +## Status Error |
| 38 | + |
| 39 | +Status errors are not defined for this module. |
| 40 | + |
| 41 | +## Command |
| 42 | + |
| 43 | +Each device (button) expects a command message containing a single key `lit_up` with a boolean value indicating whether the LED should be lit up. |
| 44 | + |
| 45 | +### Example |
| 46 | + |
| 47 | +``` json |
| 48 | +{ |
| 49 | + "lit_up": true |
| 50 | +} |
| 51 | +``` |
| 52 | + |
| 53 | +# Details of supported devices |
| 54 | + |
| 55 | +<!-- In this section, list all supported devices. Describe their purpose on the car and their behavior relevant to the application accessing the devices through the module. This includes mainly |
| 56 | +
|
| 57 | +- the device state machine, |
| 58 | +- how the status machine reflects the state machine's state, |
| 59 | +- how the state is affected by the received command. |
| 60 | +
|
| 61 | +--> |
| 62 | + |
| 63 | +## Button |
| 64 | + |
| 65 | +Button is a simple button device which has one LED attached to it. As status, it sends JSON with key `"pressed"` indicating whether button is pressed. As command, it expects JSON with key `"lit_up"` indicating the desired state of internal LED. |
| 66 | + |
| 67 | +See the state transition diagram below: |
| 68 | + |
| 69 | + |
0 commit comments