In the official example , all settings like pin, apn, username and password are configured via mbed_app.json, then the instance is get by calling:
ec25 = CellularContext::get_default_instance();
This works, but has the downside are: 1) sensitive information like username and password are included in source which is typically not a good practice; 2) those settings cannot be changed on the fly.
So my question is, can we instantiate a cellular connectivity like we do with ethernet or Wifi/ESP8266? Something like the following lines of code. If yes, we will have a lot more flexibility.
Not necessarily a moot. 1) If the same PCB are used in two models of product, once with EC25 and the other one without. Then starting UART TX as input can be used as a mechanism to detect if a module is installed. 2) I generally try to avoid changes/configurations in the json file. Whenever any minor changes happen there , it means minutes of compilation time.