From bc67100dcf3411c3ec2ab22ed3f2835ab4291004 Mon Sep 17 00:00:00 2001 From: Ari Parkkila Date: Mon, 19 Feb 2018 10:44:15 +0200 Subject: [PATCH] Added const in AT_CellularNetwork::set_registration --- features/cellular/UNITTESTS/stubs/AT_CellularNetwork_stub.cpp | 2 +- features/cellular/framework/API/CellularNetwork.h | 2 +- features/cellular/framework/AT/AT_CellularNetwork.cpp | 4 ++-- features/cellular/framework/AT/AT_CellularNetwork.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/features/cellular/UNITTESTS/stubs/AT_CellularNetwork_stub.cpp b/features/cellular/UNITTESTS/stubs/AT_CellularNetwork_stub.cpp index 623f465628..ca1645f0ce 100644 --- a/features/cellular/UNITTESTS/stubs/AT_CellularNetwork_stub.cpp +++ b/features/cellular/UNITTESTS/stubs/AT_CellularNetwork_stub.cpp @@ -95,7 +95,7 @@ nsapi_error_t AT_CellularNetwork::set_registration_urc(bool urc_on) return NSAPI_ERROR_OK; } -nsapi_error_t AT_CellularNetwork::set_registration(char *plmn) +nsapi_error_t AT_CellularNetwork::set_registration(const char *plmn) { return NSAPI_ERROR_OK; } diff --git a/features/cellular/framework/API/CellularNetwork.h b/features/cellular/framework/API/CellularNetwork.h index edf15140dc..8dc556fff3 100644 --- a/features/cellular/framework/API/CellularNetwork.h +++ b/features/cellular/framework/API/CellularNetwork.h @@ -206,7 +206,7 @@ public: * @param plmn format is in numeric format or 0 for automatic network registration * @return zero on success */ - virtual nsapi_error_t set_registration(char *plmn = 0) = 0; + virtual nsapi_error_t set_registration(const char *plmn = 0) = 0; /** Gets the network registration status. * diff --git a/features/cellular/framework/AT/AT_CellularNetwork.cpp b/features/cellular/framework/AT/AT_CellularNetwork.cpp index e5debb5af8..9b25f87b98 100644 --- a/features/cellular/framework/AT/AT_CellularNetwork.cpp +++ b/features/cellular/framework/AT/AT_CellularNetwork.cpp @@ -420,7 +420,7 @@ nsapi_ip_stack_t AT_CellularNetwork::string_to_stack_type(const char* pdp_type) nsapi_error_t AT_CellularNetwork::set_registration_urc(bool urc_on) { - for (int i = 0; i < sizeof(at_reg)/sizeof(at_reg[0]); i++) { + for (unsigned int i = 0; i < sizeof(at_reg)/sizeof(at_reg[0]); i++) { if (has_registration(at_reg[i].type)) { _last_reg_type = at_reg[i].type; if (urc_on) { @@ -440,7 +440,7 @@ nsapi_error_t AT_CellularNetwork::set_registration_urc(bool urc_on) return _at.get_last_error(); } -nsapi_error_t AT_CellularNetwork::set_registration(char *plmn) +nsapi_error_t AT_CellularNetwork::set_registration(const char *plmn) { _at.lock(); diff --git a/features/cellular/framework/AT/AT_CellularNetwork.h b/features/cellular/framework/AT/AT_CellularNetwork.h index ef20d27159..1649ae99a7 100644 --- a/features/cellular/framework/AT/AT_CellularNetwork.h +++ b/features/cellular/framework/AT/AT_CellularNetwork.h @@ -91,7 +91,7 @@ public: // CellularNetwork * @param plmn format is in numeric format or 0 for automatic network registration * @return zero on success */ - virtual nsapi_error_t set_registration(char *plmn = 0); + virtual nsapi_error_t set_registration(const char *plmn = 0); /** * Gets the network registration status.