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