Skip to content

Commit 9d0e3d8

Browse files
author
Ari Parkkila
committed
Cellular: Added support for the Gemalto/EMS31 cellular module
1 parent a14ac31 commit 9d0e3d8

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

features/cellular/framework/targets/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularNetwork.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ bool GEMALTO_CINTERION_CellularNetwork::get_modem_stack_type(nsapi_ip_stack_t re
4949

5050
bool GEMALTO_CINTERION_CellularNetwork::has_registration(RegistrationType reg_type)
5151
{
52+
if (GEMALTO_CINTERION_Module::get_model() == GEMALTO_CINTERION_Module::ModelEMS31) {
53+
return (reg_type == C_EREG);
54+
}
5255
if (GEMALTO_CINTERION_Module::get_model() == GEMALTO_CINTERION_Module::ModelBGS2) {
5356
return (reg_type == C_REG || reg_type == C_GREG);
5457
}

features/cellular/framework/targets/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
#include <stdlib.h>
18+
#include <cstdlib>
1919
#include "GEMALTO_CINTERION_CellularStack.h"
2020
#include "GEMALTO_CINTERION_Module.h"
2121
#include "CellularLog.h"
@@ -176,7 +176,6 @@ nsapi_error_t GEMALTO_CINTERION_CellularStack::socket_open_defer(CellularSocket
176176
_at.resp_start();
177177
_at.resp_stop();
178178

179-
180179
_at.cmd_start("AT^SISO=");
181180
_at.write_int(socket->id);
182181
_at.cmd_stop();
@@ -483,6 +482,11 @@ nsapi_size_or_error_t GEMALTO_CINTERION_CellularStack::socket_recvfrom_impl(Cell
483482
// setup internet connection profile for sockets
484483
bool GEMALTO_CINTERION_CellularStack::create_connection_profile()
485484
{
485+
if (GEMALTO_CINTERION_Module::get_model() == GEMALTO_CINTERION_Module::ModelEMS31) {
486+
// EMS31 connection has only DNS settings and there is no need to modify those here for now
487+
return true;
488+
}
489+
486490
char conParamType[12];
487491
std::sprintf(conParamType, "GPRS%d", (_stack_type == IPV4_STACK) ? 0 : 6);
488492
_at.cmd_start("AT^SICS?");

features/cellular/framework/targets/GEMALTO/CINTERION/GEMALTO_CINTERION_Module.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,17 @@ static const AT_CellularBase::SupportedFeature unsupported_features_els61[] = {
2929
AT_CellularBase::SUPPORTED_FEATURE_END_MARK
3030
};
3131

32-
// unsupported features as per EMS31-US_ATC_V4.9.5
32+
// unsupported features as per BGS2-W_ATC_V00.100
3333
static const AT_CellularBase::SupportedFeature unsupported_features_bgs2[] = {
3434
AT_CellularBase::AT_CGSN_WITH_TYPE,
3535
AT_CellularBase::SUPPORTED_FEATURE_END_MARK
3636
};
3737

38+
// unsupported features as per EMS31-US_ATC_V4.9.5
39+
static const AT_CellularBase::SupportedFeature unsupported_features_ems31[] = {
40+
AT_CellularBase::SUPPORTED_FEATURE_END_MARK
41+
};
42+
3843
GEMALTO_CINTERION_Module::Model GEMALTO_CINTERION_Module::_model;
3944

4045
nsapi_error_t GEMALTO_CINTERION_Module::detect_model(const char *model)
@@ -46,6 +51,9 @@ nsapi_error_t GEMALTO_CINTERION_Module::detect_model(const char *model)
4651
} else if (memcmp(model, "BGS2", sizeof("BGS2") - 1) == 0) {
4752
_model = ModelBGS2;
4853
unsupported_features = unsupported_features_bgs2;
54+
} else if (memcmp(model, "EMS31", sizeof("EMS31") - 1) == 0) {
55+
_model = ModelEMS31;
56+
unsupported_features = unsupported_features_ems31;
4957
} else {
5058
tr_error("Cinterion model unsupported %s", model);
5159
return NSAPI_ERROR_UNSUPPORTED;

features/cellular/framework/targets/GEMALTO/CINTERION/GEMALTO_CINTERION_Module.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class GEMALTO_CINTERION_Module {
3333
ModelUnknown = 0,
3434
ModelELS61,
3535
ModelBGS2,
36+
ModelEMS31,
3637
};
3738
static nsapi_error_t detect_model(const char *model);
3839
static Model get_model();

0 commit comments

Comments
 (0)