Hi!
I have tested different code examples but without success. So, some questions came out.
- What are all parameters that I can set to my target in
mbed_app.json
? How are this parameters used? - How can I initialize my cellular interface without PSM?
Here a non-working example:
File mbed_app.json
{
"target_overrides": {
"UBLOX_C030_R412M": {
"target.network-default-interface-type": "CELLULAR"
}
}
}
File main.cpp
#include "UbloxATCellularInterfaceExt.h"
#include "mbed.h"
#define APN NULL
#define USERNAME NULL
#define PASSWORD NULL
int main() {
UbloxATCellularInterfaceExt *interface = new UbloxATCellularInterfaceExt(
/*MDMTXD, MDMRXD,
MBED_CONF_UBLOX_CELL_BAUD_RATE,
true*/);
UbloxATCellularInterfaceExt::Error *err;
UbloxATCellularInterfaceExt::CellLocData data;
if (interface->init()) {
interface->disable_power_saving_mode();
interface->set_mno_profile(UbloxATCellularInterface::VODAFONE);
interface->set_modem_rat(UbloxCellularBase::RAT::LTE_CATNB1, UbloxCellularBase::RAT::GPRS_EGPRS);
interface->set_credentials(APN, USERNAME, PASSWORD);
printf("Registered, connecting to the packet network...\n");
for (int x = 0; interface->connect() != 0; x++) {
if (x > 0) {
printf("Retrying (have you checked that an antenna is plugged in and your APN is correct?)...\n");
}
}
} else {
printf("Unable to initialise the interface.\n");
}
}
In my opinion function interface->init
just do to much if I want to configure some things first. And simple modem power up etc. functions are protected
. So, what is here the best practice to get more control over the interface?