3 #include "../../gsmstate.h" 5 #if defined(GSM_ENABLE_AT) || defined(GSM_ENABLE_BLUEAT) || defined(GSM_ENABLE_IRDAAT) || defined(GSM_ENABLE_DKU2AT) 11 #include "../../gsmcomon.h" 17 int sent=0, write_data=0, i=0;
23 while (sent != length) {
26 if (write_data == 0 || write_data < 0) {
32 for (i = 0; i < length; i++) {
38 if (write_data != 1) {
52 } SpecialAnswersStruct;
61 static const char *StatusStrings[] = {
78 "COMMAND NOT SUPPORT",
85 static const SpecialAnswersStruct SpecialAnswers[] = {
103 {
"NO CARRIER" ,1,
ID_All},
118 {
"SAMSUNG PTS DG Test", 1,
ID_All},
121 {
"NOT FOND ^,NOT CUSTOM AT", 1,
ID_All},
132 {
"^DSFLOWRPT:" ,1,
ID_All},
149 if (rx_char == 10 || rx_char == 13 || rx_char == 27) {
183 for (i = 0; StatusStrings[i] != NULL; i++) {
184 if (strncmp(StatusStrings[i],
186 strlen(StatusStrings[i])) == 0) {
195 if (strncmp(
"+CPIN: ",
206 for (i = 0; SpecialAnswers[i].text != NULL; i++) {
207 if (strncmp(SpecialAnswers[i].text,
209 strlen(SpecialAnswers[i].text)) == 0) {
216 strcmp(SpecialAnswers[i].text,
"NO CARRIER") == 0) {
321 if (error !=
ERR_NONE)
return error;
324 if (error !=
ERR_NONE)
return error;
void GSM_DumpMessageBinary(GSM_StateMachine *s, unsigned const char *message, size_t messagesize, int type)
GSM_Error(* DeviceSetDtrRts)(GSM_StateMachine *s, gboolean dtr, gboolean rts)
struct GSM_Protocol::@1 Data
GSM_Error(* DeviceSetParity)(GSM_StateMachine *s, gboolean parity)
GSM_ConnectionType ConnectionType
GSM_Error AT_StateMachine(GSM_StateMachine *s, unsigned char rx_char)
int(* WriteDevice)(GSM_StateMachine *s, const void *buf, size_t nbytes)
GSM_Error AT_Initialise(GSM_StateMachine *s)
GSM_Phone_RequestID RequestID
GSM_Device_Functions * Functions
size_t SpecialAnswerStart
GSM_Phone_Functions * Functions
GSM_Error(* DispatchMessage)(GSM_StateMachine *s)
size_t SpecialAnswerLines
GSM_Protocol_Message * RequestMsg
GSM_Error(* DeviceSetSpeed)(GSM_StateMachine *s, int speed)
void GSM_DumpMessageText(GSM_StateMachine *s, unsigned const char *message, size_t messagesize, int type)