Skip to content

Commit d5d4520

Browse files
committed
Implement set_access_technology_impl for Telit ME910
1 parent a5a9683 commit d5d4520

File tree

4 files changed

+90
-0
lines changed

4 files changed

+90
-0
lines changed

features/cellular/framework/targets/TELIT/ME910/TELIT_ME910.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#include "TELIT_ME910.h"
1919
#include "TELIT_ME910_CellularContext.h"
20+
#include "TELIT_ME910_CellularNetwork.h"
2021
#include "AT_CellularNetwork.h"
2122
#include "PinNames.h"
2223
#include "rtos/ThisThread.h"
@@ -187,3 +188,8 @@ nsapi_error_t TELIT_ME910::soft_power_off()
187188
{
188189
return AT_CellularDevice::soft_power_off();
189190
}
191+
192+
AT_CellularNetwork *TELIT_ME910::open_network_impl(ATHandler &at)
193+
{
194+
return new TELIT_ME910_CellularNetwork(at);
195+
}

features/cellular/framework/targets/TELIT/ME910/TELIT_ME910.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ class TELIT_ME910 : public AT_CellularDevice {
4848
virtual nsapi_error_t hard_power_off();
4949
virtual nsapi_error_t soft_power_on();
5050
virtual nsapi_error_t soft_power_off();
51+
virtual AT_CellularNetwork *open_network_impl(ATHandler &at);
52+
5153
private:
5254
bool _active_high;
5355
DigitalOut _pwr_key;
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Copyright (c) 2019, Arm Limited and affiliates.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
#include "TELIT_ME910_CellularNetwork.h"
19+
20+
using namespace mbed;
21+
22+
TELIT_ME910_CellularNetwork::TELIT_ME910_CellularNetwork(ATHandler &atHandler) : AT_CellularNetwork(atHandler)
23+
{
24+
}
25+
26+
TELIT_ME910_CellularNetwork::~TELIT_ME910_CellularNetwork()
27+
{
28+
}
29+
30+
nsapi_error_t TELIT_ME910_CellularNetwork::set_access_technology_impl(RadioAccessTechnology opsAct)
31+
{
32+
switch (opsAct) {
33+
case RAT_GSM:
34+
case RAT_CATM1:
35+
case RAT_NB1:
36+
_op_act = opsAct;
37+
return NSAPI_ERROR_OK;
38+
39+
default:
40+
_op_act = RAT_UNKNOWN;
41+
return NSAPI_ERROR_UNSUPPORTED;
42+
}
43+
}
44+
45+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright (c) 2019, Arm Limited and affiliates.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
#ifndef TELIT_ME910_CELLULAR_NETWORK_H_
19+
#define TELIT_ME910_CELLULAR_NETWORK_H_
20+
21+
#include "AT_CellularNetwork.h"
22+
23+
namespace mbed {
24+
25+
class TELIT_ME910_CellularNetwork : public AT_CellularNetwork {
26+
public:
27+
TELIT_ME910_CellularNetwork(ATHandler &atHandler);
28+
virtual ~ TELIT_ME910_CellularNetwork();
29+
30+
protected:
31+
virtual nsapi_error_t set_access_technology_impl(RadioAccessTechnology opRat);
32+
33+
};
34+
35+
} // namespace mbed
36+
37+
#endif // TELIT_ME910_CELLULAR_NETWORK_H_

0 commit comments

Comments
 (0)