-rw-r--r-- | gammu/emb/common/protocol/nokia/fbus2.c | 10 | ||||
-rw-r--r-- | gammu/emb/common/protocol/nokia/fbus2.h | 9 | ||||
-rw-r--r-- | gammu/emb/common/protocol/nokia/phonet.c | 9 | ||||
-rw-r--r-- | gammu/emb/common/protocol/nokia/phonet.h | 9 |
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,18 +1,27 @@ | |||
1 | /* (c) 2002-2003 by Marcin Wiacek */ | 1 | /* (c) 2002-2003 by Marcin Wiacek */ |
2 | /* based on some work from MyGnokii (www.mwiacek.com) */ | 2 | /* based on some work from MyGnokii (www.mwiacek.com) */ |
3 | /* Based on some work from Gnokii (www.gnokii.org) | 3 | /* Based on some work from Gnokii (www.gnokii.org) |
4 | * (C) 1999-2000 Hugh Blemings & Pavel Janik ml. (C) 2001-2004 Pawel Kot | 4 | * (C) 1999-2000 Hugh Blemings & Pavel Janik ml. (C) 2001-2004 Pawel Kot |
5 | * GNU GPL version 2 or later | 5 | * GNU GPL version 2 or later |
6 | */ | 6 | */ |
7 | /* Due to a problem in the source code management, the names of some of | ||
8 | * the authors have unfortunately been lost. We do not mean to belittle | ||
9 | * their efforts and hope they will contact us to see their names | ||
10 | * properly added to the Copyright notice above. | ||
11 | * Having published their contributions under the terms of the GNU | ||
12 | * General Public License (GPL) [version 2], the Copyright of these | ||
13 | * authors will remain respected by adhering to the license they chose | ||
14 | * to publish their code under. | ||
15 | */ | ||
7 | 16 | ||
8 | #include "../../gsmstate.h" | 17 | #include "../../gsmstate.h" |
9 | 18 | ||
10 | #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) | 19 | #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) |
11 | 20 | ||
12 | #include <stdio.h> | 21 | #include <stdio.h> |
13 | #include <string.h> | 22 | #include <string.h> |
14 | 23 | ||
15 | #include "../../gsmcomon.h" | 24 | #include "../../gsmcomon.h" |
16 | #include "fbus2.h" | 25 | #include "fbus2.h" |
17 | 26 | ||
18 | static GSM_Error FBUS2_WriteFrame(GSM_StateMachine *s, | 27 | static GSM_Error FBUS2_WriteFrame(GSM_StateMachine *s, |
@@ -136,24 +145,25 @@ static GSM_Error FBUS2_StateMachine(GSM_StateMachine *s, unsigned char rx_char) | |||
136 | 145 | ||
137 | d->MsgRXState = RX_Sync; | 146 | d->MsgRXState = RX_Sync; |
138 | return ERR_NONE; | 147 | return ERR_NONE; |
139 | } | 148 | } |
140 | 149 | ||
141 | seq_num = d->Msg.Buffer[d->Msg.Length-1]; | 150 | seq_num = d->Msg.Buffer[d->Msg.Length-1]; |
142 | 151 | ||
143 | if (d->Msg.Type == FBUS2_ACK_BYTE) { | 152 | if (d->Msg.Type == FBUS2_ACK_BYTE) { |
144 | if (s->di.dl==DL_TEXT || s->di.dl==DL_TEXTALL || | 153 | if (s->di.dl==DL_TEXT || s->di.dl==DL_TEXTALL || |
145 | s->di.dl==DL_TEXTDATE || s->di.dl==DL_TEXTALLDATE) { | 154 | s->di.dl==DL_TEXTDATE || s->di.dl==DL_TEXTALLDATE) { |
146 | smprintf(s, "[Received Ack of type %02x, seq %02x]\n",d->Msg.Buffer[0],seq_num); | 155 | smprintf(s, "[Received Ack of type %02x, seq %02x]\n",d->Msg.Buffer[0],seq_num); |
147 | } | 156 | } |
157 | free(d->Msg.Buffer); | ||
148 | 158 | ||
149 | d->MsgRXState = RX_Sync; | 159 | d->MsgRXState = RX_Sync; |
150 | return ERR_NONE; | 160 | return ERR_NONE; |
151 | } | 161 | } |
152 | 162 | ||
153 | frm_num = d->Msg.Buffer[d->Msg.Length-2]; | 163 | frm_num = d->Msg.Buffer[d->Msg.Length-2]; |
154 | 164 | ||
155 | if ((seq_num & 0x40) == 0x40) { | 165 | if ((seq_num & 0x40) == 0x40) { |
156 | d->FramesToGo = frm_num; | 166 | d->FramesToGo = frm_num; |
157 | d->MultiMsg.Length= 0; | 167 | d->MultiMsg.Length= 0; |
158 | d->MultiMsg.Type= d->Msg.Type; | 168 | d->MultiMsg.Type= d->Msg.Type; |
159 | d->MultiMsg.Destination= d->Msg.Destination; | 169 | d->MultiMsg.Destination= d->Msg.Destination; |
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,18 +1,27 @@ | |||
1 | /* (c) 2002-2003 by Marcin Wiacek */ | 1 | /* (c) 2002-2003 by Marcin Wiacek */ |
2 | /* based on some work from MyGnokii (www.mwiacek.com) */ | 2 | /* based on some work from MyGnokii (www.mwiacek.com) */ |
3 | /* Based on some work from Gnokii (www.gnokii.org) | 3 | /* Based on some work from Gnokii (www.gnokii.org) |
4 | * (C) 1999-2000 Hugh Blemings & Pavel Janik ml. (C) 2001-2004 Pawel Kot | 4 | * (C) 1999-2000 Hugh Blemings & Pavel Janik ml. (C) 2001-2004 Pawel Kot |
5 | * GNU GPL version 2 or later | 5 | * GNU GPL version 2 or later |
6 | */ | 6 | */ |
7 | /* Due to a problem in the source code management, the names of some of | ||
8 | * the authors have unfortunately been lost. We do not mean to belittle | ||
9 | * their efforts and hope they will contact us to see their names | ||
10 | * properly added to the Copyright notice above. | ||
11 | * Having published their contributions under the terms of the GNU | ||
12 | * General Public License (GPL) [version 2], the Copyright of these | ||
13 | * authors will remain respected by adhering to the license they chose | ||
14 | * to publish their code under. | ||
15 | */ | ||
7 | 16 | ||
8 | #ifndef fbus2_h | 17 | #ifndef fbus2_h |
9 | #define fbus2_h | 18 | #define fbus2_h |
10 | 19 | ||
11 | #include "../protocol.h" | 20 | #include "../protocol.h" |
12 | 21 | ||
13 | #define FBUS2_FRAME_ID 0x1e | 22 | #define FBUS2_FRAME_ID 0x1e |
14 | #define FBUS2_IRDA_FRAME_ID 0x1c | 23 | #define FBUS2_IRDA_FRAME_ID 0x1c |
15 | #define FBUS2_DEVICE_PHONE 0x00 /* Nokia mobile phone */ | 24 | #define FBUS2_DEVICE_PHONE 0x00 /* Nokia mobile phone */ |
16 | #define FBUS2_DEVICE_PC 0x0c /* Our PC */ | 25 | #define FBUS2_DEVICE_PC 0x0c /* Our PC */ |
17 | #define FBUS2_ACK_BYTE 0x7f /* Acknowledge of the received frame */ | 26 | #define FBUS2_ACK_BYTE 0x7f /* Acknowledge of the received frame */ |
18 | 27 | ||
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,17 +1,26 @@ | |||
1 | /* (c) 2002-2003 by Marcin Wiacek */ | 1 | /* (c) 2002-2003 by Marcin Wiacek */ |
2 | /* Based on some work from Gnokii (www.gnokii.org) | 2 | /* Based on some work from Gnokii (www.gnokii.org) |
3 | * (C) 1999-2000 Hugh Blemings & Pavel Janik ml. (C) 2001-2004 Pawel Kot | 3 | * (C) 1999-2000 Hugh Blemings & Pavel Janik ml. (C) 2001-2004 Pawel Kot |
4 | * GNU GPL version 2 or later | 4 | * GNU GPL version 2 or later |
5 | */ | 5 | */ |
6 | /* Due to a problem in the source code management, the names of some of | ||
7 | * the authors have unfortunately been lost. We do not mean to belittle | ||
8 | * their efforts and hope they will contact us to see their names | ||
9 | * properly added to the Copyright notice above. | ||
10 | * Having published their contributions under the terms of the GNU | ||
11 | * General Public License (GPL) [version 2], the Copyright of these | ||
12 | * authors will remain respected by adhering to the license they chose | ||
13 | * to publish their code under. | ||
14 | */ | ||
6 | 15 | ||
7 | #include "../../gsmstate.h" | 16 | #include "../../gsmstate.h" |
8 | 17 | ||
9 | #if defined(GSM_ENABLE_IRDA) || defined(GSM_ENABLE_PHONETBLUE) || defined(GSM_ENABLE_BLUEPHONET) | 18 | #if defined(GSM_ENABLE_IRDA) || defined(GSM_ENABLE_PHONETBLUE) || defined(GSM_ENABLE_BLUEPHONET) |
10 | 19 | ||
11 | #include <stdio.h> | 20 | #include <stdio.h> |
12 | #include <string.h> | 21 | #include <string.h> |
13 | 22 | ||
14 | #include "../../gsmcomon.h" | 23 | #include "../../gsmcomon.h" |
15 | #include "phonet.h" | 24 | #include "phonet.h" |
16 | 25 | ||
17 | static GSM_Error PHONET_WriteMessage (GSM_StateMachine *s, | 26 | static GSM_Error PHONET_WriteMessage (GSM_StateMachine *s, |
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,17 +1,26 @@ | |||
1 | /* (c) 2002-2003 by Marcin Wiacek */ | 1 | /* (c) 2002-2003 by Marcin Wiacek */ |
2 | /* Based on some work from Gnokii (www.gnokii.org) | 2 | /* Based on some work from Gnokii (www.gnokii.org) |
3 | * (C) 1999-2000 Hugh Blemings & Pavel Janik ml. (C) 2001-2004 Pawel Kot | 3 | * (C) 1999-2000 Hugh Blemings & Pavel Janik ml. (C) 2001-2004 Pawel Kot |
4 | * GNU GPL version 2 or later | 4 | * GNU GPL version 2 or later |
5 | */ | 5 | */ |
6 | /* Due to a problem in the source code management, the names of some of | ||
7 | * the authors have unfortunately been lost. We do not mean to belittle | ||
8 | * their efforts and hope they will contact us to see their names | ||
9 | * properly added to the Copyright notice above. | ||
10 | * Having published their contributions under the terms of the GNU | ||
11 | * General Public License (GPL) [version 2], the Copyright of these | ||
12 | * authors will remain respected by adhering to the license they chose | ||
13 | * to publish their code under. | ||
14 | */ | ||
6 | 15 | ||
7 | #ifndef PHONET_h | 16 | #ifndef PHONET_h |
8 | #define PHONET_h | 17 | #define PHONET_h |
9 | 18 | ||
10 | #include "../protocol.h" | 19 | #include "../protocol.h" |
11 | 20 | ||
12 | #define PHONET_FRAME_ID 0x14 | 21 | #define PHONET_FRAME_ID 0x14 |
13 | #define PHONET_BLUE_FRAME_ID0x19 | 22 | #define PHONET_BLUE_FRAME_ID0x19 |
14 | #define PHONET_DEVICE_PHONE 0x00 /* Nokia mobile phone */ | 23 | #define PHONET_DEVICE_PHONE 0x00 /* Nokia mobile phone */ |
15 | #define PHONET_DEVICE_PC 0x0c /* Our PC */ | 24 | #define PHONET_DEVICE_PC 0x0c /* Our PC */ |
16 | #define PHONET_BLUE_DEVICE_PC 0x10 /* Our PC */ | 25 | #define PHONET_BLUE_DEVICE_PC 0x10 /* Our PC */ |
17 | 26 | ||