sinfonia: Further dumpall enhancements.

This commit is contained in:
Solomon Peachy 2019-09-22 00:14:12 -04:00
parent 6c7881679d
commit 183c68a431
5 changed files with 24 additions and 14 deletions

View File

@ -734,7 +734,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");
// DEBUG("\t\t[ -Z 0|1 ] # Dump all parameters\n");
}
static int kodak605_cmdline_arg(void *vctx, int argc, char **argv)
@ -745,7 +745,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:Z")) >= 0) {
while ((i = getopt(argc, argv, GETOPT_LIST_GLOBAL "b:c:C:eFil:L:mrRsX:Z:")) >= 0) {
switch(i) {
GETOPT_PROCESS_GLOBAL
case 'b':
@ -798,7 +798,7 @@ static int kodak605_cmdline_arg(void *vctx, int argc, char **argv)
j = sinfonia_canceljob(&ctx->dev, atoi(optarg));
break;
case 'Z':
j = sinfonia_dumpallparams(&ctx->dev);
j = sinfonia_dumpallparams(&ctx->dev, atoi(optarg));
break;
default:
break; /* Ignore completely */

View File

@ -902,7 +902,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:Z")) >= 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':
@ -968,7 +968,7 @@ int shinkos6145_cmdline_arg(void *vctx, int argc, char **argv)
j = sinfonia_canceljob(&ctx->dev, atoi(optarg));
break;
case 'Z':
j = sinfonia_dumpallparams(&ctx->dev);
j = sinfonia_dumpallparams(&ctx->dev, atoi(optarg));
break;
default:
break; /* Ignore completely */

View File

@ -882,7 +882,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:Z")) >= 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':
@ -956,7 +956,7 @@ int shinkos6245_cmdline_arg(void *vctx, int argc, char **argv)
j = sinfonia_canceljob(&ctx->dev, atoi(optarg));
break;
case 'Z':
j = sinfonia_dumpallparams(&ctx->dev);
j = sinfonia_dumpallparams(&ctx->dev, atoi(optarg));
break;
default:
break; /* Ignore completely */

View File

@ -451,17 +451,27 @@ const char *sinfonia_paramname(struct sinfonia_usbdev *usbh,
return "Unknown/Not Found!";
}
int sinfonia_dumpallparams(struct sinfonia_usbdev *usbh)
int sinfonia_dumpallparams(struct sinfonia_usbdev *usbh, int known)
{
int i, ret;
uint32_t param = 0;
if (known) {
for (i = 0 ; i < usbh->params_count ; i++) {
ret = sinfonia_getparam(usbh, usbh->params[i].id, &param);
if (ret)
continue;
DEBUG("%02x (%s): %08x\n", usbh->params[i].id,
usbh->params[i].descr, param);
}
} else {
for (i = 0 ; i < 256 ; i++) {
ret = sinfonia_getparam(usbh, i, &param);
if (ret)
continue;
DEBUG("%02x (%s): %08x\n", i, sinfonia_paramname(usbh, i), param);
}
}
return CUPS_BACKEND_OK;
}

View File

@ -104,7 +104,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);
int sinfonia_dumpallparams(struct sinfonia_usbdev *usbh, int known);
const char *sinfonia_paramname(struct sinfonia_usbdev *usbh, int id);
#define BANK_STATUS_FREE 0x00