sinfonia: Add ability to dump all parameters.

This commit is contained in:
Solomon Peachy 2019-09-19 15:49:00 -04:00
parent 1f27acbfc8
commit 128050cfad
5 changed files with 31 additions and 4 deletions

View File

@ -677,6 +677,7 @@ static void kodak605_cmdline(void)
DEBUG("\t\t[ -R ] # Reset printer to factory defaults\n");
DEBUG("\t\t[ -s ] # Query status\n");
DEBUG("\t\t[ -X jobid ] # Cancel job\n");
// DEBUG("\t\t[ -Z ] # Dump all parameters\n");
}
static int kodak605_cmdline_arg(void *vctx, int argc, char **argv)
@ -687,7 +688,7 @@ static int kodak605_cmdline_arg(void *vctx, int argc, char **argv)
if (!ctx)
return -1;
while ((i = getopt(argc, argv, GETOPT_LIST_GLOBAL "b:c:C:eFil:L:mrRsX:")) >= 0) {
while ((i = getopt(argc, argv, GETOPT_LIST_GLOBAL "b:c:C:eFil:L:mrRsX:Z")) >= 0) {
switch(i) {
GETOPT_PROCESS_GLOBAL
case 'b':
@ -735,10 +736,13 @@ static int kodak605_cmdline_arg(void *vctx, int argc, char **argv)
if (!j)
kodak605_dump_status(ctx, &sts);
break;
}
case 'X':
j = sinfonia_canceljob(&ctx->dev, atoi(optarg));
break;
}
case 'Z':
j = sinfonia_dumpallparams(&ctx->dev);
break;
default:
break; /* Ignore completely */
}

View File

@ -879,6 +879,7 @@ static void shinkos6145_cmdline(void)
DEBUG("\t\t[ -R ] # Reset printer to factory defaults\n");
DEBUG("\t\t[ -s ] # Query status\n");
DEBUG("\t\t[ -X jobid ] # Abort a printjob\n");
// DEBUG("\t\t[ -Z ] # Dump all parameters\n");
}
int shinkos6145_cmdline_arg(void *vctx, int argc, char **argv)
@ -889,7 +890,7 @@ int shinkos6145_cmdline_arg(void *vctx, int argc, char **argv)
if (!ctx)
return -1;
while ((i = getopt(argc, argv, GETOPT_LIST_GLOBAL "c:C:eFik:l:L:mr:Q:q:rR:sX:")) >= 0) {
while ((i = getopt(argc, argv, GETOPT_LIST_GLOBAL "c:C:eFik:l:L:mr:Q:q:rR:sX:Z")) >= 0) {
switch(i) {
GETOPT_PROCESS_GLOBAL
case 'c':
@ -954,6 +955,9 @@ int shinkos6145_cmdline_arg(void *vctx, int argc, char **argv)
case 'X':
j = sinfonia_canceljob(&ctx->dev, atoi(optarg));
break;
case 'Z':
j = sinfonia_dumpallparams(&ctx->dev);
break;
default:
break; /* Ignore completely */
}

View File

@ -799,6 +799,7 @@ static void shinkos6245_cmdline(void)
DEBUG("\t\t[ -R ] # Reset printer to factory defaults\n");
DEBUG("\t\t[ -s ] # Query status\n");
DEBUG("\t\t[ -X jobid ] # Abort a printjob\n");
// DEBUG("\t\t[ -Z ] # Dump all parameters\n");
}
int shinkos6245_cmdline_arg(void *vctx, int argc, char **argv)
@ -809,7 +810,7 @@ int shinkos6245_cmdline_arg(void *vctx, int argc, char **argv)
if (!ctx)
return -1;
while ((i = getopt(argc, argv, GETOPT_LIST_GLOBAL "b:c:C:eFik:l:L:mrR:sX:")) >= 0) {
while ((i = getopt(argc, argv, GETOPT_LIST_GLOBAL "b:c:C:eFik:l:L:mrR:sX:Z")) >= 0) {
switch(i) {
GETOPT_PROCESS_GLOBAL
case 'b':
@ -882,6 +883,9 @@ int shinkos6245_cmdline_arg(void *vctx, int argc, char **argv)
case 'X':
j = sinfonia_canceljob(&ctx->dev, atoi(optarg));
break;
case 'Z':
j = sinfonia_dumpallparams(&ctx->dev);
break;
default:
break; /* Ignore completely */
}

View File

@ -435,6 +435,20 @@ int sinfonia_getparam(struct sinfonia_usbdev *usbh, int target, uint32_t *param)
return ret;
}
int sinfonia_dumpallparams(struct sinfonia_usbdev *usbh)
{
int i, ret;
uint32_t param = 0;
for (i = 0 ; i < 256 ; i++) {
ret = sinfonia_getparam(usbh, i, &param);
if (ret)
continue;
DEBUG("%02x: %08x\n", i, param);
}
return CUPS_BACKEND_OK;
}
int sinfonia_setparam(struct sinfonia_usbdev *usbh, int target, uint32_t param)
{
struct sinfonia_setparam_cmd cmd;

View File

@ -94,6 +94,7 @@ int sinfonia_settonecurve(struct sinfonia_usbdev *usbh, int target, char *fname)
int sinfonia_button_set(struct sinfonia_usbdev *dev, int enable);
int sinfonia_query_serno(struct libusb_device_handle *dev, uint8_t endp_up, uint8_t endp_down, char *buf, int buf_len);
int sinfonia_dumpallparams(struct sinfonia_usbdev *usbh);
#define BANK_STATUS_FREE 0x00
#define BANK_STATUS_XFER 0x01