-
-
Notifications
You must be signed in to change notification settings - Fork 212
/
Copy path0093-Implement-GEMALTO-subclass-of-CellularNetwork.patch
153 lines (147 loc) · 6.28 KB
/
0093-Implement-GEMALTO-subclass-of-CellularNetwork.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
From b1234223bf7f1d63f53eced12dd1903ba32629c7 Mon Sep 17 00:00:00 2001
From: giulcioffi <g.cioffi@arduino.cc>
Date: Tue, 13 Jul 2021 18:17:13 +0200
Subject: [PATCH 093/204] Implement GEMALTO subclass of CellularNetwork
---
.../framework/device/CellularStateMachine.cpp | 6 ----
.../GEMALTO/CINTERION/GEMALTO_CINTERION.cpp | 6 ++++
.../GEMALTO/CINTERION/GEMALTO_CINTERION.h | 1 +
.../GEMALTO_CINTERION_CellularNetwork.cpp | 34 ++++++++++++++++++
.../GEMALTO_CINTERION_CellularNetwork.h | 35 +++++++++++++++++++
5 files changed, 76 insertions(+), 6 deletions(-)
create mode 100644 connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularNetwork.cpp
create mode 100644 connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularNetwork.h
diff --git a/connectivity/cellular/source/framework/device/CellularStateMachine.cpp b/connectivity/cellular/source/framework/device/CellularStateMachine.cpp
index 35b16839d3..0a452eacb3 100644
--- a/connectivity/cellular/source/framework/device/CellularStateMachine.cpp
+++ b/connectivity/cellular/source/framework/device/CellularStateMachine.cpp
@@ -471,13 +471,7 @@ void CellularStateMachine::state_registering()
_cb_data.error = NSAPI_ERROR_OK;
send_event_cb(_current_event);
// we are already registered, go to attach
-#if defined __has_include
-# if __has_include (<GEMALTO_CINTERION.h>)
-# else
- //This state is not needed for Gemalto TX62-W module
enter_to_state(STATE_ATTACHING_NETWORK);
-# endif
-#endif
} else {
tr_info("Network registration (timeout %d ms)", _state_timeout_registration.count());
change_timeout(_state_timeout_registration);
diff --git a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION.cpp b/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION.cpp
index 6e062039d4..f8f892fccd 100644
--- a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION.cpp
+++ b/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION.cpp
@@ -17,6 +17,7 @@
#include "GEMALTO_CINTERION_CellularContext.h"
#include "GEMALTO_CINTERION_CellularInformation.h"
+#include "GEMALTO_CINTERION_CellularNetwork.h"
#include "GEMALTO_CINTERION.h"
#include "AT_CellularNetwork.h"
#include "CellularLog.h"
@@ -43,6 +44,11 @@ AT_CellularInformation *GEMALTO_CINTERION::open_information_impl(ATHandler &at)
return AT_CellularDevice::open_information_impl(at);
}
+AT_CellularNetwork *GEMALTO_CINTERION::open_network_impl(ATHandler &at)
+{
+ return new GEMALTO_CINTERION_CellularNetwork(at, *this);
+}
+
nsapi_error_t GEMALTO_CINTERION::init()
{
nsapi_error_t err = AT_CellularDevice::init();
diff --git a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION.h b/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION.h
index 73cb7dc67c..21d5888383 100644
--- a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION.h
+++ b/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION.h
@@ -51,6 +51,7 @@ public:
protected: // AT_CellularDevice
virtual AT_CellularContext *create_context_impl(ATHandler &at, const char *apn, bool cp_req = false, bool nonip_req = false);
virtual AT_CellularInformation *open_information_impl(ATHandler &at);
+ virtual AT_CellularNetwork *open_network_impl(ATHandler &at);
protected:
virtual nsapi_error_t init();
diff --git a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularNetwork.cpp b/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularNetwork.cpp
new file mode 100644
index 0000000000..37ca733b6e
--- /dev/null
+++ b/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularNetwork.cpp
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2018, Arm Limited and affiliates.
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "GEMALTO_CINTERION_CellularNetwork.h"
+
+using namespace mbed;
+
+GEMALTO_CINTERION_CellularNetwork::GEMALTO_CINTERION_CellularNetwork(ATHandler &at, AT_CellularDevice &device) : AT_CellularNetwork(at, device)
+{
+}
+
+GEMALTO_CINTERION_CellularNetwork::~GEMALTO_CINTERION_CellularNetwork()
+{
+}
+
+nsapi_error_t GEMALTO_CINTERION_CellularNetwork::set_attach()
+{
+ return NSAPI_ERROR_OK;
+}
+
+ /* namespace mbed */
diff --git a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularNetwork.h b/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularNetwork.h
new file mode 100644
index 0000000000..8d5f49cf5a
--- /dev/null
+++ b/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularNetwork.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2018, Arm Limited and affiliates.
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef GEMALTO_CINTERION_CELLULARNETWORK_H_
+#define GEMALTO_CINTERION_CELLULARNETWORK_H_
+
+#include "AT_CellularNetwork.h"
+
+namespace mbed {
+
+class GEMALTO_CINTERION_CellularNetwork: public AT_CellularNetwork {
+public:
+ GEMALTO_CINTERION_CellularNetwork(ATHandler &at, AT_CellularDevice &device);
+ virtual ~GEMALTO_CINTERION_CellularNetwork();
+ virtual nsapi_error_t set_attach();
+
+protected:
+};
+
+} /* namespace mbed */
+
+#endif // GEMALTO_CINTERION_CELLULARNETWORK_H_
--
2.39.1