Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: NFC M2M_2016_STM32 MyongjiElec_capstone1 IDW01M1_Cloud_IBM ... more
Fork of NDefLib by
RecordWifiConf Class Reference
Specialize the RecordMimeType to store Wifi configuration information. More...
#include <RecordWifiConf.h>
Inherits NDefLib::RecordMimeType.
Public Types | |
| enum | authType_t { AUTH_OPEN = 0x0000 } |
Authentication required by the wifi network. More... | |
| enum | encryptionType_t { ENC_TYPE_NONE = 0x0001, ENC_TYPE_WEP = 0x0002, ENC_TYPE_TKIP = 0x0004, ENC_TYPE_AES = 0x0008, ENC_TYPE_AES_TKIP = 0x000c } |
Encryption used by the network. More... | |
| enum | RecordType_t { TYPE_UNKNOWN, TYPE_TEXT, TYPE_AAR, TYPE_MIME, TYPE_URI, TYPE_URI_MAIL, TYPE_URI_SMS, TYPE_URI_GEOLOCATION, TYPE_MIME_VCARD, TYPE_WIFI_CONF } |
Enum used to identify the record type. More... | |
Public Member Functions | |
| RecordWifiConf (const std::string &ssid, const std::string &pass="", authType_t authType=AUTH_OPEN, encryptionType_t encType=ENC_TYPE_NONE) | |
| Create a record with the wifi configuration, the default parameters create an open network. | |
| virtual RecordType_t | get_type () const |
| Get the record type. | |
| virtual uint16_t | get_byte_length () |
| virtual uint16_t | write (uint8_t *buffer) |
| Update the content and write it on the buffer. | |
| bool | operator== (const RecordWifiConf &other) |
| Compare two objects. | |
| void | set_as_first_record () |
| Set the record as the first record in the message. | |
| void | set_as_last_record () |
| Set the record as the last record in the message. | |
| bool | is_last_record () const |
| Check if it is the last record in the message. | |
| bool | is_first_record () const |
| Check if it is the first record in the message. | |
| void | set_as_middle_record () |
| Set the record as generic (not the first one and not the last one) | |
| bool | is_middle_record () const |
| Check if the record is in the middle of a chain. | |
| const RecordHeader & | get_header () const |
| Get the record header. | |
| const std::string & | get_mime_type () const |
| Return the mime type of the content. | |
| void | set_mime_data_pointer (uint8_t *data, uint32_t dataLength) |
| Change the data pointer used by this record. | |
| void | copy_mime_data (const uint8_t *data, uint32_t dataLength) |
| Change the data linked with this record, with this function the data are copied inside the object. | |
| uint32_t | get_mime_data_lenght () const |
| uint8_t const * | get_mime_data () const |
| bool | operator== (const RecordMimeType &other) const |
| Compare two objects. | |
Static Public Member Functions | |
| static RecordWifiConf * | parse (const RecordHeader &header, const uint8_t *buffer) |
| Create a RecordWifiConf reading the data from the buffer. | |
Detailed Description
Specialize the RecordMimeType to store Wifi configuration information.
Definition at line 47 of file RecordWifiConf.h.
Member Enumeration Documentation
| enum authType_t |
Authentication required by the wifi network.
Definition at line 53 of file RecordWifiConf.h.
| enum encryptionType_t |
Encryption used by the network.
- Enumerator:
ENC_TYPE_NONE no authentication
ENC_TYPE_WEP wep is deprecated
ENC_TYPE_TKIP deprecated -> only with mixed mode (0x000c)
ENC_TYPE_AES includes CCMP and GCMP
ENC_TYPE_AES_TKIP mixed mode
Definition at line 64 of file RecordWifiConf.h.
enum RecordType_t [inherited] |
Enum used to identify the record type.
- Enumerator:
Constructor & Destructor Documentation
| RecordWifiConf | ( | const std::string & | ssid, |
| const std::string & | pass = "", |
||
| authType_t | authType = AUTH_OPEN, |
||
| encryptionType_t | encType = ENC_TYPE_NONE |
||
| ) |
Create a record with the wifi configuration, the default parameters create an open network.
- Parameters:
-
ssid network name pass network password authType authentication used in the network encType encryption used in the network
Definition at line 51 of file RecordWifiConf.cpp.
Member Function Documentation
| void copy_mime_data | ( | const uint8_t * | data, |
| uint32_t | dataLength | ||
| ) | [inherited] |
Change the data linked with this record, with this function the data are copied inside the object.
- Parameters:
-
data Pointer to the data buffer. dataLength Number of bytes to write.
Definition at line 105 of file RecordMimeType.cpp.
| virtual uint16_t get_byte_length | ( | ) | [virtual] |
- Returns:
- update the record content and return the number of bytes needed to store this record
Reimplemented from Record.
Definition at line 105 of file RecordWifiConf.h.
| const RecordHeader& get_header | ( | ) | const [inherited] |
| uint8_t const* get_mime_data | ( | ) | const [inherited] |
- Returns:
- pointer to the content data
- DO NOT free this pointer, it is managed by the class.
Definition at line 124 of file RecordMimeType.h.
| uint32_t get_mime_data_lenght | ( | ) | const [inherited] |
- Returns:
- number of bytes used to store the content data
Definition at line 116 of file RecordMimeType.h.
| const std::string& get_mime_type | ( | ) | const [inherited] |
Return the mime type of the content.
- Returns:
- the mime type of the content.
Definition at line 87 of file RecordMimeType.h.
| virtual RecordType_t get_type | ( | ) | const [virtual] |
Get the record type.
- Returns:
- TYPE_WIFI_CONF
Reimplemented from RecordMimeType.
Definition at line 97 of file RecordWifiConf.h.
| bool is_first_record | ( | ) | const [inherited] |
| bool is_last_record | ( | ) | const [inherited] |
| bool is_middle_record | ( | ) | const [inherited] |
| bool operator== | ( | const RecordWifiConf & | other ) |
Compare two objects.
- Returns:
- true if the records have the same Vcard information
Definition at line 125 of file RecordWifiConf.h.
| bool operator== | ( | const RecordMimeType & | other ) | const [inherited] |
Compare two objects.
- Returns:
- true if the 2 records have the same mime type, length and data.
Definition at line 150 of file RecordMimeType.h.
| RecordWifiConf * parse | ( | const RecordHeader & | header, |
| const uint8_t * | buffer | ||
| ) | [static] |
Create a RecordWifiConf reading the data from the buffer.
- Parameters:
-
header Record header. buffer Buffer to read the data from.
- Returns:
- an object of type RecordVCard or NULL
- User is in charge of freeing the pointer returned by this function.
Reimplemented from RecordMimeType.
Definition at line 154 of file RecordWifiConf.cpp.
| void set_as_first_record | ( | ) | [inherited] |
| void set_as_last_record | ( | ) | [inherited] |
| void set_as_middle_record | ( | ) | [inherited] |
| void set_mime_data_pointer | ( | uint8_t * | data, |
| uint32_t | dataLength | ||
| ) | [inherited] |
Change the data pointer used by this record.
- Parameters:
-
data Pointer used by this record. dataLength Number of byte to write in this record.
- The buffer is not copied or freed by this class.
- With this function only the data pointer is copied, so it must not be freed before the object is deallocated.
Definition at line 98 of file RecordMimeType.h.
| virtual uint16_t write | ( | uint8_t * | buffer ) | [virtual] |
Update the content and write it on the buffer.
- Parameters:
-
[out] buffer buffer to write the record content into.
- Returns:
- number of bytes written
- See also:
- Record::write
Reimplemented from RecordMimeType.
Definition at line 116 of file RecordWifiConf.h.
Generated on Tue Jul 12 2022 14:14:49 by
1.7.2
