add cut bitmask option and debug dump support

Replace auto-cut toggle with --cut bit flags (default 011), wire flags through C/Ruby APIs, and document the new cut/debug-dump behavior in both READMEs.

Made-with: Cursor
This commit is contained in:
knb
2026-04-20 04:22:27 +09:00
parent bfd6adda42
commit e10a430f9e
19 changed files with 255 additions and 38 deletions

View File

@@ -194,5 +194,14 @@ libptouch_err_t ptouch_bulk_send_job(libptouch_ctx *ctx, const uint8_t *buf,
ptouch_set_error(ctx, LIBPTOUCH_ERR_USB, msg);
return LIBPTOUCH_ERR_USB;
}
if (ctx->debug_dump_path && ctx->debug_dump_path[0]) {
FILE *fp = fopen(ctx->debug_dump_path,
ctx->debug_dump_truncate_next ? "wb" : "ab");
if (fp) {
(void)fwrite(buf, 1, len, fp);
(void)fclose(fp);
}
ctx->debug_dump_truncate_next = 0;
}
return LIBPTOUCH_OK;
}