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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user