summaryrefslogtreecommitdiffabout
path: root/gammu/emb/common/service/sms
Side-by-side diff
Diffstat (limited to 'gammu/emb/common/service/sms') (more/less context) (show whitespace changes)
-rw-r--r--gammu/emb/common/service/sms/gsmmulti.c5
-rw-r--r--gammu/emb/common/service/sms/gsmmulti.h11
-rw-r--r--gammu/emb/common/service/sms/gsmsms.c5
-rw-r--r--gammu/emb/common/service/sms/gsmsms.h5
4 files changed, 23 insertions, 3 deletions
diff --git a/gammu/emb/common/service/sms/gsmmulti.c b/gammu/emb/common/service/sms/gsmmulti.c
index 6c1cdcd..bdb5ee9 100644
--- a/gammu/emb/common/service/sms/gsmmulti.c
+++ b/gammu/emb/common/service/sms/gsmmulti.c
@@ -466,48 +466,53 @@ GSM_Error GSM_EncodeMultiPartSMS(GSM_MultiPartSMSInfo *Info,
Length = 4;
j = 0;
/* Offsets to bitmaps */
for (i=0;i<Info->Entries[0].Bitmap->Number;i++) {
Buffer[Length++] = (4+j+Info->Entries[0].Bitmap->Number*2) % 256;
Buffer[Length++] = (4+j+Info->Entries[0].Bitmap->Number*2) / 256;
j += PHONE_GetBitmapSize(GSM_AlcatelBMMIPicture,Info->Entries[0].Bitmap->Bitmap[i].BitmapWidth,Info->Entries[0].Bitmap->Bitmap[i].BitmapHeight)+2;
}
/* Bitmaps */
for (i=0;i<Info->Entries[0].Bitmap->Number;i++) {
Buffer[Length++] = Info->Entries[0].Bitmap->Bitmap[i].BitmapWidth;
Buffer[Length++] = Info->Entries[0].Bitmap->Bitmap[i].BitmapHeight;
PHONE_EncodeBitmap(GSM_AlcatelBMMIPicture, Buffer+Length, &Info->Entries[0].Bitmap->Bitmap[i]);
Length += PHONE_GetBitmapSize(GSM_AlcatelBMMIPicture,Info->Entries[0].Bitmap->Bitmap[i].BitmapWidth,Info->Entries[0].Bitmap->Bitmap[i].BitmapHeight);
}
return GSM_EncodeAlcatelMultiPartSMS(SMS,Buffer,Length,Info->Entries[0].Bitmap->Bitmap[0].Text,ALCATELTDD_ANIMATION);
case SMS_MMSIndicatorLong:
Class = 1;
UDH = UDH_MMSIndicatorLong;
GSM_EncodeMMSIndicatorSMSText(Buffer,&Length,*Info->Entries[0].MMSIndicator);
break;
+ case SMS_WAPIndicatorLong:
+ Class = 1;
+ UDH = UDH_MMSIndicatorLong;
+ GSM_EncodeWAPIndicatorSMSText(Buffer,&Length,Info->Entries[0].MMSIndicator->Title,Info->Entries[0].MMSIndicator->Address);
+ break;
case SMS_NokiaRingtoneLong:
case SMS_NokiaRingtone:
UDH = UDH_NokiaRingtone;
Class = 1;
/* 7 = length of UDH_NokiaRingtone UDH header */
Length = GSM_MAX_8BIT_SMS_LENGTH-7;
Info->Entries[0].RingtoneNotes = GSM_EncodeNokiaRTTLRingtone(*Info->Entries[0].Ringtone,Buffer,&Length);
if (Info->Entries[0].ID == SMS_NokiaRingtone) break;
if (Info->Entries[0].RingtoneNotes != Info->Entries[0].Ringtone->NoteTone.NrCommands) {
UDH = UDH_NokiaRingtoneLong;
Length = (GSM_MAX_8BIT_SMS_LENGTH-12)*3;
Info->Entries[0].RingtoneNotes = GSM_EncodeNokiaRTTLRingtone(*Info->Entries[0].Ringtone,Buffer,&Length);
}
break;
case SMS_NokiaOperatorLogoLong:
if (Info->Entries[0].Bitmap->Bitmap[0].BitmapWidth > 72 || Info->Entries[0].Bitmap->Bitmap[0].BitmapHeight > 14) {
UDH = UDH_NokiaOperatorLogoLong;
Class = 1;
NOKIA_EncodeNetworkCode(Buffer, Info->Entries[0].Bitmap->Bitmap[0].NetworkCode);
Length = Length + 3;
NOKIA_CopyBitmap(GSM_Nokia7110OperatorLogo, &Info->Entries[0].Bitmap->Bitmap[0], Buffer, &Length);
break;
}
case SMS_NokiaOperatorLogo:
diff --git a/gammu/emb/common/service/sms/gsmmulti.h b/gammu/emb/common/service/sms/gsmmulti.h
index c672261..3f70d81 100644
--- a/gammu/emb/common/service/sms/gsmmulti.h
+++ b/gammu/emb/common/service/sms/gsmmulti.h
@@ -1,29 +1,33 @@
/* (c) 2002-2004 by Marcin Wiacek */
#ifndef __gsm_multi_h
#define __gsm_multi_h
+#if defined(_MSC_VER) && defined(__cplusplus)
+ extern "C" {
+#endif
+
#include "../../gsmcomon.h"
#include "../gsmlogo.h"
#include "../gsmcal.h"
#include "../gsmpbk.h"
#include "../gsmdata.h"
#include "../gsmring.h"
#include "gsmsms.h"
/* ---------------------- multi SMS --------------------------------------- */
/* Identifiers for Smart Messaging 3.0 multipart SMS */
#define SM30_ISOTEXT 0 /* ISO 8859-1 text */
#define SM30_UNICODETEXT 1
#define SM30_OTA 2
#define SM30_RINGTONE 3
#define SM30_PROFILENAME 4
/* ... */
#define SM30_SCREENSAVER 6
/* Identifiers for Alcatel Terminal Data Download */
#define ALCATELTDD_PICTURE 4
#define ALCATELTDD_ANIMATION 5
#define ALCATELTDD_SMSTEMPLATE 6
@@ -151,66 +155,67 @@ typedef enum {
SMS_VCARD21Long,
SMS_DisableVoice,
SMS_DisableFax,
SMS_DisableEmail,
SMS_EnableVoice,
SMS_EnableFax,
SMS_EnableEmail,
SMS_VoidSMS,
/**
* IMelody 1.0
*/
SMS_EMSSound10,
/**
* IMelody 1.2
*/
SMS_EMSSound12,
/**
* IMelody without header - SonyEricsson extension
*/
SMS_EMSSonyEricssonSound,
/**
* IMelody 1.0 with UPI.
*/
SMS_EMSSound10Long,
- /***
+ /**
* IMelody 1.2 with UPI.
*/
SMS_EMSSound12Long,
/**
* IMelody without header with UPI.
*/
SMS_EMSSonyEricssonSoundLong,
SMS_EMSPredefinedSound,
SMS_EMSPredefinedAnimation,
SMS_EMSAnimation,
/**
* Fixed bitmap of size 16x16 or 32x32.
*/
SMS_EMSFixedBitmap,
SMS_EMSVariableBitmap,
SMS_EMSVariableBitmapLong,
SMS_MMSIndicatorLong,
+ SMS_WAPIndicatorLong,
/**
* Variable bitmap with black and white colors
*/
SMS_AlcatelMonoBitmapLong,
/**
* Variable animation with black and white colors
*/
SMS_AlcatelMonoAnimationLong,
SMS_AlcatelSMSTemplateName
} EncodeMultiPartSMSID;
typedef struct {
EncodeMultiPartSMSID ID;
int Number;
GSM_Ringtone *Ringtone;
GSM_MultiBitmap *Bitmap;
GSM_WAPBookmark *Bookmark;
GSM_WAPSettings *Settings;
GSM_MMSIndicator *MMSIndicator;
GSM_MemoryEntry *Phonebook;
GSM_CalendarEntry *Calendar;
GSM_ToDoEntry *ToDo;
bool Protected;
@@ -243,29 +248,33 @@ typedef struct {
* Encodes multi part SMS from "readable" format.
*/
GSM_Error GSM_EncodeMultiPartSMS (GSM_MultiPartSMSInfo *Info, GSM_MultiSMSMessage *SMS);
/**
* Decodes multi part SMS to "readable" format.
*/
bool GSM_DecodeMultiPartSMS (GSM_MultiPartSMSInfo *Info, GSM_MultiSMSMessage *SMS, bool ems);
/**
* Clears @ref GSM_MultiPartSMSInfo to default values.
*/
void GSM_ClearMultiPartSMSInfo (GSM_MultiPartSMSInfo *Info);
/**
* Frees any allocated structures inside @ref GSM_MultiPartSMSInfo.
*/
void GSM_FreeMultiPartSMSInfo (GSM_MultiPartSMSInfo *Info);
/**
* Links SMS messages according to IDs.
*/
GSM_Error GSM_LinkSMS(GSM_MultiSMSMessage **INPUT, GSM_MultiSMSMessage **OUTPUT, bool ems);
+#if defined(_MSC_VER) && defined(__cplusplus)
+ }
+#endif
+
#endif
/* How should editor hadle tabs in this file? Add editor commands here.
* vim: noexpandtab sw=8 ts=8 sts=8:
*/
diff --git a/gammu/emb/common/service/sms/gsmsms.c b/gammu/emb/common/service/sms/gsmsms.c
index 9920835..feceba4 100644
--- a/gammu/emb/common/service/sms/gsmsms.c
+++ b/gammu/emb/common/service/sms/gsmsms.c
@@ -1,26 +1,29 @@
/* (c) 2001-2004 by Marcin Wiacek */
-/* based on some work from Pawel Kot, others and Gnokii */
+/* Based on some Pawel Kot and others 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 <ctype.h>
#include <string.h>
#include <time.h>
#include "../../gsmcomon.h"
#include "../../misc/coding/coding.h"
#include "../gsmcal.h"
#include "../gsmpbk.h"
#include "../gsmlogo.h"
#include "../gsmring.h"
#include "../gsmdata.h"
#include "../gsmnet.h"
#include "gsmsms.h"
/* User data headers */
static GSM_UDHHeader UDHHeaders[] = {
/* See GSM 03.40 section 9.2.3.24.1
* 1 byte 0x00
* 1 byte 0x03
* 1 byte 0x01: unique ID for message series
* 1 byte 0x00: how many SMS in sequence
* 1 byte 0x00: number of current SMS in sequence */
{ UDH_ConcatenatedMessages, 0x05, "\x00\x03\x01\x00\x00",2,-1,4,3},
diff --git a/gammu/emb/common/service/sms/gsmsms.h b/gammu/emb/common/service/sms/gsmsms.h
index d87ff60..0b950d3 100644
--- a/gammu/emb/common/service/sms/gsmsms.h
+++ b/gammu/emb/common/service/sms/gsmsms.h
@@ -1,26 +1,29 @@
/* (c) 2001-2004 by Marcin Wiacek */
-/* based on some work from Pawel Kot, others and Gnokii */
+/* Based on some Pawel Kot and others 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 __gsm_sms_h
#define __gsm_sms_h
#include "../../gsmcomon.h"
#include "../gsmlogo.h"
#include "../gsmcal.h"
#include "../gsmpbk.h"
#include "../gsmdata.h"
#include "../gsmring.h"
/* --------------------- Some general definitions ------------------------- */
#define GSM_MAX_UDH_LENGTH 140
#define GSM_MAX_SMS_LENGTH 160
#define GSM_MAX_8BIT_SMS_LENGTH 140
/* -------------------- Cell Broadcast ------------------------------------ */
/**
* Structure for Cell Broadcast messages.
*/
typedef struct {
/**