nl:: Weave:: Profiles:: NetworkProvisioning:: NetworkInfo
#include <src/lib/profiles/network-provisioning/NetworkInfo.h>
A utility class for serializing and deserializing payloads communicated via NetworkProvisioning profile: it encapsulates information pertinent to the detecting and configuring networks.
Summary
The class relies on intermediate storage of network provisioning information (intermediate between the ultimate store of the information and the network payload) and uses dynamic memory management to give the resulting object flexible runtime. As such, this class is not suitable for the most constrained environments, but may be used on larger systems.
Constructors and Destructors |
|
---|---|
NetworkInfo()
|
|
~NetworkInfo()
|
Public types |
|
---|---|
@210
|
enum |
@211
|
enum |
Public attributes |
|
---|---|
Hidden
|
bool
Whether or not the network is hidden.
|
NetworkId
|
int64_t
The network id assigned to the network by the device, -1 if not specified.
|
NetworkType
|
The type of network.
|
ThreadChannel
|
uint8_t
The current channel (currently [11..26]) on which the Thread network operates, or kThreadChannel_NotSpecified.
|
ThreadExtendedPANId
|
uint8_t *
The Thread extended PAN ID.
|
ThreadNetworkKey
|
uint8_t *
The Thread master network key , or NULL if not specified.
|
ThreadNetworkName
|
char *
The name of the Thread network, or NULL if not specified.
|
ThreadPANId
|
uint32_t
The 16-bit Thread PAN ID, or kThreadPANId_NotSpecified.
|
ThreadPSKc
|
uint8_t *
Thread pre-shared key for commissioner, or NULL if not specified.
|
WiFiKey
|
uint8_t *
The WiFi key, or NULL if not specified.
|
WiFiKeyLen
|
uint32_t
The length in bytes of the WiFi key.
|
WiFiMode
|
The operating mode of the WiFi network.
|
WiFiRole
|
The role played by the device on the WiFi network.
|
WiFiSSID
|
char *
The WiFi SSID, or NULL if not specified.
|
WiFiSecurityType
|
The WiFi security type.
|
WirelessSignalStrength
|
int16_t
The signal strength of the network, or INT16_MIN if not available/applicable.
|
Public functions |
|
---|---|
Clear(void)
|
void
Reset to default and free all values within this NetworkInfo object.
|
CopyTo(NetworkInfo & dest)
|
Replace the contents of this NetworkInfo object with the deep copy of the contents of the argument.
|
Decode(nl::Weave::TLV::TLVReader & reader)
|
Deserialize the content of this NetworkInfo object from its TLV representation.
|
Encode(nl::Weave::TLV::TLVWriter & writer, uint8_t encodeFlags) const
|
Serialize the content of this NetworkInfo object into its TLV representation.
|
MergeTo(NetworkInfo & dest)
|
Merge the contents of this NetworkInfo object with the deep copy of the contents of the argument.
|
Public static functions |
|
---|---|
DecodeList(nl::Weave::TLV::TLVReader & reader, uint16_t & elemCount, NetworkInfo *& elemArray)
|
Deserialize a list of NetworkInfo elements from its TLV representation.
|
EncodeList(nl::Weave::TLV::TLVWriter & writer, uint16_t elemCount, const NetworkInfo *elemArray, uint8_t encodeFlags)
|
Serialize an array of NetworkInfo objects into its TLV representation.
|
EncodeList(nl::Weave::TLV::TLVWriter & writer, uint16_t arrayLen, const NetworkInfo *elemArray, ::nl::Weave::Profiles::NetworkProvisioning::NetworkType networkType, uint8_t encodeFlags, uint16_t & encodedElemCount)
|
Serialize an array of NetworkInfo objects into its TLV representation selecting only networks of a specific type.
|
Public types
@210
@210
@211
@211
Public attributes
Hidden
bool Hidden
Whether or not the network is hidden.
NetworkId
int64_t NetworkId
The network id assigned to the network by the device, -1 if not specified.
NetworkType
::nl::Weave::Profiles::NetworkProvisioning::NetworkType NetworkType
The type of network.
ThreadChannel
uint8_t ThreadChannel
The current channel (currently [11..26]) on which the Thread network operates, or kThreadChannel_NotSpecified.
ThreadExtendedPANId
uint8_t * ThreadExtendedPANId
The Thread extended PAN ID.
It is a dynamically allocated array of 8 octects, owned by the class. Destroyed on any condition that calls Clear()
on the object.
ThreadNetworkKey
uint8_t * ThreadNetworkKey
The Thread master network key , or NULL if not specified.
It is a dynamically allocated array of arbitrary octets, owned by the class Destroyed on any condition that calls Clear()
on the object.
ThreadNetworkName
char * ThreadNetworkName
The name of the Thread network, or NULL if not specified.
It is a NUL-terminated, dynamically-allocated C-string, owned by the class. Destroyed on any condition that calls Clear()
on the object.
ThreadPANId
uint32_t ThreadPANId
The 16-bit Thread PAN ID, or kThreadPANId_NotSpecified.
ThreadPSKc
uint8_t * ThreadPSKc
Thread pre-shared key for commissioner, or NULL if not specified.
It is a dynamically allocated array of arbitrary octets, owned by the class Destroyed on any condition that calls Clear()
on the object.
WiFiKey
uint8_t * WiFiKey
The WiFi key, or NULL if not specified.
It is a dynamically allocated array of arbitrary octets, owned by the class, with length specified by WiFiKeyLen
. Destroyed on any condition that calls Clear()
on the object.
WiFiKeyLen
uint32_t WiFiKeyLen
The length in bytes of the WiFi key.
WiFiMode
::nl::Weave::Profiles::NetworkProvisioning::WiFiMode WiFiMode
The operating mode of the WiFi network.
WiFiRole
::nl::Weave::Profiles::NetworkProvisioning::WiFiRole WiFiRole
The role played by the device on the WiFi network.
WiFiSSID
char * WiFiSSID
The WiFi SSID, or NULL if not specified.
It is a NUL-terminated, dynamically-allocated C-string, owned by the class. Destroyed on any condition that calls Clear()
on the object.
WiFiSecurityType
::nl::Weave::Profiles::NetworkProvisioning::WiFiSecurityType WiFiSecurityType
The WiFi security type.
WirelessSignalStrength
int16_t WirelessSignalStrength
The signal strength of the network, or INT16_MIN if not available/applicable.
Public functions
CopyTo
WEAVE_ERROR CopyTo( NetworkInfo & dest )
Replace the contents of this NetworkInfo object with the deep copy of the contents of the argument.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
Decode
WEAVE_ERROR Decode( nl::Weave::TLV::TLVReader & reader )
Deserialize the content of this NetworkInfo object from its TLV representation.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
WEAVE_NO_ERROR On success, WEAVE_ERROR_INVALID_TLV_ELEMENT on any element not conforming to the network provisioning profile, any of the TLV reader errors on incorrect decoding of elements.
|
Encode
WEAVE_ERROR Encode( nl::Weave::TLV::TLVWriter & writer, uint8_t encodeFlags ) const
Serialize the content of this NetworkInfo object into its TLV representation.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
WEAVE_NO_ERROR On success, WEAVE_ERROR_INVALID_TLV_ELEMENT on any element not conforming to the network provisioning profile, any of the TLV reader errors on incorrect decoding of elements.
|
MergeTo
WEAVE_ERROR MergeTo( NetworkInfo & dest )
Merge the contents of this NetworkInfo object with the deep copy of the contents of the argument.
All the non-default values from the argument object replace the values in this object.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
NetworkInfo
NetworkInfo()
~NetworkInfo
~NetworkInfo()
Public static functions
DecodeList
WEAVE_ERROR DecodeList( nl::Weave::TLV::TLVReader & reader, uint16_t & elemCount, NetworkInfo *& elemArray )
Deserialize a list of NetworkInfo elements from its TLV representation.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
EncodeList
WEAVE_ERROR EncodeList( nl::Weave::TLV::TLVWriter & writer, uint16_t elemCount, const NetworkInfo *elemArray, uint8_t encodeFlags )
Serialize an array of NetworkInfo objects into its TLV representation.
The array will be an anonymous element in the TLV representation.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Return Values |
|
EncodeList
WEAVE_ERROR EncodeList( nl::Weave::TLV::TLVWriter & writer, uint16_t arrayLen, const NetworkInfo *elemArray, ::nl::Weave::Profiles::NetworkProvisioning::NetworkType networkType, uint8_t encodeFlags, uint16_t & encodedElemCount )
Serialize an array of NetworkInfo objects into its TLV representation selecting only networks of a specific type.
Details | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||||
Return Values |
|