Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions plugin/NetworkManagerConnectivity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ namespace WPEFramework
return;
}

internetSate = checkCurlResponse(endpoints, timeout_ms, headReq, ipversion, interface);
internetSate = checkCurlResponse(endpoints, timeout_ms, headReq, ipversion, std::move(interface));
}

static bool curlVerboseEnabled() {
Expand Down Expand Up @@ -655,7 +655,7 @@ namespace WPEFramework
NMLOG_INFO("notifying internet state %s", getInternetStateString(newInternetState));
Exchange::INetworkManager::InternetStatus newState = newInternetState;
string defaultIface = _instance->getDefaultInterface();
_instance->ReportInternetStatusChange(oldState, newState, defaultIface);
_instance->ReportInternetStatusChange(oldState, newState, std::move(defaultIface));
m_InternetState = newInternetState;
oldState = newState; // 'm_InternetState' not exactly previous state, it may change to unknow when interface changed
}
Expand Down Expand Up @@ -745,7 +745,7 @@ namespace WPEFramework
if(m_InternetState != INTERNET_FULLY_CONNECTED)
{
TestConnectivity testInternet(m_endpoint(), NMCONNECTIVITY_CURL_REQUEST_TIMEOUT_MS,
NMCONNECTIVITY_CURL_HEAD_REQUEST, 2, defaultIface); // check both IP versions
NMCONNECTIVITY_CURL_HEAD_REQUEST, 2, std::move(defaultIface)); // check both IP versions
currentInternetState = testInternet.getInternetState();

if (currentInternetState == INTERNET_CAPTIVE_PORTAL) // if captive portal found copy the URL
Expand Down
4 changes: 2 additions & 2 deletions plugin/NetworkManagerStunClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ namespace details {
if (addr->ai_family != protocol_family)
continue;

std::string const s = sockaddr_to_string2(addr->ai_addr, addr->ai_family);
std::string s = sockaddr_to_string2(addr->ai_addr, addr->ai_family);

if (already_seen.find(s) == std::end(already_seen)) {
struct sockaddr_storage temp = {};
Expand All @@ -230,7 +230,7 @@ namespace details {
}

addrs.push_back(temp);
already_seen.insert(s);
already_seen.insert(std::move(s));
}
}

Expand Down
12 changes: 6 additions & 6 deletions plugin/gnome/NetworkManagerGnomeEvents.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ namespace WPEFramework
return; // if not good don't report the evnet
}

GnomeNetworkManagerEvents::onActiveInterfaceChangeCb(newIface);
GnomeNetworkManagerEvents::onActiveInterfaceChangeCb(std::move(newIface));
}
else
{
Expand Down Expand Up @@ -187,7 +187,7 @@ namespace WPEFramework
uint32_t prefix = nm_ip_address_get_prefix(addr);
if (isIPv6) {
if (isIPv6LinkLocal(addrString)) {
newCache.linkLocalAddresses.insert(addrString);
newCache.linkLocalAddresses.insert(std::move(addrString));
} else if (isIPv6ULA(addrString)) {
newCache.uniqueLocalAddresses.insert(addrString);
} else {
Expand Down Expand Up @@ -406,7 +406,7 @@ namespace WPEFramework
case NM_DEVICE_STATE_UNAVAILABLE:
case NM_DEVICE_STATE_DISCONNECTED:
wifiState = "WIFI_STATE_DISCONNECTED";
GnomeNetworkManagerEvents::onWIFIStateChanged(Exchange::INetworkManager::WIFI_STATE_DISCONNECTED, attemptingSSID);
GnomeNetworkManagerEvents::onWIFIStateChanged(Exchange::INetworkManager::WIFI_STATE_DISCONNECTED, std::move(attemptingSSID));
refreshIpFamilyCache(device, false);
refreshIpFamilyCache(device, true);
GnomeNetworkManagerEvents::onInterfaceStateChangeCb(Exchange::INetworkManager::INTERFACE_LINK_DOWN, nmUtils::wlanIface());
Expand Down Expand Up @@ -646,7 +646,7 @@ namespace WPEFramework
if (_instance) {
for (const char* family : {"IPv4", "IPv6"}) {
IpFamilyCache empty;
std::set<std::string> oldKeys = _instance->swapIpCache(ifname, family, empty);
std::set<std::string> oldKeys = _instance->swapIpCache(ifname, family, std::move(empty));
for (const auto& key : oldKeys) {
_instance->ReportIPAddressChange(ifname, family, key, Exchange::INetworkManager::IP_LOST);
}
Expand Down Expand Up @@ -967,14 +967,14 @@ namespace WPEFramework

NMLOG_DEBUG("%s interface state changed - %s", iface.c_str(), state.c_str());
if(_instance != nullptr && (iface == nmUtils::wlanIface() || iface == nmUtils::ethIface()))
_instance->ReportInterfaceStateChange(static_cast<Exchange::INetworkManager::InterfaceState>(newState), iface);
_instance->ReportInterfaceStateChange(static_cast<Exchange::INetworkManager::InterfaceState>(newState), std::move(iface));
}

void GnomeNetworkManagerEvents::onWIFIStateChanged(uint8_t state, std::string ssid)
{
if(_instance != nullptr)
{
_instance->ReportWiFiStateChange(static_cast<Exchange::INetworkManager::WiFiState>(state), ssid);
_instance->ReportWiFiStateChange(static_cast<Exchange::INetworkManager::WiFiState>(state), std::move(ssid));
#ifdef ENABLE_MIGRATION_MFRMGR_SUPPORT
// Handle WiFi state changes for MfrMgr integration
NetworkManagerMfrManager* mfrManager = NetworkManagerMfrManager::getInstance();
Expand Down
10 changes: 5 additions & 5 deletions plugin/gnome/NetworkManagerGnomeProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ namespace WPEFramework
interface.enabled = GnomeNetworkManagerEvents::isInterfaceStateEnabled(info.state);
interface.connected = GnomeNetworkManagerEvents::isInterfaceStateConnected(info.state);

interfaceList.push_back(interface);
interfaceList.push_back(std::move(interface));
}

using Implementation = RPC::IteratorType<Exchange::INetworkManager::IInterfaceDetailsIterator>;
Expand Down Expand Up @@ -590,9 +590,9 @@ namespace WPEFramework
if(enabled && interface == nmUtils::wlanIface() && _instance != NULL)
{
sleep(1); // wait for 1 sec to change the device state
const string lastConnectedSSID = getLastConnectedSSID();
string lastConnectedSSID = getLastConnectedSSID();
NMLOG_INFO("Activating connection '%s' ...", lastConnectedSSID.c_str());
wifi->activateKnownConnection(nmUtils::wlanIface(), lastConnectedSSID);
wifi->activateKnownConnection(nmUtils::wlanIface(), std::move(lastConnectedSSID));
Comment thread
Copilot marked this conversation as resolved.
}
}

Expand Down Expand Up @@ -666,7 +666,7 @@ namespace WPEFramework
{
NMLOG_DEBUG("no %s address on %s", family.c_str(), interface.c_str());
}
result.ipversion = family;
result.ipversion = std::move(family);

return Core::ERROR_NONE;
}
Expand Down Expand Up @@ -741,7 +741,7 @@ namespace WPEFramework
m_filterSsidslist.clear();
m_filterFrequencies.clear();
m_filterSsidslist = filteredSsids;
m_filterFrequencies = filteredFrequencies;
m_filterFrequencies = std::move(filteredFrequencies);
m_filterVectorsLock.Unlock();

nmEvent->setwifiScanOptions(true);
Expand Down
10 changes: 5 additions & 5 deletions plugin/gnome/NetworkManagerGnomeUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ namespace WPEFramework
}
file.close();

m_wlanifname = wifiIfname;
m_ethifname = ethIfname;
m_deviceHostname = deviceHostname;
m_wlanifname = std::move(wifiIfname);
m_ethifname = std::move(ethIfname);
m_deviceHostname = std::move(deviceHostname);
NMLOG_INFO("/etc/device.properties eth: %s, wlan: %s, default hostname: %s", m_ethifname.c_str(), m_wlanifname.c_str(), m_deviceHostname.c_str());
return true;
}
Expand Down Expand Up @@ -392,7 +392,7 @@ namespace WPEFramework
// Remove any whitespace, newlines, etc.
line.erase(line.find_last_not_of("\r\n\t") + 1);
line.erase(0, line.find_first_not_of("\r\n\t"));
hostname = line;
hostname = std::move(line);
file.close();

NMLOG_INFO("Read persistent hostname: '%s'", hostname.c_str());
Expand Down Expand Up @@ -426,7 +426,7 @@ namespace WPEFramework

if (iss >> ip >> hwType >> flags >> hwAddr) {
if (ip == gatewayIp && hwAddr != "00:00:00:00:00:00") {
mac = hwAddr;
mac = std::move(hwAddr);
NMLOG_INFO("Resolved gateway IP %s to MAC %s", gatewayIp.c_str(), mac.c_str());
break;
}
Expand Down
2 changes: 1 addition & 1 deletion plugin/gnome/gdbus/NetworkManagerGdbusUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ namespace WPEFramework
// Remove any whitespace, newlines, etc.
line.erase(line.find_last_not_of("\r\n\t") + 1);
line.erase(0, line.find_first_not_of("\r\n\t"));
hostname = line;
hostname = std::move(line);
file.close();

NMLOG_INFO("Read persistent hostname: '%s'", hostname.c_str());
Expand Down
Loading