33#ifndef PROTOCORE_SCPI_H
34#define PROTOCORE_SCPI_H
38#if PROTOCORE_ENABLE_SCPI
43#define PROTOCORE_SCPI_PORT 5025
46#define SCPI_ESR_OPC 0x01
47#define SCPI_ESR_RQC 0x02
48#define SCPI_ESR_QYE 0x04
49#define SCPI_ESR_DDE 0x08
50#define SCPI_ESR_EXE 0x10
51#define SCPI_ESR_CME 0x20
52#define SCPI_ESR_URQ 0x40
53#define SCPI_ESR_PON 0x80
56#define SCPI_STB_EAV 0x04
57#define SCPI_STB_QSB 0x08
58#define SCPI_STB_MAV 0x10
59#define SCPI_STB_ESB 0x20
60#define SCPI_STB_MSS 0x40
61#define SCPI_STB_OSB 0x80
81const char *protocore_scpi_common(ScpiCommon c);
92size_t protocore_scpi_build(
char *buf,
size_t cap,
const char *header,
const char *
const *args,
size_t argc);
99size_t protocore_scpi_fmt_real(
char *buf,
size_t cap,
double v);
106embed_bool protocore_scpi_parse_number(
const char *s,
size_t len,
double *out);
112embed_bool protocore_scpi_parse_bool(
const char *s,
size_t len, embed_bool *out);
119size_t protocore_scpi_parse_string(
const char *s,
size_t len,
char *out,
size_t cap);
129embed_bool protocore_scpi_parse_block(
const uint8_t *buf,
size_t len,
const uint8_t **data,
size_t *data_len,
154void protocore_scpi_status_init(ScpiStatus *s);
157void protocore_scpi_event(ScpiStatus *s, uint8_t esr_bits);
164void protocore_scpi_push_error(ScpiStatus *s, int16_t number,
const char *msg);
171embed_bool protocore_scpi_pop_error(ScpiStatus *s, ScpiError *out);
174uint8_t protocore_scpi_stb(
const ScpiStatus *s);
177void protocore_scpi_cls(ScpiStatus *s);
180const char *protocore_scpi_std_error(int16_t number);
194embed_bool protocore_scpi_match(
const char *input,
size_t input_len,
const char *pattern);
#define PROTOCORE_SCPI_ERR_QUEUE
SCPI error/event queue depth (entries). The SCPI status model requires a queue; when it overflows the...
EMBED_ENUM_BYTE(ProtoConn, PROTO_NONE=0, PROTO_HTTP=1, PROTO_TELNET=2, PROTO_SSH=3, PROTO_MODBUS=4, PROTO_OPCUA=5, PROTO_SSH_RFWD=6, PROTO_RELAY=7, PROTO_BRIDGE=8, PROTO_NTRIP_CASTER=9, PROTO_MESH=10, PROTO_UDP=11,)
Application protocol spoken on a listener port or connection slot.