summaryrefslogtreecommitdiffabout
path: root/gammu/emb/common/protocol
Side-by-side diff
Diffstat (limited to 'gammu/emb/common/protocol') (more/less context) (ignore whitespace changes)
-rw-r--r--gammu/emb/common/protocol/nokia/fbus2.c10
-rw-r--r--gammu/emb/common/protocol/nokia/fbus2.h9
-rw-r--r--gammu/emb/common/protocol/nokia/phonet.c9
-rw-r--r--gammu/emb/common/protocol/nokia/phonet.h9
4 files changed, 37 insertions, 0 deletions
diff --git a/gammu/emb/common/protocol/nokia/fbus2.c b/gammu/emb/common/protocol/nokia/fbus2.c
index 2b41f8b..967eaa4 100644
--- a/gammu/emb/common/protocol/nokia/fbus2.c
+++ b/gammu/emb/common/protocol/nokia/fbus2.c
@@ -1,30 +1,39 @@
/* (c) 2002-2003 by Marcin Wiacek */
/* 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
*/
+/* Due to a problem in the source code management, the names of some of
+ * the authors have unfortunately been lost. We do not mean to belittle
+ * their efforts and hope they will contact us to see their names
+ * properly added to the Copyright notice above.
+ * Having published their contributions under the terms of the GNU
+ * General Public License (GPL) [version 2], the Copyright of these
+ * authors will remain respected by adhering to the license they chose
+ * to publish their code under.
+ */
#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
@@ -124,48 +133,49 @@ static GSM_Error FBUS2_StateMachine(GSM_StateMachine *s, unsigned char rx_char)
/* This is not last byte in frame */
if (d->Msg.Count != d->Msg.Length+(d->Msg.Length%2)+2) return ERR_NONE;
/* Checksum is incorrect */
if (d->Msg.CheckSum[0] != d->Msg.CheckSum[1]) {
if (s->di.dl==DL_TEXT || s->di.dl==DL_TEXTALL || s->di.dl==DL_TEXTERROR ||
s->di.dl==DL_TEXTDATE || s->di.dl==DL_TEXTALLDATE || s->di.dl==DL_TEXTERRORDATE) {
smprintf(s,"[ERROR: checksum]\n");
}
free(d->Msg.Buffer);
d->Msg.Length = 0;
d->Msg.Buffer = NULL;
d->MsgRXState = RX_Sync;
return ERR_NONE;
}
seq_num = d->Msg.Buffer[d->Msg.Length-1];
if (d->Msg.Type == FBUS2_ACK_BYTE) {
if (s->di.dl==DL_TEXT || s->di.dl==DL_TEXTALL ||
s->di.dl==DL_TEXTDATE || s->di.dl==DL_TEXTALLDATE) {
smprintf(s, "[Received Ack of type %02x, seq %02x]\n",d->Msg.Buffer[0],seq_num);
}
+ free(d->Msg.Buffer);
d->MsgRXState = RX_Sync;
return ERR_NONE;
}
frm_num = d->Msg.Buffer[d->Msg.Length-2];
if ((seq_num & 0x40) == 0x40) {
d->FramesToGo = frm_num;
d->MultiMsg.Length = 0;
d->MultiMsg.Type = d->Msg.Type;
d->MultiMsg.Destination = d->Msg.Destination;
d->MultiMsg.Source = d->Msg.Source;
}
if ((seq_num & 0x40) != 0x40 && d->FramesToGo != frm_num) {
if (s->di.dl==DL_TEXT || s->di.dl==DL_TEXTALL || s->di.dl==DL_TEXTERROR ||
s->di.dl==DL_TEXTDATE || s->di.dl==DL_TEXTALLDATE || s->di.dl==DL_TEXTERRORDATE) {
smprintf(s, "[ERROR: Missed part of multiframe msg]\n");
}
free(d->Msg.Buffer);
d->Msg.Length = 0;
d->Msg.Buffer = NULL;
diff --git a/gammu/emb/common/protocol/nokia/fbus2.h b/gammu/emb/common/protocol/nokia/fbus2.h
index 8dbcb07..3d31006 100644
--- a/gammu/emb/common/protocol/nokia/fbus2.h
+++ b/gammu/emb/common/protocol/nokia/fbus2.h
@@ -1,30 +1,39 @@
/* (c) 2002-2003 by Marcin Wiacek */
/* 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
*/
+/* Due to a problem in the source code management, the names of some of
+ * the authors have unfortunately been lost. We do not mean to belittle
+ * their efforts and hope they will contact us to see their names
+ * properly added to the Copyright notice above.
+ * Having published their contributions under the terms of the GNU
+ * General Public License (GPL) [version 2], the Copyright of these
+ * authors will remain respected by adhering to the license they chose
+ * to publish their code under.
+ */
#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/phonet.c b/gammu/emb/common/protocol/nokia/phonet.c
index db5bd72..495a1bf 100644
--- a/gammu/emb/common/protocol/nokia/phonet.c
+++ b/gammu/emb/common/protocol/nokia/phonet.c
@@ -1,29 +1,38 @@
/* (c) 2002-2003 by Marcin Wiacek */
/* 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
*/
+/* Due to a problem in the source code management, the names of some of
+ * the authors have unfortunately been lost. We do not mean to belittle
+ * their efforts and hope they will contact us to see their names
+ * properly added to the Copyright notice above.
+ * Having published their contributions under the terms of the GNU
+ * General Public License (GPL) [version 2], the Copyright of these
+ * authors will remain respected by adhering to the license they chose
+ * to publish their code under.
+ */
#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 e750bbd..7626c23 100644
--- a/gammu/emb/common/protocol/nokia/phonet.h
+++ b/gammu/emb/common/protocol/nokia/phonet.h
@@ -1,29 +1,38 @@
/* (c) 2002-2003 by Marcin Wiacek */
/* 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
*/
+/* Due to a problem in the source code management, the names of some of
+ * the authors have unfortunately been lost. We do not mean to belittle
+ * their efforts and hope they will contact us to see their names
+ * properly added to the Copyright notice above.
+ * Having published their contributions under the terms of the GNU
+ * General Public License (GPL) [version 2], the Copyright of these
+ * authors will remain respected by adhering to the license they chose
+ * to publish their code under.
+ */
#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