Skip to content

Add minimal CUC quick-start snippet with encode/decode flow - #5

Merged
Michal-Pogorzelec merged 4 commits into
mainfrom
copilot/add-cuc-code-snapshot
Oct 4, 2026
Merged

Michal-Pogorzelec merged 4 commits into
mainfrom
copilot/add-cuc-code-snapshot

Conversation

Copilot AI commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Quick Start only pointed to examples and did not show a minimal CUC setup inline. This updates README with a compact, copy-ready snippet that shows both encode and mirrored decode paths.

  • Quick Start content update

    • Replaced the placeholder “See the examples.” text with an embedded CUC setup snapshot.
    • Kept the snippet minimal: format setup, time creation, buffer allocation, and checked API calls.
  • Encode/decode symmetry

    • Added the decode path immediately after encode to mirror real usage and complete the minimum round-trip flow.
    • Preserved concise error-handling placeholders to keep focus on API shape.
  • Reference to full example

    • Kept a direct pointer to examples/cuc_example.c for full output/printing flow.
cuc_format_t fmt = {CUC_EPOCH_CCSDS, 4, 2};
cuc_time_t time = cuc_time_from_seconds(1234567.25);

uint8_t buf[CUC_OCTETS_MAX];
size_t written = 0;
if (cuc_encode(&time, &fmt, buf, sizeof(buf), &written) != CUC_OK)
{
    /* handle error */
}

cuc_format_t decoded_fmt;
cuc_time_t decoded;
size_t consumed = 0;
if (cuc_decode(buf, written, &decoded_fmt, &decoded, &consumed) != CUC_OK)
{
    /* handle error */
}

Copilot AI and others added 2 commits October 4, 2026 12:18
Co-authored-by: Michal-Pogorzelec <80826463+Michal-Pogorzelec@users.noreply.github.com>
Co-authored-by: Michal-Pogorzelec <80826463+Michal-Pogorzelec@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The snippet is not compilable under the supported -DCUC_NO_FLOAT configuration.

Review effort: Lite
Findings: 1 Low severity

Open (1)
What changed in this PR

Adds a compact CUC encode/decode quick-start snippet to the README.

Changes:

  • Adds format, time, buffer, encode, and decode setup.
  • Includes checked API calls and a full-example reference.
File Description
README.md Adds the minimal CUC quick-start encode/decode flow.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread README.md Outdated
Michal-Pogorzelec and others added 2 commits October 4, 2026 14:31
Updated cuc_time_t initialization to use struct initializer.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

No unresolved review comments remain.

Review effort: Lite
Findings: None

Resolved since last review (1)

@Michal-Pogorzelec
Michal-Pogorzelec merged commit 1c7ba16 into main Oct 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants