Skip to content

Commit 7ac4bf4

Browse files
author
Cruz Monrreal
authored
Merge pull request #7870 from AriParkkila/cell-cgdata
Cellular: Support for GPRS dial-up
2 parents 686b779 + d208706 commit 7ac4bf4

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

features/cellular/framework/AT/AT_CellularBase.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class AT_CellularBase {
5050
*/
5151
enum SupportedFeature {
5252
AT_CGSN_WITH_TYPE, // AT+CGSN without type is likely always supported similar to AT+GSN
53+
AT_CGDATA, // alternative is to support only ATD*99***<cid>#
5354
SUPPORTED_FEATURE_END_MARK // must be last element in the array of features
5455
};
5556
static void set_unsupported_features(const SupportedFeature *unsupported_features);

features/cellular/framework/AT/AT_CellularNetwork.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,15 @@ nsapi_error_t AT_CellularNetwork::open_data_channel()
381381
{
382382
#if NSAPI_PPP_AVAILABLE
383383
tr_info("Open data channel in PPP mode");
384-
_at.cmd_start("AT+CGDATA=\"PPP\",");
385-
_at.write_int(_cid);
384+
if (is_supported(AT_CGDATA)) {
385+
_at.cmd_start("AT+CGDATA=\"PPP\",");
386+
_at.write_int(_cid);
387+
} else {
388+
MBED_ASSERT(_cid >= 0 && _cid <= 99);
389+
char cmd_buf[sizeof("ATD*99***xx#")];
390+
std::sprintf(cmd_buf, "ATD*99***%d#", _cid);
391+
_at.cmd_start(cmd_buf);
392+
}
386393
_at.cmd_stop();
387394

388395
_at.resp_start("CONNECT", true);

0 commit comments

Comments
 (0)