Skip to content

Commit

Permalink
feat: support queued commands type
Browse files Browse the repository at this point in the history
  • Loading branch information
ThisAMJ committed Jul 31, 2024
1 parent 6269481 commit fbbaa4a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,11 @@ static int _parse_sar_data(struct sar_data *out, FILE *f, size_t len) {

break;

case SAR_DATA_QUEUEDCMD:
out->queuedcmd = strdup((char *)data);

break;

default:
fprintf(g_errfile, "[SAR] Unhandled message type %02X\n", out->type);
out->type = SAR_DATA_INVALID;
Expand Down
2 changes: 2 additions & 0 deletions src/demo.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ struct sar_data {
SAR_DATA_HWAIT_RUN = 0x0D,
SAR_DATA_ENTITY_SERIAL = 0x0E,
SAR_DATA_FRAMETIME = 0x0F,
SAR_DATA_QUEUEDCMD = 0x10,
SAR_DATA_CHECKSUM = 0xFF,
SAR_DATA_CHECKSUM_V2 = 0xFE,

Expand All @@ -43,6 +44,7 @@ struct sar_data {
float timescale;
uint32_t pause_ticks;
float frametime;
char *queuedcmd;

struct {
char *cvar;
Expand Down
5 changes: 5 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ static void _output_sar_data(uint32_t tick, struct sar_data data) {
}
}
break;
case SAR_DATA_QUEUEDCMD:
if (!config_check_cmd_whitelist(g_cmd_whitelist, data.queuedcmd)) {
fprintf(g_outfile, "\t\t[%5u] [SAR] queued command: %s\n", tick, queuedCmd);
}
break;
default:
// don't care
break;
Expand Down

0 comments on commit fbbaa4a

Please sign in to comment.