summaryrefslogtreecommitdiff
path: root/include/libgsmd
diff options
context:
space:
mode:
Diffstat (limited to 'include/libgsmd')
-rw-r--r--include/libgsmd/sms.h31
1 files changed, 8 insertions, 23 deletions
diff --git a/include/libgsmd/sms.h b/include/libgsmd/sms.h
index a07fc74..6a62c38 100644
--- a/include/libgsmd/sms.h
+++ b/include/libgsmd/sms.h
@@ -5,23 +5,6 @@
/* Short Message Service */
-/* Data Coding Scheme, refer to GSM 03.38 Clause 4 */
-#define B5_COMPRESSED (1<<5)
-#define B4_CLASSMEANING (1<<4)
-enum {
- MESSAGE_CLASS_CLASS0 = 0x00,
- MESSAGE_CLASS_CLASS1 = 0x01,
- MESSAGE_CLASS_CLASS2 = 0x10,
- MESSAGE_CLASS_CLASS3 = 0x11,
-};
-
-enum {
- ALPHABET_DEFAULT = (0x00<<2),
- ALPHABET_8BIT = (0x01<<2),
- ALPHABET_UCS2 = (0x10<<2),
- ALPHABET_RESERVED = (0x11<<2),
-};
-
/* Coding of Alpha fields in the SIM for UCS2, (3GPP TS 11.11 Annex B) */
//enum {
@@ -57,15 +40,17 @@ struct lgsm_sms_delete {
#define LGSM_SMS_ADDR_MAXLEN 12
#define LGSM_SMS_DATA_MAXLEN 140
struct lgsm_sms {
- /* FIXME: max length of data,
- * 7 bit coding - 160(140*8/7); ucs2 coding - 70(140/2) */
char addr[LGSM_SMS_ADDR_MAXLEN+1];
- char data[LGSM_SMS_DATA_MAXLEN+1];
+ /* FIXME: max length of data,
+ * 7 bit coding - 160(140*8/7); ucs2 coding - 70(140/2) */
+ enum gsmd_sms_alphabet alpha;
+ u_int8_t data[LGSM_SMS_DATA_MAXLEN+1];
+ int length;
};
/* GSM 03.40 subclause 9.2.2.2 and GSM 07.05 subclause 4.4 and subclause 3.1 */
struct lgsm_sms_write {
- enum lgsm_msg_sms_stat stat;
+ enum lgsm_msg_sms_stat stat;
struct lgsm_sms sms;
};
@@ -87,10 +72,10 @@ extern int lgsmd_sms_write(struct lgsm_handle *lh,
const struct lgsm_sms_write *sms_write);
/* Packing of 7-bit characters, refer to GSM 03.38 subclause 6.1.2.1.1 */
-extern int packing_7bit_character(char *src, char *dest);
+extern int packing_7bit_character(const char *src, struct lgsm_sms *dest);
/* Packing of 7-bit characters, refer to GSM 03.38 subclause 6.1.2.1.1 */
-extern int unpacking_7bit_character(char *src, char *dest);
+extern int unpacking_7bit_character(const struct gsmd_sms *src, char *dest);
/* Refer to 3GPP TS 11.11 Annex B */
extern int packing_UCS2_80(char *src, char *dest);
personal git repositories of Harald Welte. Your mileage may vary