7#include "olpcmeshsetting.h"
8#include "olpcmeshsetting_p.h"
12NetworkManager::OlpcMeshSettingPrivate::OlpcMeshSettingPrivate()
13 : name(NM_SETTING_OLPC_MESH_SETTING_NAME)
18NetworkManager::OlpcMeshSetting::OlpcMeshSetting()
19 : Setting(Setting::Bond)
20 , d_ptr(new OlpcMeshSettingPrivate())
24NetworkManager::OlpcMeshSetting::OlpcMeshSetting(
const Ptr &other)
26 , d_ptr(new OlpcMeshSettingPrivate())
28 setSsid(other->ssid());
29 setChannel(other->channel());
30 setDhcpAnycastAddress(other->dhcpAnycastAddress());
33NetworkManager::OlpcMeshSetting::~OlpcMeshSetting()
45void NetworkManager::OlpcMeshSetting::setSsid(
const QByteArray &ssid)
52QByteArray NetworkManager::OlpcMeshSetting::ssid()
const
54 Q_D(
const OlpcMeshSetting);
59void NetworkManager::OlpcMeshSetting::setChannel(quint32 channel)
66quint32 NetworkManager::OlpcMeshSetting::channel()
const
68 Q_D(
const OlpcMeshSetting);
73void NetworkManager::OlpcMeshSetting::setDhcpAnycastAddress(
const QByteArray &address)
77 d->dhcpAnycastAddress =
address;
80QByteArray NetworkManager::OlpcMeshSetting::dhcpAnycastAddress()
const
82 Q_D(
const OlpcMeshSetting);
84 return d->dhcpAnycastAddress;
89 if (setting.contains(
QLatin1String(NM_SETTING_OLPC_MESH_SSID))) {
90 setSsid(setting.value(
QLatin1String(NM_SETTING_OLPC_MESH_SSID)).toByteArray());
93 if (setting.contains(
QLatin1String(NM_SETTING_OLPC_MESH_CHANNEL))) {
94 setChannel(setting.value(
QLatin1String(NM_SETTING_OLPC_MESH_CHANNEL)).toUInt());
97 if (setting.contains(
QLatin1String(NM_SETTING_OLPC_MESH_DHCP_ANYCAST_ADDRESS))) {
98 setDhcpAnycastAddress(setting.value(
QLatin1String(NM_SETTING_OLPC_MESH_DHCP_ANYCAST_ADDRESS)).toByteArray());
106 if (!ssid().isEmpty()) {
107 setting.insert(
QLatin1String(NM_SETTING_OLPC_MESH_SSID), ssid());
111 setting.insert(
QLatin1String(NM_SETTING_OLPC_MESH_CHANNEL), channel());
114 if (!dhcpAnycastAddress().isEmpty()) {
115 setting.insert(
QLatin1String(NM_SETTING_OLPC_MESH_DHCP_ANYCAST_ADDRESS), dhcpAnycastAddress());
123 dbg.
nospace() <<
"type: " << setting.typeAsString(setting.type()) <<
'\n';
124 dbg.
nospace() <<
"initialized: " << !setting.isNull() <<
'\n';
126 dbg.
nospace() << NM_SETTING_OLPC_MESH_SSID <<
": " << setting.ssid() <<
'\n';
127 dbg.
nospace() << NM_SETTING_OLPC_MESH_CHANNEL <<
": " << setting.channel() <<
'\n';
128 dbg.
nospace() << NM_SETTING_OLPC_MESH_DHCP_ANYCAST_ADDRESS <<
": " << setting.dhcpAnycastAddress() <<
'\n';
Represents olpc mesh setting.
QVariantMap toMap() const override
Must be reimplemented, default implementationd does nothing.
QString name() const override
Must be reimplemented, default implementationd does nothing.
void fromMap(const QVariantMap &setting) override
Must be reimplemented, default implementation does nothing.
PostalAddress address(const QVariant &location)