Log undecodable CAN frames to per-ID CSVs under unknown_ids and document E2E procedure#2
Draft
Copilot wants to merge 3 commits into
Draft
Log undecodable CAN frames to per-ID CSVs under unknown_ids and document E2E procedure#2Copilot wants to merge 3 commits into
unknown_ids and document E2E procedure#2Copilot wants to merge 3 commits into
Conversation
Agent-Logs-Url: https://github.com/sbasu107/can-telem-cloud/sessions/3aa2c46a-510e-4ef6-8e17-dbf4edd5da30 Co-authored-by: sbasu107 <40325803+sbasu107@users.noreply.github.com>
Agent-Logs-Url: https://github.com/sbasu107/can-telem-cloud/sessions/3aa2c46a-510e-4ef6-8e17-dbf4edd5da30 Co-authored-by: sbasu107 <40325803+sbasu107@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement logging of unknown CAN IDs to CSV files
Log undecodable CAN frames to per-ID CSVs under Apr 23, 2026
unknown_ids and document E2E procedure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change extends telemetry output to capture CAN frames that do not decode to any configured signal, without changing existing known-signal CSV behavior. Unknown frames are now persisted as per-ID CSVs in a dedicated subdirectory under the configured output path.
CAN read/decode path
Writer enhancements
<outdir>/unknown_idsduring writer initialization.writer_append_unknown(...)to append unknown frames to one file per CAN ID:<outdir>/unknown_ids/%08X.csv(e.g.,00000777.csv)timestamp_ns,dlc,data_hexDocumentation / E2E procedure
unknown_idsOriginal prompt
Implement logging of unknown CAN IDs to per-ID CSV files under a subdirectory, and add an end-to-end test procedure.
Repository: sbasu107/can-telem-cloud
Goal
Behavior details
Unknown CSV format
Implementation guidance
Testing
Deliverables
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: what happens if a can id is not found in the json sheet? can it still be saved into a csv?
Assistant: If a CAN frame comes in with an ID that isn’t present in
format.json, then in this repo nothing is decoded and nothing is written to CSV for that frame.Why:
const sig_node_t *node = signal_table_lookup(table, id);for (; node; node = node->next)and only writes CSV inside that loop after a successful decode (decoder_extract) viawriter_append(...).signal_table_lookup(...)returnsNULL, the loop body never runs, and no CSV row is produced for that unknown ID. (Seesrc/can_reader.caround the lookup + loop.)So: No, with the current implementation it will not “still be saved into a CSV” (because the CSV writer is per-signal and only triggered for known signal definitions).
If you want unknown CAN IDs saved anyway, you’d need to add a new behavior, e.g.:
unknown_frames.csvwithtimestamp_ns,can_id,dlc,data_hex, written whensignal_table_lookup(...)returnsNULL, orIf you want, tell me the exact CSV format you want for unknown frames and whether you want one file for all unknown IDs or one file per CAN ID, and I’ll point you to the exact place in
can_reader_loop()to implement it.User: in addition to found signals, one csv per unnown can id as well.
Assistant: Yes—this is doable, but it’s not implemented right now. Currently, if a CAN ID isn’t in
format.json, the code simply doesn’t callwriter_append(), so no CSV gets created for that frame.To add what you want (“in addition to found signals, create one CSV per unknown CAN ID too”), the cleanest approach is:
Recommended behavior
signal_table_lookup(table, id)returnsNULL(or returns only placeholder entries), treat the frame as “unknown” and append it to:This pull request was created from Copilot chat.