Skip to content

Commit

Permalink
WIP fix(esp_modem): Adapt to A7670 cmux mode
Browse files Browse the repository at this point in the history
Closes #118
  • Loading branch information
david-cermak committed Oct 25, 2022
1 parent 6a43236 commit 28de345
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions components/esp_modem/src/esp_modem_cmux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,15 @@ bool CMux::on_header(CMuxFrame &frame)
}
size_t payload_offset = std::min(frame.len, 4 - frame_header_offset);
memcpy(frame_header + frame_header_offset, frame.ptr, payload_offset);
if (frame_header[1] == 0xEF) {
dlci = 0;
type = frame_header[1];
payload_len = 0;
data_available(&frame.ptr[0], payload_len); // Notify DISC
frame.advance(payload_offset);
state = cmux_state::FOOTER;
return true;
}
if ((frame_header[3] & 1) == 0) {
if (frame_header_offset + frame.len <= 4) {
frame_header_offset += frame.len;
Expand Down

0 comments on commit 28de345

Please sign in to comment.