Skip to content

WIP: accm#1

Closed
scribam wants to merge 1 commit into
masterfrom
accm
Closed

WIP: accm#1
scribam wants to merge 1 commit into
masterfrom
accm

Conversation

@scribam
Copy link
Copy Markdown
Owner

@scribam scribam commented May 10, 2026

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds initial support for PPP LCP Async-Control-Character-Map (ACCM / Asyncmap) negotiation in the PPP device module, along with a new unit test for parsing the option.

Changes:

  • Introduces LCPOPT_ASYNCMAP and its fixed length, plus a new asyncmap field in struct pico_device_ppp.
  • Extends LCP Configure-Request generation and option parsing to include/decode ACCM.
  • Adds a unit test case for lcp_optflags() parsing of the Asyncmap option and registers it in the unit test suite.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
test/unit/modunit_pico_dev_ppp.c Adds a new unit test for Asyncmap parsing and attempts to enable the option in Configure-Request tests.
modules/pico_dev_ppp.c Adds ACCM option constant/length, stores parsed asyncmap, includes ACCM in Configure-Request, and threads ppp into escaping decision (currently unused).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +474 to 477
LCPOPT_SET_LOCAL((&_ppp), LCPOPT_ASYNCMAP); // FIXME
lcp_send_configure_request(&_ppp);
fail_if(called_serial_send != 1);
fail_if(serial_out_len != 32);
p[4] = 0x56;
p[5] = 0x78;
memset(&_ppp, 0, sizeof(_ppp));
fail_if(lcp_optflags(&_ppp, pkt, 4 + sizeof(struct pico_lcp_hdr), 1u) != 0x04);
Comment thread modules/pico_dev_ppp.c
uint8_t *p = pkt + sizeof(struct pico_lcp_hdr);
int off;

if (adjust_opts)
Comment thread modules/pico_dev_ppp.c
Comment on lines +857 to +860
opts[optsize++] = 0;
opts[optsize++] = 0;
opts[optsize++] = 0;
opts[optsize++] = 0;
Comment thread modules/pico_dev_ppp.c
static int should_escape(uint8_t byte) {
return (byte == PPPF_FLAG_SEQ || byte == PPPF_CTRL_ESC || byte == PPPF_CTRL || byte < 0x20);
static int should_escape(struct pico_device_ppp* ppp, uint8_t byte) {
// TODO: use ppp->asyncmap
Comment thread modules/pico_dev_ppp.c
Comment on lines 933 to +937
break;
case LCPOPT_ASYNCMAP:
ppp->asyncmap = ((uint32_t)p[2] << 24) | ((uint32_t)p[3] << 16) | ((uint32_t)p[4] << 8) | p[5];
ppp_dbg("Setting Async-Control-Character-Map to %08x\n", ppp->asyncmap);
break;
@scribam scribam closed this May 10, 2026
@scribam scribam deleted the accm branch May 10, 2026 15:22
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.

2 participants