Skip to main content

Module codes

Module codes 

Source
Expand description

The stable diagnostic codes, one per message.

The ranges are reserved by stage (see the crate docs). Keeping the map in one place is what stops two stages from picking the same number: a new message gets a new entry here, and for_message is the only producer of a code for the EspfError shim.

Codes are data: the human renderer does not print them, to_json does. Once a code has shipped it is a public contract, so never renumber one for a different message.

Constants§

CLI_ANSWER
A command-line answer that cannot be applied (no source span).
COMPONENT_I2C_BUS_USED
Two <i2c_component>s on one <i2c>.
COMPONENT_INVALID_BAUD
<uart_component baud_rate="0">.
COMPONENT_INVALID_BUTTON
A <button> that cannot be built.
COMPONENT_INVALID_CS
A chip-select attribute that is neither a pin nor a gpio id.
COMPONENT_INVALID_I2C
An <i2c_component> that cannot be built.
COMPONENT_INVALID_ID
A component id that cannot become a Rust identifier.
COMPONENT_INVALID_LED
An <led> that cannot be built.
COMPONENT_INVALID_SPI
An <spi_component> that cannot be built.
COMPONENT_INVALID_UART
A <uart_component> that cannot be built.
COMPONENT_UART_USED
Two <uart_component>s on one <uart>.
COMPONENT_UNKNOWN_BUS
A component pointing at a bus that is not a bus of that kind.
COMPONENT_UNKNOWN_GPIO
A <led>/<button> referencing a gpio id that does not exist.
COMPONENT_UNSUPPORTED
A component tag build does not lower yet.
COMPONENT_WRONG_DIRECTION
A led on an input pin or a button on an output pin.
CONFLICT_DIRECTION
One element needs an input and the other an output.
CONFLICT_I2C_WIRING
An <i2c> bus whose SDA and SCL are the same pin.
CONFLICT_PERIPHERAL
Two elements on one <uart> peripheral.
CONFLICT_PIN
Two elements on one pin.
CONFLICT_PIN_USED
A pin claimed by two elements of the same kind.
CONFLICT_SPI_WIRING
An <spi> bus whose SCLK and MOSI are the same pin.
CONFLICT_UART_WIRING
A <uart> whose TX and RX are the same pin.
CORE_CHIP_WITHOUT_TYPE
<chip> without a type attribute.
CORE_CONSOLE_WITHOUT_TYPE
<console> without a type attribute.
CORE_DUPLICATE_ELEMENT
The same element is written twice in # espforge.
CORE_INCOMPLETE
# espforge lacks <project>, <chip> or <runtime>.
CORE_RUNTIME_WITHOUT_TYPE
<runtime> without a type attribute.
CORE_UNKNOWN_CHIP
A chip name the catalog does not know.
CORE_UNKNOWN_CONSOLE
A console name the catalog does not know.
CORE_UNKNOWN_ELEMENT
An element the # espforge schema does not know.
CORE_UNKNOWN_RUNTIME
A runtime name the catalog does not know.
DRIVER_UNKNOWN
A device tag with no compile-time driver.
GPIO_INVALID_DIRECTION
<gpio direction> outside input/output.
GPIO_INVALID_PIN
<gpio pin> that is not a number.
GRAPH_COMPONENT_WITHOUT_ID
A component without an id.
GRAPH_COMPONENT_WITHOUT_LINK
A component without its i2c=/spi=/gpio=/uart= link.
GRAPH_DEVICE_WITHOUT_ID
A device without an id.
GRAPH_DEVICE_WITHOUT_MAPPING
A device without its component mapping.
GRAPH_INVALID_PIN
A pin attribute that is not a 0..=255 number.
GRAPH_PERIPHERAL_WITHOUT_ID
A peripheral without an id.
GRAPH_UNKNOWN_COMPONENT
A $ reference to a component id that does not exist.
GRAPH_UNKNOWN_PERIPHERAL
A $ reference to a peripheral id that does not exist.
I2C_INVALID_FREQUENCY
An <i2c frequency> that is not NkHz.
I2C_INVALID_ID
An <i2c> id other than i2c0..i2c2.
I2C_INVALID_PIN
An <i2c> pin that is not a number.
OPTION_DERIVED
An option value that cannot be set in <options>.
OPTION_INVALID_VALUE
An option value outside its declared choices.
OPTION_MUTUALLY_EXCLUSIVE
Two options in one selection group are on together.
OPTION_NO_CONSOLE
The selected console does not exist on the chip.
OPTION_REQUIRES
An option that needs another option that is off.
OPTION_UNAVAILABLE
An option that the selected chip cannot provide.
OPTION_UNKNOWN
An option name that is not in the schema.
PERIPHERAL_UNSUPPORTED
A peripheral tag build does not lower yet.
SERVICE_DUPLICATE_WIFI
A second <wifi> in # services.
SERVICE_INVALID_PASSWORD
A password that is neither empty nor 8..=63 characters.
SERVICE_INVALID_SSID
An ssid outside 1..=32 bytes.
SERVICE_INVALID_VALUE
A wifi value that cannot be a Rust string literal.
SERVICE_MISSING_SSID
<wifi> without an ssid.
SERVICE_UNSUPPORTED
A service other than <wifi>.
SERVICE_UNSUPPORTED_DEVICES
# devices entries are not lowered yet.
SERVICE_UNSUPPORTED_FIELD
A <wifi> field other than network1.ssid/password.
SPI_INVALID_FREQUENCY
An <spi frequency> that is not NkHz.
SPI_INVALID_ID
An <spi> id other than spi2.
SPI_INVALID_MODE
An <spi mode> outside 0..=3.
SPI_INVALID_PIN
An <spi> pin that is not a number.
STRUCTURE_DUPLICATE_SECTION
Two # section blocks with the same name.
STRUCTURE_MISSING_SECTION
A required # section block is absent.
SYNTAX_NODE_LINE
A parser-junk line that is not a node.
SYNTAX_SECTION_HEADER
A line that should have been a # section header.
UART_INVALID_ID
A <uart> id other than uart0..uart3.
UART_INVALID_PERIPHERAL
An explicit <uart uart> outside UART0..UART3.
UART_INVALID_PIN
A <uart> pin that is not a number.
UNCLASSIFIED
The fallback for a message the table does not know.
VALUE_KEY_KIND
A key used both as a plain value and as an object.
VALUE_MISSING_ATTRIBUTE
A required attribute is absent.
VALUE_NOT_BOOLEAN
A value that should be a boolean.
VALUE_NOT_NUMBER
A value that should be an unsigned number.
VALUE_WRONG_TYPE
An attribute value with the wrong type.

Functions§

for_cli_message
The code for a command-line answer that never enters the source pipeline.
for_message
The code for one diagnostic message.