File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
features/cellular/framework/AT Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ class AT_CellularBase {
50
50
*/
51
51
enum SupportedFeature {
52
52
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>#
53
54
SUPPORTED_FEATURE_END_MARK // must be last element in the array of features
54
55
};
55
56
static void set_unsupported_features (const SupportedFeature *unsupported_features);
Original file line number Diff line number Diff line change @@ -381,8 +381,15 @@ nsapi_error_t AT_CellularNetwork::open_data_channel()
381
381
{
382
382
#if NSAPI_PPP_AVAILABLE
383
383
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
+ }
386
393
_at.cmd_stop ();
387
394
388
395
_at.resp_start (" CONNECT" , true );
You can’t perform that action at this time.
0 commit comments