Conversation
There was a problem hiding this comment.
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_ASYNCMAPand its fixed length, plus a newasyncmapfield instruct 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); |
| uint8_t *p = pkt + sizeof(struct pico_lcp_hdr); | ||
| int off; | ||
|
|
||
| if (adjust_opts) |
Comment on lines
+857
to
+860
| opts[optsize++] = 0; | ||
| opts[optsize++] = 0; | ||
| opts[optsize++] = 0; | ||
| opts[optsize++] = 0; |
| 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 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; |
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.
No description provided.