convert 'send' arguments to upper case and substitute '%' and '`' with axis_label

r2169 | dcl | 2007-10-02 12:41:34 +1000 (Tue, 02 Oct 2007) | 2 lines
This commit is contained in:
Douglas Clowes
2007-10-02 12:41:34 +10:00
parent f7cce8d15a
commit dc266a1c92

View File

@@ -1,4 +1,3 @@
#define POSIT_SHIM
/** \file motor_dmc2280.c
* \brief Driver for Galil DMC2280 motor controller.
*
@@ -3224,14 +3223,21 @@ int DMC2280Action(SConnection *pCon, SicsInterp *pSics, void *pData,
char cmd[CMDLEN];
char rsp[CMDLEN];
int idx = 0;
int i, j;
int i;
cmd[0] = '\0';
for (i = 2; i < argc; ++i) {
int j, k;
j = snprintf(&cmd[idx], CMDLEN - idx, "%s%s",
(i > 2) ? " " : "",
argv[i]);
if (j < 0)
break;
for ( k = 0; k < j && cmd[idx + k]; ++k) {
if (cmd[idx + k] == '%' || cmd[idx + k] == '`')
cmd[idx + k] = self->axisLabel;
if (islower(cmd[idx + k]))
cmd[idx + k] = toupper(cmd[idx + k]);
}
idx += j;
}
DMC2280SendReceive(self, cmd, rsp);