interface

Attribute Macro interface 

Source
#[interface]
Expand description

Macro attribute to define an SCPI interface.

This attribute processes an impl block and registers the SCPI commands defined within it. It generates the code needed to implement the microscpi::Interface trait, including the command tree and command handler dispatch logic.

§Options

The interface can be configured with additional options:

use microscpi::Interface;

#[microscpi::interface(StandardCommands, ErrorCommands, export = "commands.json")]
impl ExampleInterface {
    // ...
}

Available options:

  • StandardCommands: Add standard SCPI commands (e.g., SYSTem:VERSion?)
  • ErrorCommands: Add error-related commands (e.g., SYSTem:ERRor:[NEXT]?)
  • StatusCommands: Add status-related commands (e.g., *OPC, *CLS)