diff --git a/examples/all-clusters-app/esp32/README.md b/examples/all-clusters-app/esp32/README.md index 73cac3d7c1cf07..15dce596e041e0 100644 --- a/examples/all-clusters-app/esp32/README.md +++ b/examples/all-clusters-app/esp32/README.md @@ -290,8 +290,8 @@ Start the console From within the console you can then invoke rpcs: - rpcs.chip.rpc.Wifi.Connect(ssid=b"MySSID", secret=b"MyPASSWORD") - rpcs.chip.rpc.Wifi.GetIP6Address() + rpcs.chip.rpc.WiFi.Connect(ssid=b"MySSID", secret=b"MyPASSWORD") + rpcs.chip.rpc.WiFi.GetIP6Address() rpcs.chip.rpc.Lighting.Get() rpcs.chip.rpc.Lighting.Set(on=True, level=128, color=protos.chip.rpc.LightingColor(hue=5, saturation=5)) diff --git a/examples/all-clusters-app/esp32/main/main.cpp b/examples/all-clusters-app/esp32/main/main.cpp index 82441ca30737aa..262b2c06da1fa3 100644 --- a/examples/all-clusters-app/esp32/main/main.cpp +++ b/examples/all-clusters-app/esp32/main/main.cpp @@ -379,10 +379,10 @@ class SetupListModel : public ListScreen::Model { std::string resetWiFi = "Reset WiFi"; std::string resetToFactory = "Reset to factory"; - std::string forceWifiCommissioningBasic = "Force WiFi commissioning (basic)"; + std::string forceWiFiCommissioningBasic = "Force WiFi commissioning (basic)"; options.emplace_back(resetWiFi); options.emplace_back(resetToFactory); - options.emplace_back(forceWifiCommissioningBasic); + options.emplace_back(forceWiFiCommissioningBasic); } virtual std::string GetTitle() { return "Setup"; } virtual int GetItemCount() { return options.size(); } diff --git a/examples/chip-tool/commands/pairing/PairingCommand.cpp b/examples/chip-tool/commands/pairing/PairingCommand.cpp index cc1f4a7953abdf..c568bf45f5d08f 100644 --- a/examples/chip-tool/commands/pairing/PairingCommand.cpp +++ b/examples/chip-tool/commands/pairing/PairingCommand.cpp @@ -73,7 +73,7 @@ CommissioningParameters PairingCommand::GetCommissioningParameters() switch (mNetworkType) { case PairingNetworkType::WiFi: - return CommissioningParameters().SetWifiCredentials(Controller::WifiCredentials(mSSID, mPassword)); + return CommissioningParameters().SetWiFiCredentials(Controller::WiFiCredentials(mSSID, mPassword)); case PairingNetworkType::Thread: return CommissioningParameters().SetThreadOperationalDataset(mOperationalDataset); case PairingNetworkType::Ethernet: diff --git a/examples/ipv6only-app/common/wifi_service/wifi_service.proto b/examples/ipv6only-app/common/wifi_service/wifi_service.proto index 996efe29fe500d..773bee853fb667 100644 --- a/examples/ipv6only-app/common/wifi_service/wifi_service.proto +++ b/examples/ipv6only-app/common/wifi_service/wifi_service.proto @@ -147,11 +147,11 @@ message ConnectionResult { CONNECTION_ERROR error = 1; } -// The Wifi service provides the common RPC interface for interacting +// The WiFi service provides the common RPC interface for interacting // with a WIFI capable CHIP device. // The current state can be retrieved using the various 'Get' RPCs. // A device can be connected to an AP using the StartScan, and Connect RPCs. -service Wifi { +service WiFi { rpc GetChannel(pw.protobuf.Empty) returns (Channel) {} rpc GetSsid(pw.protobuf.Empty) returns (Ssid) {} rpc GetState(pw.protobuf.Empty) returns (State) {} diff --git a/examples/ipv6only-app/esp32/README.md b/examples/ipv6only-app/esp32/README.md index 4dc6c28355ad88..c19ceb5b7db0e4 100644 --- a/examples/ipv6only-app/esp32/README.md +++ b/examples/ipv6only-app/esp32/README.md @@ -100,10 +100,10 @@ Start the console: An example flow of performing a scan, connecting, and getting the IPv6 address: - scan = rpcs.chip.rpc.Wifi.StartScan(pw_rpc_timeout_s=5) + scan = rpcs.chip.rpc.WiFi.StartScan(pw_rpc_timeout_s=5) ap = next(filter(lambda a: b"SSID\000" in a.ssid, next(scan.responses()).aps)) connect = protos.chip.rpc.ConnectionData(ssid=ap.ssid,security_type=ap.security_type,secret=b"PASSWORD") - rpcs.chip.rpc.Wifi.Connect(connect, pw_rpc_timeout_s=10) + rpcs.chip.rpc.WiFi.Connect(connect, pw_rpc_timeout_s=10) - rpcs.chip.rpc.Wifi.GetIP6Address() + rpcs.chip.rpc.WiFi.GetIP6Address() diff --git a/examples/ipv6only-app/esp32/include/wifi_service.h b/examples/ipv6only-app/esp32/include/wifi_service.h index bac312964be281..12dc0e9a2d0f46 100644 --- a/examples/ipv6only-app/esp32/include/wifi_service.h +++ b/examples/ipv6only-app/esp32/include/wifi_service.h @@ -31,18 +31,18 @@ namespace chip { namespace rpc { -class Wifi final : public pw_rpc::nanopb::Wifi::Service +class WiFi final : public pw_rpc::nanopb::WiFi::Service { public: // Singleton - static Wifi & Instance() { return instance_; } + static WiFi & Instance() { return instance_; } // Initalize the wifi station pw::Status Init(); // Blocks the calling thread until wifi connection is completed successfully. // NOTE: Currently only supports blocking a single thread. - void BlockUntilWifiConnected() { xSemaphoreTake(wifi_connected_semaphore_, portMAX_DELAY); } + void BlockUntilWiFiConnected() { xSemaphoreTake(wifi_connected_semaphore_, portMAX_DELAY); } // The following functions are the RPC handlers @@ -125,7 +125,7 @@ class Wifi final : public pw_rpc::nanopb::Wifi::Service } private: - static Wifi instance_; + static WiFi instance_; esp_netif_t * esp_netif_ = nullptr; SemaphoreHandle_t wifi_connected_semaphore_; @@ -156,7 +156,7 @@ class Wifi final : public pw_rpc::nanopb::Wifi::Service } } - static void WifiEventHandler(void * arg, esp_event_base_t event_base, int32_t event_id, void * event_data); + static void WiFiEventHandler(void * arg, esp_event_base_t event_base, int32_t event_id, void * event_data); }; } // namespace rpc diff --git a/examples/ipv6only-app/esp32/main/main.cpp b/examples/ipv6only-app/esp32/main/main.cpp index c6104e9da89b91..608350a38ad053 100644 --- a/examples/ipv6only-app/esp32/main/main.cpp +++ b/examples/ipv6only-app/esp32/main/main.cpp @@ -56,7 +56,7 @@ void UdpReceiver(void * pvParameters) while (1) { // Start the udp server after the wifi is connectd. - chip::rpc::Wifi::Instance().BlockUntilWifiConnected(); + chip::rpc::WiFi::Instance().BlockUntilWiFiConnected(); ESP_LOGI(TAG, "UDP server starting"); portno = 8765; @@ -121,7 +121,7 @@ void UdpReceiver(void * pvParameters) void RegisterServices(pw::rpc::Server & server) { - server.RegisterService(chip::rpc::Wifi::Instance()); + server.RegisterService(chip::rpc::WiFi::Instance()); } void RunRpcService(void *) @@ -144,7 +144,7 @@ extern "C" void app_main() } ESP_ERROR_CHECK(ret); - ESP_LOGI(TAG, "Wifi Init: %s", pw_StatusString(chip::rpc::Wifi::Instance().Init())); + ESP_LOGI(TAG, "WiFi Init: %s", pw_StatusString(chip::rpc::WiFi::Instance().Init())); ESP_LOGI(TAG, "----------- chip-esp32-ipv6-example starting -----------"); xTaskCreate(RunRpcService, "RPC", kRpcStackSizeBytes / sizeof(StackType_t), nullptr, kRpcTaskPriority, &rpcTaskHandle); diff --git a/examples/ipv6only-app/esp32/main/wifi_service.cpp b/examples/ipv6only-app/esp32/main/wifi_service.cpp index 1795d4def06af0..3b51c44eac891a 100644 --- a/examples/ipv6only-app/esp32/main/wifi_service.cpp +++ b/examples/ipv6only-app/esp32/main/wifi_service.cpp @@ -44,16 +44,16 @@ constexpr pw::containers::FlatMap kChannelToFreqMap({ { // Creating the object will register all handlers needed, destroying will // unregister. The object is only needed during initialization, after the station // is up it is safe to destroy this object. -class WifiInitStationEventHandler +class WiFiInitStationEventHandler { public: - WifiInitStationEventHandler() + WiFiInitStationEventHandler() { handler_context_.event_group = xEventGroupCreate(); esp_event_handler_register(WIFI_EVENT, ESP_EVENT_ANY_ID, &EventHandler, &handler_context_); } - ~WifiInitStationEventHandler() + ~WiFiInitStationEventHandler() { vEventGroupDelete(handler_context_.event_group); esp_event_handler_unregister(WIFI_EVENT, ESP_EVENT_ANY_ID, &EventHandler); @@ -61,8 +61,8 @@ class WifiInitStationEventHandler pw::Status WaitForStationUp() { - EventBits_t bits = xEventGroupWaitBits(handler_context_.event_group, kWifiStationUpBit, pdFALSE, pdFALSE, portMAX_DELAY); - if (!(bits & kWifiStationUpBit)) + EventBits_t bits = xEventGroupWaitBits(handler_context_.event_group, kWiFiStationUpBit, pdFALSE, pdFALSE, portMAX_DELAY); + if (!(bits & kWiFiStationUpBit)) { return pw::Status::Unknown(); } @@ -70,7 +70,7 @@ class WifiInitStationEventHandler } private: - static constexpr uint8_t kWifiStationUpBit = BIT0; + static constexpr uint8_t kWiFiStationUpBit = BIT0; struct HandlerContext { size_t retry_count = 0; @@ -84,7 +84,7 @@ class WifiInitStationEventHandler if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_START) { ESP_LOGI(TAG, "EVENT: WIFI_EVENT_STATION_START"); - xEventGroupSetBits(context->event_group, kWifiStationUpBit); + xEventGroupSetBits(context->event_group, kWiFiStationUpBit); } } }; @@ -93,10 +93,10 @@ class WifiInitStationEventHandler // Creating the object will register all handlers needed, destroying will // unregister. The object is only needed during connection, once connected // is up it is safe to destroy this object. -class WifiConnectionEventHandler +class WiFiConnectionEventHandler { public: - WifiConnectionEventHandler(esp_netif_t * esp_netif) + WiFiConnectionEventHandler(esp_netif_t * esp_netif) { handler_context_.esp_netif = esp_netif; handler_context_.event_group = xEventGroupCreate(); @@ -105,7 +105,7 @@ class WifiConnectionEventHandler esp_event_handler_register(IP_EVENT, IP_EVENT_GOT_IP6, &EventHandler, &handler_context_); } - ~WifiConnectionEventHandler() + ~WiFiConnectionEventHandler() { esp_event_handler_unregister(WIFI_EVENT, ESP_EVENT_ANY_ID, &EventHandler); esp_event_handler_unregister(WIFI_EVENT, ESP_EVENT_ANY_ID, &EventHandler); @@ -117,13 +117,13 @@ class WifiConnectionEventHandler // Waits for the events to determine if connected successfully. pw::Status WaitForConnection(chip_rpc_ConnectionResult * result) { - EventBits_t bits = xEventGroupWaitBits(handler_context_.event_group, kWifiFailBit | kWifiIpv6ConnectedBit, pdFALSE, pdFALSE, + EventBits_t bits = xEventGroupWaitBits(handler_context_.event_group, kWiFiFailBit | kWiFiIpv6ConnectedBit, pdFALSE, pdFALSE, portMAX_DELAY); - if (bits & kWifiIpv6ConnectedBit) + if (bits & kWiFiIpv6ConnectedBit) { result->error = chip_rpc_CONNECTION_ERROR_OK; } - else if (bits & kWifiFailBit) + else if (bits & kWiFiFailBit) { result->error = handler_context_.error_code; return pw::Status::Unavailable(); @@ -138,9 +138,9 @@ class WifiConnectionEventHandler private: static constexpr size_t kWiFiConnectRetryMax = 5; - static constexpr uint8_t kWifiIpv6ConnectedBit = BIT0; - static constexpr uint8_t kWifiIpv4ConnectedBit = BIT1; - static constexpr uint8_t kWifiFailBit = BIT2; + static constexpr uint8_t kWiFiIpv6ConnectedBit = BIT0; + static constexpr uint8_t kWiFiIpv4ConnectedBit = BIT1; + static constexpr uint8_t kWiFiFailBit = BIT2; struct HandlerContext { @@ -167,7 +167,7 @@ class WifiConnectionEventHandler { context->error_code = static_cast<_chip_rpc_CONNECTION_ERROR>((static_cast(event_data))->reason); - xEventGroupSetBits(context->event_group, kWifiFailBit); + xEventGroupSetBits(context->event_group, kWiFiFailBit); } } else if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_CONNECTED) @@ -179,13 +179,13 @@ class WifiConnectionEventHandler { auto * event = static_cast(event_data); ESP_LOGI(TAG, "got ip4: " IPSTR, IP2STR(&event->ip_info.ip)); - xEventGroupSetBits(context->event_group, kWifiIpv4ConnectedBit); + xEventGroupSetBits(context->event_group, kWiFiIpv4ConnectedBit); } else if (event_base == IP_EVENT && event_id == IP_EVENT_GOT_IP6) { auto * event = static_cast(event_data); ESP_LOGI(TAG, "got ip6: " IPV6STR, IPV62STR(event->ip6_info.ip)); - xEventGroupSetBits(context->event_group, kWifiIpv6ConnectedBit); + xEventGroupSetBits(context->event_group, kWiFiIpv6ConnectedBit); } } }; @@ -197,9 +197,9 @@ wifi_ap_record_t scan_records[kScanRecordsMax] = { 0 }; } // namespace -Wifi Wifi::instance_; +WiFi WiFi::instance_; -pw::Status Wifi::Init() +pw::Status WiFi::Init() { wifi_connected_semaphore_ = xSemaphoreCreateBinary(); PW_TRY(EspToPwStatus(esp_netif_init())); @@ -207,7 +207,7 @@ pw::Status Wifi::Init() esp_netif_ = esp_netif_create_default_wifi_sta(); PW_TRY(EspToPwStatus(esp_netif_dhcpc_stop(esp_netif_))); - WifiInitStationEventHandler event_handler; + WiFiInitStationEventHandler event_handler; wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); PW_TRY(EspToPwStatus(esp_wifi_init(&cfg))); @@ -218,7 +218,7 @@ pw::Status Wifi::Init() return pw::OkStatus(); } -pw::Status Wifi::Connect(const chip_rpc_ConnectionData & request, chip_rpc_ConnectionResult & response) +pw::Status WiFi::Connect(const chip_rpc_ConnectionData & request, chip_rpc_ConnectionResult & response) { wifi_config_t wifi_config { .sta = { @@ -240,7 +240,7 @@ pw::Status Wifi::Connect(const chip_rpc_ConnectionData & request, chip_rpc_Conne memcpy(wifi_config.sta.password, request.secret.bytes, std::min(sizeof(wifi_config.sta.password), static_cast(request.secret.size))); - WifiConnectionEventHandler event_handler(esp_netif_); + WiFiConnectionEventHandler event_handler(esp_netif_); PW_TRY(EspToPwStatus(esp_wifi_set_config(WIFI_IF_STA, &wifi_config))); esp_err_t err = esp_wifi_connect(); @@ -263,7 +263,7 @@ pw::Status Wifi::Connect(const chip_rpc_ConnectionData & request, chip_rpc_Conne return pw::OkStatus(); } -void Wifi::StartScan(const chip_rpc_ScanConfig & request, ServerWriter & writer) +void WiFi::StartScan(const chip_rpc_ScanConfig & request, ServerWriter & writer) { wifi_scan_config_t scan_config{ 0 }; if (request.ssid_count != 0) @@ -321,13 +321,13 @@ void Wifi::StartScan(const chip_rpc_ScanConfig & request, ServerWriter CommissioningParameters::kMaxSsidLen || creds.credentials.size() > CommissioningParameters::kMaxCredentialsLen) { @@ -46,8 +46,8 @@ CHIP_ERROR AutoCommissioner::SetCommissioningParameters(const CommissioningParam } memcpy(mSsid, creds.ssid.data(), creds.ssid.size()); memcpy(mCredentials, creds.credentials.data(), creds.credentials.size()); - mParams.SetWifiCredentials( - WifiCredentials(ByteSpan(mSsid, creds.ssid.size()), ByteSpan(mCredentials, creds.credentials.size()))); + mParams.SetWiFiCredentials( + WiFiCredentials(ByteSpan(mSsid, creds.ssid.size()), ByteSpan(mCredentials, creds.credentials.size()))); } return CHIP_NO_ERROR; } @@ -66,9 +66,9 @@ CommissioningStage AutoCommissioner::GetNextCommissioningStage(CommissioningStag // TODO(cecille): device attestation casues operational cert provisioinging to happen, This should be a separate stage. // For thread and wifi, this should go to network setup then enable. For on-network we can skip right to finding the // operational network because the provisioning of certificates will trigger the device to start operational advertising. - if (mParams.HasWifiCredentials()) + if (mParams.HasWiFiCredentials()) { - return CommissioningStage::kWifiNetworkSetup; + return CommissioningStage::kWiFiNetworkSetup; } else if (mParams.HasThreadOperationalDataset()) { @@ -82,26 +82,26 @@ CommissioningStage AutoCommissioner::GetNextCommissioningStage(CommissioningStag return CommissioningStage::kSendComplete; #endif } - case CommissioningStage::kWifiNetworkSetup: + case CommissioningStage::kWiFiNetworkSetup: if (mParams.HasThreadOperationalDataset()) { return CommissioningStage::kThreadNetworkSetup; } else { - return CommissioningStage::kWifiNetworkEnable; + return CommissioningStage::kWiFiNetworkEnable; } case CommissioningStage::kThreadNetworkSetup: - if (mParams.HasWifiCredentials()) + if (mParams.HasWiFiCredentials()) { - return CommissioningStage::kWifiNetworkEnable; + return CommissioningStage::kWiFiNetworkEnable; } else { return CommissioningStage::kThreadNetworkEnable; } - case CommissioningStage::kWifiNetworkEnable: + case CommissioningStage::kWiFiNetworkEnable: if (mParams.HasThreadOperationalDataset()) { return CommissioningStage::kThreadNetworkEnable; diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index fed4eb6b218aad..de4a4077183ae8 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -891,7 +891,7 @@ CHIP_ERROR DeviceCommissioner::Commission(NodeId remoteDeviceId, CommissioningPa ChipLogError(Controller, "Commissioning already in progress - not restarting"); return CHIP_ERROR_INCORRECT_STATE; } - if (!params.HasWifiCredentials() && !params.HasThreadOperationalDataset() && !mIsIPRendezvous) + if (!params.HasWiFiCredentials() && !params.HasThreadOperationalDataset() && !mIsIPRendezvous) { ChipLogError(Controller, "Network commissioning parameters are required for BLE auto commissioning."); return CHIP_ERROR_INVALID_ARGUMENT; @@ -1823,8 +1823,8 @@ void DeviceCommissioner::PerformCommissioningStep(DeviceProxy * proxy, Commissio case CommissioningStage::kConfigACL: // TODO: Implement break; - case CommissioningStage::kWifiNetworkSetup: { - if (!params.HasWifiCredentials()) + case CommissioningStage::kWiFiNetworkSetup: { + if (!params.HasWiFiCredentials()) { CommissioningDelegate::CommissioningReport report; report.stageCompleted = step; @@ -1834,8 +1834,8 @@ void DeviceCommissioner::PerformCommissioningStep(DeviceProxy * proxy, Commissio ChipLogProgress(Controller, "Adding wifi network"); NetworkCommissioningCluster netCom; netCom.Associate(proxy, 0); - netCom.AddOrUpdateWiFiNetwork(mSuccess.Cancel(), mFailure.Cancel(), params.GetWifiCredentials().Value().ssid, - params.GetWifiCredentials().Value().credentials, breadcrumb); + netCom.AddOrUpdateWiFiNetwork(mSuccess.Cancel(), mFailure.Cancel(), params.GetWiFiCredentials().Value().ssid, + params.GetWiFiCredentials().Value().credentials, breadcrumb); } break; case CommissioningStage::kThreadNetworkSetup: { @@ -1853,8 +1853,8 @@ void DeviceCommissioner::PerformCommissioningStep(DeviceProxy * proxy, Commissio breadcrumb); } break; - case CommissioningStage::kWifiNetworkEnable: { - if (!params.HasWifiCredentials()) + case CommissioningStage::kWiFiNetworkEnable: { + if (!params.HasWiFiCredentials()) { CommissioningDelegate::CommissioningReport report; report.stageCompleted = step; @@ -1864,7 +1864,7 @@ void DeviceCommissioner::PerformCommissioningStep(DeviceProxy * proxy, Commissio ChipLogProgress(Controller, "Enabling wifi network"); NetworkCommissioningCluster netCom; netCom.Associate(proxy, 0); - netCom.ConnectNetwork(mSuccess.Cancel(), mFailure.Cancel(), params.GetWifiCredentials().Value().ssid, breadcrumb); + netCom.ConnectNetwork(mSuccess.Cancel(), mFailure.Cancel(), params.GetWiFiCredentials().Value().ssid, breadcrumb); } break; case CommissioningStage::kThreadNetworkEnable: { diff --git a/src/controller/CommissioningDelegate.h b/src/controller/CommissioningDelegate.h index bc31c32ac60de8..3a48eded46068b 100644 --- a/src/controller/CommissioningDelegate.h +++ b/src/controller/CommissioningDelegate.h @@ -35,21 +35,21 @@ enum CommissioningStage : uint8_t kDeviceAttestation, kCheckCertificates, kConfigACL, - kWifiNetworkSetup, + kWiFiNetworkSetup, kThreadNetworkSetup, - kWifiNetworkEnable, + kWiFiNetworkEnable, kThreadNetworkEnable, kFindOperational, kSendComplete, kCleanup, }; -struct WifiCredentials +struct WiFiCredentials { ByteSpan ssid; // TODO(cecille): We should add a PII bytespan concept. ByteSpan credentials; - WifiCredentials(ByteSpan newSsid, ByteSpan newCreds) : ssid(newSsid), credentials(newCreds) {} + WiFiCredentials(ByteSpan newSsid, ByteSpan newCreds) : ssid(newSsid), credentials(newCreds) {} }; class CommissioningParameters { @@ -59,11 +59,11 @@ class CommissioningParameters static constexpr size_t kMaxCredentialsLen = 64; bool HasCSRNonce() const { return mCSRNonce.HasValue(); } bool HasAttestationNonce() const { return mAttestationNonce.HasValue(); } - bool HasWifiCredentials() const { return mWifiCreds.HasValue(); } + bool HasWiFiCredentials() const { return mWiFiCreds.HasValue(); } bool HasThreadOperationalDataset() const { return mThreadOperationalDataset.HasValue(); } const Optional GetCSRNonce() const { return mCSRNonce; } const Optional GetAttestationNonce() const { return mAttestationNonce; } - const Optional GetWifiCredentials() const { return mWifiCreds; } + const Optional GetWiFiCredentials() const { return mWiFiCreds; } const Optional GetThreadOperationalDataset() const { return mThreadOperationalDataset; } // The lifetime of the buffer csrNonce is pointing to, should exceed the lifetime of CommissioningParameters object. @@ -79,9 +79,9 @@ class CommissioningParameters mAttestationNonce.SetValue(attestationNonce); return *this; } - CommissioningParameters & SetWifiCredentials(WifiCredentials wifiCreds) + CommissioningParameters & SetWiFiCredentials(WiFiCredentials wifiCreds) { - mWifiCreds.SetValue(wifiCreds); + mWiFiCreds.SetValue(wifiCreds); return *this; } @@ -95,7 +95,7 @@ class CommissioningParameters private: Optional mCSRNonce; ///< CSR Nonce passed by the commissioner Optional mAttestationNonce; ///< Attestation Nonce passed by the commissioner - Optional mWifiCreds; + Optional mWiFiCreds; Optional mThreadOperationalDataset; }; diff --git a/src/controller/python/ChipDeviceController-ScriptBinding.cpp b/src/controller/python/ChipDeviceController-ScriptBinding.cpp index e3fb4272c2d1b3..dea6112c653c7c 100644 --- a/src/controller/python/ChipDeviceController-ScriptBinding.cpp +++ b/src/controller/python/ChipDeviceController-ScriptBinding.cpp @@ -117,7 +117,7 @@ ChipError::StorageType pychip_DeviceController_ConnectBLE(chip::Controller::Devi ChipError::StorageType pychip_DeviceController_ConnectIP(chip::Controller::DeviceCommissioner * devCtrl, const char * peerAddrStr, uint32_t setupPINCode, chip::NodeId nodeid); ChipError::StorageType pychip_DeviceController_SetThreadOperationalDataset(const char * threadOperationalDataset, uint32_t size); -ChipError::StorageType pychip_DeviceController_SetWifiCredentials(const char * ssid, const char * credentials); +ChipError::StorageType pychip_DeviceController_SetWiFiCredentials(const char * ssid, const char * credentials); ChipError::StorageType pychip_DeviceController_CloseSession(chip::Controller::DeviceCommissioner * devCtrl, chip::NodeId nodeid); ChipError::StorageType pychip_DeviceController_EstablishPASESessionIP(chip::Controller::DeviceCommissioner * devCtrl, const char * peerAddrStr, uint32_t setupPINCode, @@ -349,7 +349,7 @@ ChipError::StorageType pychip_DeviceController_SetThreadOperationalDataset(const sCommissioningParameters.SetThreadOperationalDataset(ByteSpan(sThreadBuf.Get(), size)); return CHIP_NO_ERROR.AsInteger(); } -ChipError::StorageType pychip_DeviceController_SetWifiCredentials(const char * ssid, const char * credentials) +ChipError::StorageType pychip_DeviceController_SetWiFiCredentials(const char * ssid, const char * credentials) { size_t ssidSize = strlen(ssid); ReturnErrorCodeIf(!sSsidBuf.Alloc(ssidSize), CHIP_ERROR_NO_MEMORY.AsInteger()); @@ -359,10 +359,10 @@ ChipError::StorageType pychip_DeviceController_SetWifiCredentials(const char * s ReturnErrorCodeIf(!sCredsBuf.Alloc(credsSize), CHIP_ERROR_NO_MEMORY.AsInteger()); memcpy(sCredsBuf.Get(), credentials, credsSize); - sCommissioningParameters.SetWifiCredentials( - chip::Controller::WifiCredentials(ByteSpan(sSsidBuf.Get(), ssidSize), ByteSpan(sCredsBuf.Get(), credsSize))); + sCommissioningParameters.SetWiFiCredentials( + chip::Controller::WiFiCredentials(ByteSpan(sSsidBuf.Get(), ssidSize), ByteSpan(sCredsBuf.Get(), credsSize))); char tmp[128]; - chip::Platform::CopyString(tmp, sCommissioningParameters.GetWifiCredentials().Value().ssid); + chip::Platform::CopyString(tmp, sCommissioningParameters.GetWiFiCredentials().Value().ssid); return CHIP_NO_ERROR.AsInteger(); } diff --git a/src/controller/python/chip-device-ctrl.py b/src/controller/python/chip-device-ctrl.py index c7414487a7ddde..99baedbf07ab2f 100755 --- a/src/controller/python/chip-device-ctrl.py +++ b/src/controller/python/chip-device-ctrl.py @@ -904,7 +904,7 @@ def do_setpairingwificredential(self, line): print("Usage:") self.do_help("set-pairing-wifi-credential") return - self.devCtrl.SetWifiCredentials( + self.devCtrl.SetWiFiCredentials( args[0].encode("utf-8"), args[1].encode("utf-8")) except Exception as ex: print(str(ex)) diff --git a/src/controller/python/chip/ChipDeviceCtrl.py b/src/controller/python/chip/ChipDeviceCtrl.py index 8dabea2710b89c..811e19003090cd 100644 --- a/src/controller/python/chip/ChipDeviceCtrl.py +++ b/src/controller/python/chip/ChipDeviceCtrl.py @@ -242,9 +242,9 @@ def ConnectIP(self, ipaddr, setupPinCode, nodeid): return False return self._ChipStack.commissioningEventRes == 0 - def SetWifiCredentials(self, ssid, credentials): + def SetWiFiCredentials(self, ssid, credentials): return self._ChipStack.Call( - lambda: self._dmLib.pychip_DeviceController_SetWifiCredentials( + lambda: self._dmLib.pychip_DeviceController_SetWiFiCredentials( ssid, credentials) ) @@ -696,9 +696,9 @@ def _InitLib(self): c_char_p, c_uint32] self._dmLib.pychip_DeviceController_SetThreadOperationalDataset.restype = c_uint32 - self._dmLib.pychip_DeviceController_SetWifiCredentials.argtypes = [ + self._dmLib.pychip_DeviceController_SetWiFiCredentials.argtypes = [ c_char_p, c_char_p] - self._dmLib.pychip_DeviceController_SetWifiCredentials.restype = c_uint32 + self._dmLib.pychip_DeviceController_SetWiFiCredentials.restype = c_uint32 self._dmLib.pychip_DeviceController_Commission.argtypes = [ c_void_p, c_uint64] diff --git a/src/controller/python/chip/ble/commissioning/__init__.py b/src/controller/python/chip/ble/commissioning/__init__.py index efc367c4081076..05b31f1e1c4812 100644 --- a/src/controller/python/chip/ble/commissioning/__init__.py +++ b/src/controller/python/chip/ble/commissioning/__init__.py @@ -45,11 +45,11 @@ def __init__(self, controller): self._controller = controller self._pair_queue = Queue() - def ConnectToWifi(self, ssid: str, password: str): + def ConnectToWiFi(self, ssid: str, password: str): if not self.needsNetworkCredentials: raise Exception("Not requiring network credentials yet.") - self._controller.PairSendWifiCredentials(ssid, password) + self._controller.PairSendWiFiCredentials(ssid, password) self._WaitForPairProgress() def ConnectToThread(self, blob: bytes): diff --git a/src/controller/python/chip/server/ServerInit.cpp b/src/controller/python/chip/server/ServerInit.cpp index 529c28a377a5ee..a0239c66ebdbb9 100644 --- a/src/controller/python/chip/server/ServerInit.cpp +++ b/src/controller/python/chip/server/ServerInit.cpp @@ -72,26 +72,26 @@ extern "C" { #if CHIP_DEVICE_CONFIG_ENABLE_WPA /* - * The device shall check every kWifiStartCheckTimeUsec whether Wi-Fi management - * has been fully initialized. If after kWifiStartCheckAttempts Wi-Fi management + * The device shall check every kWiFiStartCheckTimeUsec whether Wi-Fi management + * has been fully initialized. If after kWiFiStartCheckAttempts Wi-Fi management * still hasn't been initialized, the device configuration is reset, and device * needs to be paired again. */ -static constexpr useconds_t kWifiStartCheckTimeUsec = 100 * 1000; // 100 ms -static constexpr uint8_t kWifiStartCheckAttempts = 5; +static constexpr useconds_t kWiFiStartCheckTimeUsec = 100 * 1000; // 100 ms +static constexpr uint8_t kWiFiStartCheckAttempts = 5; #endif #if CHIP_DEVICE_CONFIG_ENABLE_WPA -static bool EnsureWifiIsStarted() +static bool EnsureWiFiIsStarted() { - for (int cnt = 0; cnt < kWifiStartCheckAttempts; cnt++) + for (int cnt = 0; cnt < kWiFiStartCheckAttempts; cnt++) { if (chip::DeviceLayer::ConnectivityMgrImpl().IsWiFiManagementStarted()) { return true; } - usleep(kWifiStartCheckTimeUsec); + usleep(kWiFiStartCheckTimeUsec); } return chip::DeviceLayer::ConnectivityMgrImpl().IsWiFiManagementStarted(); @@ -159,7 +159,7 @@ void pychip_server_native_init() if (LinuxDeviceOptions::GetInstance().mWiFi) { chip::DeviceLayer::ConnectivityMgrImpl().StartWiFiManagement(); - if (!EnsureWifiIsStarted()) + if (!EnsureWiFiIsStarted()) { ChipLogError(NotSpecified, "Wi-Fi Management taking too long to start - device configuration will be reset."); } diff --git a/src/darwin/CHIPTool/CHIPTool.xcodeproj/project.pbxproj b/src/darwin/CHIPTool/CHIPTool.xcodeproj/project.pbxproj index ec119db4bb5ebf..04a4ac77eab565 100644 --- a/src/darwin/CHIPTool/CHIPTool.xcodeproj/project.pbxproj +++ b/src/darwin/CHIPTool/CHIPTool.xcodeproj/project.pbxproj @@ -21,7 +21,7 @@ B204A632244E1D0700C7C0E1 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B204A631244E1D0700C7C0E1 /* main.m */; }; B232D8BA2514BD0800792CB4 /* CHIPUIViewUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = B232D8B92514BD0800792CB4 /* CHIPUIViewUtils.m */; }; B243A6692513A73600E56FEA /* RootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B243A6682513A73600E56FEA /* RootViewController.m */; }; - B2946A4224C99D53005C87D0 /* WifiViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B2946A4124C99D53005C87D0 /* WifiViewController.m */; }; + B2946A4224C99D53005C87D0 /* WiFiViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B2946A4124C99D53005C87D0 /* WiFiViewController.m */; }; B2946A9B24C9A7BF005C87D0 /* DefaultsUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = B2946A9A24C9A7BF005C87D0 /* DefaultsUtils.m */; }; B2B0209225C9C1AC00A4C220 /* BindingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B2B0209125C9C1AC00A4C220 /* BindingsViewController.m */; }; B2C2267526289324009DAB8B /* FabricUIViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B2C2267426289324009DAB8B /* FabricUIViewController.m */; }; @@ -82,8 +82,8 @@ B243A6672513A73600E56FEA /* RootViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = ""; }; B243A6682513A73600E56FEA /* RootViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RootViewController.m; sourceTree = ""; }; B27FAB67255D4B980038F0D2 /* CHIPTool.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = CHIPTool.entitlements; sourceTree = ""; }; - B2946A4024C99D53005C87D0 /* WifiViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WifiViewController.h; sourceTree = ""; }; - B2946A4124C99D53005C87D0 /* WifiViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WifiViewController.m; sourceTree = ""; }; + B2946A4024C99D53005C87D0 /* WiFiViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WiFiViewController.h; sourceTree = ""; }; + B2946A4124C99D53005C87D0 /* WiFiViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WiFiViewController.m; sourceTree = ""; }; B2946A9924C9A7BF005C87D0 /* DefaultsUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DefaultsUtils.h; sourceTree = ""; }; B2946A9A24C9A7BF005C87D0 /* DefaultsUtils.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DefaultsUtils.m; sourceTree = ""; }; B2B0209025C9C1AC00A4C220 /* BindingsViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BindingsViewController.h; sourceTree = ""; }; @@ -233,7 +233,7 @@ B243A6682513A73600E56FEA /* RootViewController.m */, B2F51E93252DCC9E00911FA5 /* Temperature Sensor */, B2B0208F25C9C18500A4C220 /* Bindings */, - B2946A3F24C99D21005C87D0 /* Wifi */, + B2946A3F24C99D21005C87D0 /* WiFi */, 0C79937824858B3B0047A373 /* QRCode */, B2C22672262892D7009DAB8B /* Fabric */, 0C79937924858B4F0047A373 /* Echo client */, @@ -251,13 +251,13 @@ path = "Framework Helpers"; sourceTree = ""; }; - B2946A3F24C99D21005C87D0 /* Wifi */ = { + B2946A3F24C99D21005C87D0 /* WiFi */ = { isa = PBXGroup; children = ( - B2946A4024C99D53005C87D0 /* WifiViewController.h */, - B2946A4124C99D53005C87D0 /* WifiViewController.m */, + B2946A4024C99D53005C87D0 /* WiFiViewController.h */, + B2946A4124C99D53005C87D0 /* WiFiViewController.m */, ); - path = Wifi; + path = WiFi; sourceTree = ""; }; B2B0208F25C9C18500A4C220 /* Bindings */ = { @@ -401,7 +401,7 @@ B243A6692513A73600E56FEA /* RootViewController.m in Sources */, B204A632244E1D0700C7C0E1 /* main.m in Sources */, B204A624244E1D0600C7C0E1 /* SceneDelegate.m in Sources */, - B2946A4224C99D53005C87D0 /* WifiViewController.m in Sources */, + B2946A4224C99D53005C87D0 /* WiFiViewController.m in Sources */, 0CA0E0CF248599BB009087B9 /* OnOffViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/src/darwin/CHIPTool/CHIPTool/View Controllers/QRCode/QRCodeViewController.m b/src/darwin/CHIPTool/CHIPTool/View Controllers/QRCode/QRCodeViewController.m index 5fb53e994670f9..275c57a5cad81e 100644 --- a/src/darwin/CHIPTool/CHIPTool/View Controllers/QRCode/QRCodeViewController.m +++ b/src/darwin/CHIPTool/CHIPTool/View Controllers/QRCode/QRCodeViewController.m @@ -481,7 +481,7 @@ - (void)onPairingComplete:(NSError *)error } else { dispatch_async(dispatch_get_main_queue(), ^{ [self->_deviceList refreshDeviceList]; - [self retrieveAndSendWifiCredentials]; + [self retrieveAndSendWiFiCredentials]; }); } } @@ -574,10 +574,10 @@ - (void)showPayload:(CHIPSetupPayload *)payload rawPayload:(NSString *)rawPayloa [self handleRendezVous:payload rawPayload:rawPayload]; } -- (void)retrieveAndSendWifiCredentials +- (void)retrieveAndSendWiFiCredentials { UIAlertController * alertController = - [UIAlertController alertControllerWithTitle:@"Wifi Configuration" + [UIAlertController alertControllerWithTitle:@"WiFi Configuration" message:@"Input network SSID and password that your phone is connected to." preferredStyle:UIAlertControllerStyleAlert]; [alertController addTextFieldWithConfigurationHandler:^(UITextField * textField) { diff --git a/src/darwin/CHIPTool/CHIPTool/View Controllers/RootViewController.m b/src/darwin/CHIPTool/CHIPTool/View Controllers/RootViewController.m index cac6a23c284f32..707b8cc1e8287d 100644 --- a/src/darwin/CHIPTool/CHIPTool/View Controllers/RootViewController.m +++ b/src/darwin/CHIPTool/CHIPTool/View Controllers/RootViewController.m @@ -24,7 +24,7 @@ #import "QRCodeViewController.h" #import "TemperatureSensorViewController.h" #import "UnpairDevicesViewController.h" -#import "WifiViewController.h" +#import "WiFiViewController.h" @implementation RootViewController @@ -42,7 +42,7 @@ - (void)setUpTableView self.tableView.dataSource = self; [self.view addSubview:self.tableView]; self.options = @[ - @"QRCode scanner", @"Echo client", @"Light on / off cluster", @"Temperature Sensor", @"Bindings", @"Wifi Configuration", + @"QRCode scanner", @"Echo client", @"Light on / off cluster", @"Temperature Sensor", @"Bindings", @"WiFi Configuration", @"Enable Pairing", @"Unpair Devices", @"Fabric Management" ]; } @@ -121,7 +121,7 @@ - (void)pushTemperatureSensor - (void)pushNetworkConfiguration { - WifiViewController * controller = [WifiViewController new]; + WiFiViewController * controller = [WiFiViewController new]; [self.navigationController pushViewController:controller animated:YES]; } diff --git a/src/darwin/CHIPTool/CHIPTool/View Controllers/Wifi/WifiViewController.h b/src/darwin/CHIPTool/CHIPTool/View Controllers/WiFi/WiFiViewController.h similarity index 93% rename from src/darwin/CHIPTool/CHIPTool/View Controllers/Wifi/WifiViewController.h rename to src/darwin/CHIPTool/CHIPTool/View Controllers/WiFi/WiFiViewController.h index 2fc9c34aa2149b..0823b1caf371cb 100644 --- a/src/darwin/CHIPTool/CHIPTool/View Controllers/Wifi/WifiViewController.h +++ b/src/darwin/CHIPTool/CHIPTool/View Controllers/WiFi/WiFiViewController.h @@ -19,7 +19,7 @@ NS_ASSUME_NONNULL_BEGIN -@interface WifiViewController : UIViewController +@interface WiFiViewController : UIViewController @end diff --git a/src/darwin/CHIPTool/CHIPTool/View Controllers/Wifi/WifiViewController.m b/src/darwin/CHIPTool/CHIPTool/View Controllers/WiFi/WiFiViewController.m similarity index 98% rename from src/darwin/CHIPTool/CHIPTool/View Controllers/Wifi/WifiViewController.m rename to src/darwin/CHIPTool/CHIPTool/View Controllers/WiFi/WiFiViewController.m index 61ded066c5461e..03c088bdb35e21 100644 --- a/src/darwin/CHIPTool/CHIPTool/View Controllers/Wifi/WifiViewController.m +++ b/src/darwin/CHIPTool/CHIPTool/View Controllers/WiFi/WiFiViewController.m @@ -15,18 +15,18 @@ * limitations under the License. */ -#import "WifiViewController.h" +#import "WiFiViewController.h" #import "CHIPUIViewUtils.h" #import "DefaultsUtils.h" -@interface WifiViewController () +@interface WiFiViewController () @property (strong, nonatomic) UITextField * networkSSID; @property (strong, nonatomic) UITextField * networkPassword; @property (strong, nonatomic) UIButton * saveButton; @property (strong, nonatomic) UIButton * clearButton; @end -@implementation WifiViewController +@implementation WiFiViewController // MARK: UIViewController methods diff --git a/src/include/platform/ConnectivityManager.h b/src/include/platform/ConnectivityManager.h index 694d064da9720c..32824e2fd6462e 100644 --- a/src/include/platform/ConnectivityManager.h +++ b/src/include/platform/ConnectivityManager.h @@ -167,7 +167,7 @@ class ConnectivityManager CHIP_ERROR SetWiFiStationReconnectInterval(System::Clock::Timeout val); bool IsWiFiStationProvisioned(); void ClearWiFiStationProvision(); - CHIP_ERROR GetAndLogWifiStatsCounters(); + CHIP_ERROR GetAndLogWiFiStatsCounters(); // WiFi AP methods WiFiAPMode GetWiFiAPMode(); @@ -406,9 +406,9 @@ inline void ConnectivityManager::SetWiFiAPIdleTimeout(System::Clock::Timeout val static_cast(this)->_SetWiFiAPIdleTimeout(val); } -inline CHIP_ERROR ConnectivityManager::GetAndLogWifiStatsCounters() +inline CHIP_ERROR ConnectivityManager::GetAndLogWiFiStatsCounters() { - return static_cast(this)->_GetAndLogWifiStatsCounters(); + return static_cast(this)->_GetAndLogWiFiStatsCounters(); } inline ConnectivityManager::ThreadMode ConnectivityManager::GetThreadMode() diff --git a/src/include/platform/internal/GenericConnectivityManagerImpl_NoWiFi.h b/src/include/platform/internal/GenericConnectivityManagerImpl_NoWiFi.h index 8d62822e69bf41..ce81cf8d29d611 100644 --- a/src/include/platform/internal/GenericConnectivityManagerImpl_NoWiFi.h +++ b/src/include/platform/internal/GenericConnectivityManagerImpl_NoWiFi.h @@ -70,7 +70,7 @@ class GenericConnectivityManagerImpl_NoWiFi void _MaintainOnDemandWiFiAP(void); System::Clock::Timeout _GetWiFiAPIdleTimeout(void); void _SetWiFiAPIdleTimeout(System::Clock::Timeout val); - CHIP_ERROR _GetAndLogWifiStatsCounters(void); + CHIP_ERROR _GetAndLogWiFiStatsCounters(void); bool _CanStartWiFiScan(); void _OnWiFiScanDone(); void _OnWiFiStationProvisionChange(); @@ -176,7 +176,7 @@ inline void GenericConnectivityManagerImpl_NoWiFi::_SetWiFiAPIdleTime {} template -inline CHIP_ERROR GenericConnectivityManagerImpl_NoWiFi::_GetAndLogWifiStatsCounters(void) +inline CHIP_ERROR GenericConnectivityManagerImpl_NoWiFi::_GetAndLogWiFiStatsCounters(void) { return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; } diff --git a/src/include/platform/internal/GenericConnectivityManagerImpl_WiFi.h b/src/include/platform/internal/GenericConnectivityManagerImpl_WiFi.h index cb352445a0c7bd..1de4a57ea3b168 100644 --- a/src/include/platform/internal/GenericConnectivityManagerImpl_WiFi.h +++ b/src/include/platform/internal/GenericConnectivityManagerImpl_WiFi.h @@ -72,7 +72,7 @@ class GenericConnectivityManagerImpl_WiFi void _MaintainOnDemandWiFiAP(); System::Clock::Timeout _GetWiFiAPIdleTimeout(); void _SetWiFiAPIdleTimeout(System::Clock::Timeout val); - CHIP_ERROR _GetAndLogWifiStatsCounters(); + CHIP_ERROR _GetAndLogWiFiStatsCounters(); bool _CanStartWiFiScan(); void _OnWiFiScanDone(); void _OnWiFiStationProvisionChange(); @@ -162,7 +162,7 @@ inline void GenericConnectivityManagerImpl_WiFi::_SetWiFiAPIdleTimeou {} template -inline CHIP_ERROR GenericConnectivityManagerImpl_WiFi::_GetAndLogWifiStatsCounters() +inline CHIP_ERROR GenericConnectivityManagerImpl_WiFi::_GetAndLogWiFiStatsCounters() { return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; } diff --git a/src/lib/shell/commands/WiFi.cpp b/src/lib/shell/commands/WiFi.cpp index ffa15dcf772518..ed531e6bf0bf20 100644 --- a/src/lib/shell/commands/WiFi.cpp +++ b/src/lib/shell/commands/WiFi.cpp @@ -35,15 +35,15 @@ using chip::DeviceLayer::ConnectivityMgr; namespace chip { namespace Shell { -static chip::Shell::Engine sShellWifiSubCommands; +static chip::Shell::Engine sShellWiFiSubCommands; static CHIP_ERROR WiFiHelpHandler(int argc, char ** argv) { - sShellWifiSubCommands.ForEachCommand(PrintCommandHelp, nullptr); + sShellWiFiSubCommands.ForEachCommand(PrintCommandHelp, nullptr); return CHIP_NO_ERROR; } -static CHIP_ERROR PrintWifiMode() +static CHIP_ERROR PrintWiFiMode() { streamer_t * sout = streamer_get(); ConnectivityManager::WiFiAPMode apMode = ConnectivityMgr().GetWiFiAPMode(); @@ -71,7 +71,7 @@ static CHIP_ERROR PrintWifiMode() return CHIP_NO_ERROR; } -static CHIP_ERROR SetWifiMode(const char * mode) +static CHIP_ERROR SetWiFiMode(const char * mode) { if (strcmp(mode, "disable") == 0) { @@ -100,13 +100,13 @@ static CHIP_ERROR WiFiModeHandler(int argc, char ** argv) { if (argc == 0) { - return PrintWifiMode(); + return PrintWiFiMode(); } else if (argc != 1) { return CHIP_ERROR_INVALID_ARGUMENT; } - return SetWifiMode(argv[0]); + return SetWiFiMode(argv[0]); } static CHIP_ERROR WiFiConnectHandler(int argc, char ** argv) @@ -125,21 +125,21 @@ static CHIP_ERROR WiFiDispatch(int argc, char ** argv) { return WiFiHelpHandler(argc, argv); } - return sShellWifiSubCommands.ExecCommand(argc, argv); + return sShellWiFiSubCommands.ExecCommand(argc, argv); } void RegisterWiFiCommands() { /// Subcommands for root command: `device ` - static const shell_command_t sWifiSubCommands[] = { + static const shell_command_t sWiFiSubCommands[] = { { &WiFiHelpHandler, "help", "" }, { &WiFiModeHandler, "mode", "Get/Set wifi mode. Usage: wifi mode [disable|ap|sta]." }, { &WiFiConnectHandler, "connect", "Connect to AP. Usage: wifi connect ssid psk." }, }; - static const shell_command_t sWifiCommand = { &WiFiDispatch, "wifi", "Usage: wifi " }; + static const shell_command_t sWiFiCommand = { &WiFiDispatch, "wifi", "Usage: wifi " }; - sShellWifiSubCommands.RegisterCommands(sWifiSubCommands, ArraySize(sWifiSubCommands)); - Engine::Root().RegisterCommands(&sWifiCommand, 1); + sShellWiFiSubCommands.RegisterCommands(sWiFiSubCommands, ArraySize(sWiFiSubCommands)); + Engine::Root().RegisterCommands(&sWiFiCommand, 1); } } // namespace Shell diff --git a/src/platform/Ameba/ConnectivityManagerImpl.cpp b/src/platform/Ameba/ConnectivityManagerImpl.cpp index e70938d1f09f76..8316d9da32ea72 100644 --- a/src/platform/Ameba/ConnectivityManagerImpl.cpp +++ b/src/platform/Ameba/ConnectivityManagerImpl.cpp @@ -424,7 +424,7 @@ static uint16_t MapFrequency(const uint16_t inBand, const uint8_t inChannel) return frequency; } -CHIP_ERROR ConnectivityManagerImpl::_GetAndLogWifiStatsCounters(void) +CHIP_ERROR ConnectivityManagerImpl::_GetAndLogWiFiStatsCounters(void) { return CHIP_NO_ERROR; } diff --git a/src/platform/Ameba/ConnectivityManagerImpl.h b/src/platform/Ameba/ConnectivityManagerImpl.h index e4ed47d430cdd4..729336053a23c9 100644 --- a/src/platform/Ameba/ConnectivityManagerImpl.h +++ b/src/platform/Ameba/ConnectivityManagerImpl.h @@ -101,7 +101,7 @@ class ConnectivityManagerImpl final : public ConnectivityManager, void _MaintainOnDemandWiFiAP(void); System::Clock::Timeout _GetWiFiAPIdleTimeout(void); void _SetWiFiAPIdleTimeout(System::Clock::Timeout val); - CHIP_ERROR _GetAndLogWifiStatsCounters(void); + CHIP_ERROR _GetAndLogWiFiStatsCounters(void); bool _CanStartWiFiScan(); void _OnWiFiScanDone(); void _OnWiFiStationProvisionChange(); diff --git a/src/platform/ESP32/CHIPDevicePlatformEvent.h b/src/platform/ESP32/CHIPDevicePlatformEvent.h index f054c8315e71f1..33355e73f4779c 100644 --- a/src/platform/ESP32/CHIPDevicePlatformEvent.h +++ b/src/platform/ESP32/CHIPDevicePlatformEvent.h @@ -60,15 +60,15 @@ struct ChipDevicePlatformEvent final ip_event_got_ip_t IpGotIp; ip_event_got_ip6_t IpGotIp6; ip_event_ap_staipassigned_t IpApStaIpAssigned; - wifi_event_sta_scan_done_t WifiStaScanDone; - wifi_event_sta_connected_t WifiStaConnected; - wifi_event_sta_disconnected_t WifiStaDisconnected; - wifi_event_sta_authmode_change_t WifiStaAuthModeChange; - wifi_event_sta_wps_er_pin_t WifiStaWpsErPin; - wifi_event_sta_wps_fail_reason_t WifiStaWpsErFailed; - wifi_event_ap_staconnected_t WifiApStaConnected; - wifi_event_ap_stadisconnected_t WifiApStaDisconnected; - wifi_event_ap_probe_req_rx_t WifiApProbeReqRecved; + wifi_event_sta_scan_done_t WiFiStaScanDone; + wifi_event_sta_connected_t WiFiStaConnected; + wifi_event_sta_disconnected_t WiFiStaDisconnected; + wifi_event_sta_authmode_change_t WiFiStaAuthModeChange; + wifi_event_sta_wps_er_pin_t WiFiStaWpsErPin; + wifi_event_sta_wps_fail_reason_t WiFiStaWpsErFailed; + wifi_event_ap_staconnected_t WiFiApStaConnected; + wifi_event_ap_stadisconnected_t WiFiApStaDisconnected; + wifi_event_ap_probe_req_rx_t WiFiApProbeReqRecved; } Data; } ESPSystemEvent; }; diff --git a/src/platform/ESP32/ConnectivityManagerImpl.h b/src/platform/ESP32/ConnectivityManagerImpl.h index 96163cc9ca3dd2..34fb03a310abe0 100644 --- a/src/platform/ESP32/ConnectivityManagerImpl.h +++ b/src/platform/ESP32/ConnectivityManagerImpl.h @@ -108,7 +108,7 @@ class ConnectivityManagerImpl final : public ConnectivityManager, void _MaintainOnDemandWiFiAP(void); System::Clock::Timeout _GetWiFiAPIdleTimeout(void); void _SetWiFiAPIdleTimeout(System::Clock::Timeout val); - CHIP_ERROR _GetAndLogWifiStatsCounters(void); + CHIP_ERROR _GetAndLogWiFiStatsCounters(void); bool _CanStartWiFiScan(); void _OnWiFiScanDone(); void _OnWiFiStationProvisionChange(); diff --git a/src/platform/ESP32/ConnectivityManagerImpl_WiFi.cpp b/src/platform/ESP32/ConnectivityManagerImpl_WiFi.cpp index aa484a1b33ea80..b053bd9e70e0c7 100644 --- a/src/platform/ESP32/ConnectivityManagerImpl_WiFi.cpp +++ b/src/platform/ESP32/ConnectivityManagerImpl_WiFi.cpp @@ -338,7 +338,7 @@ static uint16_t MapFrequency(const uint16_t inBand, const uint8_t inChannel) return frequency; } -CHIP_ERROR ConnectivityManagerImpl::_GetAndLogWifiStatsCounters(void) +CHIP_ERROR ConnectivityManagerImpl::_GetAndLogWiFiStatsCounters(void) { esp_err_t err; wifi_config_t wifiConfig; @@ -366,7 +366,7 @@ CHIP_ERROR ConnectivityManagerImpl::_GetAndLogWifiStatsCounters(void) "Our bits are going to start overlapping"); bssid = static_cast((wifiConfig.sta.bssid[4] << 8) | wifiConfig.sta.bssid[5]); ChipLogProgress(DeviceLayer, - "Wifi-Telemetry\n" + "WiFi-Telemetry\n" "BSSID: %x\n" "freq: %d\n", bssid, freq); diff --git a/src/platform/ESP32/PlatformManagerImpl.cpp b/src/platform/ESP32/PlatformManagerImpl.cpp index d059933e2a3668..b3836f1d50f7ab 100644 --- a/src/platform/ESP32/PlatformManagerImpl.cpp +++ b/src/platform/ESP32/PlatformManagerImpl.cpp @@ -182,40 +182,40 @@ void PlatformManagerImpl::HandleESPSystemEvent(void * arg, esp_event_base_t even switch (eventId) { case WIFI_EVENT_SCAN_DONE: - memcpy(&event.Platform.ESPSystemEvent.Data.WifiStaScanDone, eventData, - sizeof(event.Platform.ESPSystemEvent.Data.WifiStaScanDone)); + memcpy(&event.Platform.ESPSystemEvent.Data.WiFiStaScanDone, eventData, + sizeof(event.Platform.ESPSystemEvent.Data.WiFiStaScanDone)); break; case WIFI_EVENT_STA_CONNECTED: - memcpy(&event.Platform.ESPSystemEvent.Data.WifiStaConnected, eventData, - sizeof(event.Platform.ESPSystemEvent.Data.WifiStaConnected)); + memcpy(&event.Platform.ESPSystemEvent.Data.WiFiStaConnected, eventData, + sizeof(event.Platform.ESPSystemEvent.Data.WiFiStaConnected)); break; case WIFI_EVENT_STA_DISCONNECTED: - memcpy(&event.Platform.ESPSystemEvent.Data.WifiStaDisconnected, eventData, - sizeof(event.Platform.ESPSystemEvent.Data.WifiStaDisconnected)); + memcpy(&event.Platform.ESPSystemEvent.Data.WiFiStaDisconnected, eventData, + sizeof(event.Platform.ESPSystemEvent.Data.WiFiStaDisconnected)); break; case WIFI_EVENT_STA_AUTHMODE_CHANGE: - memcpy(&event.Platform.ESPSystemEvent.Data.WifiStaAuthModeChange, eventData, - sizeof(event.Platform.ESPSystemEvent.Data.WifiStaAuthModeChange)); + memcpy(&event.Platform.ESPSystemEvent.Data.WiFiStaAuthModeChange, eventData, + sizeof(event.Platform.ESPSystemEvent.Data.WiFiStaAuthModeChange)); break; case WIFI_EVENT_STA_WPS_ER_PIN: - memcpy(&event.Platform.ESPSystemEvent.Data.WifiStaWpsErPin, eventData, - sizeof(event.Platform.ESPSystemEvent.Data.WifiStaWpsErPin)); + memcpy(&event.Platform.ESPSystemEvent.Data.WiFiStaWpsErPin, eventData, + sizeof(event.Platform.ESPSystemEvent.Data.WiFiStaWpsErPin)); break; case WIFI_EVENT_STA_WPS_ER_FAILED: - memcpy(&event.Platform.ESPSystemEvent.Data.WifiStaWpsErFailed, eventData, - sizeof(event.Platform.ESPSystemEvent.Data.WifiStaWpsErFailed)); + memcpy(&event.Platform.ESPSystemEvent.Data.WiFiStaWpsErFailed, eventData, + sizeof(event.Platform.ESPSystemEvent.Data.WiFiStaWpsErFailed)); break; case WIFI_EVENT_AP_STACONNECTED: - memcpy(&event.Platform.ESPSystemEvent.Data.WifiApStaConnected, eventData, - sizeof(event.Platform.ESPSystemEvent.Data.WifiApStaConnected)); + memcpy(&event.Platform.ESPSystemEvent.Data.WiFiApStaConnected, eventData, + sizeof(event.Platform.ESPSystemEvent.Data.WiFiApStaConnected)); break; case WIFI_EVENT_AP_STADISCONNECTED: - memcpy(&event.Platform.ESPSystemEvent.Data.WifiApStaDisconnected, eventData, - sizeof(event.Platform.ESPSystemEvent.Data.WifiApStaDisconnected)); + memcpy(&event.Platform.ESPSystemEvent.Data.WiFiApStaDisconnected, eventData, + sizeof(event.Platform.ESPSystemEvent.Data.WiFiApStaDisconnected)); break; case WIFI_EVENT_AP_PROBEREQRECVED: - memcpy(&event.Platform.ESPSystemEvent.Data.WifiApProbeReqRecved, eventData, - sizeof(event.Platform.ESPSystemEvent.Data.WifiApProbeReqRecved)); + memcpy(&event.Platform.ESPSystemEvent.Data.WiFiApProbeReqRecved, eventData, + sizeof(event.Platform.ESPSystemEvent.Data.WiFiApProbeReqRecved)); break; default: break; diff --git a/src/platform/P6/ConnectivityManagerImpl.cpp b/src/platform/P6/ConnectivityManagerImpl.cpp index 41c4e47fd8df0f..aed4bb9d679a49 100644 --- a/src/platform/P6/ConnectivityManagerImpl.cpp +++ b/src/platform/P6/ConnectivityManagerImpl.cpp @@ -153,7 +153,7 @@ void ConnectivityManagerImpl::_SetWiFiAPIdleTimeout(System::Clock::Timeout val) DeviceLayer::SystemLayer().ScheduleWork(DriveAPState, NULL); } -CHIP_ERROR ConnectivityManagerImpl::_GetAndLogWifiStatsCounters(void) +CHIP_ERROR ConnectivityManagerImpl::_GetAndLogWiFiStatsCounters(void) { cy_wcm_associated_ap_info_t ap_info; cy_rslt_t result = CY_RSLT_SUCCESS; @@ -166,7 +166,7 @@ CHIP_ERROR ConnectivityManagerImpl::_GetAndLogWifiStatsCounters(void) } ChipLogProgress(DeviceLayer, - "Wifi-Telemetry\n" + "WiFi-Telemetry\n" "BSSID: %02x:%02x:%02x:%02x:%02x:%02x\n" "RSSI: %d\n" "Channel: %d\n" diff --git a/src/platform/P6/ConnectivityManagerImpl.h b/src/platform/P6/ConnectivityManagerImpl.h index d54ebaf4f0edf9..6f742f2fe3ebfb 100644 --- a/src/platform/P6/ConnectivityManagerImpl.h +++ b/src/platform/P6/ConnectivityManagerImpl.h @@ -75,7 +75,7 @@ class ConnectivityManagerImpl final : public ConnectivityManager, CHIP_ERROR _SetWiFiStationReconnectInterval(System::Clock::Timeout val); bool _IsWiFiStationProvisioned(void); void _ClearWiFiStationProvision(void); - CHIP_ERROR _GetAndLogWifiStatsCounters(void); + CHIP_ERROR _GetAndLogWiFiStatsCounters(void); void ChangeWiFiStationState(WiFiStationState newState); WiFiAPMode _GetWiFiAPMode(void); CHIP_ERROR _SetWiFiAPMode(WiFiAPMode val); diff --git a/src/platform/Tizen/ConnectivityManagerImpl.cpp b/src/platform/Tizen/ConnectivityManagerImpl.cpp index 27ae77affd2352..b992985c32d613 100644 --- a/src/platform/Tizen/ConnectivityManagerImpl.cpp +++ b/src/platform/Tizen/ConnectivityManagerImpl.cpp @@ -125,41 +125,41 @@ CHIP_ERROR ConnectivityManagerImpl::_SetWiFiStationReconnectInterval(System::Clo bool ConnectivityManagerImpl::_IsWiFiStationEnabled(void) { - bool isWifiStationEnabled = false; + bool isWiFiStationEnabled = false; - WiFiMgr().IsActivated(&isWifiStationEnabled); + WiFiMgr().IsActivated(&isWiFiStationEnabled); - return isWifiStationEnabled; + return isWiFiStationEnabled; } bool ConnectivityManagerImpl::_IsWiFiStationConnected(void) { CHIP_ERROR err = CHIP_NO_ERROR; wifi_manager_connection_state_e connectionState = WIFI_MANAGER_CONNECTION_STATE_DISCONNECTED; - bool isWifiStationConnected = false; + bool isWiFiStationConnected = false; err = WiFiMgr().GetConnectionState(&connectionState); - VerifyOrReturnError(err == CHIP_NO_ERROR, isWifiStationConnected); + VerifyOrReturnError(err == CHIP_NO_ERROR, isWiFiStationConnected); if (connectionState == WIFI_MANAGER_CONNECTION_STATE_CONNECTED) - isWifiStationConnected = true; + isWiFiStationConnected = true; - return isWifiStationConnected; + return isWiFiStationConnected; } bool ConnectivityManagerImpl::_IsWiFiStationProvisioned(void) { CHIP_ERROR err = CHIP_NO_ERROR; wifi_manager_connection_state_e connectionState = WIFI_MANAGER_CONNECTION_STATE_DISCONNECTED; - bool isWifiStationProvisioned = false; + bool isWiFiStationProvisioned = false; err = WiFiMgr().GetConnectionState(&connectionState); - VerifyOrReturnError(err == CHIP_NO_ERROR, isWifiStationProvisioned); + VerifyOrReturnError(err == CHIP_NO_ERROR, isWiFiStationProvisioned); if (connectionState >= WIFI_MANAGER_CONNECTION_STATE_ASSOCIATION) - isWifiStationProvisioned = true; + isWiFiStationProvisioned = true; - return isWifiStationProvisioned; + return isWiFiStationProvisioned; } void ConnectivityManagerImpl::_ClearWiFiStationProvision(void) diff --git a/src/platform/Tizen/WiFiManager.cpp b/src/platform/Tizen/WiFiManager.cpp index 8a06d7a0e7336f..9069a5aebfe574 100644 --- a/src/platform/Tizen/WiFiManager.cpp +++ b/src/platform/Tizen/WiFiManager.cpp @@ -412,12 +412,12 @@ gboolean WiFiManager::_WiFiConnect(GMainLoop * mainLoop, gpointer userData) void WiFiManager::_WiFiSetStates(void) { int wifiErr = WIFI_MANAGER_ERROR_NONE; - bool isWifiActivated = false; + bool isWiFiActivated = false; - wifiErr = wifi_manager_is_activated(mWiFiManagerHandle, &isWifiActivated); + wifiErr = wifi_manager_is_activated(mWiFiManagerHandle, &isWiFiActivated); if (wifiErr == WIFI_MANAGER_ERROR_NONE) { - mDeviceState = isWifiActivated ? WIFI_MANAGER_DEVICE_STATE_ACTIVATED : WIFI_MANAGER_DEVICE_STATE_DEACTIVATED; + mDeviceState = isWiFiActivated ? WIFI_MANAGER_DEVICE_STATE_ACTIVATED : WIFI_MANAGER_DEVICE_STATE_DEACTIVATED; ChipLogProgress(DeviceLayer, "Set WiFi device state [%s]", __WiFiDeviceStateToStr(mDeviceState)); } @@ -579,15 +579,15 @@ void WiFiManager::Deinit(void) MainLoop::Instance().Deinit(); } -CHIP_ERROR WiFiManager::IsActivated(bool * isWifiActivated) +CHIP_ERROR WiFiManager::IsActivated(bool * isWiFiActivated) { CHIP_ERROR err = CHIP_NO_ERROR; int wifiErr = WIFI_MANAGER_ERROR_NONE; - wifiErr = wifi_manager_is_activated(sInstance.mWiFiManagerHandle, isWifiActivated); + wifiErr = wifi_manager_is_activated(sInstance.mWiFiManagerHandle, isWiFiActivated); if (wifiErr == WIFI_MANAGER_ERROR_NONE) { - ChipLogProgress(DeviceLayer, "WiFi is %s", *isWifiActivated ? "activated" : "deactivated"); + ChipLogProgress(DeviceLayer, "WiFi is %s", *isWiFiActivated ? "activated" : "deactivated"); } else { @@ -602,14 +602,14 @@ CHIP_ERROR WiFiManager::Activate(void) { CHIP_ERROR err = CHIP_NO_ERROR; int wifiErr = WIFI_MANAGER_ERROR_NONE; - bool isWifiActivated = false; + bool isWiFiActivated = false; bool dbusAsyncErr = false; - wifiErr = wifi_manager_is_activated(sInstance.mWiFiManagerHandle, &isWifiActivated); + wifiErr = wifi_manager_is_activated(sInstance.mWiFiManagerHandle, &isWiFiActivated); VerifyOrExit(wifiErr == WIFI_MANAGER_ERROR_NONE, err = CHIP_ERROR_INCORRECT_STATE; ChipLogProgress(DeviceLayer, "FAIL: check whether WiFi is activated [%s]", get_error_message(wifiErr))); - VerifyOrExit(isWifiActivated == false, ChipLogProgress(DeviceLayer, "WiFi is already activated")); + VerifyOrExit(isWiFiActivated == false, ChipLogProgress(DeviceLayer, "WiFi is already activated")); dbusAsyncErr = MainLoop::Instance().AsyncRequest(_WiFiActivate); if (dbusAsyncErr == false) @@ -625,14 +625,14 @@ CHIP_ERROR WiFiManager::Deactivate(void) { CHIP_ERROR err = CHIP_NO_ERROR; int wifiErr = WIFI_MANAGER_ERROR_NONE; - bool isWifiActivated = false; + bool isWiFiActivated = false; bool dbusAsyncErr = false; - wifiErr = wifi_manager_is_activated(sInstance.mWiFiManagerHandle, &isWifiActivated); + wifiErr = wifi_manager_is_activated(sInstance.mWiFiManagerHandle, &isWiFiActivated); VerifyOrExit(wifiErr == WIFI_MANAGER_ERROR_NONE, err = CHIP_ERROR_INCORRECT_STATE; ChipLogProgress(DeviceLayer, "FAIL: check whether WiFi is activated [%s]", get_error_message(wifiErr))); - VerifyOrExit(isWifiActivated == true, ChipLogProgress(DeviceLayer, "WiFi is already deactivated")); + VerifyOrExit(isWiFiActivated == true, ChipLogProgress(DeviceLayer, "WiFi is already deactivated")); dbusAsyncErr = MainLoop::Instance().AsyncRequest(_WiFiDeactivate); if (dbusAsyncErr == false) @@ -648,18 +648,18 @@ CHIP_ERROR WiFiManager::Connect(const char * ssid, const char * key) { CHIP_ERROR err = CHIP_NO_ERROR; int wifiErr = WIFI_MANAGER_ERROR_NONE; - bool isWifiActivated = false; + bool isWiFiActivated = false; bool dbusAsyncErr = false; wifi_manager_ap_h foundAp = NULL; g_strlcpy(sInstance.mWiFiSSID, ssid, kMaxWiFiSSIDLength + 1); g_strlcpy(sInstance.mWiFiKey, key, kMaxWiFiKeyLength + 1); - wifiErr = wifi_manager_is_activated(sInstance.mWiFiManagerHandle, &isWifiActivated); + wifiErr = wifi_manager_is_activated(sInstance.mWiFiManagerHandle, &isWiFiActivated); VerifyOrExit(wifiErr == WIFI_MANAGER_ERROR_NONE, err = CHIP_ERROR_INCORRECT_STATE; ChipLogProgress(DeviceLayer, "FAIL: check whether WiFi is activated [%s]", get_error_message(wifiErr))); - VerifyOrExit(isWifiActivated == true, ChipLogProgress(DeviceLayer, "WiFi is deactivated")); + VerifyOrExit(isWiFiActivated == true, ChipLogProgress(DeviceLayer, "WiFi is deactivated")); foundAp = sInstance._WiFiGetFoundAP(); if (foundAp != NULL) @@ -687,16 +687,16 @@ CHIP_ERROR WiFiManager::Disconnect(const char * ssid) { CHIP_ERROR err = CHIP_NO_ERROR; int wifiErr = WIFI_MANAGER_ERROR_NONE; - bool isWifiActivated = false; + bool isWiFiActivated = false; wifi_manager_ap_h foundAp = NULL; g_strlcpy(sInstance.mWiFiSSID, ssid, kMaxWiFiSSIDLength + 1); - wifiErr = wifi_manager_is_activated(sInstance.mWiFiManagerHandle, &isWifiActivated); + wifiErr = wifi_manager_is_activated(sInstance.mWiFiManagerHandle, &isWiFiActivated); VerifyOrExit(wifiErr == WIFI_MANAGER_ERROR_NONE, err = CHIP_ERROR_INCORRECT_STATE; ChipLogProgress(DeviceLayer, "FAIL: check whether WiFi is activated [%s]", get_error_message(wifiErr))); - VerifyOrExit(isWifiActivated == true, ChipLogProgress(DeviceLayer, "WiFi is deactivated")); + VerifyOrExit(isWiFiActivated == true, ChipLogProgress(DeviceLayer, "WiFi is deactivated")); foundAp = sInstance._WiFiGetFoundAP(); VerifyOrExit(foundAp != NULL, ); diff --git a/src/platform/Tizen/WiFiManager.h b/src/platform/Tizen/WiFiManager.h index eb46e9b8e4fbd9..43649270cd1c05 100644 --- a/src/platform/Tizen/WiFiManager.h +++ b/src/platform/Tizen/WiFiManager.h @@ -35,7 +35,7 @@ class WiFiManager void Init(void); void Deinit(void); - CHIP_ERROR IsActivated(bool * isWifiActivated); + CHIP_ERROR IsActivated(bool * isWiFiActivated); CHIP_ERROR Activate(void); CHIP_ERROR Deactivate(void); CHIP_ERROR Connect(const char * ssid, const char * key); diff --git a/src/platform/mbed/ConnectivityManagerImpl.cpp b/src/platform/mbed/ConnectivityManagerImpl.cpp index 5c584d07d07c4a..854699c5e35812 100644 --- a/src/platform/mbed/ConnectivityManagerImpl.cpp +++ b/src/platform/mbed/ConnectivityManagerImpl.cpp @@ -132,12 +132,12 @@ CHIP_ERROR ConnectivityManagerImpl::_Init() if (net_if->wifiInterface() != nullptr) { - mWifiInterface = net_if->wifiInterface(); + mWiFiInterface = net_if->wifiInterface(); mWiFiStationMode = kWiFiStationMode_Enabled; // TODO: Add to user documentation that add_event_listener must be used // To add more listener to the interface - mWifiInterface->add_event_listener([this](nsapi_event_t event, intptr_t data) { + mWiFiInterface->add_event_listener([this](nsapi_event_t event, intptr_t data) { PlatformMgrImpl().mQueue.call([this, event, data] { PlatformMgr().LockChipStack(); OnInterfaceEvent(event, data); @@ -145,7 +145,7 @@ CHIP_ERROR ConnectivityManagerImpl::_Init() }); }); - mWifiInterface->set_blocking(false); + mWiFiInterface->set_blocking(false); } return err; } @@ -208,14 +208,14 @@ void ConnectivityManagerImpl::OnInterfaceEvent(nsapi_event_t event, intptr_t dat CHIP_ERROR ConnectivityManagerImpl::ProvisionWiFiNetwork(const char * ssid, const char * key) { // Validate the interface is available - if (!mWifiInterface) + if (!mWiFiInterface) { ChipLogError(DeviceLayer, "WiFi interface not supported"); return CHIP_ERROR_INCORRECT_STATE; } // Set WiFi credentials - auto error = mWifiInterface->set_credentials(ssid, key, mSecurityType); + auto error = mWiFiInterface->set_credentials(ssid, key, mSecurityType); if (error) { ChipLogError(DeviceLayer, "Set WiFi credentials failed %d", error); @@ -224,7 +224,7 @@ CHIP_ERROR ConnectivityManagerImpl::ProvisionWiFiNetwork(const char * ssid, cons mIsProvisioned = true; - PlatformMgr().ScheduleWork(OnWifiStationChange, 0); + PlatformMgr().ScheduleWork(OnWiFiStationChange, 0); return CHIP_NO_ERROR; } @@ -232,14 +232,14 @@ CHIP_ERROR ConnectivityManagerImpl::ProvisionWiFiNetwork(const char * ssid, cons void ConnectivityManagerImpl::_ClearWiFiStationProvision(void) { // Validate the interface is available - if (!mWifiInterface) + if (!mWiFiInterface) { ChipLogError(DeviceLayer, "WiFi interface not supported"); return; } // Reset credentials - auto error = mWifiInterface->set_credentials("ssid", NULL, NSAPI_SECURITY_NONE); + auto error = mWiFiInterface->set_credentials("ssid", NULL, NSAPI_SECURITY_NONE); if (error) { ChipLogError(DeviceLayer, "Reset WiFi credentials failed %d", error); @@ -248,7 +248,7 @@ void ConnectivityManagerImpl::_ClearWiFiStationProvision(void) mIsProvisioned = false; - PlatformMgr().ScheduleWork(OnWifiStationChange, 0); + PlatformMgr().ScheduleWork(OnWiFiStationChange, 0); } CHIP_ERROR ConnectivityManagerImpl::OnStationConnected() @@ -266,7 +266,7 @@ CHIP_ERROR ConnectivityManagerImpl::OnStationConnected() // Update IP address SocketAddress address; - auto error = mWifiInterface->get_ip_address(&address); + auto error = mWiFiInterface->get_ip_address(&address); if (error != NSAPI_ERROR_OK) { if (mIp4Address != IPAddress::Any) @@ -309,7 +309,7 @@ CHIP_ERROR ConnectivityManagerImpl::OnStationConnected() ChipLogProgress(DeviceLayer, "New Ip4 address set: %s", address.get_ip_address()); } - error = mWifiInterface->get_ipv6_link_local_address(&address); + error = mWiFiInterface->get_ipv6_link_local_address(&address); if (error) { if (mIp6Address != IPAddress::Any) @@ -418,7 +418,7 @@ void ConnectivityManagerImpl::ExecuteStationChange() mWiFiStationState != kWiFiStationState_Connected) { // Connect the interface with network - error = mWifiInterface->connect(); + error = mWiFiInterface->connect(); if (error) { ChipLogError(DeviceLayer, "Network connection failed %d", error); @@ -429,7 +429,7 @@ void ConnectivityManagerImpl::ExecuteStationChange() mWiFiStationState == kWiFiStationState_Connected) { // Connect the interface with network - error = mWifiInterface->disconnect(); + error = mWiFiInterface->disconnect(); if (error) { ChipLogError(DeviceLayer, "Network disconnect failed %d", error); @@ -437,7 +437,7 @@ void ConnectivityManagerImpl::ExecuteStationChange() } } -void ConnectivityManagerImpl::OnWifiStationChange(intptr_t arg) +void ConnectivityManagerImpl::OnWiFiStationChange(intptr_t arg) { sInstance.ExecuteStationChange(); } diff --git a/src/platform/mbed/ConnectivityManagerImpl.h b/src/platform/mbed/ConnectivityManagerImpl.h index 6482e24e0f1ca8..cabdeaedbeb7ae 100644 --- a/src/platform/mbed/ConnectivityManagerImpl.h +++ b/src/platform/mbed/ConnectivityManagerImpl.h @@ -94,7 +94,7 @@ class ConnectivityManagerImpl final : public ConnectivityManager, ::chip::DeviceLayer::Internal::WiFiAuthSecurityType NsapiToNetworkSecurity(nsapi_security_t nsapi_security); void ExecuteStationChange(void); - static void OnWifiStationChange(intptr_t arg); + static void OnWiFiStationChange(intptr_t arg); // ===== Members for internal use by the following friends. friend ConnectivityManager & ConnectivityMgr(void); @@ -107,7 +107,7 @@ class ConnectivityManagerImpl final : public ConnectivityManager, System::Clock::Timeout mWiFiStationReconnectInterval = System::Clock::Milliseconds32(CHIP_DEVICE_CONFIG_WIFI_STATION_RECONNECT_INTERVAL); System::Clock::Timeout mWiFiAPIdleTimeout = System::Clock::Milliseconds32(CHIP_DEVICE_CONFIG_WIFI_AP_IDLE_TIMEOUT); - WiFiInterface * mWifiInterface = nullptr; + WiFiInterface * mWiFiInterface = nullptr; nsapi_security_t mSecurityType = NSAPI_SECURITY_WPA_WPA2; bool mIsProvisioned = false; Inet::IPAddress mIp4Address = Inet::IPAddress::Any;