summaryrefslogtreecommitdiffabout
path: root/gammu/emb/common/protocol
authorzautrix <zautrix>2004-10-05 11:13:51 (UTC)
committer zautrix <zautrix>2004-10-05 11:13:51 (UTC)
commit50ab40e1e02ad7c65c17a78d08116a808b1257aa (patch) (side-by-side diff)
tree0d1939e2297fa7bbd8e1f2030f154463854164c6 /gammu/emb/common/protocol
parentcf8616f64f20e5448d4ff644f7cc15750cf3f85f (diff)
downloadkdepimpi-50ab40e1e02ad7c65c17a78d08116a808b1257aa.zip
kdepimpi-50ab40e1e02ad7c65c17a78d08116a808b1257aa.tar.gz
kdepimpi-50ab40e1e02ad7c65c17a78d08116a808b1257aa.tar.bz2
updated to latest gammu version
Diffstat (limited to 'gammu/emb/common/protocol') (more/less context) (ignore whitespace changes)
-rw-r--r--gammu/emb/common/protocol/at/at.c6
-rw-r--r--gammu/emb/common/protocol/nokia/fbus2.c6
-rw-r--r--gammu/emb/common/protocol/nokia/fbus2.h6
-rw-r--r--gammu/emb/common/protocol/nokia/mbus2.c2
-rw-r--r--gammu/emb/common/protocol/nokia/mbus2.h2
-rw-r--r--gammu/emb/common/protocol/nokia/phonet.c5
-rw-r--r--gammu/emb/common/protocol/nokia/phonet.h5
7 files changed, 25 insertions, 7 deletions
diff --git a/gammu/emb/common/protocol/at/at.c b/gammu/emb/common/protocol/at/at.c
index f4a75b7..f8ddc06 100644
--- a/gammu/emb/common/protocol/at/at.c
+++ b/gammu/emb/common/protocol/at/at.c
@@ -45,56 +45,60 @@ typedef struct {
static GSM_Error AT_StateMachine(GSM_StateMachine *s, unsigned char rx_char)
{
GSM_Protocol_Message Msg2;
GSM_Protocol_ATData *d = &s->Protocol.Data.AT;
int i;
/* These are lines with end of "normal" answers */
static char *StartStrings[] = {
"OK" , "ERROR" ,
"+CME ERROR:" , "+CMS ERROR:" ,
"+CPIN: " , /*A2D issue*/
NULL};
/* Some info from phone can be inside "normal" answers
* It starts with strings written here
*/
static SpecialAnswersStruct SpecialAnswers[] = {
{"_OSIGQ:" ,1}, {"_OBS:" ,1},
{"^SCN:" ,1}, {"+CGREG:" ,1},
{"+CBM:" ,1}, {"+CMT:" ,2},
{"+CMTI:" ,1}, {"+CDS:" ,2},
- {"+CREG:" ,1},
+ {"+CREG:" ,1}, {"+CUSD" ,1},
{"RING" ,1}, {"NO CARRIER" ,1},
{"NO ANSWER" ,1}, {"+COLP" ,1},
{"+CLIP" ,1},
+ {"SDNDCRC =" ,1}, /* Samsung binary transfer end */
+
{NULL ,1}};
+//printf("%c",rx_char);
+
/* Ignore leading CR, LF and ESC */
if (d->Msg.Length == 0) {
if (rx_char == 10 || rx_char == 13 || rx_char == 27) return ERR_NONE;
d->LineStart = d->Msg.Length;
}
if (d->Msg.BufferUsed < d->Msg.Length + 2) {
d->Msg.BufferUsed = d->Msg.Length + 2;
d->Msg.Buffer = (unsigned char *)realloc(d->Msg.Buffer,d->Msg.BufferUsed);
}
d->Msg.Buffer[d->Msg.Length++] = rx_char;
d->Msg.Buffer[d->Msg.Length ] = 0;
switch (rx_char) {
case 0:
break;
case 10:
case 13:
if (!d->wascrlf) d->LineEnd = d->Msg.Length-1;
d->wascrlf = true;
if (d->Msg.Length > 0 && rx_char == 10 && d->Msg.Buffer[d->Msg.Length-2]==13) {
i = 0;
while (StartStrings[i] != NULL) {
if (strncmp(StartStrings[i],d->Msg.Buffer+d->LineStart,strlen(StartStrings[i])) == 0) {
diff --git a/gammu/emb/common/protocol/nokia/fbus2.c b/gammu/emb/common/protocol/nokia/fbus2.c
index 8b3e024..2b41f8b 100644
--- a/gammu/emb/common/protocol/nokia/fbus2.c
+++ b/gammu/emb/common/protocol/nokia/fbus2.c
@@ -1,26 +1,30 @@
/* (c) 2002-2003 by Marcin Wiacek */
-/* based on some work from Gnokii and MyGnokii */
+/* based on some work from MyGnokii (www.mwiacek.com) */
+/* Based on some work from Gnokii (www.gnokii.org)
+ * (C) 1999-2000 Hugh Blemings & Pavel Janik ml. (C) 2001-2004 Pawel Kot
+ * GNU GPL version 2 or later
+ */
#include "../../gsmstate.h"
#if defined(GSM_ENABLE_FBUS2) || defined(GSM_ENABLE_FBUS2IRDA) || defined(GSM_ENABLE_FBUS2DLR3) || defined(GSM_ENABLE_FBUS2BLUE) || defined(GSM_ENABLE_BLUEFBUS2) || defined(GSM_ENABLE_FBUS2DKU5) || defined(GSM_ENABLE_FBUS2PL2303)
#include <stdio.h>
#include <string.h>
#include "../../gsmcomon.h"
#include "fbus2.h"
static GSM_Error FBUS2_WriteFrame(GSM_StateMachine *s,
unsigned char *MsgBuffer,
int MsgLength,
unsigned char MsgType)
{
unsigned char buffer2[FBUS2_MAX_TRANSMIT_LENGTH + 10];
unsigned char checksum=0;
int i, len, sent;
buffer2[0] = FBUS2_FRAME_ID;
if (s->ConnectionType==GCT_FBUS2IRDA) buffer2[0] = FBUS2_IRDA_FRAME_ID;
buffer2[1] = FBUS2_DEVICE_PHONE; //destination
diff --git a/gammu/emb/common/protocol/nokia/fbus2.h b/gammu/emb/common/protocol/nokia/fbus2.h
index 5dd45d7..8dbcb07 100644
--- a/gammu/emb/common/protocol/nokia/fbus2.h
+++ b/gammu/emb/common/protocol/nokia/fbus2.h
@@ -1,26 +1,30 @@
/* (c) 2002-2003 by Marcin Wiacek */
-/* based on some work from Gnokii and MyGnokii */
+/* based on some work from MyGnokii (www.mwiacek.com) */
+/* Based on some work from Gnokii (www.gnokii.org)
+ * (C) 1999-2000 Hugh Blemings & Pavel Janik ml. (C) 2001-2004 Pawel Kot
+ * GNU GPL version 2 or later
+ */
#ifndef fbus2_h
#define fbus2_h
#include "../protocol.h"
#define FBUS2_FRAME_ID 0x1e
#define FBUS2_IRDA_FRAME_ID 0x1c
#define FBUS2_DEVICE_PHONE 0x00 /* Nokia mobile phone */
#define FBUS2_DEVICE_PC 0x0c /* Our PC */
#define FBUS2_ACK_BYTE 0x7f /* Acknowledge of the received frame */
#define FBUS2_MAX_TRANSMIT_LENGTH 120
typedef struct {
int MsgSequenceNumber;
int MsgRXState;
int FramesToGo;
GSM_Protocol_Message MultiMsg;
GSM_Protocol_Message Msg;
} GSM_Protocol_FBUS2Data;
#ifndef GSM_USED_SERIALDEVICE
# define GSM_USED_SERIALDEVICE
diff --git a/gammu/emb/common/protocol/nokia/mbus2.c b/gammu/emb/common/protocol/nokia/mbus2.c
index f07d6c5..8353b46 100644
--- a/gammu/emb/common/protocol/nokia/mbus2.c
+++ b/gammu/emb/common/protocol/nokia/mbus2.c
@@ -1,26 +1,26 @@
/* (c) 2001-2003 by Marcin Wiacek */
-/* based on some work from MyGnokii */
+/* based on some work from MyGnokii (www.mwiacek.com) */
#include "../../gsmstate.h"
#ifdef GSM_ENABLE_MBUS2
#include <stdio.h>
#include <string.h>
#include "../../gsmcomon.h"
#include "mbus2.h"
static GSM_Error MBUS2_WriteMessage (GSM_StateMachine *s,
unsigned char *MsgBuffer,
int MsgLength,
unsigned char MsgType)
{
unsigned char *buffer2, checksum = 0;
GSM_Protocol_MBUS2Data *d = &s->Protocol.Data.MBUS2;
int i, sent, len;
GSM_DumpMessageLevel3(s, MsgBuffer, MsgLength, MsgType);
buffer2 = (unsigned char *)malloc(MsgLength + 8);
diff --git a/gammu/emb/common/protocol/nokia/mbus2.h b/gammu/emb/common/protocol/nokia/mbus2.h
index 86fcab6..5dbd8cb 100644
--- a/gammu/emb/common/protocol/nokia/mbus2.h
+++ b/gammu/emb/common/protocol/nokia/mbus2.h
@@ -1,26 +1,26 @@
/* (c) 2001-2003 by Marcin Wiacek */
-/* based on some work from MyGnokii */
+/* based on some work from MyGnokii (www.mwiacek.com) */
#ifndef mbus2_h
#define mbus2_h
#include "../protocol.h"
#define MBUS2_FRAME_ID 0x1f
#define MBUS2_DEVICE_PHONE 0x00 /* Nokia mobile phone */
#define MBUS2_DEVICE_PC 0x10 /* Our PC (MBUS) */
#define MBUS2_ACK_BYTE 0x7f /* Acknowledge of the received frame */
typedef struct {
int MsgSequenceNumber;
int MsgRXState;
GSM_Protocol_Message Msg;
} GSM_Protocol_MBUS2Data;
#ifndef GSM_USED_SERIALDEVICE
# define GSM_USED_SERIALDEVICE
#endif
#endif
/* How should editor hadle tabs in this file? Add editor commands here.
diff --git a/gammu/emb/common/protocol/nokia/phonet.c b/gammu/emb/common/protocol/nokia/phonet.c
index bc5717d..db5bd72 100644
--- a/gammu/emb/common/protocol/nokia/phonet.c
+++ b/gammu/emb/common/protocol/nokia/phonet.c
@@ -1,26 +1,29 @@
/* (c) 2002-2003 by Marcin Wiacek */
-/* based on some work from Gnokii */
+/* Based on some work from Gnokii (www.gnokii.org)
+ * (C) 1999-2000 Hugh Blemings & Pavel Janik ml. (C) 2001-2004 Pawel Kot
+ * GNU GPL version 2 or later
+ */
#include "../../gsmstate.h"
#if defined(GSM_ENABLE_IRDA) || defined(GSM_ENABLE_PHONETBLUE) || defined(GSM_ENABLE_BLUEPHONET)
#include <stdio.h>
#include <string.h>
#include "../../gsmcomon.h"
#include "phonet.h"
static GSM_Error PHONET_WriteMessage (GSM_StateMachine *s,
unsigned char *MsgBuffer,
int MsgLength,
unsigned char MsgType)
{
unsigned char *buffer2;
int sent;
GSM_DumpMessageLevel3(s, MsgBuffer, MsgLength, MsgType);
buffer2 = (unsigned char *)malloc(MsgLength + 6);
buffer2[0] = PHONET_FRAME_ID,
diff --git a/gammu/emb/common/protocol/nokia/phonet.h b/gammu/emb/common/protocol/nokia/phonet.h
index 2f6e836..e750bbd 100644
--- a/gammu/emb/common/protocol/nokia/phonet.h
+++ b/gammu/emb/common/protocol/nokia/phonet.h
@@ -1,26 +1,29 @@
/* (c) 2002-2003 by Marcin Wiacek */
-/* based on some work from Gnokii */
+/* Based on some work from Gnokii (www.gnokii.org)
+ * (C) 1999-2000 Hugh Blemings & Pavel Janik ml. (C) 2001-2004 Pawel Kot
+ * GNU GPL version 2 or later
+ */
#ifndef PHONET_h
#define PHONET_h
#include "../protocol.h"
#define PHONET_FRAME_ID 0x14
#define PHONET_BLUE_FRAME_ID 0x19
#define PHONET_DEVICE_PHONE 0x00 /* Nokia mobile phone */
#define PHONET_DEVICE_PC 0x0c /* Our PC */
#define PHONET_BLUE_DEVICE_PC 0x10 /* Our PC */
typedef struct {
int MsgRXState;
GSM_Protocol_Message Msg;
} GSM_Protocol_PHONETData;
#if defined(GSM_ENABLE_IRDAPHONET)
# ifndef GSM_USED_IRDADEVICE
# define GSM_USED_IRDADEVICE
# endif
#endif
#if defined(GSM_ENABLE_BLUEPHONET)
# ifndef GSM_USED_BLUETOOTHDEVICE