// Autogenerated C header file for Base service
#ifndef _JACDAC_SPEC_BASE_H
#define _JACDAC_SPEC_BASE_H 1

#define JD_SERVICE_CLASS_BASE  0x1ffffff3

/**
 * This report may be emitted by a server in response to a command (action or register operation)
 * that it does not understand.
 * The `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.
 * Note that it's possible to get an ACK, followed by such an error report.
 */
typedef struct jd_base_command_not_implemented_report {
    uint16_t service_command;
    uint16_t packet_crc;
} jd_base_command_not_implemented_report_t;


/**
 * Constant string (bytes). A friendly name that describes the role of this service instance in the device.
 * It often corresponds to what's printed on the device:
 * for example, `A` for button A, or `S0` for servo channel 0.
 * Words like `left` should be avoided because of localization issues (unless they are printed on the device).
 */

/**
 * Reports the current state or error status of the device. ``code`` is a standardized value from 
 * the Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device
 * state. This report is typically not queried, when a device has an error, it will typically
 * add this report in frame along with the announce packet. If a service implements this register,
 * it should also support the ``status_code_changed`` event defined below.
 */
typedef struct jd_base_status_code {
    uint16_t code;
    uint16_t vendor_code;
} jd_base_status_code_t;


/**
 * Read-write string (bytes). An optional register in the format of a URL query string where the client can provide hints how
 * the device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.
 */

/**
 * Notifies that the status code of the service changed.
 */
typedef struct jd_base_status_code_changed {
    uint16_t code;
    uint16_t vendor_code;
} jd_base_status_code_changed_t;


#endif
