[{"name":"Common registers and commands","status":"experimental","shortId":"_system","camelName":"system","shortName":"system","extends":[],"notes":{"short":"This file describes common register and command codes.\n\nThese are defined in ranges separate from the per-service ones.\nNo service actually derives from this file, but services can include packets\ndefined here.\nTheir code is listed as say `@ intensity` and not `@ 0x01` (the spectool enforces that).","commands":"Command codes are subdivided as follows:\n\n-   Commands `0x000-0x07f` - common to all services\n-   Commands `0x080-0xeff` - defined per-service\n-   Commands `0xf00-0xfff` - reserved for implementation\n\nCommands follow.","registers":"Register codes are subdivided as follows:\n\n-   Registers `0x001-0x07f` - r/w common to all services\n-   Registers `0x080-0x0ff` - r/w defined per-service\n-   Registers `0x100-0x17f` - r/o common to all services\n-   Registers `0x180-0x1ff` - r/o defined per-service\n-   Registers `0x200-0xeff` - custom, defined per-service\n-   Registers `0xf00-0xfff` - reserved for implementation, should not be seen on the wire\n\nThe types listed are typical. Check spec for particular service for exact type,\nand a service-specific name for a register (eg. `value` could be `pulse_length`).\nAll registers default to `0` unless otherwise indicated.","events":"Events codes are 8-bit and are subdivided as follows:\n\n-   Events `0x00-0x7f` - common to all services\n-   Events `0x80-0xff` - defined per-service"},"classIdentifier":536870897,"enums":{"ReadingThreshold":{"name":"ReadingThreshold","storage":1,"members":{"Neutral":1,"Inactive":2,"Active":3}},"StatusCodes":{"name":"StatusCodes","storage":2,"members":{"Ready":0,"Initializing":1,"Calibrating":2,"Sleeping":3,"WaitingForInput":4,"CalibrationNeeded":100}}},"constants":{"announce_interval":{"value":500,"hex":false}},"packets":[{"kind":"command","name":"announce","identifier":0,"description":"Enumeration data for control service; service-specific advertisement data otherwise.\nControl broadcasts it automatically every `announce_interval`ms, but other service have to be queried to provide it.","fields":[],"hasReport":true},{"kind":"report","name":"announce","identifier":0,"description":"Enumeration data for control service; service-specific advertisement data otherwise.\nControl broadcasts it automatically every `announce_interval`ms, but other service have to be queried to provide it.","fields":[],"secondary":true},{"kind":"command","name":"get_register","identifier":4096,"description":"Registers number `N` is fetched by issuing command `0x1000 | N`.\nThe report format is the same as the format of the register.","fields":[],"hasReport":true},{"kind":"report","name":"get_register","identifier":4096,"description":"Registers number `N` is fetched by issuing command `0x1000 | N`.\nThe report format is the same as the format of the register.","fields":[],"secondary":true},{"kind":"command","name":"set_register","identifier":8192,"description":"Registers number `N` is set by issuing command `0x2000 | N`, with the format\nthe same as the format of the register.","fields":[]},{"kind":"command","name":"calibrate","identifier":2,"description":"Request to calibrate a sensor. The report indicates the calibration is done.","fields":[],"hasReport":true},{"kind":"report","name":"calibrate","identifier":2,"description":"Request to calibrate a sensor. The report indicates the calibration is done.","fields":[],"secondary":true},{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"packFormat":"u16 u16"},{"kind":"rw","name":"intensity","identifier":1,"description":"This is either binary on/off (0 or non-zero), or can be gradual (eg. brightness of an RGB LED strip).","fields":[{"name":"_","type":"u32","storage":4,"isSimpleType":true}],"packFormat":"u32"},{"kind":"rw","name":"value","identifier":2,"description":"The primary value of actuator (eg. servo pulse length, or motor duty cycle).","fields":[{"name":"_","type":"i32","storage":-4,"isSimpleType":true}],"packFormat":"i32"},{"kind":"const","name":"min_value","identifier":272,"description":"The lowest value that can be reported for the value register.","fields":[{"name":"_","type":"i32","storage":-4,"isSimpleType":true}],"packFormat":"i32"},{"kind":"const","name":"max_value","identifier":273,"description":"The highest value that can be reported for the value register.","fields":[{"name":"_","type":"i32","storage":-4,"isSimpleType":true}],"packFormat":"i32"},{"kind":"rw","name":"max_power","identifier":7,"description":"Limit the power drawn by the service, in mA.","fields":[{"name":"_","unit":"mA","type":"u16","storage":2,"isSimpleType":true,"defaultValue":500,"typicalMax":500,"typicalMin":0}],"packFormat":"u16"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"packFormat":"u8"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100}],"packFormat":"u32"},{"kind":"ro","name":"reading","identifier":257,"description":"Read-only value of the sensor, also reported in streaming.","fields":[{"name":"_","type":"i32","storage":-4,"isSimpleType":true}],"volatile":true,"packFormat":"i32"},{"kind":"rw","name":"reading_range","identifier":8,"description":"For sensors that support it, sets the range (sometimes also described `min`/`max_reading`).\nTypically only a small set of values is supported.\nSetting it to `X` will select the smallest possible range that is at least `X`,\nor if it doesn't exist, the largest supported range.","fields":[{"name":"_","type":"u32","storage":4,"isSimpleType":true}],"packFormat":"u32"},{"kind":"const","name":"supported_ranges","identifier":266,"description":"Lists the values supported as `reading_range`.","fields":[{"name":"range","type":"u32","storage":4,"isSimpleType":true,"startRepeats":true}],"packFormat":"r: u32"},{"kind":"const","name":"min_reading","identifier":260,"description":"The lowest value that can be reported by the sensor.","fields":[{"name":"_","type":"i32","storage":-4,"isSimpleType":true}],"packFormat":"i32"},{"kind":"const","name":"max_reading","identifier":261,"description":"The highest value that can be reported by the sensor.","fields":[{"name":"_","type":"i32","storage":-4,"isSimpleType":true}],"packFormat":"i32"},{"kind":"ro","name":"reading_error","identifier":262,"description":"The real value of whatever is measured is between `reading - reading_error` and `reading + reading_error`. It should be computed from the internal state of the sensor. This register is often, but not always `const`. If the register value is modified,\nsend a report in the same frame of the `reading` report.","fields":[{"name":"_","type":"u32","storage":4,"isSimpleType":true}],"volatile":true,"packFormat":"u32"},{"kind":"const","name":"reading_resolution","identifier":264,"description":"Smallest, yet distinguishable change in reading.","fields":[{"name":"_","type":"u32","storage":4,"isSimpleType":true}],"packFormat":"u32"},{"kind":"rw","name":"inactive_threshold","identifier":5,"description":"Threshold when reading data gets inactive and triggers a `inactive`.","fields":[{"name":"_","type":"i32","storage":-4,"isSimpleType":true}],"packFormat":"i32"},{"kind":"rw","name":"active_threshold","identifier":6,"description":"Thresholds when reading data gets active and triggers a `active` event.","fields":[{"name":"_","type":"i32","storage":-4,"isSimpleType":true}],"packFormat":"i32"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"packFormat":"u32"},{"kind":"const","name":"variant","identifier":263,"description":"The hardware variant of the service.\nFor services which support this, there's an enum defining the meaning.","fields":[{"name":"_","type":"u32","storage":4,"isSimpleType":true}],"packFormat":"u32"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"packFormat":"s"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. `code` is a standardized value from\nthe Jacdac status/error codes. `vendor_code` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet.","fields":[{"name":"code","type":"StatusCodes","storage":2},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"packFormat":"u16 u16"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"packFormat":"s"},{"kind":"event","name":"active","identifier":1,"description":"Notifies that the service has been activated (eg. button pressed, network connected, etc.)","fields":[]},{"kind":"event","name":"inactive","identifier":2,"description":"Notifies that the service has been dis-activated.","fields":[]},{"kind":"event","name":"change","identifier":3,"description":"Notifies that the some state of the service changed.","fields":[]},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"StatusCodes","storage":2},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"packFormat":"u16 u16"},{"kind":"event","name":"neutral","identifier":7,"description":"Notifies that the threshold is back between `low` and `high`.","fields":[]}],"tags":[]},{"name":"Base service","status":"stable","shortId":"_base","camelName":"base","shortName":"base","extends":[],"notes":{"short":"Base class for all services."},"classIdentifier":536870899,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16"}],"tags":[]},{"name":"Sensor","status":"stable","shortId":"_sensor","camelName":"sensor","shortName":"sensor","extends":["_base"],"notes":{"short":"Base class for sensors."},"classIdentifier":536870898,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32"}],"tags":[]},{"name":"Accelerometer","status":"stable","shortId":"accelerometer","camelName":"accelerometer","shortName":"accelerometer","extends":["_base","_sensor"],"notes":{"short":"A 3-axis accelerometer.","long":"## Orientation\n\nAn accelerometer module should translate acceleration values as follows:\n\n| Orientation           \t| X value (g) \t| Y value (g) \t| Z value (g) \t|\n|-----------------------\t|-------------\t|-------------\t|-------------\t|\n| Module lying flat     \t| 0           \t| 0           \t| -1          \t|\n| Module on left edge   \t| -1          \t| 0           \t| 0           \t|\n| Module on bottom edge \t| 0           \t| 1           \t| 0           \t|\n\nWe recommend an orientation marking on the PCB so that users can mount modules without having to experiment with the device. Left/bottom can be determined by assuming text on silk runs left-to-right.","events":"All events are debounced."},"classIdentifier":521405449,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"forces","identifier":257,"description":"Indicates the current forces acting on accelerometer.","fields":[{"name":"x","unit":"g","shift":20,"type":"i12.20","storage":-4},{"name":"y","unit":"g","shift":20,"type":"i12.20","storage":-4},{"name":"z","unit":"g","shift":20,"type":"i12.20","storage":-4}],"volatile":true,"identifierName":"reading","packFormat":"i12.20 i12.20 i12.20"},{"kind":"ro","name":"forces_error","identifier":262,"description":"Error on the reading value.","fields":[{"name":"_","unit":"g","shift":20,"type":"u12.20","storage":4}],"volatile":true,"optional":true,"identifierName":"reading_error","packFormat":"u12.20"},{"kind":"rw","name":"max_force","identifier":8,"description":"Configures the range forces detected.\nThe value will be \"rounded up\" to one of `max_forces_supported`.","fields":[{"name":"_","unit":"g","shift":20,"type":"u12.20","storage":4}],"optional":true,"identifierName":"reading_range","packFormat":"u12.20"},{"kind":"const","name":"max_forces_supported","identifier":266,"description":"Lists values supported for writing `max_force`.","fields":[{"name":"max_force","unit":"g","shift":20,"type":"u12.20","storage":4,"startRepeats":true}],"optional":true,"identifierName":"supported_ranges","packFormat":"r: u12.20"},{"kind":"event","name":"tilt_up","identifier":129,"description":"Emitted when accelerometer is tilted in the given direction.","fields":[]},{"kind":"event","name":"tilt_down","identifier":130,"description":"Emitted when accelerometer is tilted in the given direction.","fields":[]},{"kind":"event","name":"tilt_left","identifier":131,"description":"Emitted when accelerometer is tilted in the given direction.","fields":[]},{"kind":"event","name":"tilt_right","identifier":132,"description":"Emitted when accelerometer is tilted in the given direction.","fields":[]},{"kind":"event","name":"face_up","identifier":133,"description":"Emitted when accelerometer is laying flat in the given direction.","fields":[]},{"kind":"event","name":"face_down","identifier":134,"description":"Emitted when accelerometer is laying flat in the given direction.","fields":[]},{"kind":"event","name":"freefall","identifier":135,"description":"Emitted when total force acting on accelerometer is much less than 1g.","fields":[]},{"kind":"event","name":"shake","identifier":139,"description":"Emitted when forces change violently a few times.","fields":[]},{"kind":"event","name":"force_2g","identifier":140,"description":"Emitted when force in any direction exceeds given threshold.","fields":[]},{"kind":"event","name":"force_3g","identifier":136,"description":"Emitted when force in any direction exceeds given threshold.","fields":[]},{"kind":"event","name":"force_6g","identifier":137,"description":"Emitted when force in any direction exceeds given threshold.","fields":[]},{"kind":"event","name":"force_8g","identifier":138,"description":"Emitted when force in any direction exceeds given threshold.","fields":[]}],"tags":["C"],"group":"Movement"},{"name":"Acidity","status":"experimental","shortId":"acidity","camelName":"acidity","shortName":"acidity","extends":["_base","_sensor"],"notes":{"short":"A sensor measuring water acidity, commonly called pH."},"classIdentifier":513243333,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"acidity","identifier":257,"description":"The acidity, pH, of water.","fields":[{"name":"_","unit":"pH","shift":12,"type":"u4.12","storage":2,"absoluteMin":0,"absoluteMax":15,"typicalMin":2.5,"typicalMax":10.5}],"volatile":true,"identifierName":"reading","preferredInterval":5000,"packFormat":"u4.12"},{"kind":"ro","name":"acidity_error","identifier":262,"description":"Error on the acidity reading.","fields":[{"name":"_","unit":"pH","shift":12,"type":"u4.12","storage":2}],"volatile":true,"optional":true,"identifierName":"reading_error","packFormat":"u4.12"},{"kind":"const","name":"min_acidity","identifier":260,"description":"Lowest acidity that can be reported.","fields":[{"name":"_","unit":"pH","shift":12,"type":"u4.12","storage":2}],"optional":true,"identifierName":"min_reading","packFormat":"u4.12"},{"kind":"const","name":"max_humidity","identifier":261,"description":"Highest acidity that can be reported.","fields":[{"name":"_","unit":"pH","shift":12,"type":"u4.12","storage":2}],"optional":true,"identifierName":"max_reading","packFormat":"u4.12"}],"tags":["C","8bit"],"group":"Environment"},{"name":"Air Pressure","status":"rc","shortId":"airpressure","camelName":"airPressure","shortName":"airPressure","extends":["_base","_sensor"],"notes":{"short":"A sensor measuring air pressure of outside environment.","registers":"Default streaming interval is 1s."},"classIdentifier":504462570,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"pressure","identifier":257,"description":"The air pressure.","fields":[{"name":"_","unit":"hPa","shift":10,"type":"u22.10","storage":4,"typicalMin":150,"typicalMax":1150}],"volatile":true,"identifierName":"reading","preferredInterval":1000,"packFormat":"u22.10"},{"kind":"ro","name":"pressure_error","identifier":262,"description":"The real pressure is between `pressure - pressure_error` and `pressure + pressure_error`.","fields":[{"name":"_","unit":"hPa","shift":10,"type":"u22.10","storage":4}],"volatile":true,"optional":true,"identifierName":"reading_error","packFormat":"u22.10"},{"kind":"const","name":"min_pressure","identifier":260,"description":"Lowest air pressure that can be reported.","fields":[{"name":"_","unit":"hPa","shift":10,"type":"u22.10","storage":4}],"optional":true,"identifierName":"min_reading","packFormat":"u22.10"},{"kind":"const","name":"max_pressure","identifier":261,"description":"Highest air pressure that can be reported.","fields":[{"name":"_","unit":"hPa","shift":10,"type":"u22.10","storage":4}],"optional":true,"identifierName":"max_reading","packFormat":"u22.10"}],"tags":["8bit"],"group":"Environment"},{"name":"Air Quality Index","status":"experimental","shortId":"airqualityindex","camelName":"airQualityIndex","shortName":"airQualityIndex","extends":["_base","_sensor"],"notes":{"short":"The Air Quality Index is a measure of how clean or polluted air is. From min, good quality, to high, low quality.\nThe range of AQI may vary between countries (https://en.wikipedia.org/wiki/Air_quality_index)."},"classIdentifier":346844886,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"aqi_index","identifier":257,"description":"Air quality index, typically refreshed every second.","fields":[{"name":"_","unit":"AQI","shift":16,"type":"u16.16","storage":4,"typicalMax":500,"typicalMin":0}],"volatile":true,"identifierName":"reading","preferredInterval":60000,"packFormat":"u16.16"},{"kind":"ro","name":"aqi_index_error","identifier":262,"description":"Error on the AQI measure.","fields":[{"name":"_","unit":"AQI","shift":16,"type":"u16.16","storage":4}],"volatile":true,"optional":true,"identifierName":"reading_error","packFormat":"u16.16"},{"kind":"const","name":"min_aqi_index","identifier":260,"description":"Minimum AQI reading, representing a good air quality. Typically 0.","fields":[{"name":"_","unit":"AQI","shift":16,"type":"u16.16","storage":4}],"identifierName":"min_reading","packFormat":"u16.16"},{"kind":"const","name":"max_aqi_index","identifier":261,"description":"Maximum AQI reading, representing a very poor air quality.","fields":[{"name":"_","unit":"AQI","shift":16,"type":"u16.16","storage":4}],"identifierName":"max_reading","packFormat":"u16.16"}],"tags":[],"group":"Environment"},{"name":"Arcade Gamepad","status":"deprecated","shortId":"arcadegamepad","camelName":"arcadeGamepad","shortName":"arcadeGamepad","extends":["_base","_sensor"],"notes":{"short":"This service is deprecated in favor of `gamepad` (although it is currently used by the micro:bit Arcade smart shield).\nA gamepad with direction and action buttons for one player.\nIf a device has multiple controllers, it should have multiple gamepad services, using consecutive service identifiers."},"classIdentifier":501915758,"enums":{"Button":{"name":"Button","storage":1,"members":{"Left":1,"Up":2,"Right":3,"Down":4,"A":5,"B":6,"Menu":7,"Select":8,"Reset":9,"Exit":10}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"buttons","identifier":257,"description":"Indicates which buttons are currently active (pressed).\n`pressure` should be `0xff` for digital buttons, and proportional for analog ones.","fields":[{"name":"button","type":"Button","storage":1,"startRepeats":true},{"name":"pressure","unit":"/","shift":8,"type":"u0.8","storage":1}],"volatile":true,"identifierName":"reading","packFormat":"r: u8 u0.8"},{"kind":"const","name":"available_buttons","identifier":384,"description":"Indicates number of players supported and which buttons are present on the controller.","fields":[{"name":"button","type":"Button","storage":1,"startRepeats":true}],"packFormat":"r: u8"},{"kind":"event","name":"down","identifier":1,"description":"Emitted when button goes from inactive to active.","fields":[{"name":"button","type":"Button","storage":1}],"identifierName":"active","packFormat":"u8"},{"kind":"event","name":"up","identifier":2,"description":"Emitted when button goes from active to inactive.","fields":[{"name":"button","type":"Button","storage":1}],"identifierName":"inactive","packFormat":"u8"}],"tags":[],"group":"Button"},{"name":"Arcade Sound","status":"experimental","shortId":"arcadesound","camelName":"arcadeSound","shortName":"arcadeSound","extends":["_base"],"notes":{"short":"A sound playing device.\n\nThis is typically run over an SPI connection, not regular single-wire Jacdac."},"classIdentifier":533083654,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"command","name":"play","identifier":128,"description":"Play samples, which are single channel, signed 16-bit little endian values.","fields":[{"name":"samples","type":"bytes","storage":0,"isSimpleType":true}],"packFormat":"b"},{"kind":"rw","name":"sample_rate","identifier":128,"description":"Get or set playback sample rate (in samples per second).\nIf you set it, read it back, as the value may be rounded up or down.","fields":[{"name":"_","unit":"Hz","shift":10,"type":"u22.10","storage":4,"defaultValue":44100}],"packFormat":"u22.10"},{"kind":"const","name":"buffer_size","identifier":384,"description":"The size of the internal audio buffer.","fields":[{"name":"_","unit":"B","type":"u32","storage":4,"isSimpleType":true}],"packFormat":"u32"},{"kind":"ro","name":"buffer_pending","identifier":385,"description":"How much data is still left in the buffer to play.\nClients should not send more data than `buffer_size - buffer_pending`,\nbut can keep the `buffer_pending` as low as they want to ensure low latency\nof audio playback.","fields":[{"name":"_","unit":"B","type":"u32","storage":4,"isSimpleType":true}],"packFormat":"u32"}],"tags":["SPI"]},{"name":"Barcode reader","status":"experimental","shortId":"barcodereader","camelName":"barcodeReader","shortName":"barcodeReader","extends":["_base"],"notes":{"short":"A device that reads various barcodes, like QR codes. For the web, see [BarcodeDetector](https://developer.mozilla.org/en-US/docs/Web/API/BarcodeDetector)."},"classIdentifier":477339244,"enums":{"Format":{"name":"Format","storage":1,"members":{"Aztec":1,"Code128":2,"Code39":3,"Code93":4,"Codabar":5,"DataMatrix":6,"Ean13":8,"Ean8":9,"ITF":10,"Pdf417":11,"QrCode":12,"UpcA":13,"UpcE":14}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"enabled","identifier":1,"description":"Turns on or off the detection of barcodes.","fields":[{"name":"_","type":"bool","storage":1}],"identifierName":"intensity","packFormat":"u8"},{"kind":"const","name":"formats","identifier":384,"description":"Reports the list of supported barcode formats, as documented in https://developer.mozilla.org/en-US/docs/Web/API/Barcode_Detection_API.","fields":[{"name":"format","type":"Format","storage":1,"startRepeats":true}],"optional":true,"packFormat":"r: u8"},{"kind":"event","name":"detect","identifier":1,"description":"Raised when a bar code is detected and decoded. If the reader detects multiple codes, it will issue multiple events.\nIn case of numeric barcodes, the `data` field should contain the ASCII (which is the same as UTF8 in that case) representation of the number.","fields":[{"name":"format","type":"Format","storage":1},{"name":"data","type":"string","storage":0}],"identifierName":"active","packFormat":"u8 s"}],"tags":[]},{"name":"bit:radio","status":"stable","shortId":"bitradio","camelName":"bitRadio","shortName":"bitRadio","extends":["_base"],"notes":{"short":"Support for sending and receiving packets using the [Bit Radio protocol](https://github.com/microsoft/pxt-common-packages/blob/master/libs/radio/docs/reference/radio.md), typically used between micro:bit devices."},"classIdentifier":449414863,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"enabled","identifier":1,"description":"Turns on/off the radio antenna.","fields":[{"name":"_","type":"bool","storage":1}],"identifierName":"intensity","packFormat":"u8"},{"kind":"rw","name":"group","identifier":128,"description":"Group used to filter packets","fields":[{"name":"_","type":"u8","storage":1,"isSimpleType":true}],"packFormat":"u8"},{"kind":"rw","name":"transmission_power","identifier":129,"description":"Antenna power to increase or decrease range.","fields":[{"name":"_","type":"u8","storage":1,"isSimpleType":true,"defaultValue":6,"absoluteMin":1,"absoluteMax":7}],"packFormat":"u8"},{"kind":"rw","name":"frequency_band","identifier":130,"description":"Change the transmission and reception band of the radio to the given channel.","fields":[{"name":"_","type":"u8","storage":1,"isSimpleType":true,"defaultValue":7,"absoluteMax":83,"absoluteMin":0}],"packFormat":"u8"},{"kind":"command","name":"send_string","identifier":128,"description":"Sends a string payload as a radio message, maximum 18 characters.","fields":[{"name":"message","type":"string","storage":0}],"unique":true,"packFormat":"s"},{"kind":"command","name":"send_number","identifier":129,"description":"Sends a double precision number payload as a radio message","fields":[{"name":"value","isFloat":true,"type":"f64","storage":8}],"unique":true,"packFormat":"f64"},{"kind":"command","name":"send_value","identifier":130,"description":"Sends a double precision number and a name payload as a radio message","fields":[{"name":"value","isFloat":true,"type":"f64","storage":8},{"name":"name","type":"string","storage":0}],"unique":true,"packFormat":"f64 s"},{"kind":"command","name":"send_buffer","identifier":131,"description":"Sends a payload of bytes as a radio message","fields":[{"name":"data","type":"bytes","storage":0,"isSimpleType":true}],"unique":true,"packFormat":"b"},{"kind":"report","name":"string_received","identifier":144,"description":"Raised when a string packet is received","fields":[{"name":"time","unit":"ms","type":"u32","storage":4,"isSimpleType":true},{"name":"device_serial_number","type":"u32","storage":4,"isSimpleType":true},{"name":"rssi","unit":"dB","type":"i8","storage":-1,"isSimpleType":true},{"name":"padding","type":"u8[1]","storage":1},{"name":"message","type":"string","storage":0}],"packFormat":"u32 u32 i8 b[1] s"},{"kind":"report","name":"number_received","identifier":145,"description":"Raised when a number packet is received","fields":[{"name":"time","unit":"ms","type":"u32","storage":4,"isSimpleType":true},{"name":"device_serial_number","type":"u32","storage":4,"isSimpleType":true},{"name":"rssi","unit":"dB","type":"i8","storage":-1,"isSimpleType":true},{"name":"padding","type":"u8[3]","storage":3},{"name":"value","isFloat":true,"type":"f64","storage":8},{"name":"name","type":"string","storage":0}],"packed":true,"packFormat":"u32 u32 i8 b[3] f64 s"},{"kind":"report","name":"buffer_received","identifier":146,"description":"Raised when a buffer packet is received","fields":[{"name":"time","unit":"ms","type":"u32","storage":4,"isSimpleType":true},{"name":"device_serial_number","type":"u32","storage":4,"isSimpleType":true},{"name":"rssi","unit":"dB","type":"i8","storage":-1,"isSimpleType":true},{"name":"padding","type":"u8[1]","storage":1},{"name":"data","type":"bytes","storage":0,"isSimpleType":true}],"packFormat":"u32 u32 i8 b[1] b"}],"tags":[]},{"name":"Bootloader","status":"stable","shortId":"bootloader","camelName":"bootloader","shortName":"bootloader","extends":["_base"],"notes":{"short":"Allows flashing (reprogramming) devices over Jacdac.\n\nThis is typically implemented by having a separate _bootloader_ mode, as opposed to _application_ mode\non the module to be flashed.\nThe bootloader mode is entered on every device reset, for about 300ms.\nThe bootloader will generally not announce itself, until it gets some command.\nOnce it gets the command, it will stay in application mode.\n\nTypically, you ask the module (in application mode) to reset, while sending broadcast\n`info` commands to all bootloaders every 100ms or so.\nAlternatively, you ask the the user to disconnect and re-connect the module, while\nbroadcasting `info` commands.\nThe second method works even if the application is damaged (eg., due to an aborted flash).\n\nWhen device is in bootloader mode, the device ID may change compared to application mode,\nby flipping the first bit in the first byte of the device identifier."},"classIdentifier":536516936,"enums":{"Error":{"name":"Error","storage":4,"members":{"NoError":0,"PacketTooSmall":1,"OutOfFlashableRange":2,"InvalidPageOffset":3,"NotPageAligned":4}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"command","name":"info","identifier":0,"description":"The `service_class` is always `0x1ffa9948`. The `product_identifier` identifies the kind of firmware\nthat \"fits\" this device.","fields":[],"identifierName":"announce","hasReport":true},{"kind":"report","name":"info","identifier":0,"description":"The `service_class` is always `0x1ffa9948`. The `product_identifier` identifies the kind of firmware\nthat \"fits\" this device.","fields":[{"name":"service_class","type":"u32","storage":4,"isSimpleType":true},{"name":"page_size","unit":"B","type":"u32","storage":4,"isSimpleType":true},{"name":"flashable_size","unit":"B","type":"u32","storage":4,"isSimpleType":true},{"name":"product_identifier","type":"u32","storage":4,"isSimpleType":true}],"secondary":true,"packFormat":"u32 u32 u32 u32"},{"kind":"command","name":"set_session","identifier":129,"description":"The flashing server should generate a random id, and use this command to set it.","fields":[{"name":"session_id","type":"u32","storage":4,"isSimpleType":true}],"hasReport":true,"packFormat":"u32"},{"kind":"report","name":"set_session","identifier":129,"description":"The flashing server should generate a random id, and use this command to set it.","fields":[{"name":"session_id","type":"u32","storage":4,"isSimpleType":true}],"secondary":true,"packFormat":"u32"},{"kind":"command","name":"page_data","identifier":128,"description":"Use to send flashing data. A physical page is split into `chunk_max + 1` chunks, where `chunk_no = 0 ... chunk_max`.\nEach chunk is stored at `page_address + page_offset`. `page_address` has to be equal in all chunks,\nand is included in response.\nOnly the last chunk causes writing to flash and elicits response.\n\nErrors not listed are also possible. Errors larger than `0xffff` indicate de-synchronization on chunk numbers.\n\nWhile this command is technically `unique`, the bootloader client will retry failed pages.\nBootloaders typically will not support reliable commands delivered over pipes.","fields":[{"name":"page_address","type":"u32","storage":4,"isSimpleType":true},{"name":"page_offset","type":"u16","storage":2,"isSimpleType":true},{"name":"chunk_no","type":"u8","storage":1,"isSimpleType":true},{"name":"chunk_max","type":"u8","storage":1,"isSimpleType":true},{"name":"session_id","type":"u32","storage":4,"isSimpleType":true},{"name":"reserved0","type":"u32","storage":4,"isSimpleType":true},{"name":"reserved1","type":"u32","storage":4,"isSimpleType":true},{"name":"reserved2","type":"u32","storage":4,"isSimpleType":true},{"name":"reserved3","type":"u32","storage":4,"isSimpleType":true},{"name":"page_data","type":"bytes","storage":208,"isSimpleType":true,"maxBytes":208}],"unique":true,"hasReport":true,"packFormat":"u32 u16 u8 u8 u32 u32 u32 u32 u32 b[208]"},{"kind":"report","name":"page_data","identifier":128,"description":"Use to send flashing data. A physical page is split into `chunk_max + 1` chunks, where `chunk_no = 0 ... chunk_max`.\nEach chunk is stored at `page_address + page_offset`. `page_address` has to be equal in all chunks,\nand is included in response.\nOnly the last chunk causes writing to flash and elicits response.\n\nErrors not listed are also possible. Errors larger than `0xffff` indicate de-synchronization on chunk numbers.\n\nWhile this command is technically `unique`, the bootloader client will retry failed pages.\nBootloaders typically will not support reliable commands delivered over pipes.","fields":[{"name":"session_id","type":"u32","storage":4,"isSimpleType":true},{"name":"page_error","type":"Error","storage":4},{"name":"page_address","type":"u32","storage":4,"isSimpleType":true}],"secondary":true,"packFormat":"u32 u32 u32"}],"tags":["C","management"]},{"name":"Braille display","status":"stable","shortId":"brailledisplay","camelName":"brailleDisplay","shortName":"brailleDisplay","extends":["_base"],"notes":{"short":"A Braille pattern display module. This module display [unicode braille patterns](https://www.unicode.org/charts/PDF/U2800.pdf), country specific encoding have to be implemented by the clients."},"classIdentifier":331331532,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"enabled","identifier":1,"description":"Determines if the braille display is active.","fields":[{"name":"_","type":"bool","storage":1}],"identifierName":"intensity","packFormat":"u8"},{"kind":"rw","name":"patterns","identifier":2,"description":"Braille patterns to show. Must be unicode characters between `0x2800` and `0x28ff`.","fields":[{"name":"_","type":"string","storage":0}],"lowLevel":true,"identifierName":"value","packFormat":"s"},{"kind":"const","name":"length","identifier":385,"description":"Gets the number of patterns that can be displayed.","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"packFormat":"u8"}],"tags":[],"group":"Display"},{"name":"Bridge","status":"rc","shortId":"bridge","camelName":"bridge","shortName":"bridge","extends":["_base"],"notes":{"short":"Indicates that the device acts as a bridge to the Jacdac bus."},"classIdentifier":535147631,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"enabled","identifier":1,"description":"Enables or disables the bridge.","fields":[{"name":"_","type":"bool","storage":1}],"identifierName":"intensity","packFormat":"u8"}],"tags":["infrastructure"]},{"name":"Button","status":"stable","shortId":"button","camelName":"button","shortName":"button","extends":["_base","_sensor"],"notes":{"short":"A push-button, which returns to inactive position when not operated anymore."},"classIdentifier":343122531,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"pressure","identifier":257,"description":"Indicates the pressure state of the button, where `0` is open.","fields":[{"name":"_","unit":"/","shift":16,"type":"u0.16","storage":2}],"volatile":true,"identifierName":"reading","packFormat":"u0.16"},{"kind":"const","name":"analog","identifier":384,"description":"Indicates if the button provides analog `pressure` readings.","fields":[{"name":"_","type":"bool","storage":1}],"optional":true,"packFormat":"u8"},{"kind":"ro","name":"pressed","identifier":385,"description":"Determines if the button is pressed currently.\n\nIf the event `down` or `hold` is observed, `pressed` becomes true; if `up` is observed, `pressed` becomes false.\nThe client should initialize `pressed` to false.","fields":[{"name":"_","type":"bool","storage":1}],"client":true,"volatile":true,"packFormat":"u8"},{"kind":"event","name":"down","identifier":1,"description":"Emitted when button goes from inactive to active.","fields":[],"identifierName":"active"},{"kind":"event","name":"up","identifier":2,"description":"Emitted when button goes from active to inactive. The 'time' parameter\nrecords the amount of time between the down and up events.","fields":[{"name":"time","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"identifierName":"inactive","packFormat":"u32"},{"kind":"event","name":"hold","identifier":129,"description":"Emitted when the press time is greater than 500ms, and then at least every 500ms\nas long as the button remains pressed. The 'time' parameter records the the amount of time\nthat the button has been held (since the down event).","fields":[{"name":"time","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"packFormat":"u32"}],"tags":["C","8bit","padauk","input"],"group":"Button"},{"name":"Buzzer","status":"rc","shortId":"buzzer","camelName":"buzzer","shortName":"buzzer","extends":["_base"],"notes":{"short":"A simple buzzer."},"classIdentifier":458731991,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"volume","identifier":1,"description":"The volume (duty cycle) of the buzzer.","fields":[{"name":"_","unit":"/","shift":8,"type":"u0.8","storage":1,"defaultValue":1}],"identifierName":"intensity","packFormat":"u0.8"},{"kind":"command","name":"play_tone","identifier":128,"description":"Play a PWM tone with given period and duty for given duration.\nThe duty is scaled down with `volume` register.\nTo play tone at frequency `F` Hz and volume `V` (in `0..1`) you will want\nto send `P = 1000000 / F` and `D = P * V / 2`.","fields":[{"name":"period","unit":"us","type":"u16","storage":2,"isSimpleType":true},{"name":"duty","unit":"us","type":"u16","storage":2,"isSimpleType":true},{"name":"duration","unit":"ms","type":"u16","storage":2,"isSimpleType":true}],"lowLevel":true,"packFormat":"u16 u16 u16"},{"kind":"command","name":"play_note","identifier":129,"description":"Play a note at the given frequency and volume.","fields":[{"name":"frequency","unit":"AudHz","type":"u16","storage":2,"isSimpleType":true},{"name":"volume","unit":"/","shift":16,"type":"u0.16","storage":2},{"name":"duration","unit":"ms","type":"u16","storage":2,"isSimpleType":true}],"client":true,"packFormat":"u16 u0.16 u16"}],"tags":["C","8bit"],"group":"Sound"},{"name":"Capacitive Button","status":"rc","shortId":"capacitivebutton","camelName":"capacitiveButton","shortName":"capacitiveButton","extends":["_base"],"notes":{"short":"A configuration service for a capacitive push-button."},"classIdentifier":677752265,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"threshold","identifier":6,"description":"Indicates the threshold for ``up`` events.","fields":[{"name":"_","unit":"/","shift":16,"type":"u0.16","storage":2}],"identifierName":"active_threshold","packFormat":"u0.16"},{"kind":"command","name":"calibrate","identifier":2,"description":"Request to calibrate the capactive. When calibration is requested, the device expects that no object is touching the button. \nThe report indicates the calibration is done.","fields":[],"identifierName":"calibrate","hasReport":true},{"kind":"report","name":"calibrate","identifier":2,"description":"Request to calibrate the capactive. When calibration is requested, the device expects that no object is touching the button. \nThe report indicates the calibration is done.","fields":[],"secondary":true}],"tags":["8bit"],"group":"Button"},{"name":"Character Screen","status":"rc","shortId":"characterscreen","camelName":"characterScreen","shortName":"characterScreen","extends":["_base"],"notes":{"short":"A screen that displays characters, typically a LCD/OLED character screen."},"classIdentifier":523748714,"enums":{"Variant":{"name":"Variant","storage":1,"members":{"LCD":1,"OLED":2,"Braille":3}},"TextDirection":{"name":"TextDirection","storage":1,"members":{"LeftToRight":1,"RightToLeft":2}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"message","identifier":2,"description":"Text to show. Use `\\n` to break lines.","fields":[{"name":"_","type":"string","storage":0}],"identifierName":"value","packFormat":"s"},{"kind":"rw","name":"brightness","identifier":1,"description":"Brightness of the screen. `0` means off.","fields":[{"name":"_","unit":"/","shift":16,"type":"u0.16","storage":2}],"optional":true,"identifierName":"intensity","packFormat":"u0.16"},{"kind":"const","name":"variant","identifier":263,"description":"Describes the type of character LED screen.","fields":[{"name":"_","type":"Variant","storage":1}],"optional":true,"identifierName":"variant","packFormat":"u8"},{"kind":"rw","name":"text_direction","identifier":130,"description":"Specifies the RTL or LTR direction of the text.","fields":[{"name":"_","type":"TextDirection","storage":1}],"optional":true,"packFormat":"u8"},{"kind":"const","name":"rows","identifier":384,"description":"Gets the number of rows.","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"packFormat":"u8"},{"kind":"const","name":"columns","identifier":385,"description":"Gets the number of columns.","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"packFormat":"u8"}],"tags":[],"group":"Display"},{"name":"Cloud Adapter","status":"experimental","shortId":"cloudadapter","camelName":"cloudAdapter","shortName":"cloudAdapter","extends":["_base"],"notes":{"short":"Supports cloud connections to upload and download data.\nNote that `f64` values following a label are not necessarily aligned."},"classIdentifier":341864092,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"command","name":"upload_json","identifier":128,"description":"Upload a JSON-encoded message to the cloud.","fields":[{"name":"topic","type":"string0","storage":0},{"name":"json","type":"string","storage":0}],"packFormat":"z s"},{"kind":"command","name":"upload_binary","identifier":129,"description":"Upload a binary message to the cloud.","fields":[{"name":"topic","type":"string0","storage":0},{"name":"payload","type":"bytes","storage":0,"isSimpleType":true}],"packFormat":"z b"},{"kind":"ro","name":"connected","identifier":384,"description":"Indicate whether we're currently connected to the cloud server.\nWhen offline, `upload` commands are queued.","fields":[{"name":"_","type":"bool","storage":1}],"packFormat":"u8"},{"kind":"ro","name":"connection_name","identifier":385,"description":"User-friendly name of the connection, typically includes name of the server\nand/or type of cloud service (`\"something.cloud.net (Provider IoT)\"`).","fields":[{"name":"_","type":"string","storage":0}],"packFormat":"s"},{"kind":"event","name":"on_json","identifier":128,"description":"Emitted when cloud send us a JSON message.","fields":[{"name":"topic","type":"string0","storage":0},{"name":"json","type":"string","storage":0}],"packFormat":"z s"},{"kind":"event","name":"on_binary","identifier":129,"description":"Emitted when cloud send us a binary message.","fields":[{"name":"topic","type":"string0","storage":0},{"name":"payload","type":"bytes","storage":0,"isSimpleType":true}],"packFormat":"z b"},{"kind":"event","name":"change","identifier":3,"description":"Emitted when we connect or disconnect from the cloud.","fields":[],"identifierName":"change"}],"tags":["infrastructure","devicescript"],"group":"Iot","restricted":true},{"name":"Cloud Configuration","status":"rc","shortId":"cloudconfiguration","camelName":"cloudConfiguration","shortName":"cloudConfiguration","extends":["_base"],"notes":{"short":"Connection and diagnostics information about the cloud connection."},"classIdentifier":342028028,"enums":{"ConnectionStatus":{"name":"ConnectionStatus","storage":2,"members":{"Connected":1,"Disconnected":2,"Connecting":3,"Disconnecting":4}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"ro","name":"server_name","identifier":384,"description":"Something like `my-iot-hub.azure-devices.net` if available.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"packFormat":"s"},{"kind":"ro","name":"cloud_device_id","identifier":385,"description":"Device identifier for the device in the cloud if available.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"packFormat":"s"},{"kind":"const","name":"cloud_type","identifier":387,"description":"Cloud provider identifier.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"packFormat":"s"},{"kind":"ro","name":"connection_status","identifier":386,"description":"Indicates the status of connection. A message beyond the [0..3] range represents an HTTP error code.","fields":[{"name":"_","type":"ConnectionStatus","storage":2}],"packFormat":"u16"},{"kind":"rw","name":"push_period","identifier":128,"description":"How often to push data to the cloud.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":5000}],"packFormat":"u32"},{"kind":"rw","name":"push_watchdog_period","identifier":129,"description":"If no message is published within given period, the device resets.\nThis can be due to connectivity problems or due to the device having nothing to publish.\nForced to be at least `2 * flush_period`.\nSet to `0` to disable (default).","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"packFormat":"u32"},{"kind":"command","name":"connect","identifier":129,"description":"Starts a connection to the cloud service","fields":[],"restricted":true},{"kind":"command","name":"disconnect","identifier":130,"description":"Starts disconnecting from the cloud service","fields":[],"restricted":true},{"kind":"command","name":"set_connection_string","identifier":134,"description":"Restricted command to override the existing connection string to cloud.","fields":[{"name":"connection_string","type":"string","storage":0}],"restricted":true,"packFormat":"s"},{"kind":"event","name":"connection_status_change","identifier":3,"description":"Raised when the connection status changes","fields":[{"name":"connection_status","type":"ConnectionStatus","storage":2}],"identifierName":"change","packFormat":"u16"},{"kind":"event","name":"message_sent","identifier":128,"description":"Raised when a message has been sent to the hub.","fields":[]}],"tags":["management"],"group":"Iot"},{"name":"CODAL Message Bus","status":"experimental","shortId":"codalmessagebus","camelName":"codalMessageBus","shortName":"codalMessageBus","extends":["_base"],"notes":{"short":"A service that uses the [CODAL message bus](https://lancaster-university.github.io/microbit-docs/ubit/messageBus/) to send and receive small messages.\n\nYou can find known values for `source` in [CODAL repository](https://github.com/lancaster-university/codal-core/blob/master/inc/core/CodalComponent.h)\nIn MakeCode, you can listen for custom `source`, `value` values using [control.onEvent](https://makecode.microbit.org/reference/control/on-event]."},"classIdentifier":304085021,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"command","name":"send","identifier":128,"description":"Send a message on the CODAL bus. If `source` is `0`, it is treated as wildcard.","fields":[{"name":"source","type":"u16","storage":2,"isSimpleType":true},{"name":"value","type":"u16","storage":2,"isSimpleType":true}],"unique":true,"packFormat":"u16 u16"},{"kind":"event","name":"message","identifier":128,"description":"Raised by the server is triggered by the server. The filtering logic of which event to send over Jacdac is up to the server implementation.","fields":[{"name":"source","type":"u16","storage":2,"isSimpleType":true},{"name":"value","type":"u16","storage":2,"isSimpleType":true}],"packFormat":"u16 u16"}],"tags":[]},{"name":"Color","status":"experimental","shortId":"color","camelName":"color","shortName":"color","extends":["_base","_sensor"],"notes":{"short":"Senses RGB colors"},"classIdentifier":372299111,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"color","identifier":257,"description":"Detected color in the RGB color space.","fields":[{"name":"red","unit":"/","shift":16,"type":"u0.16","storage":2},{"name":"green","unit":"/","shift":16,"type":"u0.16","storage":2},{"name":"blue","unit":"/","shift":16,"type":"u0.16","storage":2}],"volatile":true,"identifierName":"reading","packFormat":"u0.16 u0.16 u0.16"}],"tags":["8bit"],"group":"Environment"},{"name":"Compass","status":"rc","shortId":"compass","camelName":"compass","shortName":"compass","extends":["_base","_sensor"],"notes":{"short":"A sensor that measures the heading."},"classIdentifier":364362175,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"heading","identifier":257,"description":"The heading with respect to the magnetic north.","fields":[{"name":"_","unit":"°","shift":16,"type":"u16.16","storage":4,"absoluteMin":0,"absoluteMax":359}],"volatile":true,"identifierName":"reading","preferredInterval":1000,"packFormat":"u16.16"},{"kind":"rw","name":"enabled","identifier":1,"description":"Turn on or off the sensor. Turning on the sensor may start a calibration sequence.","fields":[{"name":"_","type":"bool","storage":1}],"identifierName":"intensity","packFormat":"u8"},{"kind":"ro","name":"heading_error","identifier":262,"description":"Error on the heading reading","fields":[{"name":"_","unit":"°","shift":16,"type":"u16.16","storage":4}],"volatile":true,"optional":true,"identifierName":"reading_error","packFormat":"u16.16"},{"kind":"command","name":"calibrate","identifier":2,"description":"Starts a calibration sequence for the compass.","fields":[],"identifierName":"calibrate"}],"tags":[]},{"name":"Control","status":"stable","shortId":"control","camelName":"control","shortName":"control","extends":["_base"],"notes":{"short":"Control service is always service index `0`.\nIt handles actions common to all services on a device.\n\nNote: some of the optional features (including `flood_ping`, `mcu_temperature`, and all string registers)\nare not implemented in `8bit` version."},"classIdentifier":0,"enums":{"AnnounceFlags":{"name":"AnnounceFlags","storage":2,"isFlags":true,"members":{"RestartCounterSteady":15,"RestartCounter1":1,"RestartCounter2":2,"RestartCounter4":4,"RestartCounter8":8,"StatusLightNone":0,"StatusLightMono":16,"StatusLightRgbNoFade":32,"StatusLightRgbFade":48,"SupportsACK":256,"SupportsBroadcast":512,"SupportsFrames":1024,"IsClient":2048,"SupportsReliableCommands":4096}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"command","name":"services","identifier":0,"description":"The `restart_counter` is computed from the `flags & RestartCounterSteady`, starts at `0x1` and increments by one until it reaches `0xf`, then it stays at `0xf`.\nIf this number ever goes down, it indicates that the device restarted.\n`service_class` indicates class identifier for each service index (service index `0` is always control, so it's\nskipped in this enumeration).\n`packet_count` indicates the number of reports sent by the current device since last announce,\nincluding the current announce packet (it is always 0 if this feature is not supported).\nThe command form can be used to induce report, which is otherwise broadcast every 500ms.","fields":[],"identifierName":"announce","hasReport":true},{"kind":"report","name":"services","identifier":0,"description":"The `restart_counter` is computed from the `flags & RestartCounterSteady`, starts at `0x1` and increments by one until it reaches `0xf`, then it stays at `0xf`.\nIf this number ever goes down, it indicates that the device restarted.\n`service_class` indicates class identifier for each service index (service index `0` is always control, so it's\nskipped in this enumeration).\n`packet_count` indicates the number of reports sent by the current device since last announce,\nincluding the current announce packet (it is always 0 if this feature is not supported).\nThe command form can be used to induce report, which is otherwise broadcast every 500ms.","fields":[{"name":"flags","type":"AnnounceFlags","storage":2},{"name":"packet_count","type":"u8","storage":1,"isSimpleType":true},{"name":"reserved","type":"u8","storage":1,"isSimpleType":true},{"name":"service_class","type":"u32","storage":4,"isSimpleType":true,"startRepeats":true}],"secondary":true,"packFormat":"u16 u8 u8 r: u32"},{"kind":"command","name":"noop","identifier":128,"description":"Do nothing. Always ignored. Can be used to test ACKs.","fields":[]},{"kind":"command","name":"identify","identifier":129,"description":"Blink the status LED (262ms on, 262ms off, four times, with the blue LED) or otherwise draw user's attention to device with no status light.\nFor devices with status light (this can be discovered in the announce flags), the client should\nsend the sequence of status light command to generate the identify animation.","fields":[],"optional":true},{"kind":"command","name":"reset","identifier":130,"description":"Reset device. ACK may or may not be sent.","fields":[],"optional":true},{"kind":"command","name":"flood_ping","identifier":131,"description":"The device will respond `num_responses` times, as fast as it can, setting the `counter` field in the report\nto `start_counter`, then `start_counter + 1`, ..., and finally `start_counter + num_responses - 1`.\nThe `dummy_payload` is `size` bytes long and contains bytes `0, 1, 2, ...`.","fields":[{"name":"num_responses","type":"u32","storage":4,"isSimpleType":true},{"name":"start_counter","type":"u32","storage":4,"isSimpleType":true},{"name":"size","unit":"B","type":"u8","storage":1,"isSimpleType":true}],"unique":true,"optional":true,"hasReport":true,"packFormat":"u32 u32 u8"},{"kind":"report","name":"flood_ping","identifier":131,"description":"The device will respond `num_responses` times, as fast as it can, setting the `counter` field in the report\nto `start_counter`, then `start_counter + 1`, ..., and finally `start_counter + num_responses - 1`.\nThe `dummy_payload` is `size` bytes long and contains bytes `0, 1, 2, ...`.","fields":[{"name":"counter","type":"u32","storage":4,"isSimpleType":true},{"name":"dummy_payload","type":"bytes","storage":0,"isSimpleType":true}],"secondary":true,"packFormat":"u32 b"},{"kind":"command","name":"set_status_light","identifier":132,"description":"Initiates a color transition of the status light from its current color to the one specified.\nThe transition will complete in about `512 / speed` frames\n(each frame is currently 100ms, so speed of `51` is about 1 second and `26` 0.5 second).\nAs a special case, if speed is `0` the transition is immediate.\nIf MCU is not capable of executing transitions, it can consider `speed` to be always `0`.\nIf a monochrome LEDs is fitted, the average value of `red`, `green`, `blue` is used.\nIf intensity of a monochrome LED cannot be controlled, any value larger than `0` should be considered\non, and `0` (for all three channels) should be considered off.","fields":[{"name":"to_red","type":"u8","storage":1,"isSimpleType":true},{"name":"to_green","type":"u8","storage":1,"isSimpleType":true},{"name":"to_blue","type":"u8","storage":1,"isSimpleType":true},{"name":"speed","type":"u8","storage":1,"isSimpleType":true}],"packFormat":"u8 u8 u8 u8"},{"kind":"command","name":"proxy","identifier":133,"description":"Force client device into proxy mode.","fields":[],"optional":true},{"kind":"command","name":"reliable_commands","identifier":134,"description":"This opens a pipe to the device to provide an alternative, reliable transport of actions\n(and possibly other commands).\nThe commands are wrapped as pipe data packets.\nMultiple invocations of this command with the same `seed` are dropped\n(and thus the command is not `unique`); otherwise `seed` carries no meaning\nand should be set to a random value by the client.\nNote that while the commands sends this way are delivered exactly once, the\nresponses might get lost.","fields":[{"name":"seed","type":"u32","storage":4,"isSimpleType":true}],"optional":true,"hasReport":true,"packFormat":"u32"},{"kind":"report","name":"reliable_commands","identifier":134,"description":"This opens a pipe to the device to provide an alternative, reliable transport of actions\n(and possibly other commands).\nThe commands are wrapped as pipe data packets.\nMultiple invocations of this command with the same `seed` are dropped\n(and thus the command is not `unique`); otherwise `seed` carries no meaning\nand should be set to a random value by the client.\nNote that while the commands sends this way are delivered exactly once, the\nresponses might get lost.","fields":[{"name":"commands","type":"pipe","storage":12}],"secondary":true,"pipeType":"reliable_commands","packFormat":"b[12]"},{"kind":"pipe_command","name":"wrapped_command","identifier":0,"description":"This opens a pipe to the device to provide an alternative, reliable transport of actions\n(and possibly other commands).\nThe commands are wrapped as pipe data packets.\nMultiple invocations of this command with the same `seed` are dropped\n(and thus the command is not `unique`); otherwise `seed` carries no meaning\nand should be set to a random value by the client.\nNote that while the commands sends this way are delivered exactly once, the\nresponses might get lost.","fields":[{"name":"service_size","type":"u8","storage":1,"isSimpleType":true},{"name":"service_index","type":"u8","storage":1,"isSimpleType":true},{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"payload","type":"bytes","storage":0,"isSimpleType":true}],"pipeType":"reliable_commands","packFormat":"u8 u8 u16 b"},{"kind":"command","name":"standby","identifier":135,"description":"Attempt to put devices into lowest power sleep mode for a specified time - most likely involving a full reset on wake-up.","fields":[{"name":"duration","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"optional":true,"packFormat":"u32"},{"kind":"rw","name":"reset_in","identifier":128,"description":"When set to value other than `0`, it asks the device to reset after specified number of microseconds.\nThis is typically used to implement watchdog functionality, where a brain device sets `reset_in` to\nsay 1.6s every 0.5s.","fields":[{"name":"_","unit":"us","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"packFormat":"u32"},{"kind":"const","name":"device_description","identifier":384,"description":"Identifies the type of hardware (eg., ACME Corp. Servo X-42 Rev C)","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"packFormat":"s"},{"kind":"const","name":"product_identifier","identifier":385,"description":"A numeric code for the string above; used to identify firmware images and devices.","fields":[{"name":"_","type":"u32","storage":4,"isSimpleType":true,"absoluteMin":805306368,"absoluteMax":1073741823}],"optional":true,"packFormat":"u32"},{"kind":"const","name":"bootloader_product_identifier","identifier":388,"description":"Typically the same as `product_identifier` unless device was flashed by hand; the bootloader will respond to that code.","fields":[{"name":"_","type":"u32","storage":4,"isSimpleType":true,"absoluteMin":805306368,"absoluteMax":1073741823}],"optional":true,"packFormat":"u32"},{"kind":"const","name":"firmware_version","identifier":389,"description":"A string describing firmware version; typically semver.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"packFormat":"s"},{"kind":"ro","name":"mcu_temperature","identifier":386,"description":"MCU temperature in degrees Celsius (approximate).","fields":[{"name":"_","unit":"°C","type":"i16","storage":-2,"isSimpleType":true,"typicalMin":-10,"typicalMax":150}],"volatile":true,"optional":true,"preferredInterval":60000,"packFormat":"i16"},{"kind":"ro","name":"uptime","identifier":390,"description":"Number of microseconds since boot.","fields":[{"name":"_","unit":"us","type":"u64","storage":8,"isSimpleType":true}],"volatile":true,"optional":true,"preferredInterval":60000,"packFormat":"u64"}],"tags":["C","8bit"]},{"name":"Dashboard","status":"stable","shortId":"dashboard","camelName":"dashboard","shortName":"dashboard","extends":["_base"],"notes":{"short":"Device that interacts, configure or inspects with the services on the bus. While a dashboard is on the bus, heuristics like device reset should be disabled."},"classIdentifier":468029703,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"}],"tags":["infrastructure"]},{"name":"DC Current Measurement","status":"experimental","shortId":"dccurrentmeasurement","camelName":"dcCurrentMeasurement","shortName":"dcCurrentMeasurement","extends":["_base","_sensor"],"notes":{"short":"A service that reports a current measurement."},"classIdentifier":420661422,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"measurement_name","identifier":386,"description":"A string containing the net name that is being measured e.g. `POWER_DUT` or a reference e.g. `DIFF_DEV1_DEV2`. These constants can be used to identify a measurement from client code.","fields":[{"name":"_","type":"string","storage":0}],"packFormat":"s"},{"kind":"ro","name":"measurement","identifier":257,"description":"The current measurement.","fields":[{"name":"_","unit":"A","isFloat":true,"type":"f64","storage":8}],"volatile":true,"identifierName":"reading","packFormat":"f64"},{"kind":"ro","name":"measurement_error","identifier":262,"description":"Absolute error on the reading value.","fields":[{"name":"_","unit":"A","isFloat":true,"type":"f64","storage":8}],"volatile":true,"optional":true,"identifierName":"reading_error","packFormat":"f64"},{"kind":"const","name":"min_measurement","identifier":260,"description":"Minimum measurable current","fields":[{"name":"_","unit":"A","isFloat":true,"type":"f64","storage":8}],"optional":true,"identifierName":"min_reading","packFormat":"f64"},{"kind":"const","name":"max_measurement","identifier":261,"description":"Maximum measurable current","fields":[{"name":"_","unit":"A","isFloat":true,"type":"f64","storage":8}],"optional":true,"identifierName":"max_reading","packFormat":"f64"}],"tags":[]},{"name":"DC Voltage Measurement","status":"experimental","shortId":"dcvoltagemeasurement","camelName":"dcVoltageMeasurement","shortName":"dcVoltageMeasurement","extends":["_base","_sensor"],"notes":{"short":"A service that reports a voltage measurement."},"classIdentifier":372485145,"enums":{"VoltageMeasurementType":{"name":"VoltageMeasurementType","storage":1,"members":{"Absolute":0,"Differential":1}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"measurement_type","identifier":385,"description":"The type of measurement that is taking place. Absolute results are measured with respect to ground, whereas differential results are measured against another signal that is not ground.","fields":[{"name":"_","type":"VoltageMeasurementType","storage":1}],"packFormat":"u8"},{"kind":"const","name":"measurement_name","identifier":386,"description":"A string containing the net name that is being measured e.g. `POWER_DUT` or a reference e.g. `DIFF_DEV1_DEV2`. These constants can be used to identify a measurement from client code.","fields":[{"name":"_","type":"string","storage":0}],"packFormat":"s"},{"kind":"ro","name":"measurement","identifier":257,"description":"The voltage measurement.","fields":[{"name":"_","unit":"V","isFloat":true,"type":"f64","storage":8}],"volatile":true,"identifierName":"reading","packFormat":"f64"},{"kind":"ro","name":"measurement_error","identifier":262,"description":"Absolute error on the reading value.","fields":[{"name":"_","unit":"V","isFloat":true,"type":"f64","storage":8}],"volatile":true,"optional":true,"identifierName":"reading_error","packFormat":"f64"},{"kind":"const","name":"min_measurement","identifier":260,"description":"Minimum measurable current","fields":[{"name":"_","unit":"V","isFloat":true,"type":"f64","storage":8}],"optional":true,"identifierName":"min_reading","packFormat":"f64"},{"kind":"const","name":"max_measurement","identifier":261,"description":"Maximum measurable current","fields":[{"name":"_","unit":"V","isFloat":true,"type":"f64","storage":8}],"optional":true,"identifierName":"max_reading","packFormat":"f64"}],"tags":[]},{"name":"DeviceScript Condition","status":"deprecated","shortId":"devicescriptcondition","camelName":"deviceScriptCondition","shortName":"deviceScriptCondition","extends":["_base"],"notes":{"short":"Conditions are synthetic services used to synchronize threads of executions of a DeviceScript VM.\n**This is no longer used**."},"classIdentifier":295074157,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"command","name":"signal","identifier":128,"description":"Triggers a `signalled` event.","fields":[]},{"kind":"event","name":"signalled","identifier":3,"description":"Triggered by `signal` command.","fields":[],"identifierName":"change"}],"tags":["infrastructure","devicescript"],"restricted":true},{"name":"DeviceScript Debugger","status":"experimental","shortId":"devicescriptdebugger","camelName":"devsDbg","shortName":"devsDbg","extends":["_base"],"notes":{"short":"Allows for inspecting and affecting the state of a running DeviceScript program."},"classIdentifier":358308672,"enums":{"ValueTag":{"name":"ValueTag","storage":1,"members":{"Number":1,"Special":2,"Fiber":3,"BuiltinObject":5,"Exotic":6,"Unhandled":7,"ImgBuffer":32,"ImgStringBuiltin":33,"ImgStringAscii":34,"ImgStringUTF8":35,"ImgRole":48,"ImgFunction":49,"ImgRoleMember":50,"ObjArray":81,"ObjMap":82,"ObjBuffer":83,"ObjString":84,"ObjStackFrame":85,"ObjPacket":86,"ObjBoundFunction":87,"ObjOpaque":88,"ObjAny":80,"ObjMask":240,"User1":241,"User2":242,"User3":243,"User4":244}},"ValueSpecial":{"name":"ValueSpecial","storage":1,"members":{"Undefined":0,"True":1,"False":2,"Null":3,"Globals":100,"CurrentException":101}},"FunIdx":{"name":"FunIdx","storage":2,"isExtensible":true,"members":{"None":0,"Main":49999,"FirstBuiltIn":50000}},"FiberHandle":{"name":"FiberHandle","storage":4,"isExtensible":true,"members":{"None":0}},"ProgramCounter":{"name":"ProgramCounter","storage":4,"isExtensible":true,"members":{}},"ObjStackFrame":{"name":"ObjStackFrame","storage":4,"isExtensible":true,"members":{"Null":0}},"String":{"name":"String","storage":4,"isExtensible":true,"members":{"StaticIndicatorMask":2147483649,"StaticTagMask":2130706432,"StaticIndexMask":16777214,"Unhandled":0}},"StepFlags":{"name":"StepFlags","storage":2,"isFlags":true,"members":{"StepOut":1,"StepIn":2,"Throw":4}},"SuspensionType":{"name":"SuspensionType","storage":1,"members":{"None":0,"Breakpoint":1,"UnhandledException":2,"HandledException":3,"Halt":4,"Panic":5,"Restart":6,"DebuggerStmt":7,"Step":8}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"command","name":"read_fibers","identifier":128,"description":"List the currently running fibers (threads).","fields":[{"name":"results","type":"pipe","storage":12}],"pipeType":"read_fibers","packFormat":"b[12]"},{"kind":"pipe_report","name":"fiber","identifier":0,"description":"List the currently running fibers (threads).","fields":[{"name":"handle","type":"FiberHandle","storage":4},{"name":"initial_fn","type":"FunIdx","storage":2},{"name":"curr_fn","type":"FunIdx","storage":2}],"pipeType":"read_fibers","packFormat":"u32 u16 u16"},{"kind":"command","name":"read_stack","identifier":129,"description":"List stack frames in a fiber.","fields":[{"name":"results","type":"pipe","storage":12},{"name":"fiber_handle","type":"FiberHandle","storage":4}],"pipeType":"read_stack","packFormat":"b[12] u32"},{"kind":"pipe_report","name":"stackframe","identifier":0,"description":"List stack frames in a fiber.","fields":[{"name":"self","type":"ObjStackFrame","storage":4},{"name":"pc","type":"ProgramCounter","storage":4},{"name":"closure","type":"ObjStackFrame","storage":4},{"name":"fn_idx","type":"FunIdx","storage":2},{"name":"reserved","type":"u16","storage":2,"isSimpleType":true}],"pipeType":"read_stack","packFormat":"u32 u32 u32 u16 u16"},{"kind":"command","name":"read_indexed_values","identifier":130,"description":"Read variable slots in a stack frame, elements of an array, etc.","fields":[{"name":"results","type":"pipe","storage":12},{"name":"v0","type":"u32","storage":4,"isSimpleType":true},{"name":"tag","type":"ValueTag","storage":1},{"name":"reserved","type":"u8","storage":1,"isSimpleType":true},{"name":"start","type":"u16","storage":2,"isSimpleType":true},{"name":"length","type":"u16","storage":2,"isSimpleType":true}],"pipeType":"read_indexed_values","packFormat":"b[12] u32 u8 u8 u16 u16"},{"kind":"pipe_report","name":"value","identifier":0,"description":"Read variable slots in a stack frame, elements of an array, etc.","fields":[{"name":"v0","type":"u32","storage":4,"isSimpleType":true},{"name":"v1","type":"u32","storage":4,"isSimpleType":true},{"name":"fn_idx","type":"FunIdx","storage":2},{"name":"tag","type":"ValueTag","storage":1}],"pipeType":"read_indexed_values","packFormat":"u32 u32 u16 u8"},{"kind":"command","name":"read_named_values","identifier":131,"description":"Read variable slots in an object.","fields":[{"name":"results","type":"pipe","storage":12},{"name":"v0","type":"u32","storage":4,"isSimpleType":true},{"name":"tag","type":"ValueTag","storage":1}],"pipeType":"read_named_values","packFormat":"b[12] u32 u8"},{"kind":"pipe_report","name":"key_value","identifier":0,"description":"Read variable slots in an object.","fields":[{"name":"key","type":"String","storage":4},{"name":"v0","type":"u32","storage":4,"isSimpleType":true},{"name":"v1","type":"u32","storage":4,"isSimpleType":true},{"name":"fn_idx","type":"FunIdx","storage":2},{"name":"tag","type":"ValueTag","storage":1}],"pipeType":"read_named_values","packFormat":"u32 u32 u32 u16 u8"},{"kind":"command","name":"read_value","identifier":132,"description":"Read a specific value.","fields":[{"name":"v0","type":"u32","storage":4,"isSimpleType":true},{"name":"tag","type":"ValueTag","storage":1}],"hasReport":true,"packFormat":"u32 u8"},{"kind":"report","name":"read_value","identifier":132,"description":"Read a specific value.","fields":[{"name":"v0","type":"u32","storage":4,"isSimpleType":true},{"name":"v1","type":"u32","storage":4,"isSimpleType":true},{"name":"fn_idx","type":"FunIdx","storage":2},{"name":"tag","type":"ValueTag","storage":1}],"secondary":true,"packFormat":"u32 u32 u16 u8"},{"kind":"command","name":"read_bytes","identifier":133,"description":"Read bytes of a string (UTF8) or buffer value.","fields":[{"name":"results","type":"pipe","storage":12},{"name":"v0","type":"u32","storage":4,"isSimpleType":true},{"name":"tag","type":"ValueTag","storage":1},{"name":"reserved","type":"u8","storage":1,"isSimpleType":true},{"name":"start","type":"u16","storage":2,"isSimpleType":true},{"name":"length","type":"u16","storage":2,"isSimpleType":true}],"pipeType":"read_bytes","packFormat":"b[12] u32 u8 u8 u16 u16"},{"kind":"pipe_report","name":"bytes_value","identifier":0,"description":"Read bytes of a string (UTF8) or buffer value.","fields":[{"name":"data","type":"bytes","storage":0,"isSimpleType":true}],"pipeType":"read_bytes","packFormat":"b"},{"kind":"command","name":"set_breakpoints","identifier":144,"description":"Set breakpoint(s) at a location(s).","fields":[{"name":"break_pc","type":"ProgramCounter","storage":4,"startRepeats":true}],"packFormat":"r: u32"},{"kind":"command","name":"clear_breakpoints","identifier":145,"description":"Clear breakpoint(s) at a location(s).","fields":[{"name":"break_pc","type":"ProgramCounter","storage":4,"startRepeats":true}],"packFormat":"r: u32"},{"kind":"command","name":"clear_all_breakpoints","identifier":146,"description":"Clear all breakpoints.","fields":[]},{"kind":"command","name":"resume","identifier":147,"description":"Resume program execution after a breakpoint was hit.","fields":[]},{"kind":"command","name":"halt","identifier":148,"description":"Try suspending current program. Client needs to wait for `suspended` event afterwards.","fields":[]},{"kind":"command","name":"restart_and_halt","identifier":149,"description":"Run the program from the beginning and halt on first instruction.","fields":[]},{"kind":"command","name":"step","identifier":150,"description":"Set breakpoints that only trigger in the specified stackframe and resume program.\nThe breakpoints are cleared automatically on next suspension (regardless of the reason).","fields":[{"name":"stackframe","type":"ObjStackFrame","storage":4},{"name":"flags","type":"StepFlags","storage":2},{"name":"reserved","type":"u16","storage":2,"isSimpleType":true},{"name":"break_pc","type":"ProgramCounter","storage":4,"startRepeats":true}],"packFormat":"u32 u16 u16 r: u32"},{"kind":"rw","name":"enabled","identifier":1,"description":"Turn on/off the debugger interface.","fields":[{"name":"_","type":"bool","storage":1}],"identifierName":"intensity","packFormat":"u8"},{"kind":"rw","name":"break_at_unhandled_exn","identifier":128,"description":"Wheather to place breakpoint at unhandled exception.","fields":[{"name":"_","type":"bool","storage":1}],"packFormat":"u8"},{"kind":"rw","name":"break_at_handled_exn","identifier":129,"description":"Wheather to place breakpoint at handled exception.","fields":[{"name":"_","type":"bool","storage":1}],"packFormat":"u8"},{"kind":"ro","name":"is_suspended","identifier":384,"description":"Indicates if the program is currently suspended.\nMost commands can only be executed when the program is suspended.","fields":[{"name":"_","type":"bool","storage":1}],"packFormat":"u8"},{"kind":"event","name":"suspended","identifier":128,"description":"Emitted when the program hits a breakpoint or similar event in the specified fiber.","fields":[{"name":"fiber","type":"FiberHandle","storage":4},{"name":"type","type":"SuspensionType","storage":1}],"packFormat":"u32 u8"}],"tags":["management","devicescript"],"restricted":true},{"name":"DeviceScript Manager","status":"experimental","shortId":"devicescriptmanager","camelName":"deviceScriptManager","shortName":"deviceScriptManager","extends":["_base"],"notes":{"short":"Allows for deployment and control over DeviceScript virtual machine.\n\nPrograms start automatically after device restart or uploading of new program.\nYou can stop programs until next reset by setting the `running` and `autostart` registers to `false`.","events":"When program is running, `status_code == Ready`.\nWhen there is a valid program, but it is not running, `status_code == Sleeping`.\nWhen there is no valid program, `status_code == WaitingForInput`."},"classIdentifier":288680491,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"command","name":"deploy_bytecode","identifier":128,"description":"Open pipe for streaming in the bytecode of the program. The size of the bytecode has to be declared upfront.\nTo clear the program, use `bytecode_size == 0`.\nThe bytecode is streamed over regular pipe data packets.\nThe bytecode shall be fully written into flash upon closing the pipe.\nIf `autostart` is true, the program will start after being deployed.\nThe data payloads, including the last one, should have a size that is a multiple of 32 bytes.\nThus, the initial bytecode_size also needs to be a multiple of 32.","fields":[{"name":"bytecode_size","unit":"B","type":"u32","storage":4,"isSimpleType":true}],"unique":true,"hasReport":true,"packFormat":"u32"},{"kind":"report","name":"deploy_bytecode","identifier":128,"description":"Open pipe for streaming in the bytecode of the program. The size of the bytecode has to be declared upfront.\nTo clear the program, use `bytecode_size == 0`.\nThe bytecode is streamed over regular pipe data packets.\nThe bytecode shall be fully written into flash upon closing the pipe.\nIf `autostart` is true, the program will start after being deployed.\nThe data payloads, including the last one, should have a size that is a multiple of 32 bytes.\nThus, the initial bytecode_size also needs to be a multiple of 32.","fields":[{"name":"bytecode_port","type":"pipe_port","storage":2}],"secondary":true,"pipeType":"deploy_bytecode","packFormat":"u16"},{"kind":"command","name":"read_bytecode","identifier":129,"description":"Get the current bytecode deployed on device.","fields":[{"name":"bytecode","type":"pipe","storage":12}],"pipeType":"read_bytecode","packFormat":"b[12]"},{"kind":"pipe_report","name":"bytecode","identifier":0,"description":"Get the current bytecode deployed on device.","fields":[{"name":"data","type":"bytes","storage":0,"isSimpleType":true}],"pipeType":"read_bytecode","packFormat":"b"},{"kind":"rw","name":"running","identifier":128,"description":"Indicates if the program is currently running.\nTo restart the program, stop it (write `0`), read back the register to make sure it's stopped,\nstart it, and read back.","fields":[{"name":"_","type":"bool","storage":1}],"packFormat":"u8"},{"kind":"rw","name":"autostart","identifier":129,"description":"Indicates wheather the program should be re-started upon `reboot()` or `panic()`.\nDefaults to `true`.","fields":[{"name":"_","type":"bool","storage":1}],"packFormat":"u8"},{"kind":"ro","name":"program_size","identifier":384,"description":"The size of current program.","fields":[{"name":"_","type":"u32","storage":4,"isSimpleType":true}],"packFormat":"u32"},{"kind":"ro","name":"program_hash","identifier":385,"description":"Return FNV1A hash of the current bytecode.","fields":[{"name":"_","type":"u32","storage":4,"isSimpleType":true}],"packFormat":"u32"},{"kind":"ro","name":"program_sha256","identifier":386,"description":"Return 32-byte long SHA-256 hash of the current bytecode.","fields":[{"name":"_","type":"bytes","storage":32,"isSimpleType":true,"maxBytes":32}],"packFormat":"b[32]"},{"kind":"const","name":"runtime_version","identifier":387,"description":"Returns the runtime version number compatible with [Semver](https://semver.org/).\nWhen read as 32-bit little endian integer a version `7.15.500` would be `0x07_0F_01F4`.","fields":[{"name":"patch","type":"u16","storage":2,"isSimpleType":true},{"name":"minor","type":"u8","storage":1,"isSimpleType":true},{"name":"major","type":"u8","storage":1,"isSimpleType":true}],"optional":true,"packFormat":"u16 u8 u8"},{"kind":"ro","name":"program_name","identifier":388,"description":"The name of currently running program. The compiler takes is from `package.json`.","fields":[{"name":"_","type":"string","storage":0}],"packFormat":"s"},{"kind":"ro","name":"program_version","identifier":389,"description":"The version number of currently running program. The compiler takes is from `package.json`\nand `git`.","fields":[{"name":"_","type":"string","storage":0}],"packFormat":"s"},{"kind":"event","name":"program_panic","identifier":128,"description":"Emitted when the program calls `panic(panic_code)` or `reboot()` (`panic_code == 0` in that case).\nThe byte offset in byte code of the call is given in `program_counter`.\nThe program will restart immediately when `panic_code == 0` or in a few seconds otherwise.","fields":[{"name":"panic_code","type":"u32","storage":4,"isSimpleType":true},{"name":"program_counter","type":"u32","storage":4,"isSimpleType":true}],"packFormat":"u32 u32"},{"kind":"event","name":"program_change","identifier":3,"description":"Emitted after bytecode of the program has changed.","fields":[],"identifierName":"change"}],"tags":["management","devicescript"],"restricted":true},{"name":"Distance","status":"stable","shortId":"distance","camelName":"distance","shortName":"distance","extends":["_base","_sensor"],"notes":{"short":"A sensor that determines the distance of an object without any physical contact involved."},"classIdentifier":337275786,"enums":{"Variant":{"name":"Variant","storage":1,"members":{"Ultrasonic":1,"Infrared":2,"LiDAR":3,"Laser":4}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"distance","identifier":257,"description":"Current distance from the object","fields":[{"name":"_","unit":"m","shift":16,"type":"u16.16","storage":4,"typicalMin":0.02,"typicalMax":4}],"volatile":true,"identifierName":"reading","packFormat":"u16.16"},{"kind":"ro","name":"distance_error","identifier":262,"description":"Absolute error on the reading value.","fields":[{"name":"_","unit":"m","shift":16,"type":"u16.16","storage":4}],"volatile":true,"optional":true,"identifierName":"reading_error","packFormat":"u16.16"},{"kind":"const","name":"min_range","identifier":260,"description":"Minimum measurable distance","fields":[{"name":"_","unit":"m","shift":16,"type":"u16.16","storage":4}],"optional":true,"identifierName":"min_reading","packFormat":"u16.16"},{"kind":"const","name":"max_range","identifier":261,"description":"Maximum measurable distance","fields":[{"name":"_","unit":"m","shift":16,"type":"u16.16","storage":4}],"optional":true,"identifierName":"max_reading","packFormat":"u16.16"},{"kind":"const","name":"variant","identifier":263,"description":"Determines the type of sensor used.","fields":[{"name":"_","type":"Variant","storage":1}],"optional":true,"identifierName":"variant","packFormat":"u8"}],"tags":["8bit"]},{"name":"DMX","status":"experimental","shortId":"dmx","camelName":"dmx","shortName":"dmx","extends":["_base"],"notes":{"short":"A service that can send DMX512-A packets with limited size. This service is designed to allow tinkering with a few DMX devices, but only allows 235 channels. More about DMX at https://en.wikipedia.org/wiki/DMX512."},"classIdentifier":298814469,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"enabled","identifier":1,"description":"Determines if the DMX bridge is active.","fields":[{"name":"_","type":"bool","storage":1}],"identifierName":"intensity","packFormat":"u8"},{"kind":"command","name":"send","identifier":128,"description":"Send a DMX packet, up to 236bytes long, including the start code.","fields":[{"name":"channels","type":"bytes","storage":0,"isSimpleType":true}],"unique":true,"packFormat":"b"}],"tags":[]},{"name":"Dot Matrix","status":"rc","shortId":"dotmatrix","camelName":"dotMatrix","shortName":"dotMatrix","extends":["_base"],"notes":{"short":"A rectangular dot matrix display, made of monochrome LEDs or Braille pins."},"classIdentifier":286070091,"enums":{"Variant":{"name":"Variant","storage":1,"members":{"LED":1,"Braille":2}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"dots","identifier":2,"description":"The state of the screen where dot on/off state is\nstored as a bit, column by column. The column should be byte aligned.\n\nFor example, if the display has no more than 8 rows in each column, then each byte contains bits corresponding\nto a single column. Least-significant bit is on top.\nIf display has 10 rows, then each column is represented by two bytes.\nThe top-most 8 rows sit in the first byte (with the least significant bit being on top),\nand the remainign 2 row sit in the second byte.\n\nThe following C expression can be used to check if a given `column, row` coordinate is set:\n`dots[column * column_size + (row >> 3)] & (1 << (row & 7))`, where\n`column_size` is `(number_of_rows + 7) >> 3` (note that if number of rows is 8 or less then `column_size` is `1`),\nand `dots` is of `uint8_t*` type.\n\nThe size of this register is `number_of_columns * column_size` bytes.","fields":[{"name":"_","type":"bytes","storage":0,"isSimpleType":true}],"identifierName":"value","packFormat":"b"},{"kind":"rw","name":"brightness","identifier":1,"description":"Reads the general brightness of the display, brightness for LEDs. `0` when the screen is off.","fields":[{"name":"_","unit":"/","shift":8,"type":"u0.8","storage":1}],"optional":true,"identifierName":"intensity","packFormat":"u0.8"},{"kind":"const","name":"rows","identifier":385,"description":"Number of rows on the screen","fields":[{"name":"_","unit":"#","type":"u16","storage":2,"isSimpleType":true}],"packFormat":"u16"},{"kind":"const","name":"columns","identifier":386,"description":"Number of columns on the screen","fields":[{"name":"_","unit":"#","type":"u16","storage":2,"isSimpleType":true}],"packFormat":"u16"},{"kind":"const","name":"variant","identifier":263,"description":"Describes the type of matrix used.","fields":[{"name":"_","type":"Variant","storage":1}],"optional":true,"identifierName":"variant","packFormat":"u8"}],"tags":[],"group":"Display"},{"name":"Dual Motors","status":"experimental","shortId":"dualmotors","camelName":"dualMotors","shortName":"dualMotors","extends":["_base"],"notes":{"short":"A synchronized pair of motors."},"classIdentifier":355063095,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"speed","identifier":2,"description":"Relative speed of the motors. Use positive/negative values to run the motor forwards and backwards.\nA speed of ``0`` while ``enabled`` acts as brake.","fields":[{"name":"left","unit":"/","shift":15,"type":"i1.15","storage":-2},{"name":"right","unit":"/","shift":15,"type":"i1.15","storage":-2}],"identifierName":"value","packFormat":"i1.15 i1.15"},{"kind":"rw","name":"enabled","identifier":1,"description":"Turn the power to the motors on/off.","fields":[{"name":"_","type":"bool","storage":1}],"identifierName":"intensity","packFormat":"u8"},{"kind":"const","name":"load_torque","identifier":384,"description":"Torque required to produce the rated power of an each electrical motor at load speed.","fields":[{"name":"_","unit":"kg/cm","shift":16,"type":"u16.16","storage":4}],"optional":true,"packFormat":"u16.16"},{"kind":"const","name":"load_rotation_speed","identifier":385,"description":"Revolutions per minute of the motor under full load.","fields":[{"name":"_","unit":"rpm","shift":16,"type":"u16.16","storage":4}],"optional":true,"packFormat":"u16.16"},{"kind":"const","name":"reversible","identifier":386,"description":"Indicates if the motors can run backwards.","fields":[{"name":"_","type":"bool","storage":1}],"optional":true,"packFormat":"u8"}],"tags":[],"group":"Motor"},{"name":"Equivalent CO₂","status":"rc","shortId":"eco2","camelName":"eCO2","shortName":"eCO2","extends":["_base","_sensor"],"notes":{"short":"Measures equivalent CO₂ levels."},"classIdentifier":379362758,"enums":{"Variant":{"name":"Variant","storage":1,"members":{"VOC":1,"NDIR":2}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"e_CO2","identifier":257,"description":"Equivalent CO₂ (eCO₂) readings.","fields":[{"name":"_","unit":"ppm","shift":10,"type":"u22.10","storage":4,"typicalMin":400,"typicalMax":8192}],"volatile":true,"identifierName":"reading","preferredInterval":1000,"packFormat":"u22.10"},{"kind":"ro","name":"e_CO2_error","identifier":262,"description":"Error on the reading value.","fields":[{"name":"_","unit":"ppm","shift":10,"type":"u22.10","storage":4}],"volatile":true,"optional":true,"identifierName":"reading_error","packFormat":"u22.10"},{"kind":"const","name":"min_e_CO2","identifier":260,"description":"Minimum measurable value","fields":[{"name":"_","unit":"ppm","shift":10,"type":"u22.10","storage":4}],"identifierName":"min_reading","packFormat":"u22.10"},{"kind":"const","name":"max_e_CO2","identifier":261,"description":"Minimum measurable value","fields":[{"name":"_","unit":"ppm","shift":10,"type":"u22.10","storage":4}],"identifierName":"max_reading","packFormat":"u22.10"},{"kind":"const","name":"variant","identifier":263,"description":"Type of physical sensor and capabilities.","fields":[{"name":"_","type":"Variant","storage":1}],"optional":true,"identifierName":"variant","packFormat":"u8"}],"tags":["8bit"],"group":"Environment"},{"name":"Flex","status":"rc","shortId":"flex","camelName":"flex","shortName":"flex","extends":["_base","_sensor"],"notes":{"short":"A bending or deflection sensor."},"classIdentifier":524797638,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"bending","identifier":257,"description":"A measure of the bending.","fields":[{"name":"_","unit":"/","shift":15,"type":"i1.15","storage":-2}],"volatile":true,"identifierName":"reading","packFormat":"i1.15"},{"kind":"const","name":"length","identifier":384,"description":"Length of the flex sensor","fields":[{"name":"_","unit":"mm","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"packFormat":"u16"}],"tags":["C","8bit"],"group":"Sensor"},{"name":"Gamepad","status":"rc","shortId":"gamepad","camelName":"gamepad","shortName":"gamepad","extends":["_base","_sensor"],"notes":{"short":"A two axis directional gamepad with optional buttons."},"classIdentifier":277836886,"enums":{"Buttons":{"name":"Buttons","storage":4,"isFlags":true,"members":{"Left":1,"Up":2,"Right":4,"Down":8,"A":16,"B":32,"Menu":64,"Select":128,"Reset":256,"Exit":512,"X":1024,"Y":2048}},"Variant":{"name":"Variant","storage":1,"members":{"Thumb":1,"ArcadeBall":2,"ArcadeStick":3,"Gamepad":4}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"direction","identifier":257,"description":"If the gamepad is analog, the directional buttons should be \"simulated\", based on gamepad position\n(`Left` is `{ x = -1, y = 0 }`, `Up` is `{ x = 0, y = -1}`).\nIf the gamepad is digital, then each direction will read as either `-1`, `0`, or `1` (in fixed representation).\nThe primary button on the gamepad is `A`.","fields":[{"name":"buttons","type":"Buttons","storage":4},{"name":"x","unit":"/","shift":15,"type":"i1.15","storage":-2},{"name":"y","unit":"/","shift":15,"type":"i1.15","storage":-2}],"volatile":true,"identifierName":"reading","packFormat":"u32 i1.15 i1.15"},{"kind":"const","name":"variant","identifier":263,"description":"The type of physical gamepad.","fields":[{"name":"_","type":"Variant","storage":1}],"optional":true,"identifierName":"variant","packFormat":"u8"},{"kind":"const","name":"buttons_available","identifier":384,"description":"Indicates a bitmask of the buttons that are mounted on the gamepad.\nIf the `Left`/`Up`/`Right`/`Down` buttons are marked as available here, the gamepad is digital.\nEven when marked as not available, they will still be simulated based on the analog gamepad.","fields":[{"name":"_","type":"Buttons","storage":4}],"packFormat":"u32"},{"kind":"event","name":"buttons_changed","identifier":3,"description":"Emitted whenever the state of buttons changes.","fields":[{"name":"buttons","type":"Buttons","storage":4}],"identifierName":"change","packFormat":"u32"}],"tags":["8bit","padauk"],"group":"Button"},{"name":"GPIO","status":"experimental","shortId":"gpio","camelName":"GPIO","shortName":"GPIO","extends":["_base","_sensor"],"notes":{"short":"Access to General Purpose Input/Output (GPIO) pins on a board.\nThe pins are indexed `0 ... num_pins-1`.\nThe indexing does not correspond to hardware pin names, nor labels on the board (see `get_pin_info` command for that),\nand should **not** be exposed to the user."},"classIdentifier":282614377,"enums":{"Mode":{"name":"Mode","storage":1,"members":{"Off":0,"OffPullUp":16,"OffPullDown":32,"Input":1,"InputPullUp":17,"InputPullDown":33,"Output":2,"OutputHigh":18,"OutputLow":34,"AnalogIn":3,"Alternative":4,"BaseModeMask":15}},"Capabilities":{"name":"Capabilities","storage":2,"isFlags":true,"members":{"PullUp":1,"PullDown":2,"Input":4,"Output":8,"Analog":16}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"state","identifier":257,"description":"For every pin set to `Input*` the corresponding **bit** in `digital_values` will be `1` if and only if\nthe pin is high.\nFor other pins, the bit is `0`.\nThis is normally streamed at low-ish speed, but it's also automatically reported whenever\na digital input pin changes value (throttled to ~100Hz).\nThe analog values can be read with the `ADC` service.","fields":[{"name":"digital_values","type":"bytes","storage":0,"isSimpleType":true}],"volatile":true,"identifierName":"reading","packFormat":"b"},{"kind":"ro","name":"num_pins","identifier":384,"description":"Number of pins that can be operated through this service.","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true,"absoluteMax":128,"absoluteMin":0}],"packFormat":"u8"},{"kind":"command","name":"configure","identifier":128,"description":"Configure (including setting the value) zero or more pins.\n`Alternative` settings means the pin is controlled by other service (SPI, I2C, UART, PWM, etc.).","fields":[{"name":"pin","type":"u8","storage":1,"isSimpleType":true,"startRepeats":true},{"name":"mode","type":"Mode","storage":1}],"packFormat":"r: u8 u8"},{"kind":"command","name":"pin_info","identifier":129,"description":"Report capabilities and name of a pin.","fields":[{"name":"pin","type":"u8","storage":1,"isSimpleType":true}],"hasReport":true,"packFormat":"u8"},{"kind":"report","name":"pin_info","identifier":129,"description":"Report capabilities and name of a pin.","fields":[{"name":"pin","type":"u8","storage":1,"isSimpleType":true},{"name":"hw_pin","type":"u8","storage":1,"isSimpleType":true},{"name":"capabilities","type":"Capabilities","storage":2},{"name":"mode","type":"Mode","storage":1},{"name":"label","type":"string","storage":0}],"secondary":true,"packFormat":"u8 u8 u16 u8 s"},{"kind":"command","name":"pin_by_label","identifier":131,"description":"This responds with `pin_info` report.","fields":[{"name":"label","type":"string","storage":0}],"hasReport":true,"packFormat":"s"},{"kind":"report","name":"pin_by_label","identifier":131,"description":"This responds with `pin_info` report.","fields":[{"name":"pin","type":"u8","storage":1,"isSimpleType":true},{"name":"hw_pin","type":"u8","storage":1,"isSimpleType":true},{"name":"capabilities","type":"Capabilities","storage":2},{"name":"mode","type":"Mode","storage":1},{"name":"label","type":"string","storage":0}],"secondary":true,"packFormat":"u8 u8 u16 u8 s"},{"kind":"command","name":"pin_by_hw_pin","identifier":132,"description":"This responds with `pin_info` report.","fields":[{"name":"hw_pin","type":"u8","storage":1,"isSimpleType":true}],"hasReport":true,"packFormat":"u8"},{"kind":"report","name":"pin_by_hw_pin","identifier":132,"description":"This responds with `pin_info` report.","fields":[{"name":"pin","type":"u8","storage":1,"isSimpleType":true},{"name":"hw_pin","type":"u8","storage":1,"isSimpleType":true},{"name":"capabilities","type":"Capabilities","storage":2},{"name":"mode","type":"Mode","storage":1},{"name":"label","type":"string","storage":0}],"secondary":true,"packFormat":"u8 u8 u16 u8 s"}],"tags":["io"]},{"name":"Gyroscope","status":"rc","shortId":"gyroscope","camelName":"gyroscope","shortName":"gyroscope","extends":["_base","_sensor"],"notes":{"short":"A 3-axis gyroscope."},"classIdentifier":505087730,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"rotation_rates","identifier":257,"description":"Indicates the current rates acting on gyroscope.","fields":[{"name":"x","unit":"°/s","shift":20,"type":"i12.20","storage":-4},{"name":"y","unit":"°/s","shift":20,"type":"i12.20","storage":-4},{"name":"z","unit":"°/s","shift":20,"type":"i12.20","storage":-4}],"volatile":true,"identifierName":"reading","packFormat":"i12.20 i12.20 i12.20"},{"kind":"ro","name":"rotation_rates_error","identifier":262,"description":"Error on the reading value.","fields":[{"name":"_","unit":"°/s","shift":20,"type":"u12.20","storage":4}],"volatile":true,"optional":true,"identifierName":"reading_error","packFormat":"u12.20"},{"kind":"rw","name":"max_rate","identifier":8,"description":"Configures the range of rotation rates.\nThe value will be \"rounded up\" to one of `max_rates_supported`.","fields":[{"name":"_","unit":"°/s","shift":20,"type":"u12.20","storage":4}],"optional":true,"identifierName":"reading_range","packFormat":"u12.20"},{"kind":"const","name":"max_rates_supported","identifier":266,"description":"Lists values supported for writing `max_rate`.","fields":[{"name":"max_rate","unit":"°/s","shift":20,"type":"u12.20","storage":4,"startRepeats":true}],"optional":true,"identifierName":"supported_ranges","packFormat":"r: u12.20"}],"tags":[],"group":"Movement"},{"name":"Heart Rate","status":"experimental","shortId":"heartrate","camelName":"heartRate","shortName":"heartRate","extends":["_base","_sensor"],"notes":{"short":"A sensor approximating the heart rate. \n\n\n**Jacdac is NOT suitable for medical devices and should NOT be used in any kind of device to diagnose or treat any medical conditions.**"},"classIdentifier":376204740,"enums":{"Variant":{"name":"Variant","storage":1,"members":{"Finger":1,"Chest":2,"Wrist":3,"Pump":4,"WebCam":5}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"heart_rate","identifier":257,"description":"The estimated heart rate.","fields":[{"name":"_","unit":"bpm","shift":16,"type":"u16.16","storage":4,"typicalMin":30,"typicalMax":200}],"volatile":true,"identifierName":"reading","preferredInterval":1000,"packFormat":"u16.16"},{"kind":"ro","name":"heart_rate_error","identifier":262,"description":"The estimated error on the reported sensor data.","fields":[{"name":"_","unit":"bpm","shift":16,"type":"u16.16","storage":4}],"volatile":true,"optional":true,"identifierName":"reading_error","packFormat":"u16.16"},{"kind":"const","name":"variant","identifier":263,"description":"The type of physical sensor","fields":[{"name":"_","type":"Variant","storage":1}],"optional":true,"identifierName":"variant","packFormat":"u8"}],"tags":["8bit"],"group":"Biometric"},{"name":"HID Joystick","status":"experimental","shortId":"hidjoystick","camelName":"hidJoystick","shortName":"hidJoystick","extends":["_base"],"notes":{"short":"Controls a HID joystick."},"classIdentifier":437330261,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"button_count","identifier":384,"description":"Number of button report supported","fields":[{"name":"_","type":"u8","storage":1,"isSimpleType":true}],"packFormat":"u8"},{"kind":"const","name":"buttons_analog","identifier":385,"description":"A bitset that indicates which button is analog.","fields":[{"name":"_","type":"u32","storage":4,"isSimpleType":true}],"packFormat":"u32"},{"kind":"const","name":"axis_count","identifier":386,"description":"Number of analog input supported","fields":[{"name":"_","type":"u8","storage":1,"isSimpleType":true}],"packFormat":"u8"},{"kind":"command","name":"set_buttons","identifier":128,"description":"Sets the up/down button state, one byte per button, supports analog buttons. For digital buttons, use `0` for released, `1` for pressed.","fields":[{"name":"pressure","unit":"/","shift":8,"type":"u0.8","storage":1,"startRepeats":true}],"unique":true,"packFormat":"r: u0.8"},{"kind":"command","name":"set_axis","identifier":129,"description":"Sets the state of analog inputs.","fields":[{"name":"position","unit":"/","shift":15,"type":"i1.15","storage":-2,"startRepeats":true}],"unique":true,"packFormat":"r: i1.15"}],"tags":[]},{"name":"HID Keyboard","status":"stable","shortId":"hidkeyboard","camelName":"hidKeyboard","shortName":"hidKeyboard","extends":["_base"],"notes":{"short":"Control a HID keyboard.\n\nThe codes for the key (selectors) is defined in the [HID Keyboard\nspecification](https://usb.org/sites/default/files/hut1_21.pdf), chapter 10 Keyboard/Keypad Page, page 81.\nModifiers are in page 87.\n\nThe device keeps tracks of the key state and is able to clear it all with the clear command."},"classIdentifier":414210922,"enums":{"Selector":{"name":"Selector","storage":2,"members":{"None":0,"ErrorRollOver":1,"PostFail":2,"ErrorUndefined":3,"A":4,"B":5,"C":6,"D":7,"E":8,"F":9,"G":10,"H":11,"I":12,"J":13,"K":14,"L":15,"M":16,"N":17,"O":18,"P":19,"Q":20,"R":21,"S":22,"T":23,"U":24,"V":25,"W":26,"X":27,"Y":28,"Z":29,"_1":30,"_2":31,"_3":32,"_4":33,"_5":34,"_6":35,"_7":36,"_8":37,"_9":38,"_0":39,"Return":40,"Escape":41,"Backspace":42,"Tab":43,"Spacebar":44,"Minus":45,"Equals":46,"LeftSquareBracket":47,"RightSquareBracket":48,"Backslash":49,"NonUsHash":50,"Semicolon":51,"Quote":52,"GraveAccent":53,"Comma":54,"Period":55,"Slash":56,"CapsLock":57,"F1":58,"F2":59,"F3":60,"F4":61,"F5":62,"F6":63,"F7":64,"F8":65,"F9":66,"F10":67,"F11":68,"F12":69,"PrintScreen":70,"ScrollLock":71,"Pause":72,"Insert":73,"Home":74,"PageUp":75,"Delete":76,"End":77,"PageDown":78,"RightArrow":79,"LeftArrow":80,"DownArrow":81,"UpArrow":82,"KeypadNumLock":83,"KeypadDivide":84,"KeypadMultiply":85,"KeypadAdd":86,"KeypadSubtrace":87,"KeypadReturn":88,"Keypad1":89,"Keypad2":90,"Keypad3":91,"Keypad4":92,"Keypad5":93,"Keypad6":94,"Keypad7":95,"Keypad8":96,"Keypad9":97,"Keypad0":98,"KeypadDecimalPoint":99,"NonUsBackslash":100,"Application":101,"Power":102,"KeypadEquals":103,"F13":104,"F14":105,"F15":106,"F16":107,"F17":108,"F18":109,"F19":110,"F20":111,"F21":112,"F22":113,"F23":114,"F24":115,"Execute":116,"Help":117,"Menu":118,"Select":119,"Stop":120,"Again":121,"Undo":122,"Cut":123,"Copy":124,"Paste":125,"Find":126,"Mute":127,"VolumeUp":128,"VolumeDown":129}},"Modifiers":{"name":"Modifiers","storage":1,"isFlags":true,"members":{"None":0,"LeftControl":1,"LeftShift":2,"LeftAlt":4,"LeftGUI":8,"RightControl":16,"RightShift":32,"RightAlt":64,"RightGUI":128}},"Action":{"name":"Action","storage":1,"members":{"Press":0,"Up":1,"Down":2}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"command","name":"key","identifier":128,"description":"Presses a key or a sequence of keys down.","fields":[{"name":"selector","type":"Selector","storage":2,"startRepeats":true},{"name":"modifiers","type":"Modifiers","storage":1},{"name":"action","type":"Action","storage":1}],"lowLevel":true,"unique":true,"packFormat":"r: u16 u8 u8"},{"kind":"command","name":"clear","identifier":129,"description":"Clears all pressed keys.","fields":[]}],"tags":["8bit"]},{"name":"HID Mouse","status":"stable","shortId":"hidmouse","camelName":"hidMouse","shortName":"hidMouse","extends":["_base"],"notes":{"short":"Controls a HID mouse."},"classIdentifier":411425820,"enums":{"Button":{"name":"Button","storage":2,"isFlags":true,"members":{"Left":1,"Right":2,"Middle":4}},"ButtonEvent":{"name":"ButtonEvent","storage":1,"members":{"Up":1,"Down":2,"Click":3,"DoubleClick":4}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"command","name":"set_button","identifier":128,"description":"Sets the up/down state of one or more buttons.\nA `Click` is the same as `Down` followed by `Up` after 100ms.\nA `DoubleClick` is two clicks with `150ms` gap between them (that is, `100ms` first click, `150ms` gap, `100ms` second click).","fields":[{"name":"buttons","type":"Button","storage":2},{"name":"ev","type":"ButtonEvent","storage":1}],"unique":true,"packFormat":"u16 u8"},{"kind":"command","name":"move","identifier":129,"description":"Moves the mouse by the distance specified.\nIf the time is positive, it specifies how long to make the move.","fields":[{"name":"dx","unit":"#","type":"i16","storage":-2,"isSimpleType":true},{"name":"dy","unit":"#","type":"i16","storage":-2,"isSimpleType":true},{"name":"time","unit":"ms","type":"u16","storage":2,"isSimpleType":true}],"unique":true,"packFormat":"i16 i16 u16"},{"kind":"command","name":"wheel","identifier":130,"description":"Turns the wheel up or down. Positive if scrolling up.\nIf the time is positive, it specifies how long to make the move.","fields":[{"name":"dy","unit":"#","type":"i16","storage":-2,"isSimpleType":true},{"name":"time","unit":"ms","type":"u16","storage":2,"isSimpleType":true}],"unique":true,"packFormat":"i16 u16"}],"tags":["8bit"]},{"name":"Humidity","status":"stable","shortId":"humidity","camelName":"humidity","shortName":"humidity","extends":["_base","_sensor"],"notes":{"short":"A sensor measuring humidity of outside environment."},"classIdentifier":382210232,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"humidity","identifier":257,"description":"The relative humidity in percentage of full water saturation.","fields":[{"name":"_","unit":"%RH","shift":10,"type":"u22.10","storage":4}],"volatile":true,"identifierName":"reading","preferredInterval":5000,"packFormat":"u22.10"},{"kind":"ro","name":"humidity_error","identifier":262,"description":"The real humidity is between `humidity - humidity_error` and `humidity + humidity_error`.","fields":[{"name":"_","unit":"%RH","shift":10,"type":"u22.10","storage":4}],"volatile":true,"optional":true,"identifierName":"reading_error","packFormat":"u22.10"},{"kind":"const","name":"min_humidity","identifier":260,"description":"Lowest humidity that can be reported.","fields":[{"name":"_","unit":"%RH","shift":10,"type":"u22.10","storage":4}],"identifierName":"min_reading","packFormat":"u22.10"},{"kind":"const","name":"max_humidity","identifier":261,"description":"Highest humidity that can be reported.","fields":[{"name":"_","unit":"%RH","shift":10,"type":"u22.10","storage":4}],"identifierName":"max_reading","packFormat":"u22.10"}],"tags":["C","8bit"],"group":"Environment"},{"name":"I2C","status":"experimental","shortId":"i2c","camelName":"I2C","shortName":"I2C","extends":["_base"],"notes":{"short":"Inter-Integrated Circuit (I2C, I²C, IIC) serial communication bus lets you communicate with\nmany sensors and actuators."},"classIdentifier":471386691,"enums":{"Status":{"name":"Status","storage":1,"members":{"OK":0,"NAckAddr":1,"NAckData":2,"NoI2C":3}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"ro","name":"ok","identifier":384,"description":"Indicates whether the I2C is working.","fields":[{"name":"_","type":"bool","storage":1}],"packFormat":"u8"},{"kind":"command","name":"transaction","identifier":128,"description":"`address` is 7-bit.\n`num_read` can be 0 if nothing needs to be read.\nThe `write_buf` includes the register address if required (first one or two bytes).","fields":[{"name":"address","type":"u8","storage":1,"isSimpleType":true},{"name":"num_read","unit":"B","type":"u8","storage":1,"isSimpleType":true},{"name":"write_buf","type":"bytes","storage":0,"isSimpleType":true}],"unique":true,"hasReport":true,"packFormat":"u8 u8 b"},{"kind":"report","name":"transaction","identifier":128,"description":"`address` is 7-bit.\n`num_read` can be 0 if nothing needs to be read.\nThe `write_buf` includes the register address if required (first one or two bytes).","fields":[{"name":"status","type":"Status","storage":1},{"name":"read_buf","type":"bytes","storage":0,"isSimpleType":true}],"secondary":true,"packFormat":"u8 b"}],"tags":["io"]},{"name":"Illuminance","status":"rc","shortId":"illuminance","camelName":"illuminance","shortName":"illuminance","extends":["_base","_sensor"],"notes":{"short":"Detects the amount of light falling onto a given surface area.\n\nNote that this is different from _luminance_, the amount of light that passes through, emits from, or reflects off an object."},"classIdentifier":510577394,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"illuminance","identifier":257,"description":"The amount of illuminance, as lumens per square metre.","fields":[{"name":"_","unit":"lux","shift":10,"type":"u22.10","storage":4,"typicalMax":100000,"typicalMin":0}],"volatile":true,"identifierName":"reading","packFormat":"u22.10"},{"kind":"ro","name":"illuminance_error","identifier":262,"description":"Error on the reported sensor value.","fields":[{"name":"_","unit":"lux","shift":10,"type":"u22.10","storage":4}],"volatile":true,"optional":true,"identifierName":"reading_error","packFormat":"u22.10"}],"tags":["8bit","padauk"],"group":"Environment"},{"name":"Indexed screen","status":"rc","shortId":"indexedscreen","camelName":"indexedScreen","shortName":"indexedScreen","extends":["_base"],"notes":{"short":"A screen with indexed colors from a palette.\n\nThis is often run over an SPI connection or directly on the MCU, not regular single-wire Jacdac."},"classIdentifier":385496805,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"command","name":"start_update","identifier":129,"description":"Sets the update window for subsequent `set_pixels` commands.","fields":[{"name":"x","unit":"px","type":"u16","storage":2,"isSimpleType":true},{"name":"y","unit":"px","type":"u16","storage":2,"isSimpleType":true},{"name":"width","unit":"px","type":"u16","storage":2,"isSimpleType":true},{"name":"height","unit":"px","type":"u16","storage":2,"isSimpleType":true}],"packFormat":"u16 u16 u16 u16"},{"kind":"command","name":"set_pixels","identifier":131,"description":"Set pixels in current window, according to current palette.\nEach \"line\" of data is aligned to a byte.","fields":[{"name":"pixels","type":"bytes","storage":0,"isSimpleType":true}],"unique":true,"packFormat":"b"},{"kind":"rw","name":"brightness","identifier":1,"description":"Set backlight brightness.\nIf set to `0` the display may go to sleep.","fields":[{"name":"_","unit":"/","shift":8,"type":"u0.8","storage":1}],"identifierName":"intensity","packFormat":"u0.8"},{"kind":"rw","name":"palette","identifier":128,"description":"The current palette. The colors are `[r,g,b, padding]` 32bit color entries.\nThe color entry repeats `1 << bits_per_pixel` times.\nThis register may be write-only.","fields":[{"name":"_","type":"bytes","storage":0,"isSimpleType":true}],"packFormat":"b"},{"kind":"const","name":"bits_per_pixel","identifier":384,"description":"Determines the number of palette entries.\nTypical values are 1 or 4.","fields":[{"name":"_","unit":"bit","type":"u8","storage":1,"isSimpleType":true}],"packFormat":"u8"},{"kind":"const","name":"width","identifier":385,"description":"Screen width in \"natural\" orientation.","fields":[{"name":"_","unit":"px","type":"u16","storage":2,"isSimpleType":true}],"packFormat":"u16"},{"kind":"const","name":"height","identifier":386,"description":"Screen height in \"natural\" orientation.","fields":[{"name":"_","unit":"px","type":"u16","storage":2,"isSimpleType":true}],"packFormat":"u16"},{"kind":"rw","name":"width_major","identifier":129,"description":"If true, consecutive pixels in the \"width\" direction are sent next to each other (this is typical for graphics cards).\nIf false, consecutive pixels in the \"height\" direction are sent next to each other.\nFor embedded screen controllers, this is typically true iff `width < height`\n(in other words, it's only true for portrait orientation screens).\nSome controllers may allow the user to change this (though the refresh order may not be optimal then).\nThis is independent of the `rotation` register.","fields":[{"name":"_","type":"bool","storage":1}],"optional":true,"packFormat":"u8"},{"kind":"rw","name":"up_sampling","identifier":130,"description":"Every pixel sent over wire is represented by `up_sampling x up_sampling` square of physical pixels.\nSome displays may allow changing this (which will also result in changes to `width` and `height`).\nTypical values are 1 and 2.","fields":[{"name":"_","unit":"px","type":"u8","storage":1,"isSimpleType":true}],"optional":true,"packFormat":"u8"},{"kind":"rw","name":"rotation","identifier":131,"description":"Possible values are 0, 90, 180 and 270 only.\nWrite to this register do not affect `width` and `height` registers,\nand may be ignored by some screens.","fields":[{"name":"_","unit":"°","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"packFormat":"u16"}],"tags":["SPI"]},{"name":"Infrastructure","status":"stable","shortId":"infrastructure","camelName":"infrastructure","shortName":"infrastructure","extends":["_base"],"notes":{"short":"A service that tags a device as purely infrastructure device.\n\n\nA Jacdac user interface can hide any device that hosts this service."},"classIdentifier":504728043,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"}],"tags":["infrastructure"]},{"name":"Keyboard client","status":"experimental","shortId":"keyboardclient","camelName":"keyboardClient","shortName":"keyboardClient","extends":["_base"],"notes":{"short":"Measures KeyboardClient."},"classIdentifier":289210942,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"event","name":"down","identifier":1,"description":"Emitted when a key is pressed.","fields":[{"name":"key","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"active","packFormat":"u16"},{"kind":"event","name":"hold","identifier":129,"description":"Emitted when a key is held.","fields":[{"name":"key","type":"u16","storage":2,"isSimpleType":true}],"packFormat":"u16"}],"tags":[]},{"name":"LED","status":"stable","shortId":"led","camelName":"led","shortName":"led","extends":["_base"],"notes":{"short":"A controller for displays of individually controlled RGB LEDs.\n\nFor 64 or less LEDs, the service should support the pack the pixels in the pixels register.\nBeyond this size, the register should return an empty payload as the amount of data exceeds\nthe size of a packet. Typically services that use more than 64 LEDs\nwill run on the same MCU and will maintain the pixels buffer internally."},"classIdentifier":369743088,"enums":{"Variant":{"name":"Variant","storage":1,"members":{"Strip":1,"Ring":2,"Stick":3,"Jewel":4,"Matrix":5}}},"constants":{"max_pixels_length":{"value":64,"hex":false}},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"pixels","identifier":2,"description":"A buffer of 24bit RGB color entries for each LED, in R, G, B order.\nWhen writing, if the buffer is too short, the remaining pixels are set to `#000000`;\nIf the buffer is too long, the write may be ignored, or the additional pixels may be ignored.\nIf the number of pixels is greater than `max_pixels_length`, the read should return an empty payload.","fields":[{"name":"_","type":"bytes","storage":0,"isSimpleType":true}],"identifierName":"value","packFormat":"b"},{"kind":"rw","name":"brightness","identifier":1,"description":"Set the luminosity of the strip.\nAt `0` the power to the strip is completely shut down.","fields":[{"name":"_","unit":"/","shift":8,"type":"u0.8","storage":1,"defaultValue":0.05}],"identifierName":"intensity","packFormat":"u0.8"},{"kind":"ro","name":"actual_brightness","identifier":384,"description":"This is the luminosity actually applied to the strip.\nMay be lower than `brightness` if power-limited by the `max_power` register.\nIt will rise slowly (few seconds) back to `brightness` is limits are no longer required.","fields":[{"name":"_","unit":"/","shift":8,"type":"u0.8","storage":1}],"packFormat":"u0.8"},{"kind":"const","name":"num_pixels","identifier":386,"description":"Specifies the number of pixels in the strip.","fields":[{"name":"_","unit":"#","type":"u16","storage":2,"isSimpleType":true}],"packFormat":"u16"},{"kind":"const","name":"num_columns","identifier":387,"description":"If the LED pixel strip is a matrix, specifies the number of columns.","fields":[{"name":"_","unit":"#","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"packFormat":"u16"},{"kind":"rw","name":"max_power","identifier":7,"description":"Limit the power drawn by the light-strip (and controller).","fields":[{"name":"_","unit":"mA","type":"u16","storage":2,"isSimpleType":true,"defaultValue":200}],"optional":true,"identifierName":"max_power","packFormat":"u16"},{"kind":"const","name":"leds_per_pixel","identifier":388,"description":"If known, specifies the number of LEDs in parallel on this device.\nThe actual number of LEDs is `num_pixels * leds_per_pixel`.","fields":[{"name":"_","unit":"#","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"packFormat":"u16"},{"kind":"const","name":"wave_length","identifier":389,"description":"If monochrome LED, specifies the wave length of the LED.\nRegister is missing for RGB LEDs.","fields":[{"name":"_","unit":"nm","type":"u16","storage":2,"isSimpleType":true,"typicalMin":365,"typicalMax":885}],"optional":true,"packFormat":"u16"},{"kind":"const","name":"luminous_intensity","identifier":390,"description":"The luminous intensity of all the LEDs, at full brightness, in micro candella.","fields":[{"name":"_","unit":"mcd","type":"u16","storage":2,"isSimpleType":true,"typicalMin":10,"typicalMax":5000}],"optional":true,"packFormat":"u16"},{"kind":"const","name":"variant","identifier":263,"description":"Specifies the shape of the light strip.","fields":[{"name":"_","type":"Variant","storage":1}],"optional":true,"identifierName":"variant","packFormat":"u8"}],"tags":[],"group":"Light"},{"name":"LED Single","status":"deprecated","shortId":"ledsingle","camelName":"ledSingle","shortName":"ledSingle","extends":["_base"],"notes":{"short":"A controller for 1 or more monochrome or RGB LEDs connected in parallel."},"classIdentifier":506480888,"enums":{"Variant":{"name":"Variant","storage":1,"members":{"ThroughHole":1,"SMD":2,"Power":3,"Bead":4}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"command","name":"animate","identifier":128,"description":"This has the same semantics as `set_status_light` in the control service.","fields":[{"name":"to_red","type":"u8","storage":1,"isSimpleType":true},{"name":"to_green","type":"u8","storage":1,"isSimpleType":true},{"name":"to_blue","type":"u8","storage":1,"isSimpleType":true},{"name":"speed","type":"u8","storage":1,"isSimpleType":true}],"packFormat":"u8 u8 u8 u8"},{"kind":"ro","name":"color","identifier":384,"description":"The current color of the LED.","fields":[{"name":"red","type":"u8","storage":1,"isSimpleType":true},{"name":"green","type":"u8","storage":1,"isSimpleType":true},{"name":"blue","type":"u8","storage":1,"isSimpleType":true}],"packFormat":"u8 u8 u8"},{"kind":"rw","name":"max_power","identifier":7,"description":"Limit the power drawn by the light-strip (and controller).","fields":[{"name":"_","unit":"mA","type":"u16","storage":2,"isSimpleType":true,"defaultValue":100}],"optional":true,"identifierName":"max_power","packFormat":"u16"},{"kind":"const","name":"led_count","identifier":387,"description":"If known, specifies the number of LEDs in parallel on this device.","fields":[{"name":"_","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"packFormat":"u16"},{"kind":"const","name":"wave_length","identifier":385,"description":"If monochrome LED, specifies the wave length of the LED.","fields":[{"name":"_","unit":"nm","type":"u16","storage":2,"isSimpleType":true,"typicalMin":365,"typicalMax":885}],"optional":true,"packFormat":"u16"},{"kind":"const","name":"luminous_intensity","identifier":386,"description":"The luminous intensity of the LED, at full value, in micro candella.","fields":[{"name":"_","unit":"mcd","type":"u16","storage":2,"isSimpleType":true,"typicalMin":10,"typicalMax":5000}],"optional":true,"packFormat":"u16"},{"kind":"const","name":"variant","identifier":263,"description":"The physical type of LED.","fields":[{"name":"_","type":"Variant","storage":1}],"optional":true,"identifierName":"variant","packFormat":"u8"}],"tags":["8bit","padauk"],"group":"Light"},{"name":"LED Strip","status":"stable","shortId":"ledstrip","camelName":"ledStrip","shortName":"ledStrip","extends":["_base"],"notes":{"short":"A controller for strips of individually controlled RGB LEDs.","long":"## Light programs\n\nWith 1 mbit Jacdac, we can transmit under 2k of data per animation frame (at 20fps).\nIf transmitting raw data that would be around 500 pixels, which is not enough for many\ninstallations and it would completely clog the network.\n\nThus, light service defines a domain-specific language for describing light animations\nand efficiently transmitting them over wire. For short LED displays, less than 64 LEDs, \nyou can also use the [LED service](/services/led).\n\nLight commands are not Jacdac commands.\nLight commands are efficiently encoded as sequences of bytes and typically sent as payload\nof `run` command.\n\nDefinitions:\n\n-   `P` - position in the strip\n-   `R` - number of repetitions of the command\n-   `N` - number of pixels affected by the command\n-   `C` - single color designation\n-   `C+` - sequence of color designations\n\nUpdate modes:\n\n-   `0` - replace\n-   `1` - add RGB\n-   `2` - subtract RGB\n-   `3` - multiply RGB (by c/128); each pixel value will change by at least 1\n\nProgram commands:\n\n-   `0xD0: setall C+` - set all pixels in current range to given color pattern\n-   `0xD1: fade C+` - set pixels in current range to colors between colors in sequence\n-   `0xD2: fadehsv C+` - similar to `fade()`, but colors are specified and faded in HSV\n-   `0xD3: rotfwd K` - rotate (shift) pixels by `K` positions away from the connector\n-   `0xD4: rotback K` - same, but towards the connector\n-   `0xD5: show M=50` - send buffer to strip and wait `M` milliseconds\n-   `0xD6: range P=0 N=length W=1 S=0` - range from pixel `P`, `N` pixels long (currently unsupported: every `W` pixels skip `S` pixels)\n-   `0xD7: mode K=0` - set update mode\n-   `0xD8: tmpmode K=0` - set update mode for next command only\n-   `0xCF: setone P C` - set one pixel at `P` (in current range) to given color\n-   `mult V` - macro to multiply current range by given value (float)\n\nA number `k` is encoded as follows:\n\n-   `0 <= k < 128` -> `k`\n-   `128 <= k < 16383` -> `0x80 | (k >> 8), k & 0xff`\n-   bigger and negative numbers are not supported\n\nThus, bytes `0xC0-0xFF` are free to use for commands.\n\nFormats:\n\n-   `0xC1, R, G, B` - single color parameter\n-   `0xC2, R0, G0, B0, R1, G1, B1` - two color parameter\n-   `0xC3, R0, G0, B0, R1, G1, B1, R2, G2, B2` - three color parameter\n-   `0xC0, N, R0, G0, B0, ..., R(N-1), G(N-1), B(N-1)` - `N` color parameter\n-   `0xCF, <number>, R, G, B` - `set1` special format\n\nCommands are encoded as command byte, followed by parameters in the order\nfrom the command definition.\n\nThe `setone()` command has irregular encoding to save space - it is byte `0xCF` followed by encoded\nnumber, and followed by 3 bytes of color."},"classIdentifier":309264608,"enums":{"LightType":{"name":"LightType","storage":1,"members":{"WS2812B_GRB":0,"APA102":16,"SK9822":17}},"Variant":{"name":"Variant","storage":1,"members":{"Strip":1,"Ring":2,"Stick":3,"Jewel":4,"Matrix":5}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"brightness","identifier":1,"description":"Set the luminosity of the strip.\nAt `0` the power to the strip is completely shut down.","fields":[{"name":"_","unit":"/","shift":8,"type":"u0.8","storage":1,"defaultValue":0.05}],"identifierName":"intensity","packFormat":"u0.8"},{"kind":"ro","name":"actual_brightness","identifier":384,"description":"This is the luminosity actually applied to the strip.\nMay be lower than `brightness` if power-limited by the `max_power` register.\nIt will rise slowly (few seconds) back to `brightness` is limits are no longer required.","fields":[{"name":"_","unit":"/","shift":8,"type":"u0.8","storage":1}],"packFormat":"u0.8"},{"kind":"rw","name":"light_type","identifier":128,"description":"Specifies the type of light strip connected to controller.\nControllers which are sold with lights should default to the correct type\nand could not allow change.","fields":[{"name":"_","type":"LightType","storage":1}],"packFormat":"u8"},{"kind":"rw","name":"num_pixels","identifier":129,"description":"Specifies the number of pixels in the strip.\nControllers which are sold with lights should default to the correct length\nand could not allow change. Increasing length at runtime leads to ineffective use of memory and may lead to controller reboot.","fields":[{"name":"_","unit":"#","type":"u16","storage":2,"isSimpleType":true,"defaultValue":15}],"packFormat":"u16"},{"kind":"rw","name":"num_columns","identifier":131,"description":"If the LED pixel strip is a matrix, specifies the number of columns. Otherwise, a square shape is assumed. Controllers which are sold with lights should default to the correct length\nand could not allow change. Increasing length at runtime leads to ineffective use of memory and may lead to controller reboot.","fields":[{"name":"_","unit":"#","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"packFormat":"u16"},{"kind":"rw","name":"max_power","identifier":7,"description":"Limit the power drawn by the light-strip (and controller).","fields":[{"name":"_","unit":"mA","type":"u16","storage":2,"isSimpleType":true,"defaultValue":200}],"identifierName":"max_power","packFormat":"u16"},{"kind":"const","name":"max_pixels","identifier":385,"description":"The maximum supported number of pixels.\nAll writes to `num_pixels` are clamped to `max_pixels`.","fields":[{"name":"_","unit":"#","type":"u16","storage":2,"isSimpleType":true}],"packFormat":"u16"},{"kind":"rw","name":"num_repeats","identifier":130,"description":"How many times to repeat the program passed in `run` command.\nShould be set before the `run` command.\nSetting to `0` means to repeat forever.","fields":[{"name":"_","unit":"#","type":"u16","storage":2,"isSimpleType":true,"defaultValue":1}],"packFormat":"u16"},{"kind":"const","name":"variant","identifier":263,"description":"Specifies the shape of the light strip.","fields":[{"name":"_","type":"Variant","storage":1}],"optional":true,"identifierName":"variant","packFormat":"u8"},{"kind":"command","name":"run","identifier":129,"description":"Run the given light \"program\". See service description for details.","fields":[{"name":"program","type":"bytes","storage":0,"isSimpleType":true}],"unique":true,"packFormat":"b"}],"tags":["C"],"group":"Light"},{"name":"Light bulb","status":"rc","shortId":"lightbulb","camelName":"lightBulb","shortName":"lightBulb","extends":["_base"],"notes":{"short":"A light bulb controller."},"classIdentifier":480970060,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"brightness","identifier":1,"description":"Indicates the brightness of the light bulb. Zero means completely off and 0xffff means completely on.\nFor non-dimmable lights, the value should be clamp to 0xffff for any non-zero value.","fields":[{"name":"_","unit":"/","shift":16,"type":"u0.16","storage":2}],"identifierName":"intensity","packFormat":"u0.16"},{"kind":"const","name":"dimmable","identifier":384,"description":"Indicates if the light supports dimming.","fields":[{"name":"_","type":"bool","storage":1}],"optional":true,"packFormat":"u8"}],"tags":[],"group":"Light"},{"name":"Light level","status":"stable","shortId":"lightlevel","camelName":"lightLevel","shortName":"lightLevel","extends":["_base","_sensor"],"notes":{"short":"A sensor that measures luminosity level."},"classIdentifier":400333340,"enums":{"Variant":{"name":"Variant","storage":1,"members":{"PhotoResistor":1,"ReverseBiasedLED":2}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"light_level","identifier":257,"description":"Detect light level","fields":[{"name":"_","unit":"/","shift":16,"type":"u0.16","storage":2}],"volatile":true,"identifierName":"reading","packFormat":"u0.16"},{"kind":"ro","name":"light_level_error","identifier":262,"description":"Absolute estimated error of the reading value","fields":[{"name":"_","unit":"/","shift":16,"type":"u0.16","storage":2}],"volatile":true,"optional":true,"identifierName":"reading_error","packFormat":"u0.16"},{"kind":"const","name":"variant","identifier":263,"description":"The type of physical sensor.","fields":[{"name":"_","type":"Variant","storage":1}],"optional":true,"identifierName":"variant","packFormat":"u8"}],"tags":["8bit","padauk","input"],"group":"Environment"},{"name":"Logger","status":"stable","shortId":"logger","camelName":"logger","shortName":"logger","extends":["_base"],"notes":{"short":"A service which can report messages to the bus."},"classIdentifier":316415946,"enums":{"Priority":{"name":"Priority","storage":1,"members":{"Debug":0,"Log":1,"Warning":2,"Error":3,"Silent":4}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"min_priority","identifier":128,"description":"Messages with level lower than this won't be emitted. The default setting may vary.\nLoggers should revert this to their default setting if the register has not been\nupdated in 3000ms, and also keep the lowest setting they have seen in the last 1500ms.\nThus, clients should write this register every 1000ms and ignore messages which are\ntoo verbose for them.","fields":[{"name":"_","type":"Priority","storage":1,"defaultValue":1}],"packFormat":"u8"},{"kind":"report","name":"debug","identifier":128,"description":"Report a message.","fields":[{"name":"message","type":"string","storage":0}],"packFormat":"s"},{"kind":"report","name":"log","identifier":129,"description":"Report a message.","fields":[{"name":"message","type":"string","storage":0}],"packFormat":"s"},{"kind":"report","name":"warn","identifier":130,"description":"Report a message.","fields":[{"name":"message","type":"string","storage":0}],"packFormat":"s"},{"kind":"report","name":"error","identifier":131,"description":"Report a message.","fields":[{"name":"message","type":"string","storage":0}],"packFormat":"s"}],"tags":["infrastructure","C"]},{"name":"Magnetic field level","status":"stable","shortId":"magneticfieldlevel","camelName":"magneticFieldLevel","shortName":"magneticFieldLevel","extends":["_base","_sensor"],"notes":{"short":"A sensor that measures strength and polarity of magnetic field."},"classIdentifier":318642191,"enums":{"Variant":{"name":"Variant","storage":1,"members":{"AnalogNS":1,"AnalogN":2,"AnalogS":3,"DigitalNS":4,"DigitalN":5,"DigitalS":6}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"strength","identifier":257,"description":"Indicates the strength of magnetic field between -1 and 1.\nWhen no magnet is present the value should be around 0.\nFor analog sensors,\nwhen the north pole of the magnet is on top of the module\nand closer than south pole, then the value should be positive.\nFor digital sensors,\nthe value should either `0` or `1`, regardless of polarity.","fields":[{"name":"_","unit":"/","shift":15,"type":"i1.15","storage":-2}],"volatile":true,"identifierName":"reading","packFormat":"i1.15"},{"kind":"ro","name":"detected","identifier":385,"description":"Determines if the magnetic field is present.\nIf the event `active` is observed, `detected` is true; if `inactive` is observed, `detected` is false.","fields":[{"name":"_","type":"bool","storage":1}],"client":true,"packFormat":"u8"},{"kind":"const","name":"variant","identifier":263,"description":"Determines which magnetic poles the sensor can detected,\nand whether or not it can measure their strength or just presence.","fields":[{"name":"_","type":"Variant","storage":1}],"optional":true,"identifierName":"variant","packFormat":"u8"},{"kind":"event","name":"active","identifier":1,"description":"Emitted when strong-enough magnetic field is detected.","fields":[],"identifierName":"active"},{"kind":"event","name":"inactive","identifier":2,"description":"Emitted when strong-enough magnetic field is no longer detected.","fields":[],"identifierName":"inactive"}],"tags":["8bit","padauk","input"],"group":"Environment"},{"name":"Magnetometer","status":"rc","shortId":"magnetomer","camelName":"magnetometer","shortName":"magnetometer","extends":["_base","_sensor"],"notes":{"short":"A 3-axis magnetometer."},"classIdentifier":318935176,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"forces","identifier":257,"description":"Indicates the current magnetic field on magnetometer.\nFor reference: `1 mgauss` is `100 nT` (and `1 gauss` is `100 000 nT`).","fields":[{"name":"x","unit":"nT","type":"i32","storage":-4,"isSimpleType":true},{"name":"y","unit":"nT","type":"i32","storage":-4,"isSimpleType":true},{"name":"z","unit":"nT","type":"i32","storage":-4,"isSimpleType":true}],"volatile":true,"identifierName":"reading","packFormat":"i32 i32 i32"},{"kind":"ro","name":"forces_error","identifier":262,"description":"Absolute estimated error on the readings.","fields":[{"name":"_","unit":"nT","type":"i32","storage":-4,"isSimpleType":true}],"volatile":true,"optional":true,"identifierName":"reading_error","packFormat":"i32"},{"kind":"command","name":"calibrate","identifier":2,"description":"Forces a calibration sequence where the user/device\nmight have to rotate to be calibrated.","fields":[],"identifierName":"calibrate"}],"tags":[]},{"name":"Matrix Keypad","status":"experimental","shortId":"matrixkeypad","camelName":"matrixKeypad","shortName":"matrixKeypad","extends":["_base","_sensor"],"notes":{"short":"A matrix of buttons connected as a keypad"},"classIdentifier":319172040,"enums":{"Variant":{"name":"Variant","storage":1,"members":{"Membrane":1,"Keyboard":2,"Elastomer":3,"ElastomerLEDPixel":4}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"pressed","identifier":257,"description":"The coordinate of the button currently pressed. Keys are zero-indexed from left to right, top to bottom:\n``row = index / columns``, ``column = index % columns``.","fields":[{"name":"index","type":"u8","storage":1,"isSimpleType":true,"startRepeats":true}],"volatile":true,"identifierName":"reading","packFormat":"r: u8"},{"kind":"const","name":"rows","identifier":384,"description":"Number of rows in the matrix","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"packFormat":"u8"},{"kind":"const","name":"columns","identifier":385,"description":"Number of columns in the matrix","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"packFormat":"u8"},{"kind":"const","name":"labels","identifier":386,"description":"The characters printed on the keys if any, in indexing sequence.","fields":[{"name":"label","type":"string0","storage":0,"startRepeats":true}],"optional":true,"packFormat":"r: z"},{"kind":"const","name":"variant","identifier":263,"description":"The type of physical keypad. If the variant is ``ElastomerLEDPixel``\nand the next service on the device is a ``LEDPixel`` service, it is considered\nas the service controlling the LED pixel on the keypad.","fields":[{"name":"_","type":"Variant","storage":1}],"optional":true,"identifierName":"variant","packFormat":"u8"},{"kind":"event","name":"down","identifier":1,"description":"Emitted when a key, at the given index, goes from inactive (`pressed == 0`) to active.","fields":[{"name":"_","type":"u8","storage":1,"isSimpleType":true}],"identifierName":"active","packFormat":"u8"},{"kind":"event","name":"up","identifier":2,"description":"Emitted when a key, at the given index, goes from active (`pressed == 1`) to inactive.","fields":[{"name":"_","type":"u8","storage":1,"isSimpleType":true}],"identifierName":"inactive","packFormat":"u8"},{"kind":"event","name":"click","identifier":128,"description":"Emitted together with `up` when the press time was not longer than 500ms.","fields":[{"name":"_","type":"u8","storage":1,"isSimpleType":true}],"packFormat":"u8"},{"kind":"event","name":"long_click","identifier":129,"description":"Emitted together with `up` when the press time was more than 500ms.","fields":[{"name":"_","type":"u8","storage":1,"isSimpleType":true}],"packFormat":"u8"}],"tags":[],"group":"Button"},{"name":"Microphone","status":"experimental","shortId":"microphone","camelName":"microphone","shortName":"microphone","extends":["_base"],"notes":{"short":"A single-channel microphone."},"classIdentifier":289254534,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"command","name":"sample","identifier":129,"description":"The samples will be streamed back over the `samples` pipe.\nIf `num_samples` is `0`, streaming will only stop when the pipe is closed.\nOtherwise the specified number of samples is streamed.\nSamples are sent as `i16`.","fields":[{"name":"samples","type":"pipe","storage":12},{"name":"num_samples","type":"u32","storage":4,"isSimpleType":true}],"pipeType":"sample","packFormat":"b[12] u32"},{"kind":"rw","name":"sampling_period","identifier":128,"description":"Get or set microphone sampling period.\nSampling rate is `1_000_000 / sampling_period Hz`.","fields":[{"name":"_","unit":"us","type":"u32","storage":4,"isSimpleType":true}],"packFormat":"u32"}],"tags":[],"group":"Sound"},{"name":"MIDI output","status":"experimental","shortId":"midioutput","camelName":"midiOutput","shortName":"midiOutput","extends":["_base"],"notes":{"short":"A MIDI output device."},"classIdentifier":444894423,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"enabled","identifier":1,"description":"Opens or closes the port to the MIDI device","fields":[{"name":"_","type":"bool","storage":1}],"identifierName":"intensity","packFormat":"u8"},{"kind":"command","name":"clear","identifier":128,"description":"Clears any pending send data that has not yet been sent from the MIDIOutput's queue.","fields":[]},{"kind":"command","name":"send","identifier":129,"description":"Enqueues the message to be sent to the corresponding MIDI port","fields":[{"name":"data","type":"bytes","storage":0,"isSimpleType":true}],"unique":true,"packFormat":"b"}],"tags":[],"group":"Sound"},{"name":"Model Runner","status":"experimental","shortId":"modelrunner","camelName":"modelRunner","shortName":"modelRunner","extends":["_base"],"notes":{"short":"Runs machine learning models.\n\nOnly models with a single input tensor and a single output tensor are supported at the moment.\nInput is provided by Sensor Aggregator service on the same device.\nMultiple instances of this service may be present, if more than one model format is supported by a device."},"classIdentifier":336566904,"enums":{"ModelFormat":{"name":"ModelFormat","storage":4,"members":{"TFLite":860636756,"ML4F":809963362,"EdgeImpulseCompiled":810961221}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"command","name":"set_model","identifier":128,"description":"Open pipe for streaming in the model. The size of the model has to be declared upfront.\nThe model is streamed over regular pipe data packets.\nThe format supported by this instance of the service is specified in `format` register.\nWhen the pipe is closed, the model is written all into flash, and the device running the service may reset.","fields":[{"name":"model_size","unit":"B","type":"u32","storage":4,"isSimpleType":true}],"unique":true,"hasReport":true,"packFormat":"u32"},{"kind":"report","name":"set_model","identifier":128,"description":"Open pipe for streaming in the model. The size of the model has to be declared upfront.\nThe model is streamed over regular pipe data packets.\nThe format supported by this instance of the service is specified in `format` register.\nWhen the pipe is closed, the model is written all into flash, and the device running the service may reset.","fields":[{"name":"model_port","type":"pipe_port","storage":2}],"secondary":true,"pipeType":"set_model","packFormat":"u16"},{"kind":"command","name":"predict","identifier":129,"description":"Open channel that can be used to manually invoke the model. When enough data is sent over the `inputs` pipe, the model is invoked,\nand results are send over the `outputs` pipe.","fields":[{"name":"outputs","type":"pipe","storage":12}],"pipeType":"predict","hasReport":true,"packFormat":"b[12]"},{"kind":"report","name":"predict","identifier":129,"description":"Open channel that can be used to manually invoke the model. When enough data is sent over the `inputs` pipe, the model is invoked,\nand results are send over the `outputs` pipe.","fields":[{"name":"inputs","type":"pipe_port","storage":2}],"secondary":true,"pipeType":"predict","packFormat":"u16"},{"kind":"rw","name":"auto_invoke_every","identifier":128,"description":"When register contains `N > 0`, run the model automatically every time new `N` samples are collected.\nModel may be run less often if it takes longer to run than `N * sampling_interval`.\nThe `outputs` register will stream its value after each run.\nThis register is not stored in flash.","fields":[{"name":"_","type":"u16","storage":2,"isSimpleType":true}],"packFormat":"u16"},{"kind":"ro","name":"outputs","identifier":257,"description":"Results of last model invocation as `float32` array.","fields":[{"name":"output","isFloat":true,"type":"f32","storage":4,"startRepeats":true}],"volatile":true,"identifierName":"reading","packFormat":"r: f32"},{"kind":"ro","name":"input_shape","identifier":384,"description":"The shape of the input tensor.","fields":[{"name":"dimension","type":"u16","storage":2,"isSimpleType":true,"startRepeats":true}],"packFormat":"r: u16"},{"kind":"ro","name":"output_shape","identifier":385,"description":"The shape of the output tensor.","fields":[{"name":"dimension","type":"u16","storage":2,"isSimpleType":true,"startRepeats":true}],"packFormat":"r: u16"},{"kind":"ro","name":"last_run_time","identifier":386,"description":"The time consumed in last model execution.","fields":[{"name":"_","unit":"us","type":"u32","storage":4,"isSimpleType":true}],"packFormat":"u32"},{"kind":"ro","name":"allocated_arena_size","identifier":387,"description":"Number of RAM bytes allocated for model execution.","fields":[{"name":"_","unit":"B","type":"u32","storage":4,"isSimpleType":true}],"packFormat":"u32"},{"kind":"ro","name":"model_size","identifier":388,"description":"The size of the model in bytes.","fields":[{"name":"_","unit":"B","type":"u32","storage":4,"isSimpleType":true}],"packFormat":"u32"},{"kind":"ro","name":"last_error","identifier":389,"description":"Textual description of last error when running or loading model (if any).","fields":[{"name":"_","type":"string","storage":0}],"packFormat":"s"},{"kind":"const","name":"format","identifier":390,"description":"The type of ML models supported by this service.\n`TFLite` is flatbuffer `.tflite` file.\n`ML4F` is compiled machine code model for Cortex-M4F.\nThe format is typically present as first or second little endian word of model file.","fields":[{"name":"_","type":"ModelFormat","storage":4}],"packFormat":"u32"},{"kind":"const","name":"format_version","identifier":391,"description":"A version number for the format.","fields":[{"name":"_","type":"u32","storage":4,"isSimpleType":true}],"packFormat":"u32"},{"kind":"const","name":"parallel","identifier":392,"description":"If present and true this service can run models independently of other\ninstances of this service on the device.","fields":[{"name":"_","type":"bool","storage":1}],"optional":true,"packFormat":"u8"}],"tags":[]},{"name":"Motion","status":"experimental","shortId":"motion","camelName":"motion","shortName":"motion","extends":["_base","_sensor"],"notes":{"short":"A sensor, typically PIR, that detects object motion within a certain range"},"classIdentifier":293185353,"enums":{"Variant":{"name":"Variant","storage":1,"members":{"PIR":1}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"moving","identifier":257,"description":"Reports is movement is currently detected by the sensor.","fields":[{"name":"_","type":"bool","storage":1}],"volatile":true,"identifierName":"reading","preferredInterval":1000,"packFormat":"u8"},{"kind":"const","name":"max_distance","identifier":384,"description":"Maximum distance where objects can be detected.","fields":[{"name":"_","unit":"m","shift":16,"type":"u16.16","storage":4}],"optional":true,"packFormat":"u16.16"},{"kind":"const","name":"angle","identifier":385,"description":"Opening of the field of view","fields":[{"name":"_","unit":"°","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"packFormat":"u16"},{"kind":"const","name":"variant","identifier":263,"description":"Type of physical sensor","fields":[{"name":"_","type":"Variant","storage":1}],"optional":true,"identifierName":"variant","packFormat":"u8"},{"kind":"event","name":"movement","identifier":1,"description":"A movement was detected.","fields":[],"identifierName":"active"}],"tags":["8bit"],"group":"Movement"},{"name":"Motor","status":"rc","shortId":"motor","camelName":"motor","shortName":"motor","extends":["_base"],"notes":{"short":"A DC motor."},"classIdentifier":385895640,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"speed","identifier":2,"description":"Relative speed of the motor. Use positive/negative values to run the motor forwards and backwards.\nPositive is recommended to be clockwise rotation and negative counterclockwise. A speed of ``0`` \nwhile ``enabled`` acts as brake.","fields":[{"name":"_","unit":"/","shift":15,"type":"i1.15","storage":-2}],"identifierName":"value","packFormat":"i1.15"},{"kind":"rw","name":"enabled","identifier":1,"description":"Turn the power to the motor on/off.","fields":[{"name":"_","type":"bool","storage":1}],"identifierName":"intensity","packFormat":"u8"},{"kind":"const","name":"load_torque","identifier":384,"description":"Torque required to produce the rated power of an electrical motor at load speed.","fields":[{"name":"_","unit":"kg/cm","shift":16,"type":"u16.16","storage":4}],"optional":true,"packFormat":"u16.16"},{"kind":"const","name":"load_rotation_speed","identifier":385,"description":"Revolutions per minute of the motor under full load.","fields":[{"name":"_","unit":"rpm","shift":16,"type":"u16.16","storage":4}],"optional":true,"packFormat":"u16.16"},{"kind":"const","name":"reversible","identifier":386,"description":"Indicates if the motor can run backwards.","fields":[{"name":"_","type":"bool","storage":1}],"optional":true,"packFormat":"u8"}],"tags":["C","8bit"]},{"name":"Multitouch","status":"experimental","shortId":"multitouch","camelName":"multitouch","shortName":"multitouch","extends":["_base","_sensor"],"notes":{"short":"A capacitive touch sensor with multiple inputs.","events":"Most events include the channel number of the input."},"classIdentifier":487664309,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"capacity","identifier":257,"description":"Capacitance of channels. The capacitance is continuously calibrated, and a value of `0` indicates\nno touch, wheres a value of around `100` or more indicates touch.\nIt's best to ignore this (unless debugging), and use events.\n\nDigital sensors will use `0` or `0xffff` on each channel.","fields":[{"name":"capacitance","type":"i16","storage":-2,"isSimpleType":true,"startRepeats":true}],"volatile":true,"identifierName":"reading","packFormat":"r: i16"},{"kind":"event","name":"touch","identifier":1,"description":"Emitted when an input is touched.","fields":[{"name":"channel","type":"u8","storage":1,"isSimpleType":true}],"identifierName":"active","packFormat":"u8"},{"kind":"event","name":"release","identifier":2,"description":"Emitted when an input is no longer touched.","fields":[{"name":"channel","type":"u8","storage":1,"isSimpleType":true}],"identifierName":"inactive","packFormat":"u8"},{"kind":"event","name":"tap","identifier":128,"description":"Emitted when an input is briefly touched. TODO Not implemented.","fields":[{"name":"channel","type":"u8","storage":1,"isSimpleType":true}],"packFormat":"u8"},{"kind":"event","name":"long_press","identifier":129,"description":"Emitted when an input is touched for longer than 500ms. TODO Not implemented.","fields":[{"name":"channel","type":"u8","storage":1,"isSimpleType":true}],"packFormat":"u8"},{"kind":"event","name":"swipe_pos","identifier":144,"description":"Emitted when input channels are successively touched in order of increasing channel numbers.","fields":[{"name":"duration","unit":"ms","type":"u16","storage":2,"isSimpleType":true},{"name":"start_channel","type":"u8","storage":1,"isSimpleType":true},{"name":"end_channel","type":"u8","storage":1,"isSimpleType":true}],"packFormat":"u16 u8 u8"},{"kind":"event","name":"swipe_neg","identifier":145,"description":"Emitted when input channels are successively touched in order of decreasing channel numbers.","fields":[{"name":"duration","unit":"ms","type":"u16","storage":2,"isSimpleType":true},{"name":"start_channel","type":"u8","storage":1,"isSimpleType":true},{"name":"end_channel","type":"u8","storage":1,"isSimpleType":true}],"packFormat":"u16 u8 u8"}],"tags":[],"group":"Button"},{"name":"PC controller","status":"experimental","shortId":"pccontroller","camelName":"PCController","shortName":"PCController","extends":["_base"],"notes":{"short":"Send various events to PC, including opening a URL, start an app, sending text, etc."},"classIdentifier":289212807,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"command","name":"open_url","identifier":128,"description":"Open a URL in the default browser.","fields":[{"name":"url","type":"string","storage":0}],"packFormat":"s"},{"kind":"command","name":"start_app","identifier":129,"description":"Start an app.","fields":[{"name":"name","type":"string","storage":0}],"packFormat":"s"},{"kind":"command","name":"send_text","identifier":130,"description":"Send text to the active window.","fields":[{"name":"text","type":"string","storage":0}],"packFormat":"s"},{"kind":"command","name":"run_script","identifier":131,"description":"Run a script.","fields":[{"name":"script","type":"string","storage":0}],"packFormat":"s"}],"tags":[]},{"name":"PC monitor","status":"experimental","shortId":"pcmonitor","camelName":"PCMonitor","shortName":"PCMonitor","extends":["_base"],"notes":{"short":"Measures PC monitor."},"classIdentifier":409107221,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"ro","name":"cpu_usage","identifier":400,"description":"CPU usage in percent.","fields":[{"name":"_","unit":"%","type":"u8","storage":1,"isSimpleType":true}],"packFormat":"u8"},{"kind":"ro","name":"cpu_temperature","identifier":401,"description":"CPU temperature in Celsius.","fields":[{"name":"_","unit":"°C","type":"u8","storage":1,"isSimpleType":true}],"packFormat":"u8"},{"kind":"ro","name":"ram_usage","identifier":402,"description":"RAM usage in percent.","fields":[{"name":"_","unit":"%","type":"u8","storage":1,"isSimpleType":true}],"packFormat":"u8"},{"kind":"ro","name":"gpu_information","identifier":403,"description":"GPU info.","fields":[{"name":"usage","unit":"%","type":"u8","storage":1,"isSimpleType":true},{"name":"temperature","unit":"°C","type":"u8","storage":1,"isSimpleType":true}],"packFormat":"u8 u8"},{"kind":"ro","name":"network_information","identifier":405,"description":"Network transmit/receive speed in Kbytes per second.\n\nA measure of PC monitor.","fields":[{"name":"tx","unit":"KB","type":"u16","storage":2,"isSimpleType":true},{"name":"rx","unit":"KB","type":"u16","storage":2,"isSimpleType":true}],"packFormat":"u16 u16"}],"tags":[]},{"name":"Planar position","status":"experimental","shortId":"planarposition","camelName":"planarPosition","shortName":"planarPosition","extends":["_base","_sensor"],"notes":{"short":"A sensor that repors 2D position, typically an optical mouse tracking sensor.\n\nThe sensor starts at an arbitrary origin (0,0) and reports the distance from that origin.\n\nThe `streaming_interval` is respected when the position is changing. When the position is not changing, the streaming interval may be throttled to `500ms`."},"classIdentifier":499351381,"enums":{"Variant":{"name":"Variant","storage":1,"members":{"OpticalMousePosition":1}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"position","identifier":257,"description":"The current position of the sensor.","fields":[{"name":"x","unit":"mm","shift":10,"type":"i22.10","storage":-4},{"name":"y","unit":"mm","shift":10,"type":"i22.10","storage":-4}],"volatile":true,"identifierName":"reading","packFormat":"i22.10 i22.10"},{"kind":"const","name":"variant","identifier":263,"description":"Specifies the type of physical sensor.","fields":[{"name":"_","type":"Variant","storage":1}],"optional":true,"identifierName":"variant","packFormat":"u8"}],"tags":[],"group":"Movement"},{"name":"Potentiometer","status":"stable","shortId":"potentiometer","camelName":"potentiometer","shortName":"potentiometer","extends":["_base","_sensor"],"notes":{"short":"A slider or rotary potentiometer."},"classIdentifier":522667846,"enums":{"Variant":{"name":"Variant","storage":1,"members":{"Slider":1,"Rotary":2,"Hall":3}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"position","identifier":257,"description":"The relative position of the slider.","fields":[{"name":"_","unit":"/","shift":16,"type":"u0.16","storage":2}],"volatile":true,"identifierName":"reading","packFormat":"u0.16"},{"kind":"const","name":"variant","identifier":263,"description":"Specifies the physical layout of the potentiometer.","fields":[{"name":"_","type":"Variant","storage":1}],"optional":true,"identifierName":"variant","packFormat":"u8"}],"tags":["C","8bit","input"],"group":"Slider"},{"name":"Power","status":"experimental","shortId":"power","camelName":"power","shortName":"power","extends":["_base"],"notes":{"short":"A power-provider service.","long":"## Power negotiation protocol\n\nThe purpose of the power negotiation is to ensure that there is no more than [I<sub>out_hc(max)</sub>](https://microsoft.github.io/jacdac-docs/reference/electrical-spec/#power-providers) delivered to the power rail.\nThis is realized by limiting the number of enabled power provider services to one.\n\nNote, that it's also possible to have low-current power providers,\nwhich are limited to [I<sub>out_lc(max)</sub>](https://microsoft.github.io/jacdac-docs/reference/electrical-spec/#power-providers) and do not run a power provider service.\nThese are **not** accounted for in the power negotiation protocol.\n\nPower providers can have multiple _channels_, typically multiple Jacdac ports on the provider.\nEach channel can be limited to [I<sub>out_hc(max)</sub>](https://microsoft.github.io/jacdac-docs/reference/electrical-spec/#power-providers) separately.\nIn normal operation, the data lines of each channels are connected together.\nThe ground lines are always connected together.\nMulti-channel power providers are also called _powered hubs_.\n\nWhile channels have separate current limits, there's nothing to prevent the user\nfrom joining two or more channels outside of the provider using a passive hub.\nThis would allow more than [I<sub>out_hc(max)</sub>](https://microsoft.github.io/jacdac-docs/reference/electrical-spec/#power-providers) of current to be drawn, resulting in cables or components\ngetting hot and/or malfunctioning.\nThus, the power negotiation protocol seeks to detect situations where\nmultiple channels of power provider(s) are bridged together\nand shut down all but one of the channels involved.\n\nThe protocol is built around the power providers periodically sending specially crafted\n`shutdown` commands in broadcast mode.\nNote that this is unusual - services typically only send reports.\n\nThe `shutdown` commands can be reliably identified based on their first half (more details below).\nWhen a power provider starts receiving a `shutdown` command, it needs to take\nsteps to identify which of its channels the command is coming from.\nThis is typically realized with analog switches between the data lines of channels.\nThe delivery of power over the channel which received the `shutdown` command is then shut down.\nNote that in the case of a single-channel provider, any received `shutdown` command will cause a shut down.\n\nA multi-channel provider needs to also identify when a `shutdown` command it sent from one channel\nis received on any of its other channels and shut down one of the channels involved.\n\nIt is also possible to build a _data bridge_ device, with two or more ports.\nIt passes through all data except for `shutdown` commands,\nbut **does not** connect the power lines.\n\n### Protocol details\n\nThe `shutdown` commands follow a very narrow format:\n* they need to be the only packet in the frame (and thus we can also call them `shutdown` frames)\n* the second word of `device_id` needs to be set to `0xAA_AA_AA_AA` (alternating 0 and 1)\n* the service index is set to `0x3d`\n* the CRC is therefore fixed\n* therefore, the packet can be recognized by reading the first 8 bytes (total length is 16 bytes)\n\nThe exact byte structure of `shutdown` command is:\n`15 59 04 05 5A C9 A4 1F AA AA AA AA 00 3D 80 00`\n\nThere is one power service per channel.\nA multi-channel power provider can be implemented as one device with multiple services (typically with one MCU),\nor many devices with one service each (typically multiple MCUs).\nThe first option is preferred as it fixes the order of channels,\nbut the second option may be cheaper to implement.\n\nAfter queuing a `shutdown` command, the service enters a grace period\nuntil the report has been sent on the wire.\nDuring the grace period incoming `shutdown` commands are ignored.\n\n* Upon reset, a power service enables itself, and then only after 0-300ms (random)\n  sends the first `shutdown` command\n* Every enabled power service emits `shutdown` commands every 400-600ms (random; first few packets can be even sent more often)\n* If an enabled power service sees a `shutdown` command from somebody else,\n  it disables itself (unless in grace period)\n* If a disabled power service sees no `shutdown` command for more than ~1200ms, it enables itself\n  (this is when the previous power source is unplugged or otherwise malfunctions)\n* If a power service has been disabled for around 10s, it enables itself.\n\nAdditionally:\n* While the `allowed` register is set to `0`, the service will not enable itself (nor send `shutdown` commands)\n* When a current overdraw is detected, the service stop providing power and enters `Overload` state for around 2 seconds,\n  while still sending `shutdown` commands.\n\n### Client notes\n\nIf a client hears a `shutdown` command it just means it's on a branch of the\nnetwork with a (high) power provider.\nAs clients (brains) typically do not consume much current (as opposed to, say, servos),\nthe `shutdown` commands are typically irrelevant to them.\n\nFor power monitoring, the `power_status_changed` event (and possibly `power_status` register)\ncan be used.\nIn particular, user interfaces may alert the user to `Overload` status.\nThe `Overprovision` status is generally considered normal (eg. when two multi-channel power providers are linked together).\n\n### Server implementation notes\n\n#### A dedicated MCU per channel\n\nEvery channel has:\n* a cheap 8-bit MCU (e.g. PMS150C, PFS122),\n* a current limiter with FAULT output and ENABLE input, and\n* an analog switch.\n\nThe MCU here needs at least 4 pins per channel.\nIt is connected to data line of the channel, the control input of the switch, and to the current limiter's FAULT and ENABLE pins.\n\nThe switch connects the data line of the channel (JD_DATA_CHx) with the internal shared data bus, common to all channels (JD_DATA_COM).\nBoth the switch and the limiter are controlled by the MCU.\nA latching circuit is not needed for the limiter because the MCU will detect an overcurrent fault and shut it down immediately. \n\nDuring reception, after the beginning of `shutdown` frame is detected,\nthe switch is opened for a brief period.\nIf the `shutdown` frame is received correctly, it means it was on MCU's channel.\n\nIn the case of only one power delivery channel that's controlled by a dedicated MCU, the analog switch is not necessary. \n\n#### A shared MCU for multiple channels\n\nEvery channel has:\n* a current limiter with FAULT output and ENABLE input, \n* an analog switch, and\n* a wiggle-detection line connecting the MCU to data line of the channel\n\nThe MCU again needs at least 4 pins per channel.\nSwitches and limiters are set up like in the configuration above.\nThe Jacdac data line of the MCU is connected to internal data bus.\n\nWhile a Jacdac packet is being received, the MCU keeps checking if it is a \nbeginning of the `shutdown` frame.\nIf that is the case, it opens all switches and checks which one(s) of the channel\ndata lines wiggle (via the wiggle lines; this can be done with EXTI latches).\nThe one(s) that wiggle received the `shutdown` frame and need to be disabled.\n\nAlso, while sending the `shutdown` frames itself, it needs to be done separately\nfor each channel, with all the other switches open.\nIf during that operation we detect wiggle on other channels, then we have detected\na loop, and the respective channels needs to be disabled.\n\n#### A brain-integrated power supply\n\nHere, there's only one channel of power and we don't have hard real time requirements,\nso user-programmable brain can control it.\nThere is no need for analog switch or wiggle-detection line,\nbut a current limiter with a latching circuit is needed.\n\nThere is nothing special to do during reception of `shutdown` packet.\nWhen it is received, the current limiter should just be disabled.\n\nIdeally, exception/hard-fault handlers on the MCU should also disable the current limiter.\nSimilarly, the limiter should be disabled while the MCU is in bootloader mode,\nor otherwise unaware of the power negotiation protocol. \n\n### Rationale for the grace period\n\nConsider the following scenario:\n\n* device A queues `shutdown` command for sending\n* A receives external `shutdown` packet from B (thus disabling A)\n* the A `shutdown` command is sent from the queue (thus eventually disabling B)\n\nTo avoid that, we make sure that at the precise instant when `shutdown` command is sent,\nthe power is enabled (and thus will stay enabled until another `shutdown` command arrives).\nThis could be achieved by inspecting the enable bit, aftering acquiring the line\nand before starting UART transmission, however that would require breaking abstraction layers.\nSo instead, we never disable the service, while the `shutdown` packet is queued.\nThis may lead to delays in disabling power services, but these should be limited due to the\nrandom nature of the `shutdown` packet spacing.\n\n### Rationale for timings\n\nThe initial 0-300ms delay is set to spread out the `shutdown` periods of power services,\nto minimize collisions.\nThe `shutdown` periods are randomized 400-600ms, instead of a fixed 500ms used for regular\nservices, for the same reason.\n\nThe 1200ms period is set so that droping two `shutdown` packets in a row\nfrom the current provider will not cause power switch, while missing 3 will.\n\nThe 50-60s power switch period is arbitrary, but chosen to limit amount of switching between supplies,\nwhile keeping it short enough for user to notice any problems such switching may cause."},"classIdentifier":530893146,"enums":{"PowerStatus":{"name":"PowerStatus","storage":1,"members":{"Disallowed":0,"Powering":1,"Overload":2,"Overprovision":3}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"allowed","identifier":1,"description":"Can be used to completely disable the service.\nWhen allowed, the service may still not be providing power, see \n`power_status` for the actual current state.","fields":[{"name":"_","type":"bool","storage":1,"defaultValue":1}],"identifierName":"intensity","packFormat":"u8"},{"kind":"rw","name":"max_power","identifier":7,"description":"Limit the power provided by the service. The actual maximum limit will depend on hardware.\nThis field may be read-only in some implementations - you should read it back after setting.","fields":[{"name":"_","unit":"mA","type":"u16","storage":2,"isSimpleType":true,"defaultValue":900,"typicalMax":900,"typicalMin":0}],"optional":true,"identifierName":"max_power","packFormat":"u16"},{"kind":"ro","name":"power_status","identifier":385,"description":"Indicates whether the power provider is currently providing power (`Powering` state), and if not, why not.\n`Overprovision` means there was another power provider, and we stopped not to overprovision the bus.","fields":[{"name":"_","type":"PowerStatus","storage":1}],"volatile":true,"packFormat":"u8"},{"kind":"ro","name":"current_draw","identifier":257,"description":"Present current draw from the bus.","fields":[{"name":"_","unit":"mA","type":"u16","storage":2,"isSimpleType":true}],"volatile":true,"optional":true,"identifierName":"reading","packFormat":"u16"},{"kind":"ro","name":"battery_voltage","identifier":384,"description":"Voltage on input.","fields":[{"name":"_","unit":"mV","type":"u16","storage":2,"isSimpleType":true,"typicalMin":4500,"typicalMax":5500}],"volatile":true,"optional":true,"packFormat":"u16"},{"kind":"ro","name":"battery_charge","identifier":386,"description":"Fraction of charge in the battery.","fields":[{"name":"_","unit":"/","shift":16,"type":"u0.16","storage":2}],"volatile":true,"optional":true,"packFormat":"u0.16"},{"kind":"const","name":"battery_capacity","identifier":387,"description":"Energy that can be delivered to the bus when battery is fully charged.\nThis excludes conversion overheads if any.","fields":[{"name":"_","unit":"mWh","type":"u32","storage":4,"isSimpleType":true}],"optional":true,"packFormat":"u32"},{"kind":"rw","name":"keep_on_pulse_duration","identifier":128,"description":"Many USB power packs need current to be drawn from time to time to prevent shutdown.\nThis regulates how often and for how long such current is drawn.\nTypically a 1/8W 22 ohm resistor is used as load. This limits the duty cycle to 10%.","fields":[{"name":"_","unit":"ms","type":"u16","storage":2,"isSimpleType":true,"defaultValue":600}],"optional":true,"packFormat":"u16"},{"kind":"rw","name":"keep_on_pulse_period","identifier":129,"description":"Many USB power packs need current to be drawn from time to time to prevent shutdown.\nThis regulates how often and for how long such current is drawn.\nTypically a 1/8W 22 ohm resistor is used as load. This limits the duty cycle to 10%.","fields":[{"name":"_","unit":"ms","type":"u16","storage":2,"isSimpleType":true,"defaultValue":20000}],"optional":true,"packFormat":"u16"},{"kind":"command","name":"shutdown","identifier":128,"description":"Sent by the power service periodically, as broadcast.","fields":[]},{"kind":"event","name":"power_status_changed","identifier":3,"description":"Emitted whenever `power_status` changes.","fields":[{"name":"power_status","type":"PowerStatus","storage":1}],"identifierName":"change","packFormat":"u8"}],"tags":[]},{"name":"Power supply","status":"experimental","shortId":"powersupply","camelName":"powerSupply","shortName":"powerSupply","extends":["_base"],"notes":{"short":"A power supply with a fixed or variable voltage range"},"classIdentifier":524302175,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"enabled","identifier":1,"description":"Turns the power supply on with `true`, off with `false`.","fields":[{"name":"_","type":"bool","storage":1}],"identifierName":"intensity","packFormat":"u8"},{"kind":"rw","name":"output_voltage","identifier":2,"description":"The current output voltage of the power supply. Values provided must be in the range `minimum_voltage` to `maximum_voltage`","fields":[{"name":"_","unit":"V","isFloat":true,"type":"f64","storage":8}],"identifierName":"value","packFormat":"f64"},{"kind":"const","name":"minimum_voltage","identifier":272,"description":"The minimum output voltage of the power supply. For fixed power supplies, `minimum_voltage` should be equal to `maximum_voltage`.","fields":[{"name":"_","unit":"V","isFloat":true,"type":"f64","storage":8}],"identifierName":"min_value","packFormat":"f64"},{"kind":"const","name":"maximum_voltage","identifier":273,"description":"The maximum output voltage of the power supply. For fixed power supplies, `minimum_voltage` should be equal to `maximum_voltage`.","fields":[{"name":"_","unit":"V","isFloat":true,"type":"f64","storage":8}],"identifierName":"max_value","packFormat":"f64"}],"tags":[]},{"name":"Pressure Button","status":"rc","shortId":"pressurebutton","camelName":"pressureButton","shortName":"pressureButton","extends":["_base"],"notes":{"short":"A pressure sensitive push-button."},"classIdentifier":672612547,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"threshold","identifier":6,"description":"Indicates the threshold for ``up`` events.","fields":[{"name":"_","unit":"/","shift":16,"type":"u0.16","storage":2}],"identifierName":"active_threshold","packFormat":"u0.16"}],"tags":["8bit"],"group":"Button"},{"name":"Protocol Test","status":"experimental","shortId":"prototest","camelName":"protoTest","shortName":"protoTest","extends":["_base"],"notes":{"short":"This is test service to validate the protocol packet transmissions between the browser and a MCU.\nUse this page if you are porting Jacdac to a new platform.","long":"### Test procedure\n\nFor each ``rw`` registers, set a random value ``x``\n  * read ``rw`` and check value is equal to ``x``\n  * read ``ro`` and check value is equal to ``x``\n  * listen to ``e`` event and check that data is equal to ``x``\n  * call ``c`` command with new random value ``y``\n  * read ``rw`` and check value is equal to ``y``\n  * do all the above steps with acks\n\nFor each ``rw`` registers, there shall also\nbe an ``event`` and a ``command``. The event\nshould get raised when the value changes;\nand the command should set the value.","registers":"Every ``rw`` register has a corresponding ``ro`` regisrer\nand a corresponding ``set_...`` command to also set the value."},"classIdentifier":382158442,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"rw_bool","identifier":129,"description":"A read write bool register.","fields":[{"name":"_","type":"bool","storage":1}],"packFormat":"u8"},{"kind":"ro","name":"ro_bool","identifier":385,"description":"A read only bool register. Mirrors rw_bool.","fields":[{"name":"_","type":"bool","storage":1}],"packFormat":"u8"},{"kind":"rw","name":"rw_u32","identifier":130,"description":"A read write u32 register.","fields":[{"name":"_","type":"u32","storage":4,"isSimpleType":true}],"packFormat":"u32"},{"kind":"ro","name":"ro_u32","identifier":386,"description":"A read only u32 register.. Mirrors rw_u32.","fields":[{"name":"_","type":"u32","storage":4,"isSimpleType":true}],"packFormat":"u32"},{"kind":"rw","name":"rw_i32","identifier":131,"description":"A read write i32 register.","fields":[{"name":"_","type":"i32","storage":-4,"isSimpleType":true}],"packFormat":"i32"},{"kind":"ro","name":"ro_i32","identifier":387,"description":"A read only i32 register.. Mirrors rw_i32.","fields":[{"name":"_","type":"i32","storage":-4,"isSimpleType":true}],"packFormat":"i32"},{"kind":"rw","name":"rw_string","identifier":132,"description":"A read write string register.","fields":[{"name":"_","type":"string","storage":0}],"packFormat":"s"},{"kind":"ro","name":"ro_string","identifier":388,"description":"A read only string register. Mirrors rw_string.","fields":[{"name":"_","type":"string","storage":0}],"packFormat":"s"},{"kind":"rw","name":"rw_bytes","identifier":133,"description":"A read write string register.","fields":[{"name":"_","type":"bytes","storage":0,"isSimpleType":true}],"packFormat":"b"},{"kind":"ro","name":"ro_bytes","identifier":389,"description":"A read only string register. Mirrors ro_bytes.","fields":[{"name":"_","type":"bytes","storage":0,"isSimpleType":true}],"packFormat":"b"},{"kind":"rw","name":"rw_i8_u8_u16_i32","identifier":134,"description":"A read write i8, u8, u16, i32 register.","fields":[{"name":"i8","type":"i8","storage":-1,"isSimpleType":true},{"name":"u8","type":"u8","storage":1,"isSimpleType":true},{"name":"u16","type":"u16","storage":2,"isSimpleType":true},{"name":"i32","type":"i32","storage":-4,"isSimpleType":true}],"packFormat":"i8 u8 u16 i32"},{"kind":"ro","name":"ro_i8_u8_u16_i32","identifier":390,"description":"A read only i8, u8, u16, i32 register.. Mirrors rw_i8_u8_u16_i32.","fields":[{"name":"i8","type":"i8","storage":-1,"isSimpleType":true},{"name":"u8","type":"u8","storage":1,"isSimpleType":true},{"name":"u16","type":"u16","storage":2,"isSimpleType":true},{"name":"i32","type":"i32","storage":-4,"isSimpleType":true}],"packFormat":"i8 u8 u16 i32"},{"kind":"rw","name":"rw_u8_string","identifier":135,"description":"A read write u8, string register.","fields":[{"name":"u8","type":"u8","storage":1,"isSimpleType":true},{"name":"str","type":"string","storage":0}],"packFormat":"u8 s"},{"kind":"ro","name":"ro_u8_string","identifier":391,"description":"A read only u8, string register.. Mirrors rw_u8_string.","fields":[{"name":"u8","type":"u8","storage":1,"isSimpleType":true},{"name":"str","type":"string","storage":0}],"packFormat":"u8 s"},{"kind":"event","name":"e_bool","identifier":129,"description":"An event raised when rw_bool is modified","fields":[{"name":"bo","type":"bool","storage":1}],"packFormat":"u8"},{"kind":"event","name":"e_u32","identifier":130,"description":"An event raised when rw_u32 is modified","fields":[{"name":"u32","type":"u32","storage":4,"isSimpleType":true}],"packFormat":"u32"},{"kind":"event","name":"e_i32","identifier":131,"description":"An event raised when rw_i32 is modified","fields":[{"name":"i32","type":"i32","storage":-4,"isSimpleType":true}],"packFormat":"i32"},{"kind":"event","name":"e_string","identifier":132,"description":"An event raised when rw_string is modified","fields":[{"name":"str","type":"string","storage":0}],"packFormat":"s"},{"kind":"event","name":"e_bytes","identifier":133,"description":"An event raised when rw_bytes is modified","fields":[{"name":"bytes","type":"bytes","storage":0,"isSimpleType":true}],"packFormat":"b"},{"kind":"event","name":"e_i8_u8_u16_i32","identifier":134,"description":"An event raised when rw_i8_u8_u16_i32 is modified","fields":[{"name":"i8","type":"i8","storage":-1,"isSimpleType":true},{"name":"u8","type":"u8","storage":1,"isSimpleType":true},{"name":"u16","type":"u16","storage":2,"isSimpleType":true},{"name":"i32","type":"i32","storage":-4,"isSimpleType":true}],"packFormat":"i8 u8 u16 i32"},{"kind":"event","name":"e_u8_string","identifier":135,"description":"An event raised when rw_u8_string is modified","fields":[{"name":"u8","type":"u8","storage":1,"isSimpleType":true},{"name":"str","type":"string","storage":0}],"packFormat":"u8 s"},{"kind":"command","name":"c_bool","identifier":129,"description":"A command to set rw_bool.","fields":[{"name":"bo","type":"bool","storage":1}],"packFormat":"u8"},{"kind":"command","name":"c_u32","identifier":130,"description":"A command to set rw_u32.","fields":[{"name":"u32","type":"u32","storage":4,"isSimpleType":true}],"packFormat":"u32"},{"kind":"command","name":"c_i32","identifier":131,"description":"A command to set rw_i32.","fields":[{"name":"i32","type":"i32","storage":-4,"isSimpleType":true}],"packFormat":"i32"},{"kind":"command","name":"c_string","identifier":132,"description":"A command to set rw_string.","fields":[{"name":"str","type":"string","storage":0}],"packFormat":"s"},{"kind":"command","name":"c_bytes","identifier":133,"description":"A command to set rw_string.","fields":[{"name":"bytes","type":"bytes","storage":0,"isSimpleType":true}],"packFormat":"b"},{"kind":"command","name":"c_i8_u8_u16_i32","identifier":134,"description":"A command to set rw_bytes.","fields":[{"name":"i8","type":"i8","storage":-1,"isSimpleType":true},{"name":"u8","type":"u8","storage":1,"isSimpleType":true},{"name":"u16","type":"u16","storage":2,"isSimpleType":true},{"name":"i32","type":"i32","storage":-4,"isSimpleType":true}],"packFormat":"i8 u8 u16 i32"},{"kind":"command","name":"c_u8_string","identifier":135,"description":"A command to set rw_u8_string.","fields":[{"name":"u8","type":"u8","storage":1,"isSimpleType":true},{"name":"str","type":"string","storage":0}],"packFormat":"u8 s"},{"kind":"command","name":"c_report_pipe","identifier":144,"description":"A command to read the content of rw_bytes, byte per byte, as a pipe.","fields":[{"name":"p_bytes","type":"pipe","storage":12}],"pipeType":"c_report_pipe","packFormat":"b[12]"},{"kind":"pipe_report","name":"p_bytes","identifier":0,"description":"A command to read the content of rw_bytes, byte per byte, as a pipe.","fields":[{"name":"byte","type":"u8","storage":1,"isSimpleType":true}],"pipeType":"c_report_pipe","packFormat":"u8"}],"tags":["infrastructure"]},{"name":"Proxy","status":"stable","shortId":"proxy","camelName":"proxy","shortName":"proxy","extends":["_base"],"notes":{"short":"A service that tags a device as a packet proxy.\nA device in proxy mode will proxy Jacdac packets and typically has its core logic halted."},"classIdentifier":384932169,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"}],"tags":["infrastructure"]},{"name":"Pulse Oximeter","status":"experimental","shortId":"pulseoximeter","camelName":"pulseOximeter","shortName":"pulseOximeter","extends":["_base","_sensor"],"notes":{"short":"A sensor approximating the oxygen level.\n\n**Jacdac is not suitable for medical devices and should NOT be used in any kind of device to diagnose or treat any medical conditions.**"},"classIdentifier":280710838,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"oxygen","identifier":257,"description":"The estimated oxygen level in blood.","fields":[{"name":"_","unit":"%","shift":8,"type":"u8.8","storage":2,"typicalMin":80,"typicalMax":100}],"volatile":true,"identifierName":"reading","packFormat":"u8.8"},{"kind":"ro","name":"oxygen_error","identifier":262,"description":"The estimated error on the reported sensor data.","fields":[{"name":"_","unit":"%","shift":8,"type":"u8.8","storage":2}],"volatile":true,"optional":true,"identifierName":"reading_error","packFormat":"u8.8"}],"tags":["8bit"],"group":"Biometric"},{"name":"Rain gauge","status":"rc","shortId":"raingauge","camelName":"rainGauge","shortName":"rainGauge","extends":["_base","_sensor"],"notes":{"short":"Measures the amount of liquid precipitation over an area in a predefined period of time."},"classIdentifier":326323349,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"precipitation","identifier":257,"description":"Total precipitation recorded so far.","fields":[{"name":"_","unit":"mm","shift":16,"type":"u16.16","storage":4}],"volatile":true,"identifierName":"reading","preferredInterval":60000,"packFormat":"u16.16"},{"kind":"const","name":"precipitation_precision","identifier":264,"description":"Typically the amount of rain needed for tipping the bucket.","fields":[{"name":"_","unit":"mm","shift":16,"type":"u16.16","storage":4}],"optional":true,"identifierName":"reading_resolution","packFormat":"u16.16"}],"tags":["8bit"],"group":"Environment"},{"name":"Real time clock","status":"rc","shortId":"realtimeclock","camelName":"realTimeClock","shortName":"realTimeClock","extends":["_base","_sensor"],"notes":{"short":"Real time clock to support collecting data with precise time stamps."},"classIdentifier":445323816,"enums":{"Variant":{"name":"Variant","storage":1,"members":{"Computer":1,"Crystal":2,"Cuckoo":3}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"local_time","identifier":257,"description":"Current time in 24h representation. Default streaming period is 1 second.\n\n-   `day_of_month` is day of the month, starting at `1`\n-   `day_of_week` is day of the week, starting at `1` as monday. Leave at 0 if unsupported.","fields":[{"name":"year","type":"u16","storage":2,"isSimpleType":true},{"name":"month","type":"u8","storage":1,"isSimpleType":true,"absoluteMin":1,"absoluteMax":12},{"name":"day_of_month","type":"u8","storage":1,"isSimpleType":true,"absoluteMin":0,"absoluteMax":31},{"name":"day_of_week","type":"u8","storage":1,"isSimpleType":true,"absoluteMin":1,"absoluteMax":7},{"name":"hour","type":"u8","storage":1,"isSimpleType":true,"absoluteMin":0,"absoluteMax":23},{"name":"min","type":"u8","storage":1,"isSimpleType":true,"absoluteMin":0,"absoluteMax":59},{"name":"sec","type":"u8","storage":1,"isSimpleType":true,"absoluteMin":0,"absoluteMax":60}],"volatile":true,"identifierName":"reading","preferredInterval":1000,"packFormat":"u16 u8 u8 u8 u8 u8 u8"},{"kind":"ro","name":"drift","identifier":384,"description":"Time drift since the last call to the `set_time` command.","fields":[{"name":"_","unit":"s","shift":16,"type":"u16.16","storage":4}],"volatile":true,"optional":true,"packFormat":"u16.16"},{"kind":"const","name":"precision","identifier":385,"description":"Error on the clock, in parts per million of seconds.","fields":[{"name":"_","unit":"ppm","shift":16,"type":"u16.16","storage":4}],"optional":true,"packFormat":"u16.16"},{"kind":"const","name":"variant","identifier":263,"description":"The type of physical clock used by the sensor.","fields":[{"name":"_","type":"Variant","storage":1}],"optional":true,"identifierName":"variant","packFormat":"u8"},{"kind":"command","name":"set_time","identifier":128,"description":"Sets the current time and resets the error.","fields":[{"name":"year","type":"u16","storage":2,"isSimpleType":true},{"name":"month","type":"u8","storage":1,"isSimpleType":true,"absoluteMin":1,"absoluteMax":12},{"name":"day_of_month","type":"u8","storage":1,"isSimpleType":true,"absoluteMin":1,"absoluteMax":31},{"name":"day_of_week","type":"u8","storage":1,"isSimpleType":true,"absoluteMin":1,"absoluteMax":7},{"name":"hour","type":"u8","storage":1,"isSimpleType":true,"absoluteMin":0,"absoluteMax":23},{"name":"min","type":"u8","storage":1,"isSimpleType":true,"absoluteMin":0,"absoluteMax":59},{"name":"sec","type":"u8","storage":1,"isSimpleType":true,"absoluteMin":0,"absoluteMax":60}],"packFormat":"u16 u8 u8 u8 u8 u8 u8"}],"tags":["8bit"]},{"name":"Reflected light","status":"rc","shortId":"reflectedlight","camelName":"reflectedLight","shortName":"reflectedLight","extends":["_base","_sensor"],"notes":{"short":"A sensor that detects light and dark surfaces, commonly used for line following robots."},"classIdentifier":309087410,"enums":{"Variant":{"name":"Variant","storage":1,"members":{"InfraredDigital":1,"InfraredAnalog":2}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"brightness","identifier":257,"description":"Reports the reflected brightness. It may be a digital value or, for some sensor, analog value.","fields":[{"name":"_","unit":"/","shift":16,"type":"u0.16","storage":2}],"volatile":true,"identifierName":"reading","packFormat":"u0.16"},{"kind":"const","name":"variant","identifier":263,"description":"Type of physical sensor used","fields":[{"name":"_","type":"Variant","storage":1}],"optional":true,"identifierName":"variant","packFormat":"u8"}],"tags":["8bit"],"group":"Environment"},{"name":"Relay","status":"stable","shortId":"relay","camelName":"relay","shortName":"relay","extends":["_base"],"notes":{"short":"A switching relay.\n\nThe contacts should be labelled `NO` (normally open), `COM` (common), and `NC` (normally closed).\nWhen relay is energized it connects `NO` and `COM`.\nWhen relay is not energized it connects `NC` and `COM`.\nSome relays may be missing `NO` or `NC` contacts.\nWhen relay module is not powered, or is in bootloader mode, it is not energized (connects `NC` and `COM`)."},"classIdentifier":406840918,"enums":{"Variant":{"name":"Variant","storage":1,"members":{"Electromechanical":1,"SolidState":2,"Reed":3}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"active","identifier":1,"description":"Indicates whether the relay circuit is currently energized or not.","fields":[{"name":"_","type":"bool","storage":1}],"identifierName":"intensity","packFormat":"u8"},{"kind":"const","name":"variant","identifier":263,"description":"Describes the type of relay used.","fields":[{"name":"_","type":"Variant","storage":1}],"optional":true,"identifierName":"variant","packFormat":"u8"},{"kind":"const","name":"max_switching_current","identifier":384,"description":"Maximum switching current for a resistive load.","fields":[{"name":"_","unit":"mA","type":"u32","storage":4,"isSimpleType":true}],"optional":true,"packFormat":"u32"}],"tags":["8bit"]},{"name":"Random Number Generator","status":"rc","shortId":"rng","camelName":"rng","shortName":"rng","extends":["_base"],"notes":{"short":"Generates random numbers using entropy sourced from physical processes.\n\nThis typically uses a cryptographical pseudo-random number generator (for example [Fortuna](<https://en.wikipedia.org/wiki/Fortuna_(PRNG)>)),\nwhich is periodically re-seeded with entropy coming from some hardware source."},"classIdentifier":394916002,"enums":{"Variant":{"name":"Variant","storage":1,"members":{"Quantum":1,"ADCNoise":2,"WebCrypto":3}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"ro","name":"random","identifier":384,"description":"A register that returns a 64 bytes random buffer on every request.\nThis never blocks for a long time. If you need additional random bytes, keep querying the register.","fields":[{"name":"_","type":"bytes","storage":0,"isSimpleType":true}],"volatile":true,"packFormat":"b"},{"kind":"const","name":"variant","identifier":263,"description":"The type of algorithm/technique used to generate the number.\n`Quantum` refers to dedicated hardware device generating random noise due to quantum effects.\n`ADCNoise` is the noise from quick readings of analog-digital converter, which reads temperature of the MCU or some floating pin.\n`WebCrypto` refers is used in simulators, where the source of randomness comes from an advanced operating system.","fields":[{"name":"_","type":"Variant","storage":1}],"optional":true,"identifierName":"variant","packFormat":"u8"}],"tags":[]},{"name":"Role Manager","status":"experimental","shortId":"rolemanager","camelName":"roleManager","shortName":"roleManager","extends":["_base"],"notes":{"short":"Assign roles to services on the Jacdac bus.","long":"## Role allocation\n\nInternally, the role manager stores a mapping from role name to `(device_id, service_idx)`.\nUsers refer to services by using role names (eg., they instantiate an accelerometer client with a given role name).\nEach client has a role, and roles are unique to clients\n(ie., one should not have both a gyro and accelerometer service with role `left_leg`).\n\nThe simplest recommended automatic role assignment algorithm is as follows:\n\n```text\nroles.sort(strcmp() on UTF-8 representation of role name)\ndevices.sort(by device identifier (lexicographic on 8 byte string))\nmove self device to beginning of devices list\nfor every role\n  if role is not assigned\n    for every device\n      for every service on device\n        if serviceClass matches role\n          if service is not assigned to any role\n            assign service to role\n```\n\nDue to sorting, role names sharing a prefix will tend to be co-located on the single device.\nFor example, one can have roles `left_leg_acc`, `left_leg_gyro`, `right_leg_acc`, `right_leg_gyro`,\nand assuming combined gyro+accelerometer sensors, the pairs will tend to be allocated to a single leg,\nhowever the legs may be reversed.\nIn such a case the user can swap the physical sensors (note that left leg will always be assigned to\nsensor with smaller device identifier).\nAlternatively, the user can manually modify assignment using `set_role` command."},"classIdentifier":508264038,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"auto_bind","identifier":128,"description":"Normally, if some roles are unfilled, and there are idle services that can fulfill them,\nthe brain device will assign roles (bind) automatically.\nSuch automatic assignment happens every second or so, and is trying to be smart about\nco-locating roles that share \"host\" (part before first slash),\nas well as reasonably stable assignments.\nOnce user start assigning roles manually using this service, auto-binding should be disabled to avoid confusion.","fields":[{"name":"_","type":"bool","storage":1,"defaultValue":1}],"packFormat":"u8"},{"kind":"ro","name":"all_roles_allocated","identifier":385,"description":"Indicates if all required roles have been allocated to devices.","fields":[{"name":"_","type":"bool","storage":1}],"packFormat":"u8"},{"kind":"command","name":"set_role","identifier":129,"description":"Set role. Can set to empty to remove role binding.","fields":[{"name":"device_id","type":"devid","storage":8},{"name":"service_idx","type":"u8","storage":1,"isSimpleType":true},{"name":"role","type":"string","storage":0}],"packFormat":"b[8] u8 s"},{"kind":"command","name":"clear_all_roles","identifier":132,"description":"Remove all role bindings.","fields":[]},{"kind":"command","name":"list_roles","identifier":131,"description":"List all roles and bindings required by the current program. `device_id` and `service_idx` are `0` if role is unbound.","fields":[{"name":"roles","type":"pipe","storage":12}],"pipeType":"list_roles","packFormat":"b[12]"},{"kind":"pipe_report","name":"roles","identifier":0,"description":"List all roles and bindings required by the current program. `device_id` and `service_idx` are `0` if role is unbound.","fields":[{"name":"device_id","type":"devid","storage":8},{"name":"service_class","type":"u32","storage":4,"isSimpleType":true},{"name":"service_idx","type":"u8","storage":1,"isSimpleType":true},{"name":"role","type":"string","storage":0}],"pipeType":"list_roles","packFormat":"b[8] u32 u8 s"},{"kind":"event","name":"change","identifier":3,"description":"Notifies that role bindings have changed.","fields":[],"identifierName":"change"}],"tags":["infrastructure"]},{"name":"ROS","status":"experimental","shortId":"ros","camelName":"ros","shortName":"ros","extends":["_base"],"notes":{"short":"A ROS (Robot Operating System https://www.ros.org/) controller that can act as a broker for messages."},"classIdentifier":354743340,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"command","name":"publish_message","identifier":129,"description":"Publishes a JSON-encoded message to the given topic.","fields":[{"name":"node","type":"string0","storage":0},{"name":"topic","type":"string0","storage":0},{"name":"message","type":"string","storage":0}],"packFormat":"z z s"},{"kind":"command","name":"subscribe_message","identifier":130,"description":"Subscribes to a message topic. Subscribed topics will emit message reports.","fields":[{"name":"node","type":"string0","storage":0},{"name":"topic","type":"string","storage":0}],"packFormat":"z s"},{"kind":"report","name":"message","identifier":131,"description":"A message published on the bus. Message is JSON encoded.","fields":[{"name":"node","type":"string0","storage":0},{"name":"topic","type":"string0","storage":0},{"name":"message","type":"string","storage":0}],"packFormat":"z z s"}],"tags":["robotics"]},{"name":"Rotary encoder","status":"stable","shortId":"rotaryencoder","camelName":"rotaryEncoder","shortName":"rotaryEncoder","extends":["_base","_sensor"],"notes":{"short":"An incremental rotary encoder - converts angular motion of a shaft to digital signal."},"classIdentifier":284830153,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"position","identifier":257,"description":"Upon device reset starts at `0` (regardless of the shaft position).\nIncreases by `1` for a clockwise \"click\", by `-1` for counter-clockwise.","fields":[{"name":"_","unit":"#","type":"i32","storage":-4,"isSimpleType":true}],"volatile":true,"identifierName":"reading","packFormat":"i32"},{"kind":"const","name":"clicks_per_turn","identifier":384,"description":"This specifies by how much `position` changes when the crank does 360 degree turn. Typically 12 or 24.","fields":[{"name":"_","unit":"#","type":"u16","storage":2,"isSimpleType":true}],"packFormat":"u16"},{"kind":"const","name":"clicker","identifier":385,"description":"The encoder is combined with a clicker. If this is the case, the clicker button service\nshould follow this service in the service list of the device.","fields":[{"name":"_","type":"bool","storage":1}],"optional":true,"packFormat":"u8"}],"tags":["C","8bit","input"],"group":"Slider"},{"name":"Rover","status":"experimental","shortId":"rover","camelName":"rover","shortName":"rover","extends":["_base","_sensor"],"notes":{"short":"A roving robot."},"classIdentifier":435474539,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"kinematics","identifier":257,"description":"The current position and orientation of the robot.","fields":[{"name":"x","unit":"cm","shift":16,"type":"i16.16","storage":-4},{"name":"y","unit":"cm","shift":16,"type":"i16.16","storage":-4},{"name":"vx","unit":"cm/s","shift":16,"type":"i16.16","storage":-4},{"name":"vy","unit":"cm/s","shift":16,"type":"i16.16","storage":-4},{"name":"heading","unit":"°","shift":16,"type":"i16.16","storage":-4}],"volatile":true,"identifierName":"reading","packFormat":"i16.16 i16.16 i16.16 i16.16 i16.16"}],"tags":[]},{"name":"Satellite Navigation System","status":"experimental","shortId":"satelittenavigationsystem","camelName":"satNav","shortName":"satNav","extends":["_base","_sensor"],"notes":{"short":"A satellite-based navigation system like GPS, Gallileo, ..."},"classIdentifier":433938742,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"position","identifier":257,"description":"Reported coordinates, geometric altitude and time of position. Altitude accuracy is 0 if not available.","fields":[{"name":"timestamp","unit":"ms","type":"u64","storage":8,"isSimpleType":true},{"name":"latitude","unit":"lat","shift":23,"type":"i9.23","storage":-4,"absoluteMin":-90,"absoluteMax":90},{"name":"longitude","unit":"lon","shift":23,"type":"i9.23","storage":-4,"absoluteMin":-180,"absoluteMax":180},{"name":"accuracy","unit":"m","shift":16,"type":"u16.16","storage":4},{"name":"altitude","unit":"m","shift":6,"type":"i26.6","storage":-4},{"name":"altitudeAccuracy","unit":"m","shift":16,"type":"u16.16","storage":4}],"volatile":true,"identifierName":"reading","packFormat":"u64 i9.23 i9.23 u16.16 i26.6 u16.16"},{"kind":"rw","name":"enabled","identifier":1,"description":"Enables or disables the GPS module","fields":[{"name":"_","type":"bool","storage":1}],"identifierName":"intensity","packFormat":"u8"},{"kind":"event","name":"inactive","identifier":2,"description":"The module is disabled or lost connection with satellites.","fields":[],"identifierName":"inactive"}],"tags":[]},{"name":"Sensor Aggregator","status":"experimental","shortId":"sensoraggregator","camelName":"sensorAggregator","shortName":"sensorAggregator","extends":["_base"],"notes":{"short":"Aggregate data from multiple sensors into a single stream\n(often used as input to machine learning models on the same device, see model runner service)."},"classIdentifier":496034245,"enums":{"SampleType":{"name":"SampleType","storage":1,"members":{"U8":8,"I8":136,"U16":16,"I16":144,"U32":32,"I32":160}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"inputs","identifier":128,"description":"Set automatic input collection.\nThese settings are stored in flash.","fields":[{"name":"sampling_interval","unit":"ms","type":"u16","storage":2,"isSimpleType":true},{"name":"samples_in_window","type":"u16","storage":2,"isSimpleType":true},{"name":"reserved","type":"u32","storage":4,"isSimpleType":true},{"name":"device_id","type":"devid","storage":8,"startRepeats":true},{"name":"service_class","type":"u32","storage":4,"isSimpleType":true},{"name":"service_num","type":"u8","storage":1,"isSimpleType":true},{"name":"sample_size","unit":"B","type":"u8","storage":1,"isSimpleType":true},{"name":"sample_type","type":"SampleType","storage":1},{"name":"sample_shift","type":"i8","storage":-1,"isSimpleType":true}],"packFormat":"u16 u16 u32 r: b[8] u32 u8 u8 u8 i8"},{"kind":"ro","name":"num_samples","identifier":384,"description":"Number of input samples collected so far.","fields":[{"name":"_","type":"u32","storage":4,"isSimpleType":true}],"packFormat":"u32"},{"kind":"ro","name":"sample_size","identifier":385,"description":"Size of a single sample.","fields":[{"name":"_","unit":"B","type":"u8","storage":1,"isSimpleType":true}],"packFormat":"u8"},{"kind":"rw","name":"streaming_samples","identifier":129,"description":"When set to `N`, will stream `N` samples as `current_sample` reading.","fields":[{"name":"_","unit":"#","type":"u32","storage":4,"isSimpleType":true}],"packFormat":"u32"},{"kind":"ro","name":"current_sample","identifier":257,"description":"Last collected sample.","fields":[{"name":"_","type":"bytes","storage":0,"isSimpleType":true}],"volatile":true,"identifierName":"reading","packFormat":"b"}],"tags":[]},{"name":"Serial","status":"experimental","shortId":"serial","camelName":"serial","shortName":"serial","extends":["_base"],"notes":{"short":"An asynchronous serial communication service capable of sending and receiving buffers of data.\nSettings default to 115200 baud 8N1."},"classIdentifier":297461188,"enums":{"ParityType":{"name":"ParityType","storage":1,"members":{"None":0,"Even":1,"Odd":2}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"connected","identifier":1,"description":"Indicates if the serial connection is active.","fields":[{"name":"_","type":"bool","storage":1}],"identifierName":"intensity","packFormat":"u8"},{"kind":"ro","name":"connection_name","identifier":385,"description":"User-friendly name of the connection.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"packFormat":"s"},{"kind":"rw","name":"baud_rate","identifier":128,"description":"A positive, non-zero value indicating the baud rate at which serial communication is be established.","fields":[{"name":"_","unit":"baud","type":"u32","storage":4,"isSimpleType":true,"defaultValue":115200}],"packFormat":"u32"},{"kind":"rw","name":"data_bits","identifier":129,"description":"The number of data bits per frame. Either 7 or 8.","fields":[{"name":"_","type":"u8","storage":1,"isSimpleType":true,"defaultValue":8,"absoluteMin":7,"absoluteMax":8}],"packFormat":"u8"},{"kind":"rw","name":"stop_bits","identifier":130,"description":"The number of stop bits at the end of a frame. Either 1 or 2.","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true,"defaultValue":1,"absoluteMin":1,"absoluteMax":2}],"packFormat":"u8"},{"kind":"rw","name":"parity_mode","identifier":131,"description":"The parity mode.","fields":[{"name":"_","type":"ParityType","storage":1,"defaultValue":0}],"packFormat":"u8"},{"kind":"rw","name":"buffer_size","identifier":132,"description":"A positive, non-zero value indicating the size of the read and write buffers that should be created.","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"packFormat":"u8"},{"kind":"command","name":"send","identifier":128,"description":"Send a buffer of data over the serial transport.","fields":[{"name":"data","type":"bytes","storage":0,"isSimpleType":true}],"unique":true,"packFormat":"b"},{"kind":"report","name":"received","identifier":128,"description":"Raised when a buffer of data is received.","fields":[{"name":"data","type":"bytes","storage":0,"isSimpleType":true}],"packFormat":"b"}],"tags":["io"]},{"name":"Servo","status":"stable","shortId":"servo","camelName":"servo","shortName":"servo","extends":["_base"],"notes":{"short":"Servo is a small motor with arm that can be pointing at a specific direction.\nTypically a servo angle is between 0° and 180° where 90° is the middle resting position.\n\nThe `min_pulse/max_pulse` may be read-only if the servo is permanently affixed to its Jacdac controller."},"classIdentifier":318542083,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"angle","identifier":2,"description":"Specifies the angle of the arm (request).","fields":[{"name":"_","unit":"°","shift":16,"type":"i16.16","storage":-4,"typicalMin":0,"typicalMax":180}],"identifierName":"value","packFormat":"i16.16"},{"kind":"rw","name":"enabled","identifier":1,"description":"Turn the power to the servo on/off.","fields":[{"name":"_","type":"bool","storage":1}],"identifierName":"intensity","packFormat":"u8"},{"kind":"rw","name":"offset","identifier":129,"description":"Correction applied to the angle to account for the servo arm drift.","fields":[{"name":"_","unit":"°","shift":16,"type":"i16.16","storage":-4}],"packFormat":"i16.16"},{"kind":"const","name":"min_angle","identifier":272,"description":"Lowest angle that can be set, typically 0 °.","fields":[{"name":"_","unit":"°","shift":16,"type":"i16.16","storage":-4}],"identifierName":"min_value","packFormat":"i16.16"},{"kind":"rw","name":"min_pulse","identifier":131,"description":"The length of pulse corresponding to lowest angle.","fields":[{"name":"_","unit":"us","type":"u16","storage":2,"isSimpleType":true,"defaultValue":500}],"optional":true,"packFormat":"u16"},{"kind":"const","name":"max_angle","identifier":273,"description":"Highest angle that can be set, typically 180°.","fields":[{"name":"_","unit":"°","shift":16,"type":"i16.16","storage":-4}],"identifierName":"max_value","packFormat":"i16.16"},{"kind":"rw","name":"max_pulse","identifier":133,"description":"The length of pulse corresponding to highest angle.","fields":[{"name":"_","unit":"us","type":"u16","storage":2,"isSimpleType":true,"defaultValue":2500}],"optional":true,"packFormat":"u16"},{"kind":"const","name":"stall_torque","identifier":384,"description":"The servo motor will stop rotating when it is trying to move a `stall_torque` weight at a radial distance of `1.0` cm.","fields":[{"name":"_","unit":"kg/cm","shift":16,"type":"u16.16","storage":4}],"optional":true,"packFormat":"u16.16"},{"kind":"const","name":"response_speed","identifier":385,"description":"Time to move 60°.","fields":[{"name":"_","unit":"s/60°","shift":16,"type":"u16.16","storage":4}],"optional":true,"packFormat":"u16.16"},{"kind":"ro","name":"actual_angle","identifier":257,"description":"The current physical position of the arm, if the device has a way to sense the position.","fields":[{"name":"_","unit":"°","shift":16,"type":"i16.16","storage":-4}],"volatile":true,"optional":true,"identifierName":"reading","packFormat":"i16.16"}],"tags":["C"]},{"name":"Settings","status":"experimental","shortId":"settings","camelName":"settings","shortName":"settings","extends":["_base"],"notes":{"short":"Non-volatile key-value storage interface for storing settings.","long":"## Secrets\n\nEntries with keys starting with `$` are considered secret.\nThey can be written normally, but they read as a single `0` byte,\nunless they are empty, in which case the value returned is also empty.\nThese are typically used by other services on the same device."},"classIdentifier":285727818,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"command","name":"get","identifier":128,"description":"Get the value of given setting. If no such entry exists, the value returned is empty.","fields":[{"name":"key","type":"string","storage":0}],"hasReport":true,"packFormat":"s"},{"kind":"report","name":"get","identifier":128,"description":"Get the value of given setting. If no such entry exists, the value returned is empty.","fields":[{"name":"key","type":"string0","storage":0},{"name":"value","type":"bytes","storage":0,"isSimpleType":true}],"secondary":true,"packFormat":"z b"},{"kind":"command","name":"set","identifier":129,"description":"Set the value of a given setting.","fields":[{"name":"key","type":"string0","storage":0},{"name":"value","type":"bytes","storage":0,"isSimpleType":true}],"restricted":true,"packFormat":"z b"},{"kind":"command","name":"delete","identifier":132,"description":"Delete a given setting.","fields":[{"name":"key","type":"string","storage":0}],"restricted":true,"packFormat":"s"},{"kind":"command","name":"list_keys","identifier":130,"description":"Return keys of all settings.","fields":[{"name":"results","type":"pipe","storage":12}],"pipeType":"list_keys","packFormat":"b[12]"},{"kind":"pipe_report","name":"listed_key","identifier":0,"description":"Return keys of all settings.","fields":[{"name":"key","type":"string","storage":0}],"pipeType":"list_keys","packFormat":"s"},{"kind":"command","name":"list","identifier":131,"description":"Return keys and values of all settings.","fields":[{"name":"results","type":"pipe","storage":12}],"pipeType":"list","packFormat":"b[12]"},{"kind":"pipe_report","name":"listed_entry","identifier":0,"description":"Return keys and values of all settings.","fields":[{"name":"key","type":"string0","storage":0},{"name":"value","type":"bytes","storage":0,"isSimpleType":true}],"pipeType":"list","packFormat":"z b"},{"kind":"command","name":"clear","identifier":133,"description":"Clears all keys.","fields":[],"restricted":true},{"kind":"event","name":"change","identifier":3,"description":"Notifies that some setting have been modified.","fields":[],"identifierName":"change"}],"tags":[]},{"name":"7-segment display","status":"rc","shortId":"sevensegmentdisplay","camelName":"sevenSegmentDisplay","shortName":"sevenSegmentDisplay","extends":["_base"],"notes":{"short":"A 7-segment numeric display, with one or more digits."},"classIdentifier":425810167,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"digits","identifier":2,"description":"Each byte encodes the display status of a digit using,\nwhere lowest bit 0 encodes segment `A`, bit 1 encodes segments `B`, ..., bit 6 encodes segments `G`, and bit 7 encodes the decimal point (if present).\nIf incoming `digits` data is smaller than `digit_count`, the remaining digits will be cleared.\nThus, sending an empty `digits` payload clears the screen.\n\n```text\nGFEDCBA DP\n - A -\n F   B\n |   |\n - G -\n |   |\n E   C   _\n |   |  |DP|\n - D -   -\n```","fields":[{"name":"_","encoding":"bitset","type":"bytes","storage":0,"isSimpleType":true}],"lowLevel":true,"identifierName":"value","packFormat":"b"},{"kind":"rw","name":"brightness","identifier":1,"description":"Controls the brightness of the LEDs. `0` means off.","fields":[{"name":"_","unit":"/","shift":16,"type":"u0.16","storage":2}],"optional":true,"identifierName":"intensity","packFormat":"u0.16"},{"kind":"rw","name":"double_dots","identifier":128,"description":"Turn on or off the column LEDs (separating minutes from hours, etc.) in of the segment.\nIf the column LEDs is not supported, the value remains false.","fields":[{"name":"_","type":"bool","storage":1}],"optional":true,"packFormat":"u8"},{"kind":"const","name":"digit_count","identifier":384,"description":"The number of digits available on the display.","fields":[{"name":"_","type":"u8","storage":1,"isSimpleType":true}],"packFormat":"u8"},{"kind":"const","name":"decimal_point","identifier":385,"description":"True if decimal points are available (on all digits).","fields":[{"name":"_","type":"bool","storage":1}],"optional":true,"packFormat":"u8"},{"kind":"command","name":"set_number","identifier":128,"description":"Shows the number on the screen using the decimal dot if available.","fields":[{"name":"value","isFloat":true,"type":"f64","storage":8}],"client":true,"packFormat":"f64"}],"tags":["8bit"],"group":"Display"},{"name":"Soil moisture","status":"stable","shortId":"soilmoisture","camelName":"soilMoisture","shortName":"soilMoisture","extends":["_base","_sensor"],"notes":{"short":"A soil moisture sensor."},"classIdentifier":491430835,"enums":{"Variant":{"name":"Variant","storage":1,"members":{"Resistive":1,"Capacitive":2}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"moisture","identifier":257,"description":"Indicates the wetness of the soil, from `dry` to `wet`.","fields":[{"name":"_","unit":"/","shift":16,"type":"u0.16","storage":2}],"volatile":true,"identifierName":"reading","preferredInterval":1000,"packFormat":"u0.16"},{"kind":"ro","name":"moisture_error","identifier":262,"description":"The error on the moisture reading.","fields":[{"name":"_","unit":"/","shift":16,"type":"u0.16","storage":2}],"volatile":true,"optional":true,"identifierName":"reading_error","packFormat":"u0.16"},{"kind":"const","name":"variant","identifier":263,"description":"Describe the type of physical sensor.","fields":[{"name":"_","type":"Variant","storage":1}],"optional":true,"identifierName":"variant","packFormat":"u8"}],"tags":["8bit"],"group":"Environment"},{"name":"Solenoid","status":"rc","shortId":"solenoid","camelName":"solenoid","shortName":"solenoid","extends":["_base"],"notes":{"short":"A push-pull solenoid is a type of relay that pulls a coil when activated."},"classIdentifier":387392458,"enums":{"Variant":{"name":"Variant","storage":1,"members":{"PushPull":1,"Valve":2,"Latch":3}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"pulled","identifier":1,"description":"Indicates whether the solenoid is energized and pulled (on) or pushed (off).","fields":[{"name":"_","type":"bool","storage":1}],"identifierName":"intensity","packFormat":"u8"},{"kind":"const","name":"variant","identifier":263,"description":"Describes the type of solenoid used.","fields":[{"name":"_","type":"Variant","storage":1}],"optional":true,"identifierName":"variant","packFormat":"u8"}],"tags":["8bit"]},{"name":"Sound level","status":"rc","shortId":"soundlevel","camelName":"soundLevel","shortName":"soundLevel","extends":["_base","_sensor"],"notes":{"short":"A sound level detector sensor, gives a relative indication of the sound level."},"classIdentifier":346888797,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"sound_level","identifier":257,"description":"The sound level detected by the microphone","fields":[{"name":"_","unit":"/","shift":16,"type":"u0.16","storage":2}],"volatile":true,"identifierName":"reading","packFormat":"u0.16"},{"kind":"rw","name":"enabled","identifier":1,"description":"Turn on or off the microphone.","fields":[{"name":"_","type":"bool","storage":1}],"identifierName":"intensity","packFormat":"u8"},{"kind":"rw","name":"loud_threshold","identifier":6,"description":"Set level at which the `loud` event is generated.","fields":[{"name":"_","unit":"/","shift":16,"type":"u0.16","storage":2}],"identifierName":"active_threshold","packFormat":"u0.16"},{"kind":"rw","name":"quiet_threshold","identifier":5,"description":"Set level at which the `quiet` event is generated.","fields":[{"name":"_","unit":"/","shift":16,"type":"u0.16","storage":2}],"identifierName":"inactive_threshold","packFormat":"u0.16"},{"kind":"event","name":"loud","identifier":1,"description":"Generated when a loud sound is detected.","fields":[],"identifierName":"active"},{"kind":"event","name":"quiet","identifier":2,"description":"Generated low level of sound is detected.","fields":[],"identifierName":"inactive"}],"tags":["8bit"],"group":"Sound"},{"name":"Sound player","status":"rc","shortId":"soundplayer","camelName":"soundPlayer","shortName":"soundPlayer","extends":["_base"],"notes":{"short":"A device that can play various sounds stored locally. This service is typically paired with a ``storage`` service for storing sounds."},"classIdentifier":335795000,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"volume","identifier":1,"description":"Global volume of the output. ``0`` means completely off. This volume is mixed with each play volumes.","fields":[{"name":"_","unit":"/","shift":16,"type":"u0.16","storage":2}],"optional":true,"identifierName":"intensity","packFormat":"u0.16"},{"kind":"command","name":"play","identifier":128,"description":"Starts playing a sound.","fields":[{"name":"name","type":"string","storage":0}],"packFormat":"s"},{"kind":"command","name":"cancel","identifier":129,"description":"Cancel any sound playing.","fields":[]},{"kind":"command","name":"list_sounds","identifier":130,"description":"Returns the list of sounds available to play.","fields":[{"name":"sounds_port","type":"pipe","storage":12}],"pipeType":"list_sounds","packFormat":"b[12]"},{"kind":"pipe_report","name":"list_sounds_pipe","identifier":0,"description":"Returns the list of sounds available to play.","fields":[{"name":"duration","unit":"ms","type":"u32","storage":4,"isSimpleType":true},{"name":"name","type":"string","storage":0}],"pipeType":"list_sounds","packFormat":"u32 s"}],"tags":[],"group":"Sound"},{"name":"Sound Recorder with Playback","status":"experimental","shortId":"soundrecorderwithplayback","camelName":"soundRecorderWithPlayback","shortName":"soundRecorderWithPlayback","extends":["_base"],"notes":{"short":"A record and replay module. You can record a few seconds of audio and play it back."},"classIdentifier":460504912,"enums":{"Status":{"name":"Status","storage":1,"members":{"Idle":0,"Recording":1,"Playing":2}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"command","name":"play","identifier":128,"description":"Replay recorded audio.","fields":[]},{"kind":"command","name":"record","identifier":129,"description":"Record audio for N milliseconds.","fields":[{"name":"duration","unit":"ms","type":"u16","storage":2,"isSimpleType":true}],"packFormat":"u16"},{"kind":"command","name":"cancel","identifier":130,"description":"Cancel record, the `time` register will be updated by already cached data.","fields":[]},{"kind":"ro","name":"status","identifier":384,"description":"Indicate the current status","fields":[{"name":"_","type":"Status","storage":1}],"packFormat":"u8"},{"kind":"ro","name":"time","identifier":385,"description":"Milliseconds of audio recorded.","fields":[{"name":"_","unit":"ms","type":"u16","storage":2,"isSimpleType":true}],"packFormat":"u16"},{"kind":"rw","name":"volume","identifier":1,"description":"Playback volume control","fields":[{"name":"_","unit":"/","shift":8,"type":"u0.8","storage":1}],"optional":true,"identifierName":"intensity","packFormat":"u0.8"}],"tags":["8bit","padauk"],"group":"Sound"},{"name":"Sound Spectrum","status":"experimental","shortId":"soundspectrum","camelName":"soundSpectrum","shortName":"soundSpectrum","extends":["_base","_sensor"],"notes":{"short":"A microphone that analyzes the sound specturm"},"classIdentifier":360365086,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"frequency_bins","identifier":257,"description":"The computed frequency data.","fields":[{"name":"_","type":"bytes","storage":0,"isSimpleType":true}],"volatile":true,"identifierName":"reading","packFormat":"b"},{"kind":"rw","name":"enabled","identifier":1,"description":"Turns on/off the micropohone.","fields":[{"name":"_","type":"bool","storage":1}],"identifierName":"intensity","packFormat":"u8"},{"kind":"rw","name":"fft_pow2_size","identifier":128,"description":"The power of 2 used as the size of the FFT to be used to determine the frequency domain.","fields":[{"name":"_","type":"u8","storage":1,"isSimpleType":true,"defaultValue":5,"absoluteMin":2,"absoluteMax":7}],"packFormat":"u8"},{"kind":"rw","name":"min_decibels","identifier":129,"description":"The minimum power value in the scaling range for the FFT analysis data","fields":[{"name":"_","unit":"dB","type":"i16","storage":-2,"isSimpleType":true}],"packFormat":"i16"},{"kind":"rw","name":"max_decibels","identifier":130,"description":"The maximum power value in the scaling range for the FFT analysis data","fields":[{"name":"_","unit":"dB","type":"i16","storage":-2,"isSimpleType":true}],"packFormat":"i16"},{"kind":"rw","name":"smoothing_time_constant","identifier":131,"description":"The averaging constant with the last analysis frame.\nIf `0` is set, there is no averaging done, whereas a value of `1` means \"overlap the previous and current buffer quite a lot while computing the value\".","fields":[{"name":"_","unit":"/","shift":8,"type":"u0.8","storage":1,"defaultValue":0.8}],"packFormat":"u0.8"}],"tags":[],"group":"Sound"},{"name":"Speech synthesis","status":"rc","shortId":"speechsynthesis","camelName":"speechSynthesis","shortName":"speechSynthesis","extends":["_base"],"notes":{"short":"A speech synthesizer"},"classIdentifier":302307733,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"enabled","identifier":1,"description":"Determines if the speech engine is in a non-paused state.","fields":[{"name":"_","type":"bool","storage":1}],"identifierName":"intensity","packFormat":"u8"},{"kind":"rw","name":"lang","identifier":128,"description":"Language used for utterances as defined in https://www.ietf.org/rfc/bcp/bcp47.txt.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"packFormat":"s"},{"kind":"rw","name":"volume","identifier":129,"description":"Volume for utterances.","fields":[{"name":"_","unit":"/","shift":8,"type":"u0.8","storage":1,"defaultValue":1}],"optional":true,"packFormat":"u0.8"},{"kind":"rw","name":"pitch","identifier":130,"description":"Pitch for utterances","fields":[{"name":"_","shift":16,"type":"u16.16","storage":4,"defaultValue":1,"absoluteMax":2,"absoluteMin":0}],"optional":true,"packFormat":"u16.16"},{"kind":"rw","name":"rate","identifier":131,"description":"Rate for utterances","fields":[{"name":"_","shift":16,"type":"u16.16","storage":4,"defaultValue":1,"absoluteMin":0.1,"absoluteMax":10}],"optional":true,"packFormat":"u16.16"},{"kind":"command","name":"speak","identifier":128,"description":"Adds an utterance to the utterance queue; it will be spoken when any other utterances queued before it have been spoken.","fields":[{"name":"text","type":"string","storage":0}],"unique":true,"packFormat":"s"},{"kind":"command","name":"cancel","identifier":129,"description":"Cancels current utterance and all utterances from the utterance queue.","fields":[]}],"tags":[]},{"name":"Switch","status":"rc","shortId":"switch","camelName":"switch","shortName":"switch","extends":["_base","_sensor"],"notes":{"short":"A switch, which keeps its position."},"classIdentifier":450008066,"enums":{"Variant":{"name":"Variant","storage":1,"members":{"Slide":1,"Tilt":2,"PushButton":3,"Tactile":4,"Toggle":5,"Proximity":6,"Magnetic":7,"FootButton":8}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"active","identifier":257,"description":"Indicates whether the switch is currently active (on).","fields":[{"name":"_","type":"bool","storage":1}],"volatile":true,"identifierName":"reading","packFormat":"u8"},{"kind":"const","name":"variant","identifier":263,"description":"Describes the type of switch used.","fields":[{"name":"_","type":"Variant","storage":1}],"optional":true,"identifierName":"variant","packFormat":"u8"},{"kind":"event","name":"on","identifier":1,"description":"Emitted when switch goes from `off` to `on`.","fields":[],"identifierName":"active"},{"kind":"event","name":"off","identifier":2,"description":"Emitted when switch goes from `on` to `off`.","fields":[],"identifierName":"inactive"}],"tags":["8bit","input"],"group":"Button"},{"name":"TCP","status":"experimental","shortId":"tcp","camelName":"tcp","shortName":"tcp","extends":["_base"],"notes":{"short":"Data transfer over TCP/IP and TLS stream sockets.","commands":"## Pipes"},"classIdentifier":457422603,"enums":{"TcpError":{"name":"TcpError","storage":-4,"members":{"InvalidCommand":1,"InvalidCommandPayload":2}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"command","name":"open","identifier":128,"description":"Open pair of pipes between network peripheral and a controlling device. In/outbound refers to direction from/to internet.","fields":[{"name":"inbound","type":"pipe","storage":12}],"pipeType":"open","hasReport":true,"packFormat":"b[12]"},{"kind":"report","name":"open","identifier":128,"description":"Open pair of pipes between network peripheral and a controlling device. In/outbound refers to direction from/to internet.","fields":[{"name":"outbound_port","type":"pipe_port","storage":2}],"secondary":true,"pipeType":"open","packFormat":"u16"},{"kind":"meta_pipe_command","name":"open_ssl","identifier":1,"description":"Open an SSL connection to a given host:port pair. Can be issued only once on given pipe.\nAfter the connection is established, an empty data report is sent.\nConnection is closed by closing the pipe.","fields":[{"name":"tcp_port","type":"u16","storage":2,"isSimpleType":true},{"name":"hostname","type":"string","storage":0}],"pipeType":"open","packFormat":"u16 s"},{"kind":"pipe_command","name":"outdata","identifier":0,"description":"Bytes to be sent directly over an established TCP or SSL connection.","fields":[{"name":"data","type":"bytes","storage":0,"isSimpleType":true}],"pipeType":"open","packFormat":"b"},{"kind":"pipe_report","name":"indata","identifier":0,"description":"Bytes read directly from directly over an established TCP or SSL connection.","fields":[{"name":"data","type":"bytes","storage":0,"isSimpleType":true}],"pipeType":"open","packFormat":"b"},{"kind":"meta_pipe_report","name":"error","identifier":0,"description":"Reported when an error is encountered. Negative error codes come directly from the SSL implementation.","fields":[{"name":"error","type":"TcpError","storage":-4}],"pipeType":"open","packFormat":"i32"}],"tags":[]},{"name":"Temperature","status":"stable","shortId":"temperature","camelName":"temperature","shortName":"temperature","extends":["_base","_sensor"],"notes":{"short":"A thermometer measuring outside or inside environment."},"classIdentifier":337754823,"enums":{"Variant":{"name":"Variant","storage":1,"members":{"Outdoor":1,"Indoor":2,"Body":3}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"temperature","identifier":257,"description":"The temperature.","fields":[{"name":"_","unit":"°C","shift":10,"type":"i22.10","storage":-4}],"volatile":true,"identifierName":"reading","preferredInterval":1000,"packFormat":"i22.10"},{"kind":"const","name":"min_temperature","identifier":260,"description":"Lowest temperature that can be reported.","fields":[{"name":"_","unit":"°C","shift":10,"type":"i22.10","storage":-4}],"identifierName":"min_reading","packFormat":"i22.10"},{"kind":"const","name":"max_temperature","identifier":261,"description":"Highest temperature that can be reported.","fields":[{"name":"_","unit":"°C","shift":10,"type":"i22.10","storage":-4}],"identifierName":"max_reading","packFormat":"i22.10"},{"kind":"ro","name":"temperature_error","identifier":262,"description":"The real temperature is between `temperature - temperature_error` and `temperature + temperature_error`.","fields":[{"name":"_","unit":"°C","shift":10,"type":"u22.10","storage":4}],"volatile":true,"optional":true,"identifierName":"reading_error","packFormat":"u22.10"},{"kind":"const","name":"variant","identifier":263,"description":"Specifies the type of thermometer.","fields":[{"name":"_","type":"Variant","storage":1}],"optional":true,"identifierName":"variant","packFormat":"u8"}],"tags":["C","8bit"],"group":"Environment"},{"name":"Timeseries Aggregator","status":"experimental","shortId":"timeseriesaggregator","camelName":"timeseriesAggregator","shortName":"timeseriesAggregator","extends":["_base"],"notes":{"short":"Supports aggregating timeseries data (especially sensor readings)\nand sending them to a cloud/storage service.\nUsed in DeviceScript.\n\nNote that `f64` values are not necessarily aligned."},"classIdentifier":294829516,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"command","name":"clear","identifier":128,"description":"Remove all pending timeseries.","fields":[]},{"kind":"command","name":"update","identifier":131,"description":"Add a data point to a timeseries.","fields":[{"name":"value","isFloat":true,"type":"f64","storage":8},{"name":"label","type":"string","storage":0}],"packFormat":"f64 s"},{"kind":"command","name":"set_window","identifier":132,"description":"Set aggregation window.\nSetting to `0` will restore default.","fields":[{"name":"duration","unit":"ms","type":"u32","storage":4,"isSimpleType":true},{"name":"label","type":"string","storage":0}],"packFormat":"u32 s"},{"kind":"command","name":"set_upload","identifier":133,"description":"Set whether or not the timeseries will be uploaded to the cloud.\nThe `stored` reports are generated regardless.","fields":[{"name":"upload","type":"bool","storage":1},{"name":"label","type":"string","storage":0}],"packFormat":"u8 s"},{"kind":"report","name":"stored","identifier":144,"description":"Indicates that the average, minimum and maximum value of a given\ntimeseries are as indicated.\nIt also says how many samples were collected, and the collection period.\nTimestamps are given using device's internal clock, which will wrap around.\nTypically, `end_time` can be assumed to be \"now\".\n`end_time - start_time == window`","fields":[{"name":"num_samples","unit":"#","type":"u32","storage":4,"isSimpleType":true},{"name":"padding","type":"u8[4]","storage":4},{"name":"avg","isFloat":true,"type":"f64","storage":8},{"name":"min","isFloat":true,"type":"f64","storage":8},{"name":"max","isFloat":true,"type":"f64","storage":8},{"name":"start_time","unit":"ms","type":"u32","storage":4,"isSimpleType":true},{"name":"end_time","unit":"ms","type":"u32","storage":4,"isSimpleType":true},{"name":"label","type":"string","storage":0}],"packFormat":"u32 b[4] f64 f64 f64 u32 u32 s"},{"kind":"ro","name":"now","identifier":384,"description":"This can queried to establish local time on the device.","fields":[{"name":"_","unit":"us","type":"u32","storage":4,"isSimpleType":true}],"volatile":true,"packFormat":"u32"},{"kind":"rw","name":"fast_start","identifier":128,"description":"When `true`, the windows will be shorter after service reset and gradually extend to requested length.\nThis is ensure valid data is being streamed in program development.","fields":[{"name":"_","type":"bool","storage":1,"defaultValue":1}],"packFormat":"u8"},{"kind":"rw","name":"default_window","identifier":129,"description":"Window for timeseries for which `set_window` was never called.\nNote that windows returned initially may be shorter if `fast_start` is enabled.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":60000}],"packFormat":"u32"},{"kind":"rw","name":"default_upload","identifier":130,"description":"Whether labelled timeseries for which `set_upload` was never called should be automatically uploaded.","fields":[{"name":"_","type":"bool","storage":1,"defaultValue":1}],"packFormat":"u8"},{"kind":"rw","name":"upload_unlabelled","identifier":131,"description":"Whether automatically created timeseries not bound in role manager should be uploaded.","fields":[{"name":"_","type":"bool","storage":1,"defaultValue":1}],"packFormat":"u8"},{"kind":"rw","name":"sensor_watchdog_period","identifier":132,"description":"If no data is received from any sensor within given period, the device is rebooted.\nSet to `0` to disable (default).\nUpdating user-provided timeseries does not reset the watchdog.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"packFormat":"u32"}],"tags":["infrastructure","devicescript"],"group":"Iot","restricted":true},{"name":"Traffic Light","status":"rc","shortId":"trafficlight","camelName":"trafficLight","shortName":"trafficLight","extends":["_base"],"notes":{"short":"Controls a mini traffic with a red, orange and green LED."},"classIdentifier":365137307,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"red","identifier":128,"description":"The on/off state of the red light.","fields":[{"name":"_","type":"bool","storage":1}],"packFormat":"u8"},{"kind":"rw","name":"yellow","identifier":129,"description":"The on/off state of the yellow light.","fields":[{"name":"_","type":"bool","storage":1}],"packFormat":"u8"},{"kind":"rw","name":"green","identifier":130,"description":"The on/off state of the green light.","fields":[{"name":"_","type":"bool","storage":1}],"packFormat":"u8"}],"tags":["8bit"]},{"name":"Total Volatile organic compound","status":"stable","shortId":"tvoc","camelName":"tvoc","shortName":"tvoc","extends":["_base","_sensor"],"notes":{"short":"Measures equivalent Total Volatile Organic Compound levels."},"classIdentifier":312849815,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"TVOC","identifier":257,"description":"Total volatile organic compound readings in parts per billion.","fields":[{"name":"_","unit":"ppb","shift":10,"type":"u22.10","storage":4,"absoluteMin":0,"typicalMax":1187,"typicalMin":0}],"volatile":true,"identifierName":"reading","packFormat":"u22.10"},{"kind":"ro","name":"TVOC_error","identifier":262,"description":"Error on the reading data","fields":[{"name":"_","unit":"ppb","shift":10,"type":"u22.10","storage":4}],"volatile":true,"optional":true,"identifierName":"reading_error","packFormat":"u22.10"},{"kind":"const","name":"min_TVOC","identifier":260,"description":"Minimum measurable value","fields":[{"name":"_","unit":"ppb","shift":10,"type":"u22.10","storage":4}],"identifierName":"min_reading","packFormat":"u22.10"},{"kind":"const","name":"max_TVOC","identifier":261,"description":"Minimum measurable value.","fields":[{"name":"_","unit":"ppb","shift":10,"type":"u22.10","storage":4}],"identifierName":"max_reading","packFormat":"u22.10"}],"tags":["8bit"],"group":"Environment"},{"name":"Unique Brain","status":"stable","shortId":"uniquebrain","camelName":"uniqueBrain","shortName":"uniqueBrain","extends":["_base"],"notes":{"short":"The presence of this service indicates that this device is a client that controls sensors and actuators.\nIf a unique brain detects another younger unique brain (determined by reset counter in announce packets),\nthen the older brain should switch into proxy mode."},"classIdentifier":272387813,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"}],"tags":["infrastructure"]},{"name":"USB Bridge","status":"rc","shortId":"usbbridge","camelName":"usbBridge","shortName":"usbBridge","extends":["_base"],"notes":{"short":"This service is normally not announced or otherwise exposed on the serial bus.\nIt is used to communicate with a USB-Jacdac bridge at the USB layer.\nThe host sends broadcast packets to this service to control the link layer.\nThe device responds with broadcast reports (no-one else does that).\nThese packets are not forwarded to the UART Jacdac line.\n\nPackets are sent over USB Serial (CDC).\nThe host shall set the CDC to 1Mbaud 8N1\n(even though in some cases the USB interface is connected directly to the MCU and line settings are\nignored).\n\nThe CDC line carries both Jacdac frames and serial logging output.\nJacdac frames have valid CRC and are framed by delimeter characters and possibly fragmented.\n\n`0xFE` is used as a framing byte.\nNote that bytes `0xF8`-`0xFF` are always invalid UTF-8.\n`0xFF` occurs relatively often in Jacdac packets, so is not used for framing.\n\nThe following sequences are supported:\n\n* `0xFE 0xF8` - literal 0xFE\n* `0xFE 0xF9` - reserved; ignore\n* `0xFE 0xFA` - indicates that some serial logs were dropped at this point\n* `0xFE 0xFB` - indicates that some Jacdac frames were dropped at this point\n* `0xFE 0xFC` - Jacdac frame start\n* `0xFE 0xFD` - Jacdac frame end\n\n0xFE followed by any other byte:\n* in serial, should be treated as literal 0xFE (and the byte as itself, unless it's 0xFE)\n* in frame data, should terminate the current frame fragment,\n  and ideally have all data (incl. fragment start) in the current frame fragment treated as serial"},"classIdentifier":418781770,"enums":{"QByte":{"name":"QByte","storage":1,"members":{"Magic":254,"LiteralMagic":248,"Reserved":249,"SerialGap":250,"FrameGap":251,"FrameStart":252,"FrameEnd":253}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"command","name":"disable_packets","identifier":128,"description":"Disables forwarding of Jacdac packets.","fields":[],"hasReport":true},{"kind":"report","name":"disable_packets","identifier":128,"description":"Disables forwarding of Jacdac packets.","fields":[],"secondary":true},{"kind":"command","name":"enable_packets","identifier":129,"description":"Enables forwarding of Jacdac packets.","fields":[],"hasReport":true},{"kind":"report","name":"enable_packets","identifier":129,"description":"Enables forwarding of Jacdac packets.","fields":[],"secondary":true},{"kind":"command","name":"disable_log","identifier":130,"description":"Disables forwarding of serial log messages.","fields":[],"hasReport":true},{"kind":"report","name":"disable_log","identifier":130,"description":"Disables forwarding of serial log messages.","fields":[],"secondary":true},{"kind":"command","name":"enable_log","identifier":131,"description":"Enables forwarding of serial log messages.","fields":[],"hasReport":true},{"kind":"report","name":"enable_log","identifier":131,"description":"Enables forwarding of serial log messages.","fields":[],"secondary":true}],"tags":["infrastructure"]},{"name":"UV index","status":"stable","shortId":"uvindex","camelName":"uvIndex","shortName":"uvIndex","extends":["_base","_sensor"],"notes":{"short":"The UV Index is a measure of the intensity of ultraviolet (UV) rays from the Sun."},"classIdentifier":527306128,"enums":{"Variant":{"name":"Variant","storage":1,"members":{"UVA_UVB":1,"Visible_IR":2}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"uv_index","identifier":257,"description":"Ultraviolet index, typically refreshed every second.","fields":[{"name":"_","unit":"uv","shift":16,"type":"u16.16","storage":4,"typicalMax":11,"typicalMin":0}],"volatile":true,"identifierName":"reading","preferredInterval":1000,"packFormat":"u16.16"},{"kind":"ro","name":"uv_index_error","identifier":262,"description":"Error on the UV measure.","fields":[{"name":"_","unit":"uv","shift":16,"type":"u16.16","storage":4}],"volatile":true,"optional":true,"identifierName":"reading_error","packFormat":"u16.16"},{"kind":"const","name":"variant","identifier":263,"description":"The type of physical sensor and capabilities.","fields":[{"name":"_","type":"Variant","storage":1}],"optional":true,"identifierName":"variant","packFormat":"u8"}],"tags":["8bit"],"group":"Environment"},{"name":"Verified Telemetry","status":"deprecated","shortId":"verifiedtelemetrysensor","camelName":"verifiedTelemetry","shortName":"verifiedTelemetry","extends":["_base"],"notes":{"short":"A mixin service that exposes verified telemetry information for a sensor (see https://github.com/Azure/Verified-Telemetry/tree/main/PnPModel)."},"classIdentifier":563381279,"enums":{"Status":{"name":"Status","storage":1,"members":{"Unknown":0,"Working":1,"Faulty":2}},"FingerprintType":{"name":"FingerprintType","storage":1,"members":{"FallCurve":1,"CurrentSense":2,"Custom":3}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"ro","name":"telemetry_status","identifier":384,"description":"Reads the telemetry working status, where ``true`` is working and ``false`` is faulty.","fields":[{"name":"_","type":"Status","storage":1}],"packFormat":"u8"},{"kind":"rw","name":"telemetry_status_interval","identifier":128,"description":"Specifies the interval between computing the fingerprint information.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"optional":true,"packFormat":"u32"},{"kind":"const","name":"fingerprint_type","identifier":385,"description":"Type of the fingerprint.","fields":[{"name":"_","type":"FingerprintType","storage":1}],"packFormat":"u8"},{"kind":"ro","name":"fingerprint_template","identifier":386,"description":"Template Fingerprint information of a working sensor.","fields":[{"name":"confidence","unit":"%","type":"u16","storage":2,"isSimpleType":true},{"name":"template","type":"bytes","storage":0,"isSimpleType":true}],"packFormat":"u16 b"},{"kind":"command","name":"reset_fingerprint_template","identifier":128,"description":"This command will clear the template fingerprint of a sensor and collect a new template fingerprint of the attached sensor.","fields":[]},{"kind":"command","name":"retrain_fingerprint_template","identifier":129,"description":"This command will append a new template fingerprint to the `fingerprintTemplate`. Appending more fingerprints will increase the accuracy in detecting the telemetry status.","fields":[],"unique":true},{"kind":"event","name":"telemetry_status_change","identifier":3,"description":"The telemetry status of the device was updated.","fields":[{"name":"telemetry_status","type":"Status","storage":1}],"identifierName":"change","packFormat":"u8"},{"kind":"event","name":"fingerprint_template_change","identifier":128,"description":"The fingerprint template was updated","fields":[]}],"tags":[]},{"name":"Vibration motor","status":"stable","shortId":"vibrationmotor","camelName":"vibrationMotor","shortName":"vibrationMotor","extends":["_base"],"notes":{"short":"A vibration motor."},"classIdentifier":406832290,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"command","name":"vibrate","identifier":128,"description":"Starts a sequence of vibration and pauses. To stop any existing vibration, send an empty payload.","fields":[{"name":"duration","unit":"8ms","type":"u8","storage":1,"isSimpleType":true,"startRepeats":true},{"name":"intensity","unit":"/","shift":8,"type":"u0.8","storage":1}],"packFormat":"r: u8 u0.8"},{"kind":"const","name":"max_vibrations","identifier":384,"description":"The maximum number of vibration sequences supported in a single packet.","fields":[{"name":"_","type":"u8","storage":1,"isSimpleType":true}],"optional":true,"packFormat":"u8"}],"tags":[]},{"name":"Water level","status":"rc","shortId":"waterlevel","camelName":"waterLevel","shortName":"waterLevel","extends":["_base","_sensor"],"notes":{"short":"A sensor that measures liquid/water level."},"classIdentifier":343630573,"enums":{"Variant":{"name":"Variant","storage":1,"members":{"Resistive":1,"ContactPhotoElectric":2,"NonContactPhotoElectric":3}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"level","identifier":257,"description":"The reported water level.","fields":[{"name":"_","unit":"/","shift":16,"type":"u0.16","storage":2}],"volatile":true,"identifierName":"reading","packFormat":"u0.16"},{"kind":"ro","name":"level_error","identifier":262,"description":"The error rage on the current reading","fields":[{"name":"_","unit":"/","shift":16,"type":"u0.16","storage":2}],"volatile":true,"optional":true,"identifierName":"reading_error","packFormat":"u0.16"},{"kind":"const","name":"variant","identifier":263,"description":"The type of physical sensor.","fields":[{"name":"_","type":"Variant","storage":1}],"optional":true,"identifierName":"variant","packFormat":"u8"}],"tags":["8bit"]},{"name":"Weight Scale","status":"rc","shortId":"weightscale","camelName":"weightScale","shortName":"weightScale","extends":["_base","_sensor"],"notes":{"short":"A weight measuring sensor."},"classIdentifier":525160512,"enums":{"Variant":{"name":"Variant","storage":1,"members":{"Body":1,"Food":2,"Jewelry":3}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"weight","identifier":257,"description":"The reported weight.","fields":[{"name":"_","unit":"kg","shift":16,"type":"u16.16","storage":4}],"volatile":true,"identifierName":"reading","packFormat":"u16.16"},{"kind":"ro","name":"weight_error","identifier":262,"description":"The estimate error on the reported reading.","fields":[{"name":"_","unit":"kg","shift":16,"type":"u16.16","storage":4}],"volatile":true,"optional":true,"identifierName":"reading_error","packFormat":"u16.16"},{"kind":"rw","name":"zero_offset","identifier":128,"description":"Calibrated zero offset error on the scale, i.e. the measured weight when nothing is on the scale.\nYou do not need to subtract that from the reading, it has already been done.","fields":[{"name":"_","unit":"kg","shift":16,"type":"u16.16","storage":4}],"optional":true,"packFormat":"u16.16"},{"kind":"rw","name":"gain","identifier":129,"description":"Calibrated gain on the weight scale error.","fields":[{"name":"_","shift":16,"type":"u16.16","storage":4}],"optional":true,"packFormat":"u16.16"},{"kind":"const","name":"max_weight","identifier":261,"description":"Maximum supported weight on the scale.","fields":[{"name":"_","unit":"kg","shift":16,"type":"u16.16","storage":4}],"optional":true,"identifierName":"max_reading","packFormat":"u16.16"},{"kind":"const","name":"min_weight","identifier":260,"description":"Minimum recommend weight on the scale.","fields":[{"name":"_","unit":"kg","shift":16,"type":"u16.16","storage":4}],"optional":true,"identifierName":"min_reading","packFormat":"u16.16"},{"kind":"const","name":"weight_resolution","identifier":264,"description":"Smallest, yet distinguishable change in reading.","fields":[{"name":"_","unit":"kg","shift":16,"type":"u16.16","storage":4}],"optional":true,"identifierName":"reading_resolution","packFormat":"u16.16"},{"kind":"const","name":"variant","identifier":263,"description":"The type of physical scale","fields":[{"name":"_","type":"Variant","storage":1}],"optional":true,"identifierName":"variant","packFormat":"u8"},{"kind":"command","name":"calibrate_zero_offset","identifier":128,"description":"Call this command when there is nothing on the scale. If supported, the module should save the calibration data.","fields":[]},{"kind":"command","name":"calibrate_gain","identifier":129,"description":"Call this command with the weight of the thing on the scale.","fields":[{"name":"weight","unit":"g","shift":10,"type":"u22.10","storage":4}],"packFormat":"u22.10"}],"tags":["8bit"]},{"name":"WIFI","status":"rc","shortId":"wifi","camelName":"wifi","shortName":"wifi","extends":["_base"],"notes":{"short":"Discovery and connection to WiFi networks. Separate TCP service can be used for data transfer.","long":"## Connection\n\nThe device controlled by this service is meant to connect automatically, once configured.\nTo that end, it keeps a list of known WiFi networks, with priorities and passwords.\nIt will connect to the available network with numerically highest priority,\nbreaking ties in priority by signal strength (typically all known networks have priority of `0`).\nIf the connection fails (due to wrong password, radio failure, or other problem)\nan `connection_failed` event is emitted, and the device will try to connect to the next eligible network.\nWhen networks are exhausted, the scan is performed again and the connection process restarts.\n\nUpdating networks (setting password, priorties, forgetting) does not trigger an automatic reconnect.\n\n## Captive portals\n\nIf the Wifi is not able to join an AP because it needs to receive a password, it may decide to enter a mode\nwhere it waits for user input. Typical example of this mode would be a captive portal or waiting for a BLE interaction.\nIn that situation, the `status_code` should set to `WaitingForInput`."},"classIdentifier":413852154,"enums":{"APFlags":{"name":"APFlags","storage":4,"isFlags":true,"members":{"HasPassword":1,"WPS":2,"HasSecondaryChannelAbove":4,"HasSecondaryChannelBelow":8,"IEEE_802_11B":256,"IEEE_802_11A":512,"IEEE_802_11G":1024,"IEEE_802_11N":2048,"IEEE_802_11AC":4096,"IEEE_802_11AX":8192,"IEEE_802_LongRange":32768}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"command","name":"last_scan_results","identifier":128,"description":"Return list of WiFi network from the last scan.\nScans are performed periodically while not connected (in particular, on startup and after current connection drops),\nas well as upon `reconnect` and `scan` commands.","fields":[{"name":"results","type":"pipe","storage":12}],"pipeType":"last_scan_results","packFormat":"b[12]"},{"kind":"pipe_report","name":"results","identifier":0,"description":"Return list of WiFi network from the last scan.\nScans are performed periodically while not connected (in particular, on startup and after current connection drops),\nas well as upon `reconnect` and `scan` commands.","fields":[{"name":"flags","type":"APFlags","storage":4},{"name":"reserved","type":"u32","storage":4,"isSimpleType":true},{"name":"rssi","unit":"dB","type":"i8","storage":-1,"isSimpleType":true,"typicalMin":-100,"typicalMax":-20},{"name":"channel","type":"u8","storage":1,"isSimpleType":true,"typicalMin":1,"typicalMax":13},{"name":"bssid","type":"u8[6]","storage":6},{"name":"ssid","type":"string","storage":33,"maxBytes":33}],"pipeType":"last_scan_results","packFormat":"u32 u32 i8 u8 b[6] s[33]"},{"kind":"command","name":"add_network","identifier":129,"description":"Automatically connect to named network if available. Also set password if network is not open.","fields":[{"name":"ssid","type":"string0","storage":0},{"name":"password","type":"string0","storage":0,"isOptional":true}],"packFormat":"z z"},{"kind":"command","name":"reconnect","identifier":130,"description":"Enable the WiFi (if disabled), initiate a scan, wait for results, disconnect from current WiFi network if any,\nand then reconnect (using regular algorithm, see `set_network_priority`).","fields":[]},{"kind":"command","name":"forget_network","identifier":131,"description":"Prevent from automatically connecting to named network in future.\nForgetting a network resets its priority to `0`.","fields":[{"name":"ssid","type":"string","storage":0}],"packFormat":"s"},{"kind":"command","name":"forget_all_networks","identifier":132,"description":"Clear the list of known networks.","fields":[]},{"kind":"command","name":"set_network_priority","identifier":133,"description":"Set connection priority for a network.\nBy default, all known networks have priority of `0`.","fields":[{"name":"priority","type":"i16","storage":-2,"isSimpleType":true},{"name":"ssid","type":"string","storage":0}],"packFormat":"i16 s"},{"kind":"command","name":"scan","identifier":134,"description":"Initiate search for WiFi networks. Generates `scan_complete` event.","fields":[]},{"kind":"command","name":"list_known_networks","identifier":135,"description":"Return list of known WiFi networks.\n`flags` is currently always 0.","fields":[{"name":"results","type":"pipe","storage":12}],"pipeType":"list_known_networks","packFormat":"b[12]"},{"kind":"pipe_report","name":"network_results","identifier":0,"description":"Return list of known WiFi networks.\n`flags` is currently always 0.","fields":[{"name":"priority","type":"i16","storage":-2,"isSimpleType":true},{"name":"flags","type":"i16","storage":-2,"isSimpleType":true},{"name":"ssid","type":"string","storage":0}],"pipeType":"list_known_networks","packFormat":"i16 i16 s"},{"kind":"ro","name":"rssi","identifier":257,"description":"Current signal strength. Returns -128 when not connected.","fields":[{"name":"_","unit":"dB","type":"i8","storage":-1,"isSimpleType":true,"typicalMin":-128,"typicalMax":-20}],"volatile":true,"identifierName":"reading","preferredInterval":15000,"packFormat":"i8"},{"kind":"rw","name":"enabled","identifier":1,"description":"Determines whether the WiFi radio is enabled. It starts enabled upon reset.","fields":[{"name":"_","type":"bool","storage":1}],"identifierName":"intensity","packFormat":"u8"},{"kind":"ro","name":"ip_address","identifier":385,"description":"0, 4 or 16 byte buffer with the IPv4 or IPv6 address assigned to device if any.","fields":[{"name":"_","type":"bytes","storage":16,"isSimpleType":true,"maxBytes":16}],"packFormat":"b[16]"},{"kind":"const","name":"eui_48","identifier":386,"description":"The 6-byte MAC address of the device. If a device does MAC address randomization it will have to \"restart\".","fields":[{"name":"_","type":"bytes","storage":6,"isSimpleType":true,"maxBytes":6}],"packFormat":"b[6]"},{"kind":"ro","name":"ssid","identifier":387,"description":"SSID of the access-point to which device is currently connected.\nEmpty string if not connected.","fields":[{"name":"_","type":"string","storage":32,"maxBytes":32}],"packFormat":"s[32]"},{"kind":"event","name":"got_ip","identifier":1,"description":"Emitted upon successful join and IP address assignment.","fields":[],"identifierName":"active"},{"kind":"event","name":"lost_ip","identifier":2,"description":"Emitted when disconnected from network.","fields":[],"identifierName":"inactive"},{"kind":"event","name":"scan_complete","identifier":128,"description":"A WiFi network scan has completed. Results can be read with the `last_scan_results` command.\nThe event indicates how many networks where found, and how many are considered\nas candidates for connection.","fields":[{"name":"num_networks","type":"u16","storage":2,"isSimpleType":true},{"name":"num_known_networks","type":"u16","storage":2,"isSimpleType":true}],"packFormat":"u16 u16"},{"kind":"event","name":"networks_changed","identifier":129,"description":"Emitted whenever the list of known networks is updated.","fields":[]},{"kind":"event","name":"connection_failed","identifier":130,"description":"Emitted when when a network was detected in scan, the device tried to connect to it\nand failed.\nThis may be because of wrong password or other random failure.","fields":[{"name":"ssid","type":"string","storage":0}],"packFormat":"s"}],"tags":[],"group":"Iot"},{"name":"Wind direction","status":"rc","shortId":"winddirection","camelName":"windDirection","shortName":"windDirection","extends":["_base","_sensor"],"notes":{"short":"A sensor that measures wind direction."},"classIdentifier":409725227,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"wind_direction","identifier":257,"description":"The direction of the wind.","fields":[{"name":"_","unit":"°","type":"u16","storage":2,"isSimpleType":true,"absoluteMin":0,"absoluteMax":359}],"volatile":true,"identifierName":"reading","preferredInterval":1000,"packFormat":"u16"},{"kind":"ro","name":"wind_direction_error","identifier":262,"description":"Error on the wind direction reading","fields":[{"name":"_","unit":"°","type":"u16","storage":2,"isSimpleType":true}],"volatile":true,"optional":true,"identifierName":"reading_error","packFormat":"u16"}],"tags":["8bit"],"group":"Environment"},{"name":"Wind speed","status":"rc","shortId":"windspeed","camelName":"windSpeed","shortName":"windSpeed","extends":["_base","_sensor"],"notes":{"short":"A sensor that measures wind speed."},"classIdentifier":458824639,"enums":{},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"streaming_samples","identifier":3,"description":"Asks device to stream a given number of samples\n(clients will typically write `255` to this register every second or so, while streaming is required).","fields":[{"name":"_","unit":"#","type":"u8","storage":1,"isSimpleType":true}],"internal":true,"identifierName":"streaming_samples","packFormat":"u8","derived":"_sensor"},{"kind":"rw","name":"streaming_interval","identifier":4,"description":"Period between packets of data when streaming in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true,"defaultValue":100,"typicalMin":1,"typicalMax":60000}],"identifierName":"streaming_interval","packFormat":"u32","derived":"_sensor"},{"kind":"const","name":"streaming_preferred_interval","identifier":258,"description":"Preferred default streaming interval for sensor in milliseconds.","fields":[{"name":"_","unit":"ms","type":"u32","storage":4,"isSimpleType":true}],"internal":true,"optional":true,"identifierName":"streaming_preferred_interval","packFormat":"u32","derived":"_sensor"},{"kind":"ro","name":"wind_speed","identifier":257,"description":"The velocity of the wind.","fields":[{"name":"_","unit":"m/s","shift":16,"type":"u16.16","storage":4}],"volatile":true,"identifierName":"reading","preferredInterval":60000,"packFormat":"u16.16"},{"kind":"ro","name":"wind_speed_error","identifier":262,"description":"Error on the reading","fields":[{"name":"_","unit":"m/s","shift":16,"type":"u16.16","storage":4}],"volatile":true,"optional":true,"identifierName":"reading_error","packFormat":"u16.16"},{"kind":"const","name":"max_wind_speed","identifier":261,"description":"Maximum speed that can be measured by the sensor.","fields":[{"name":"_","unit":"m/s","shift":16,"type":"u16.16","storage":4}],"optional":true,"identifierName":"max_reading","packFormat":"u16.16"}],"tags":["8bit"],"group":"Environment"},{"name":"WSSK","status":"experimental","shortId":"wssk","camelName":"wssk","shortName":"wssk","extends":["_base"],"notes":{"short":"Defines a binary protocol for IoT devices to talk to DeviceScript gateway over encrypted websockets.\nThis is not used as a regular Jacdac service."},"classIdentifier":330775038,"enums":{"StreamingType":{"name":"StreamingType","storage":2,"members":{"Jacdac":1,"Dmesg":2,"Exceptions":256,"TemporaryMask":255,"PermamentMask":65280,"DefaultMask":256}},"DataType":{"name":"DataType","storage":1,"members":{"Binary":1,"JSON":2}}},"constants":{},"packets":[{"kind":"report","name":"command_not_implemented","identifier":3,"description":"This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.","fields":[{"name":"service_command","type":"u16","storage":2,"isSimpleType":true},{"name":"packet_crc","type":"u16","storage":2,"isSimpleType":true}],"identifierName":"command_not_implemented","packFormat":"u16 u16","derived":"_base"},{"kind":"const","name":"instance_name","identifier":265,"description":"A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"instance_name","packFormat":"s","derived":"_base"},{"kind":"ro","name":"status_code","identifier":259,"description":"Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code","packFormat":"u16 u16","derived":"_base"},{"kind":"rw","name":"client_variant","identifier":9,"description":"An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.","fields":[{"name":"_","type":"string","storage":0}],"optional":true,"identifierName":"client_variant","packFormat":"s","derived":"_base"},{"kind":"event","name":"status_code_changed","identifier":4,"description":"Notifies that the status code of the service changed.","fields":[{"name":"code","type":"u16","storage":2,"isSimpleType":true},{"name":"vendor_code","type":"u16","storage":2,"isSimpleType":true}],"optional":true,"identifierName":"status_code_changed","packFormat":"u16 u16","derived":"_base"},{"kind":"report","name":"error","identifier":255,"description":"Issued when a command fails.","fields":[{"name":"message","type":"string","storage":0}],"packFormat":"s"},{"kind":"command","name":"set_streaming","identifier":144,"description":"Enable/disable forwarding of all Jacdac frames, exception reporting, and `dmesg` streaming.","fields":[{"name":"status","type":"StreamingType","storage":2}],"packFormat":"u16"},{"kind":"command","name":"ping_device","identifier":145,"description":"Send from gateway when it wants to see if the device is alive.\nThe device currently only support 0-length payload.","fields":[{"name":"payload","type":"bytes","storage":0,"isSimpleType":true}],"hasReport":true,"packFormat":"b"},{"kind":"report","name":"ping_device","identifier":145,"description":"Send from gateway when it wants to see if the device is alive.\nThe device currently only support 0-length payload.","fields":[{"name":"payload","type":"bytes","storage":0,"isSimpleType":true}],"secondary":true,"packFormat":"b"},{"kind":"command","name":"ping_cloud","identifier":146,"description":"Send from device to gateway to test connection.","fields":[{"name":"payload","type":"bytes","storage":0,"isSimpleType":true}],"hasReport":true,"packFormat":"b"},{"kind":"report","name":"ping_cloud","identifier":146,"description":"Send from device to gateway to test connection.","fields":[{"name":"payload","type":"bytes","storage":0,"isSimpleType":true}],"secondary":true,"packFormat":"b"},{"kind":"command","name":"get_hash","identifier":147,"description":"Get SHA256 of the currently deployed program.","fields":[],"hasReport":true},{"kind":"report","name":"get_hash","identifier":147,"description":"Get SHA256 of the currently deployed program.","fields":[{"name":"sha256","type":"u8[32]","storage":32}],"secondary":true,"packFormat":"b[32]"},{"kind":"command","name":"deploy_start","identifier":148,"description":"Start deployment of a new program.","fields":[{"name":"size","unit":"B","type":"u32","storage":4,"isSimpleType":true}],"hasReport":true,"packFormat":"u32"},{"kind":"report","name":"deploy_start","identifier":148,"description":"Start deployment of a new program.","fields":[],"secondary":true},{"kind":"command","name":"deploy_write","identifier":149,"description":"Payload length must be multiple of 32 bytes.","fields":[{"name":"payload","type":"bytes","storage":0,"isSimpleType":true}],"hasReport":true,"packFormat":"b"},{"kind":"report","name":"deploy_write","identifier":149,"description":"Payload length must be multiple of 32 bytes.","fields":[],"secondary":true},{"kind":"command","name":"deploy_finish","identifier":150,"description":"Finish deployment.","fields":[],"hasReport":true},{"kind":"report","name":"deploy_finish","identifier":150,"description":"Finish deployment.","fields":[],"secondary":true},{"kind":"command","name":"c2d","identifier":151,"description":"Upload a labelled tuple of values to the cloud.\nThe tuple will be automatically tagged with timestamp and originating device.","fields":[{"name":"datatype","type":"DataType","storage":1},{"name":"topic","type":"string0","storage":0},{"name":"payload","type":"bytes","storage":0,"isSimpleType":true}],"packFormat":"u8 z b"},{"kind":"report","name":"d2c","identifier":152,"description":"Upload a binary message to the cloud.","fields":[{"name":"datatype","type":"DataType","storage":1},{"name":"topic","type":"string0","storage":0},{"name":"payload","type":"bytes","storage":0,"isSimpleType":true}],"packFormat":"u8 z b"},{"kind":"command","name":"jacdac_packet","identifier":153,"description":"Sent both ways.","fields":[{"name":"frame","type":"bytes","storage":0,"isSimpleType":true}],"hasReport":true,"packFormat":"b"},{"kind":"report","name":"jacdac_packet","identifier":153,"description":"Sent both ways.","fields":[{"name":"frame","type":"bytes","storage":0,"isSimpleType":true}],"secondary":true,"packFormat":"b"},{"kind":"report","name":"dmesg","identifier":154,"description":"The `logs` field is string in UTF-8 encoding, however it can be split in the middle of UTF-8 code point.\nControlled via `dmesg_en`.","fields":[{"name":"logs","type":"bytes","storage":0,"isSimpleType":true}],"packFormat":"b"},{"kind":"report","name":"exception_report","identifier":155,"description":"The format is the same as `dmesg` but this is sent on exceptions only and is controlled separately via `exception_en`.","fields":[{"name":"logs","type":"bytes","storage":0,"isSimpleType":true}],"packFormat":"b"}],"tags":["infrastructure","devicescript"],"group":"Iot"}]