|
| 1 | +From 822f1b2b855afd1f332dc3c8e490c1f7b08923b5 Mon Sep 17 00:00:00 2001 |
| 2 | +From: pennam <m.pennasilico@arduino.cc> |
| 3 | +Date: Fri, 10 Nov 2023 10:30:12 +0100 |
| 4 | +Subject: [PATCH 217/221] AT_CellularContext: move enable_access_technology() |
| 5 | + at commands into GEMALTO_CINTERION_CellularContext |
| 6 | + |
| 7 | +--- |
| 8 | + .../framework/AT/AT_CellularContext.h | 4 +-- |
| 9 | + .../framework/AT/AT_CellularContext.cpp | 25 +---------------- |
| 10 | + .../GEMALTO_CINTERION_CellularContext.cpp | 28 +++++++++++++++++++ |
| 11 | + .../GEMALTO_CINTERION_CellularContext.h | 1 + |
| 12 | + 4 files changed, 32 insertions(+), 26 deletions(-) |
| 13 | + |
| 14 | +diff --git a/connectivity/cellular/include/cellular/framework/AT/AT_CellularContext.h b/connectivity/cellular/include/cellular/framework/AT/AT_CellularContext.h |
| 15 | +index eb3bf5afdd..2f68f1f97b 100644 |
| 16 | +--- a/connectivity/cellular/include/cellular/framework/AT/AT_CellularContext.h |
| 17 | ++++ b/connectivity/cellular/include/cellular/framework/AT/AT_CellularContext.h |
| 18 | +@@ -135,8 +135,6 @@ private: |
| 19 | + |
| 20 | + PinName _dcd_pin; |
| 21 | + bool _active_high; |
| 22 | +- RadioAccessTechnologyType _rat; |
| 23 | +- FrequencyBand _band; |
| 24 | + |
| 25 | + protected: |
| 26 | + char _found_apn[MAX_APN_LENGTH]; |
| 27 | +@@ -144,6 +142,8 @@ protected: |
| 28 | + bool _cp_req; |
| 29 | + bool _is_connected; |
| 30 | + ATHandler &_at; |
| 31 | ++ RadioAccessTechnologyType _rat; |
| 32 | ++ FrequencyBand _band; |
| 33 | + }; |
| 34 | + |
| 35 | + } // namespace mbed |
| 36 | +diff --git a/connectivity/cellular/source/framework/AT/AT_CellularContext.cpp b/connectivity/cellular/source/framework/AT/AT_CellularContext.cpp |
| 37 | +index e876e384c9..c05fc386e0 100644 |
| 38 | +--- a/connectivity/cellular/source/framework/AT/AT_CellularContext.cpp |
| 39 | ++++ b/connectivity/cellular/source/framework/AT/AT_CellularContext.cpp |
| 40 | +@@ -445,30 +445,7 @@ bool AT_CellularContext::set_new_context(int cid) |
| 41 | + |
| 42 | + void AT_CellularContext::enable_access_technology() |
| 43 | + { |
| 44 | +- char *buffer = new char [8]; |
| 45 | +- memset(buffer, 0, 8); |
| 46 | +- sprintf(buffer,"%08X", _band); |
| 47 | +- switch (_rat) |
| 48 | +- { |
| 49 | +- case CATM1: |
| 50 | +- _at.at_cmd_discard("^SXRAT", "=","%d", _rat); |
| 51 | +- _at.at_cmd_discard("^SCFG", "=","%s%s", "Radio/Band/CatM",buffer); |
| 52 | +- _at.at_cmd_discard("^SCFG", "=","%s%d%d", "Radio/Band/CatNB",0,0); |
| 53 | +- break; |
| 54 | +- |
| 55 | +- case CATNB: |
| 56 | +- _at.at_cmd_discard("^SXRAT", "=","%d", _rat); |
| 57 | +- _at.at_cmd_discard("^SCFG", "=","%s%s", "Radio/Band/CatNB",buffer); |
| 58 | +- _at.at_cmd_discard("^SCFG", "=","%s%d%d", "Radio/Band/CatM",0,0); |
| 59 | +- break; |
| 60 | +- |
| 61 | +- default: |
| 62 | +- break; |
| 63 | +- } |
| 64 | +- |
| 65 | +- _at.at_cmd_discard("^SCFG", "=", "%s%s", "Tcp/withURCs", "on"); |
| 66 | +- free(buffer); |
| 67 | +- |
| 68 | ++ enable_access_technology(); |
| 69 | + } |
| 70 | + |
| 71 | + nsapi_error_t AT_CellularContext::do_activate_context() |
| 72 | +diff --git a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularContext.cpp b/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularContext.cpp |
| 73 | +index 7ee2c8e53c..bc2b1d514c 100644 |
| 74 | +--- a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularContext.cpp |
| 75 | ++++ b/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularContext.cpp |
| 76 | +@@ -148,4 +148,32 @@ NetworkStack *GEMALTO_CINTERION_CellularContext::get_stack() |
| 77 | + } |
| 78 | + #endif // NSAPI_PPP_AVAILABLE |
| 79 | + |
| 80 | ++void GEMALTO_CINTERION_CellularContext::enable_access_technology() |
| 81 | ++{ |
| 82 | ++ char *buffer = new char [8]; |
| 83 | ++ memset(buffer, 0, 8); |
| 84 | ++ sprintf(buffer,"%08X", _band); |
| 85 | ++ switch (_rat) |
| 86 | ++ { |
| 87 | ++ case CATM1: |
| 88 | ++ _at.at_cmd_discard("^SXRAT", "=","%d", _rat); |
| 89 | ++ _at.at_cmd_discard("^SCFG", "=","%s%s", "Radio/Band/CatM",buffer); |
| 90 | ++ _at.at_cmd_discard("^SCFG", "=","%s%d%d", "Radio/Band/CatNB",0,0); |
| 91 | ++ break; |
| 92 | ++ |
| 93 | ++ case CATNB: |
| 94 | ++ _at.at_cmd_discard("^SXRAT", "=","%d", _rat); |
| 95 | ++ _at.at_cmd_discard("^SCFG", "=","%s%s", "Radio/Band/CatNB",buffer); |
| 96 | ++ _at.at_cmd_discard("^SCFG", "=","%s%d%d", "Radio/Band/CatM",0,0); |
| 97 | ++ break; |
| 98 | ++ |
| 99 | ++ default: |
| 100 | ++ break; |
| 101 | ++ } |
| 102 | ++ |
| 103 | ++ _at.at_cmd_discard("^SCFG", "=", "%s%s", "Tcp/withURCs", "on"); |
| 104 | ++ free(buffer); |
| 105 | ++ |
| 106 | ++} |
| 107 | ++ |
| 108 | + } /* namespace mbed */ |
| 109 | +diff --git a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularContext.h b/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularContext.h |
| 110 | +index 0645b2b87c..cd9aef0222 100644 |
| 111 | +--- a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularContext.h |
| 112 | ++++ b/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularContext.h |
| 113 | +@@ -34,6 +34,7 @@ protected: |
| 114 | + virtual NetworkStack *get_stack(); |
| 115 | + #endif // NSAPI_PPP_AVAILABLE |
| 116 | + virtual nsapi_error_t do_user_authentication(); |
| 117 | ++ virtual void enable_access_technology(); |
| 118 | + }; |
| 119 | + |
| 120 | + } /* namespace mbed */ |
| 121 | +-- |
| 122 | +2.42.0 |
| 123 | + |
0 commit comments