Diffstat (limited to 'gammu/emb/common/protocol/nokia/phonet.c') (more/less context) (show whitespace changes)
-rw-r--r-- | gammu/emb/common/protocol/nokia/phonet.c | 5 |
1 files changed, 4 insertions, 1 deletions
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,50 +1,53 @@ /* (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, buffer2[1] = PHONET_DEVICE_PHONE; //destination buffer2[2] = PHONET_DEVICE_PC; //source if (s->ConnectionType==GCT_PHONETBLUE || s->ConnectionType==GCT_BLUEPHONET) { buffer2[0] = PHONET_BLUE_FRAME_ID; buffer2[1] = PHONET_DEVICE_PHONE; //destination buffer2[2] = PHONET_BLUE_DEVICE_PC; //source } buffer2[3] = MsgType; buffer2[4] = MsgLength / 256; buffer2[5] = MsgLength % 256; memcpy(buffer2 + 6, MsgBuffer, MsgLength); GSM_DumpMessageLevel2(s, buffer2+6, MsgLength, MsgType); /* Sending to phone */ sent = s->Device.Functions->WriteDevice(s,buffer2,MsgLength+6); free(buffer2); if (sent!=MsgLength+6) return ERR_DEVICEWRITEERROR; return ERR_NONE; |