Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

QAtUtils Class Reference
[QtBaseModule]

The QAtUtils class provides several utility functions that assist with interfacing to AT-based modems. More...

    #include <QAtUtils>

Static Public Members


Detailed Description

The QAtUtils class provides several utility functions that assist with interfacing to AT-based modems.


Member Function Documentation

QTextCodec * QAtUtils::codec ( const QString & gsmCharset )   [static]

Returns the text codec for the GSM character set identifier gsmCharset. The returned object should not be deleted.

The following standard GSM character sets from 3GPP TS 27.007 are recognized:

GSM7-bit default GSM alphabet. There may be some loss of information where multiple Unicode characters map to the same 7-bit encoding.
HEXHex encoding of the 7-bit default GSM alphabet.
UCS2Hex encoding of UCS-2.
IRAInternational reference alphabet (i.e. ASCII).
PCCPxxxPC character set code page xxx. Code pages 437 and 850 are guaranteed to be supported. Other code pages depend upon the codecs installed with QTextCodec.
PCDNPC Danish/Norwegian character set (same as PCCP850).
UTF-88-bit encoding of Unicode.
8859-nISO 8859 Latin-n character set.
8859-CISO 8859 Latin/Cyrillic character set (same as 8859-5).
8859-AISO 8859 Latin/Arabic character set (same as 8859-6).
8859-GISO 8859 Latin/Greek character set (same as 8859-7).
8859-HISO 8859 Latin/Hebrew character set (same as 8859-8).

This implementation also supports the following character sets, beyond those mandated by 3GPP TS 27.007:

gsm-noloss7-bit default GSM alphabet, with no loss of information.
xxxAny codec xxx that is supported by QTextCodec::codecForName().

See also QTextCodec and QGsmCodec.

QString QAtUtils::decode ( const QString & str, QTextCodec * codec )   [static]

Decode str according to codec. The string is assumed to have been retrieved from an AT modem using the facilities in QAtChat and QAtResultParser.

QString QAtUtils::decodeNumber ( const QString & value, uint type )   [static]

Decode a phone number from value and type. The type is a type of address octet, usually 145 for international numbers and 129 for local numbers. The return will normalize the value to include the + prefix for international numbers.

See also encodeNumber().

QString QAtUtils::decodeNumber ( QAtResultParser & parser )   [static]

This is an overloaded member function, provided for convenience.

Read a string field and a numeric field from parser and then decode them into a properly normalized phone number.

See also encodeNumber().

QString QAtUtils::decodeString ( const QString & value, uint dcs )   [static]

Decodes value according to the cell broadcast data coding scheme dcs. The value is assumed to have been parsed by nextString() and be compliant with section 5 of 3GPP TS 23.038.

This function was introduced in Qtopia 4.3.3.

See also nextString().

QString QAtUtils::encodeNumber ( const QString & value, bool keepPlus = false )   [static]

Encode the phone number in value into a string plus a type of address octet. International numbers that start with + become "number",145, and local numbers become "number",129. If keepPlus is true, then the + will be left on the resulting number, even if the type is 145.

See also decodeNumber().

QByteArray QAtUtils::fromHex ( const QString & hex )   [static]

Convert a hexadecimal string, hex, into a byte array.

See also toHex().

QString QAtUtils::nextString ( const QString & buf, uint & posn )   [static]

Extract the next quoted string from buf, starting at posn.

See also parseNumber() and skipField().

bool QAtUtils::octalEscapes ()   [static]

Returns true if nextString() should parse backslash escape sequences in octal rather than the default of hexadecimal; otherwise returns false.

See also setOctalEscapes().

uint QAtUtils::parseNumber ( const QString & str, uint & posn )   [static]

Utility function for parsing a number from position posn in str.

See also nextString() and skipField().

QString QAtUtils::quote ( const QString & str )   [static]

Quote str so that it is suitable to be sent as an AT command argument. The caller will need to add double quotes to the start and end of the return value to complete the AT command argument.

QString QAtUtils::quote ( const QString & str, QTextCodec * codec )   [static]

This is an overloaded member function, provided for convenience.

Quote str so that it is suitable to be sent as an AT command argument and use codec to encode the string. The caller will need to add double quotes to the start and end of the return value to complete the AT command argument.

void QAtUtils::setOctalEscapes ( bool value )   [static]

Indicate that nextString() should parse backslash escape sequences in octal if value is true, rather than the default of hexadecimal (value is false).

See also octalEscapes().

void QAtUtils::skipField ( const QString & str, uint & posn )   [static]

Utility function for skipping a comma-delimited field starting at posn within str.

See also nextString() and parseNumber().

QString QAtUtils::stripNumber ( const QString & number )   [static]

Strip non-digit characters from number and normalize special characters. The digit and special characters are normalized as follows:

InputNormalizedMeaning
0..90..9Numeric dialing digits
ABCDABCDAlphabetic dialing digits
abcdABCDAlphabetic dialing digits
,pPxX,Short pause or extension separator
wWWWait for dial tone
!!Hook flash
@@Wait for silence

All other characters are stripped from number.

See also QPhoneNumber::resolveLetters().

QString QAtUtils::toHex ( const QByteArray & binary )   [static]

Convert the byte array, binary, into a hexadecimal string.

See also fromHex().


Copyright © 2009 Nokia Trademarks
Qt Extended 4.4.3