sinfonia: Further dumpall enhancements.

master
Solomon Peachy 3 years ago
parent 6c7881679d
commit 183c68a431
  1. 6
      backend_kodak605.c
  2. 4
      backend_shinkos6145.c
  3. 4
      backend_shinkos6245.c
  4. 22
      backend_sinfonia.c
  5. 2
      backend_sinfonia.h

@ -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 */

@ -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 */

@ -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 */

@ -451,16 +451,26 @@ 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;
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);
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;
}

@ -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

Loading…
Cancel
Save