dnp/citizen: Allow iserial status to be reported, but not updated on new DS40/DS80 FW.

This commit is contained in:
Solomon Peachy 2024-02-26 17:10:10 -05:00
parent 0081e77288
commit 9a4af3ce3e
1 changed files with 11 additions and 11 deletions

View File

@ -132,7 +132,7 @@ struct dnpds40_ctx {
int supports_keepmode;
int supports_6x4_5;
int supports_mqty_default;
int supports_iserial;
int supports_iserial; /* 0 == no, 1 == configurable, 2 == always enabled */
int supports_6x6;
int supports_5x5;
int supports_counterp;
@ -1490,10 +1490,9 @@ static int dnpds40_attach(void *vctx, struct dyesub_connection *conn, uint8_t jo
ctx->supports_3x5x2 = 1;
if (FW_VER_CHECK(1,60))
ctx->supports_fullcut = ctx->supports_6x6 = 1; // No 5x5!
#if 0 /* Printer _always_ reports iSerial */
if (FW_VER_CHECK(1,70))
ctx->supports_iserial = 1;
#endif
/* Always reports iSerial, not configurable */
ctx->supports_iserial = 2;
break;
case P_DNP_DS80:
case P_DNP_DS80D:
@ -1503,10 +1502,9 @@ static int dnpds40_attach(void *vctx, struct dyesub_connection *conn, uint8_t jo
ctx->supports_counterp = 1;
if (FW_VER_CHECK(1,30))
ctx->supports_matte = 1;
#if 0 /* Printer _always_ reports iSerial */
if (FW_VER_CHECK(1,42))
ctx->supports_iserial = 1;
#endif
/* Always reports iSerial, not configurable */
ctx->supports_iserial = 2;
break;
case P_DNP_DSRX1:
ctx->native_width = 1920;
@ -3663,7 +3661,9 @@ CWD_TOP:
free(resp);
}
if (ctx->supports_iserial) {
if (ctx->supports_iserial == 2) {
INFO("Report Serial Number in USB descriptor: Yes\n");
} else if (ctx->supports_iserial == 1) {
int i;
/* Get USB serial descriptor status */
dnpds40_build_cmd(&cmd, "MNT_RD", "USB_ISERI_SET", 0);
@ -4420,8 +4420,8 @@ static int dnpds40_cmdline_arg(void *vctx, int argc, char **argv)
}
case 'x': {
int enable = atoi(optarg);
if (!ctx->supports_iserial) {
ERROR("Printer does not support USB iSerialNumber reporting\n");
if (ctx->supports_iserial != 1) {
ERROR("Printer does not support configuring iSerialNumber reporting!\n");
j = -1;
break;
}
@ -4610,7 +4610,7 @@ static const char *dnpds40_prefixes[] = {
const struct dyesub_backend dnpds40_backend = {
.name = "DNP DS-series / Citizen C-series",
.version = "0.156",
.version = "0.157",
.uri_prefixes = dnpds40_prefixes,
.cmdline_usage = dnpds40_cmdline,
.cmdline_arg = dnpds40_cmdline_arg,