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
RecordSMS Class Reference
Extend the RecordUri to handle the SMS content. More...
#include <RecordSMS.h>
Inherits NDefLib::RecordURI.
Public Types | |
| enum | knowUriId_t { UNKNOWN = 0X00, HTTP_WWW = 0X01, HTTPS_WWW = 0X02, HTTP = 0X03, HTTPS = 0X04, TEL = 0x05, MAIL = 0X06, FTP_ANONIMUS = 0X07, FTP_FTP = 0X08, FTPS = 0X09, SFTP = 0X0A, SMB = 0X0B, NFS = 0X0C, FTP = 0X0d, DAV = 0X0E, NEWS = 0X0F, TELNET = 0X10, IMAP = 0X11, RTSP = 0X12, URN = 0X13, POP = 0X14, SIP = 0X15, SIPS = 0X016, TFTP = 0X017, BTSPP = 0x018, BTL2CAP = 0x019, BTGOEP = 0X01A, TCPOBEX = 0X1B, IRDAOBEX = 0X1C, FILE = 0X1D, URN_EPC_ID = 0X1E, URN_EPC_TAG = 0X1F, URN_EPC_PAT = 0X20, URN_EPC_RAW = 0X21, URN_EPC = 0X22, URN_NFC = 0X23 } |
If you want encode an know URI you can use this define to avoid to encode the URI type as string. 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 | |
| RecordSMS (const std::string &number, const std::string &message) | |
| Build a sms record. | |
| virtual RecordType_t | get_type () const |
| Get the record type. | |
| const std::string & | get_number () const |
| Get recipient number. | |
| const std::string & | get_messagge () const |
| Get SMS text message. | |
| void | set_number (const std::string &number) |
| Change the recipent number. | |
| void | set_message (const std::string &message) |
| Change the message content. | |
| bool | operator== (const RecordSMS &other) const |
| Compare 2 objects. | |
| knowUriId_t | get_uri_id () const |
| Returns the URI type. | |
| virtual uint16_t | get_byte_length () |
| Number of bytes needed to store this record. | |
| std::string & | get_content () |
| Returns the URI content. | |
| void | set_content (const std::string &URI) |
| Change the URI content. | |
| 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. | |
| virtual uint16_t | write (uint8_t *buffer)=0 |
| Write the record content into a buffer. | |
Static Public Member Functions | |
| static RecordSMS * | parse (const RecordHeader &header, const uint8_t *buffer) |
| Read a recordSMS. | |
Protected Member Functions | |
| virtual void | update_content () |
| Generate the URI content that encodes the sms. | |
Detailed Description
Extend the RecordUri to handle the SMS content.
Definition at line 50 of file RecordSMS.h.
Member Enumeration Documentation
enum knowUriId_t [inherited] |
If you want encode an know URI you can use this define to avoid to encode the URI type as string.
- Enumerator:
Definition at line 67 of file RecordURI.h.
enum RecordType_t [inherited] |
Enum used to identify the record type.
- Enumerator:
Constructor & Destructor Documentation
| RecordSMS | ( | const std::string & | number, |
| const std::string & | message | ||
| ) |
Build a sms record.
- Parameters:
-
number Sms recipient phone number. message Message to send.
- Strings are copied inside the class.
Definition at line 47 of file RecordSMS.cpp.
Member Function Documentation
| virtual uint16_t get_byte_length | ( | ) | [virtual, inherited] |
Number of bytes needed to store this record.
- Returns:
- size of the header + size of the record content
Reimplemented from Record.
Definition at line 138 of file RecordURI.h.
| std::string& get_content | ( | ) | [inherited] |
| const RecordHeader& get_header | ( | ) | const [inherited] |
| const std::string& get_messagge | ( | ) | const |
| const std::string& get_number | ( | ) | const |
| virtual RecordType_t get_type | ( | ) | const [virtual] |
Get the record type.
- Returns:
- TYPE_URI_SMS
Reimplemented from RecordURI.
Definition at line 75 of file RecordSMS.h.
| knowUriId_t get_uri_id | ( | ) | const [inherited] |
Returns the URI type.
- Returns:
- URI type inside this record, UNKNOWN if unknown
Definition at line 134 of file RecordURI.h.
| bool is_first_record | ( | ) | const [inherited] |
| bool is_last_record | ( | ) | const [inherited] |
| bool is_middle_record | ( | ) | const [inherited] |
| bool operator== | ( | const RecordSMS & | other ) | const |
Compare 2 objects.
- Returns:
- true if the records have the same message and number.
Definition at line 117 of file RecordSMS.h.
| RecordSMS * parse | ( | const RecordHeader & | header, |
| const uint8_t * | buffer | ||
| ) | [static] |
Read a recordSMS.
- Parameters:
-
header Record header. buffer Buffer to read the data from.
- Returns:
- a RecordSMS type or NULL if it was not possible to build this record
- User is in charge of freeing the pointer returned by this function.
Reimplemented from RecordURI.
Definition at line 65 of file RecordSMS.cpp.
| void set_as_first_record | ( | ) | [inherited] |
| void set_as_last_record | ( | ) | [inherited] |
| void set_as_middle_record | ( | ) | [inherited] |
| void set_content | ( | const std::string & | URI ) | [inherited] |
| void set_message | ( | const std::string & | message ) |
Change the message content.
- Parameters:
-
message New message.
Definition at line 108 of file RecordSMS.h.
| void set_number | ( | const std::string & | number ) |
Change the recipent number.
- Parameters:
-
number New recipent number.
Definition at line 99 of file RecordSMS.h.
| void update_content | ( | ) | [protected, virtual] |
Generate the URI content that encodes the sms.
- See also:
- RecordUri::updateContent
Definition at line 51 of file RecordSMS.cpp.
| virtual uint16_t write | ( | uint8_t * | buffer ) | [pure virtual, inherited] |
Write the record content into a buffer.
- Parameters:
-
[out] buffer buffer to write the record content into, the buffer size must be almost Record#getByteLength bytes.
- Returns:
- number of written bytes
Implemented in EmptyRecord, RecordAAR, RecordMimeType, RecordText, RecordVCard, and RecordWifiConf.
Generated on Tue Jul 12 2022 14:14:49 by
1.7.2
