Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
The QAtResultParser class provides support for parsing the response to AT modem commands and unsolicited notifications. More...
#include <QAtResultParser>
The QAtResultParser class provides support for parsing the response to AT modem commands and unsolicited notifications.
The following example demonstrates how to parse the response to a AT+CPOL (preferred operator list) query:
QAtResultParser parser( result ); while ( parser.next( "+CPOL:" ) ) { uint index = parser.readNumeric(); uint format = parser.readNumeric(); QString name; if ( format == 2 ) // Numeric format. name = QString::number( parser.readNumeric() ); else // String format. name = parser.readString(); }
See also QAtResult.
Construct an AT modem result parser to parse the content of result. The caller will typically follow this with a call to next() to position the parser on the first line of relevant result data.
Construct an AT modem result parser and initialize it to parse the specified unsolicited notification. Notifications are expected to have the format NAME: VALUE. The next() function will be called internally to position the parser at VALUE.
Destruct this AT modem result parser.
Returns the full content of the line that next() positioned us on. The line's prefix is not included in the return value.
See also next(), readNumeric(), and readString().
Returns the content of all lines that begin with prefix starting at the current position.
See also next().
Position this AT modem result parser on the next line that begins with prefix. Returns true on success; otherwise returns false.
See also line(), lines(), readNumeric(), and readString().
Read a list of values surrounded by parentheses. This is for complex command results that cannot be parsed with readNumeric() and readString().
Read the next line of input as literal text, without looking for a prefix. This is for results from commands such as AT+CMGL which place the PDU on a line of its own.
Read a numeric value from the current line.
See also readString() and skip().
Read a string from the current line.
See also readNumeric() and skip().
Reset this AT modem result parser to the beginning of the content.
Skip the contents of a comma-separated field in the current line.
See also readNumeric() and readString().
Copyright © 2009 Trolltech | Trademarks | Qt Extended 4.4.3 |