Skip to content

Commit

Permalink
SCPI: removing debug commands
Browse files Browse the repository at this point in the history
  • Loading branch information
jeras committed Jul 7, 2017
1 parent 411e47d commit 2dacb2b
Showing 1 changed file with 15 additions and 31 deletions.
46 changes: 15 additions & 31 deletions scpi-server/src/scpi-commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,54 +89,38 @@ scpi_result_t SCPI_SystemCommTcpipControlQ(scpi_t * context) {
return SCPI_RES_ERR;
}

scpi_result_t SCPI_Echo(scpi_t * context) {
syslog(LOG_ERR, "*ECHO");
SCPI_ResultText(context, "ECHO?");
return SCPI_RES_OK;
}

scpi_result_t SCPI_EchoVersion(scpi_t * context) {
syslog(LOG_ERR, "*ECO:VERSION?");
SCPI_ResultText(context, rp_GetVersion());
return SCPI_RES_OK;
}

/**
* SCPI Configuration
*/

static const scpi_command_t scpi_commands[] = {
/* IEEE Mandated Commands (SCPI std V1999.0 4.1.1) */
{ .pattern = "*CLS", .callback = SCPI_CoreCls,},
{ .pattern = "*ESE", .callback = SCPI_CoreEse,},
{ .pattern = "*CLS" , .callback = SCPI_CoreCls,},
{ .pattern = "*ESE" , .callback = SCPI_CoreEse,},
{ .pattern = "*ESE?", .callback = SCPI_CoreEseQ,},
{ .pattern = "*ESR?", .callback = SCPI_CoreEsrQ,},
{ .pattern = "*IDN?", .callback = SCPI_CoreIdnQ,},
{ .pattern = "*OPC", .callback = SCPI_CoreOpc,},
{ .pattern = "*OPC" , .callback = SCPI_CoreOpc,},
{ .pattern = "*OPC?", .callback = SCPI_CoreOpcQ,},
{ .pattern = "*RST", .callback = SCPI_CoreRst,},
{ .pattern = "*SRE", .callback = SCPI_CoreSre,},
{ .pattern = "*RST" , .callback = SCPI_CoreRst,},
{ .pattern = "*SRE" , .callback = SCPI_CoreSre,},
{ .pattern = "*SRE?", .callback = SCPI_CoreSreQ,},
{ .pattern = "*STB?", .callback = SCPI_CoreStbQ,},
{ .pattern = "*TST?", .callback = SCPI_CoreTstQ,},
{ .pattern = "*WAI", .callback = SCPI_CoreWai,},
{ .pattern = "*WAI" , .callback = SCPI_CoreWai,},

/* Required SCPI commands (SCPI std V1999.0 4.2.1) */
{.pattern = "SYSTem:ERRor[:NEXT]?", .callback = SCPI_SystemErrorNextQ,},
{.pattern = "SYSTem:ERRor:COUNt?", .callback = SCPI_SystemErrorCountQ,},
{.pattern = "SYSTem:VERSion?", .callback = SCPI_SystemVersionQ,},
{.pattern = "SYSTem:ERRor:COUNt?", .callback = SCPI_SystemErrorCountQ,},
{.pattern = "SYSTem:VERSion?", .callback = SCPI_SystemVersionQ,},

{.pattern = "STATus:QUEStionable[:EVENt]?", .callback = SCPI_StatusQuestionableEventQ,},
{.pattern = "STATus:QUEStionable:ENABle", .callback = SCPI_StatusQuestionableEnable,},
{.pattern = "STATus:QUEStionable:ENABle?", .callback = SCPI_StatusQuestionableEnableQ,},

{.pattern = "STATus:PRESet", .callback = SCPI_StatusPreset,},
{.pattern = "STATus:QUEStionable:ENABle", .callback = SCPI_StatusQuestionableEnable,},
{.pattern = "STATus:QUEStionable:ENABle?", .callback = SCPI_StatusQuestionableEnableQ,},
{.pattern = "STATus:PRESet", .callback = SCPI_StatusPreset,},

{.pattern = "SYSTem:COMMunication:TCPIP:CONTROL?", .callback = SCPI_SystemCommTcpipControlQ,},

{.pattern = "ECHO?", .callback = SCPI_Echo,},
{.pattern = "ECO:VERSION?", .callback = SCPI_EchoVersion,},

/* RedPitaya */

/* General commands */
Expand Down Expand Up @@ -223,11 +207,11 @@ static const scpi_command_t scpi_commands[] = {
};

static scpi_interface_t scpi_interface = {
.error = SCPI_Error,
.write = SCPI_Write,
.error = SCPI_Error,
.write = SCPI_Write,
.control = SCPI_Control,
.flush = SCPI_Flush,
.reset = SCPI_Reset,
.flush = SCPI_Flush,
.reset = SCPI_Reset,
};

#define SCPI_INPUT_BUFFER_LENGTH 538688
Expand Down

0 comments on commit 2dacb2b

Please sign in to comment.