@ -37,6 +37,9 @@ int main(void)
// ---- Test device impl ----
// Newline sequence for responses.
// Device accepts botn \r\n and \n in incomming messages.
const char *scpi_eol = "\r\n";
const SCPI_error_desc scpi_user_errors[] = {
{10, "Custom error"},
@ -70,6 +70,9 @@ extern const SCPI_command_t scpi_commands_builtin[];
/** Send a byte to master (may be buffered) */
extern void scpi_send_byte_impl(uint8_t b);
/** Character sequence used as a newline in responses. */
extern const char *scpi_eol;
// --------------- functions --------------------
@ -165,7 +165,7 @@ static void builtin_SYST_ERR_ALLq(const SCPI_argval_t *args)
scpi_send_string_raw(sbuf);
}
scpi_send_string_raw("\r\n"); // eol
scpi_send_string_raw(scpi_eol);
@ -208,7 +208,7 @@ static void builtin_SYST_ERR_CODE_ALLq(const SCPI_argval_t *args)
@ -134,9 +134,7 @@ void scpi_send_string_raw(const char *message)
void scpi_send_string(const char *message)
{
scpi_send_string_raw(message);
scpi_send_byte_impl('\r');
scpi_send_byte_impl('\n');
// ------- Error shortcuts ----------