Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cellular: Support Cinterion EHS5-E cellular module #10100

Merged
merged 5 commits into from
Mar 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ nsapi_error_t GEMALTO_CINTERION::init()
if (!information) {
return NSAPI_ERROR_NO_MEMORY;
}
char model[sizeof("ELS61") + 1]; // sizeof need to be long enough to hold just the model text
char model[sizeof("EHS5-E") + 1]; // sizeof need to be long enough to hold just the model text
nsapi_error_t ret = information->get_model(model, sizeof(model));
close_information();
if (ret != NSAPI_ERROR_OK) {
Expand All @@ -70,6 +70,8 @@ nsapi_error_t GEMALTO_CINTERION::init()
init_module_bgs2();
} else if (memcmp(model, "EMS31", sizeof("EMS31") - 1) == 0) {
init_module_ems31();
} else if (memcmp(model, "EHS5-E", sizeof("EHS5-E") - 1) == 0) {
init_module_ehs5e();
} else {
tr_error("Cinterion model unsupported %s", model);
return NSAPI_ERROR_UNSUPPORTED;
Expand Down Expand Up @@ -147,6 +149,24 @@ void GEMALTO_CINTERION::init_module_ems31()
_module = ModuleEMS31;
}

void GEMALTO_CINTERION::init_module_ehs5e()
{
// EHS5-E
static const intptr_t cellular_properties[AT_CellularBase::PROPERTY_MAX] = {
AT_CellularNetwork::RegistrationModeDisable, // C_EREG
AT_CellularNetwork::RegistrationModeLAC, // C_GREG
AT_CellularNetwork::RegistrationModeLAC, // C_REG
0, // AT_CGSN_WITH_TYPE
1, // AT_CGDATA
1, // AT_CGAUTH
1, // PROPERTY_IPV4_STACK
1, // PROPERTY_IPV6_STACK
0, // PROPERTY_IPV4V6_STACK
};
AT_CellularBase::set_cellular_properties(cellular_properties);
_module = ModuleEHS5E;
}

#if MBED_CONF_GEMALTO_CINTERION_PROVIDE_DEFAULT
#include "UARTSerial.h"
CellularDevice *CellularDevice::get_default_instance()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class GEMALTO_CINTERION : public AT_CellularDevice {
ModuleELS61,
ModuleBGS2,
ModuleEMS31,
ModuleEHS5E,
};
static Module get_module();

Expand All @@ -59,6 +60,7 @@ class GEMALTO_CINTERION : public AT_CellularDevice {
void init_module_bgs2();
void init_module_els61();
void init_module_ems31();
void init_module_ehs5e();
};

} // namespace mbed
Expand Down