Skip to content

Commit c1fb5b5

Browse files
committed
app: Add automatic data reception for sockets
A new AT-command #XRECVCFG can be used to set the automatic data reception for the sockets. When the automatic data reception is activated, the data received for the socket is immediately sent to host as URC. Signed-off-by: Markus Lassila <markus.lassila@nordicsemi.no>
1 parent e5668b3 commit c1fb5b5

8 files changed

Lines changed: 660 additions & 147 deletions

File tree

app/src/sm_at_host.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ static bool exit_datamode(void)
132132
rsp_send("\r\n#XDATAMODE: %d\r\n", datamode_handler_result);
133133
datamode_handler_result = 0;
134134

135+
sm_at_socket_notify_datamode_exit();
136+
135137
LOG_INF("Exit datamode");
136138
ret = true;
137139
}
@@ -873,6 +875,11 @@ bool in_datamode(void)
873875
return (get_sm_mode() == SM_DATA_MODE);
874876
}
875877

878+
bool in_at_mode(void)
879+
{
880+
return (get_sm_mode() == SM_AT_COMMAND_MODE);
881+
}
882+
876883
bool exit_datamode_handler(int result)
877884
{
878885
bool ret = false;

app/src/sm_at_host.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,13 @@ int enter_datamode(sm_datamode_handler_t handler, size_t data_len);
164164
*/
165165
bool in_datamode(void);
166166

167+
/**
168+
* @brief Check whether Serial Modem AT host is in AT command mode
169+
*
170+
* @retval true if yes, false if no.
171+
*/
172+
bool in_at_mode(void);
173+
167174
/**
168175
* @brief Exit the data mode handler
169176
*

0 commit comments

Comments
 (0)