Skip to content

Commit

Permalink
Added switch to skip CFUN=0 on INIT (#24)
Browse files Browse the repository at this point in the history
* Added switch to skip CFUN=0 on INIT
  • Loading branch information
DrBomb committed Apr 23, 2021
1 parent 2b28a88 commit 5a8fd5d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions mos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ config_schema:
- ["pppos.hexdump_enable", "b", false, {title: "Dump all the data sent over UART to stderr"}]
- ["pppos.last_oper", "s", "", {title: "This field is used to store last successfully connected operator"}]
- ["pppos.reg_cmd", "s", "CREG", {title: "AT command used for setting and checking network registration. CREG(default), CGREG, CEREG"}]
- ["pppos.cfun_cycle", "b", true, {title: "Set CFUN to 0, then to 1"}]

conds:
# ESP32 sets LwIP options via sdkconfig, for other platforms use cdefs directly.
Expand Down
4 changes: 3 additions & 1 deletion src/mgos_pppos.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,9 @@ static void mgos_pppos_dispatch_once(struct mgos_pppos_data *pd) {
add_cmd(pd, mgos_pppos_at_cb, 0, "AT");
add_cmd(pd, NULL, 0, "ATH");
add_cmd(pd, NULL, 0, "ATE0");
add_cmd(pd, NULL, 0, "AT+CFUN=0"); /* Offline */
if (mgos_sys_config_get_pppos_cfun_cycle()) {
add_cmd(pd, NULL, 0, "AT+CFUN=0"); /* Offline */
}
if (!pd->baud_ok) {
struct mgos_uart_config ucfg;
bool need_ifr = true, need_ifc = true;
Expand Down

0 comments on commit 5a8fd5d

Please sign in to comment.