|
enum | GSM_AT_SMS_Modes { SMS_AT_PDU = 1,
SMS_AT_TXT
} |
|
enum | GSM_AT_Reply_State {
AT_Reply_OK = 1,
AT_Reply_Connect,
AT_Reply_Error,
AT_Reply_Unknown,
AT_Reply_CMSError,
AT_Reply_CMEError,
AT_Reply_SMSEdit
} |
|
enum | GSM_AT_Manufacturer {
AT_Nokia = 1,
AT_Alcatel,
AT_Siemens,
AT_HP,
AT_Falcom,
AT_Ericsson,
AT_Sagem,
AT_Samsung,
AT_Mitsubishi,
AT_Sharp,
AT_Option,
AT_Motorola,
AT_Wavecom,
AT_Philips,
AT_Huawei,
AT_Qualcomm,
AT_ZTE,
AT_Unknown
} |
|
enum | GSM_AT_Charset {
AT_CHARSET_HEX = 1,
AT_CHARSET_GSM,
AT_CHARSET_UCS2,
AT_CHARSET_UCS_2,
AT_CHARSET_UTF8,
AT_CHARSET_UTF_8,
AT_CHARSET_PCCP437,
AT_CHARSET_IRA,
AT_CHARSET_ASCII,
AT_CHARSET_ISO88591,
AT_CHARSET_ISO88592,
AT_CHARSET_ISO88593,
AT_CHARSET_ISO88594,
AT_CHARSET_ISO88595,
AT_CHARSET_ISO88596
} |
|
enum | GSM_AT_Charset_Preference {
AT_PREF_CHARSET_NORMAL = 1,
AT_PREF_CHARSET_UNICODE,
AT_PREF_CHARSET_IRA,
AT_PREF_CHARSET_GSM,
AT_PREF_CHARSET_RESET
} |
|
enum | GSM_AT_Feature { AT_AVAILABLE = 1,
AT_NOTAVAILABLE
} |
|
enum | GSM_SamsungCalendar { SAMSUNG_NONE = 1,
SAMSUNG_ORG,
SAMSUNG_SSH
} |
|
enum | GSM_AT_NeededMemoryInfo {
AT_Status,
AT_NextEmpty,
AT_Total,
AT_First,
AT_Sizes
} |
|
|
GSM_Error | ATGEN_HandleCMSError (GSM_StateMachine *s) |
|
GSM_Error | ATGEN_HandleCMEError (GSM_StateMachine *s) |
|
GSM_Error | ATGEN_DispatchMessage (GSM_StateMachine *s) |
|
GSM_Error | ATGEN_WaitFor (GSM_StateMachine *s, const char *cmd, size_t len, int type, int time, GSM_Phone_RequestID request) |
|
GSM_Error | ATGEN_ParseReply (GSM_StateMachine *s, const unsigned char *input, const char *format,...) |
|
GSM_Error | ATGEN_EncodeText (GSM_StateMachine *s, const unsigned char *input, const size_t inlength, unsigned char *output, const size_t outlength, size_t *resultlength) |
|
GSM_Error | ATGEN_DecodeText (GSM_StateMachine *s, const unsigned char *input, const size_t length, unsigned char *output, const size_t outlength, const gboolean guess, const gboolean phone) |
|
GSM_Error | ATGEN_SetCharset (GSM_StateMachine *s, GSM_AT_Charset_Preference Prefer) |
|
int | ATGEN_ExtractOneParameter (unsigned char *input, unsigned char *output) |
|
GSM_Error | ATGEN_DecodeDateTime (GSM_StateMachine *s, GSM_DateTime *dt, unsigned char *_input) |
|
#define | _GNU_SOURCE |
|
#define | _GNU_SOURCE |
|
This module implements standard AT commands.
- See also
- http://www.etsi.org
-
http://www.3gpp.org
§ _GNU_SOURCE [1/2]
§ _GNU_SOURCE [2/2]
§ AT_PBK_MAX_MEMORIES
#define AT_PBK_MAX_MEMORIES 200 |
Maximal length of phonebook memories list.
Definition at line 233 of file atgen.h.
§ ATGEN_WaitForAutoLen
#define ATGEN_WaitForAutoLen |
( |
|
s, |
|
|
|
cmd, |
|
|
|
type, |
|
|
|
time, |
|
|
|
request |
|
) |
| ATGEN_WaitFor(s, cmd, strlen(cmd), type, time, request) |
§ GSM_AT_MAXPDULEN
#define GSM_AT_MAXPDULEN 400 |
Maximal length of PDU cache line. It has to be at least 160 * 2 (message can be 160 bytes and hex representation needs twice more space).
Definition at line 210 of file atgen.h.
§ GSM_USED_AT
§ GSM_USED_BLUEAT
§ GSM_USED_IRDAAT
§ MAX_VCALENDAR_LOCATION
#define MAX_VCALENDAR_LOCATION 50 |
§ GSM_AT_Charset
Character set definitions.
Enumerator |
---|
AT_CHARSET_HEX | Hex encoded GSM.
|
AT_CHARSET_GSM | GSM charset.
|
AT_CHARSET_UCS2 | Hex encoded UCS2.
|
AT_CHARSET_UCS_2 | Hex encoded UCS2.
|
AT_CHARSET_UTF8 | UTF-8.
|
AT_CHARSET_UTF_8 | UTF-8.
|
AT_CHARSET_PCCP437 | CP-437, not fully supported.
|
AT_CHARSET_IRA | IRA, what is same as 7-bit ASCII.
|
AT_CHARSET_ASCII | 7-bit ASCII.
|
AT_CHARSET_ISO88591 | ISO-8859-1, supported only with iconv.
|
AT_CHARSET_ISO88592 | ISO-8859-2, supported only with iconv.
|
AT_CHARSET_ISO88593 | ISO-8859-3, supported only with iconv.
|
AT_CHARSET_ISO88594 | ISO-8859-4, supported only with iconv.
|
AT_CHARSET_ISO88595 | ISO-8859-5, supported only with iconv.
|
AT_CHARSET_ISO88596 | ISO-8859-6, supported only with iconv.
|
Definition at line 90 of file atgen.h.
§ GSM_AT_Charset_Preference
Character set preference indication.
Enumerator |
---|
AT_PREF_CHARSET_NORMAL | Prefer standard GSM character set.
|
AT_PREF_CHARSET_UNICODE | Prefer Unicode character set to get text without any possible garbling caused by conversion.
|
AT_PREF_CHARSET_IRA | IRA is ASCII character set. This might be useful for some operations where we only want to transmit ASCII characters and we don't want to take care about encoding or encoding of some transmitted characters is not possible to GSM.
|
AT_PREF_CHARSET_GSM | For some operations, using standard GSM charset is best as it avoids problems with various broken phones and we don't need full charset anyway.
|
AT_PREF_CHARSET_RESET | This option just sets again charset in phone. Useful after something what resets this information in phone.
|
Definition at line 156 of file atgen.h.
GSM_AT_Charset_Preference
§ GSM_AT_Feature
Enumerator |
---|
AT_AVAILABLE | |
AT_NOTAVAILABLE | |
Definition at line 186 of file atgen.h.
§ GSM_AT_Manufacturer
Manufacturer identification. This is usually used to enable some hacks which are specific for all phones from one manufacturer.
Enumerator |
---|
AT_Nokia | |
AT_Alcatel | |
AT_Siemens | |
AT_HP | |
AT_Falcom | |
AT_Ericsson | |
AT_Sagem | |
AT_Samsung | |
AT_Mitsubishi | |
AT_Sharp | |
AT_Option | |
AT_Motorola | |
AT_Wavecom | |
AT_Philips | |
AT_Huawei | |
AT_Qualcomm | |
AT_ZTE | |
AT_Unknown | |
Definition at line 66 of file atgen.h.
§ GSM_AT_NeededMemoryInfo
Enumerator |
---|
AT_Status | |
AT_NextEmpty | |
AT_Total | |
AT_First | |
AT_Sizes | |
Definition at line 197 of file atgen.h.
§ GSM_AT_Reply_State
Enumerator |
---|
AT_Reply_OK | |
AT_Reply_Connect | |
AT_Reply_Error | |
AT_Reply_Unknown | |
AT_Reply_CMSError | |
AT_Reply_CMEError | |
AT_Reply_SMSEdit | |
Definition at line 52 of file atgen.h.
§ GSM_AT_SMS_Modes
Enumerator |
---|
SMS_AT_PDU | |
SMS_AT_TXT | |
Definition at line 47 of file atgen.h.
§ GSM_SamsungCalendar
Enumerator |
---|
SAMSUNG_NONE | |
SAMSUNG_ORG | |
SAMSUNG_SSH | |
Definition at line 191 of file atgen.h.
§ ATGEN_DecodeDateTime()
This function parses datetime strings in the format: [YY[YY]/MM/DD,]hh:mm[:ss[+TZ]] , [] enclosed parts are optional (or the same hex/unicode encoded).
- Todo:
- Too many static buffers are used here.
§ ATGEN_DecodeText()
Decodes text from phone encoding to internal representation.
- Parameters
-
s | State machine structure. |
input | Input string. |
length | Length of string to convert. |
output | Storage for converted text. |
outlength | Size of output storage. |
guess | Allow guessing whether input is really encoded. |
phone | Whether input is phone number, used only when guessing. |
- Returns
- Error code.
§ ATGEN_DispatchMessage()
§ ATGEN_EncodeText()
GSM_Error ATGEN_EncodeText |
( |
GSM_StateMachine * |
s, |
|
|
const unsigned char * |
input, |
|
|
const size_t |
inlength, |
|
|
unsigned char * |
output, |
|
|
const size_t |
outlength, |
|
|
size_t * |
resultlength |
|
) |
| |
Encodes text to current phone charset.
- Parameters
-
s | State machine structure. |
input | Input string. |
inlength | Length of string to convert. |
output | Storage for converted text. |
outlength | Size of output storage. |
resultlength | Lengt of output text will be stored here. |
- Returns
- Error code.
§ ATGEN_ExtractOneParameter()
int ATGEN_ExtractOneParameter |
( |
unsigned char * |
input, |
|
|
unsigned char * |
output |
|
) |
| |
§ ATGEN_HandleCMEError()
Generates error code from current CME error according to specifications.
- Parameters
-
s | State machine structure. |
§ ATGEN_HandleCMSError()
Generates error code from current CMS error according to specifications.
- Parameters
-
s | State machine structure. |
§ ATGEN_ParseReply()
Parses AT formatted reply. This is a bit like sprintf parser, but specially focused on AT replies and can automatically convert text encoding and decode some special fields.
- Parser tokens:
- @i - Number, expects pointer to int.
- @n - Quoted number, expects pointer to int.
- @I - Optional number (string can be empty), expects pointer to int.
- @l - Number, expects pointer to long int.
- @s - String, will be converted from phone encoding, stripping quotes, expects pointer to unsigned char and size of storage. Encoding is somehow guessed.
- @u - String in utf-8, expects pointer to unsigned char and size of storage.
- @t - String with length as first element (eg. "5,test1"), will be converted from phone encoding, stripping quotes, expects pointer to unsigned char and size of storage. Encoding is somehow guessed.
- @T - String with length as first element (eg. "5,test1"), same as @t, just with utf-8 encoding.
- @e - String, will be converted from phone encoding, stripping quotes, expects pointer to unsigned char and size of storage. No encoding guessing.
- @S - String with Samsung specials (0x02 at beginning and 0x03 at the end, encoded in utf-8), otherwise same as @s.
- @p - String with phone number hint for heuristics, otherwise same as @s.
- @r - Raw string, no conversion will be done, only stripped quotes, expects pointer to char and size of storage.
- @d - Date, expects pointer to GSM_DateTime.
- @@ - @ literal.
- @0 - Ignore rest of input, same as .* regular expression.
- Special behaviour:
- Any space is automatically treated as [[:space:]]* regular expression. So use space whenever some weird implementation in phone can insert it space.
- Parameters
-
s | State machine structure. |
input | Input string to parse. |
format | Format string for parser. |
... | Pointers to various buffers as defined by format string. |
§ ATGEN_SetCharset()
Sets charset in phone according to preference.
- Parameters
-
s | State machine structure. |
Prefer | What charset setting is prefered. |
- Returns
- Error code.
§ ATGEN_WaitFor()
Wrapper around GSM_WaitFor, which automatically sets correct Motorola mode. It accepts same parameters as GSM_WaitFor.