diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/gsmd/sms.h | 3 | ||||
-rw-r--r-- | include/gsmd/usock.h | 23 | ||||
-rw-r--r-- | include/libgsmd/misc.h | 5 | ||||
-rw-r--r-- | include/libgsmd/sms.h | 20 |
4 files changed, 43 insertions, 8 deletions
diff --git a/include/gsmd/sms.h b/include/gsmd/sms.h index ac16509..3192472 100644 --- a/include/gsmd/sms.h +++ b/include/gsmd/sms.h @@ -11,6 +11,9 @@ int sms_pdu_make_smssubmit(char *dest, const struct gsmd_sms_submit *src); int sms_pdu_to_msg(struct gsmd_sms_list *dst, const u_int8_t *src, int pdulen, int len); +extern const char *ts0705_memtype_name[]; +int parse_memtype(char *memtype); + #endif /* __GSMD__ */ #endif diff --git a/include/gsmd/usock.h b/include/gsmd/usock.h index b60e28e..bcff129 100644 --- a/include/gsmd/usock.h +++ b/include/gsmd/usock.h @@ -329,6 +329,29 @@ struct gsmd_sms_list { int is_last; }; +/* Refer to GSM 07.05 subclause 3.1 */ +enum ts0705_mem_type { + GSM0705_MEMTYPE_NONE, + GSM0705_MEMTYPE_BROADCAST, + GSM0705_MEMTYPE_ME_MESSAGE, + GSM0705_MEMTYPE_MT, + GSM0705_MEMTYPE_SIM, + GSM0705_MEMTYPE_TA, + GSM0705_MEMTYPE_SR, +}; + +/* Refer to GSM 07.05 subclause 3.2.2 */ +struct __gsmd_sms_storage { + u_int8_t memtype; + u_int8_t pad[3]; + u_int16_t used; + u_int16_t total; +} __attribute__ ((packed)); + +struct gsmd_sms_storage { + struct __gsmd_sms_storage mem[3]; +} __attribute__ ((packed)); + /* Refer to GSM 07.07 subclause 8.12 */ struct gsmd_phonebook_readrg { u_int8_t index1; diff --git a/include/libgsmd/misc.h b/include/libgsmd/misc.h index 672b980..9988518 100644 --- a/include/libgsmd/misc.h +++ b/include/libgsmd/misc.h @@ -65,11 +65,6 @@ extern int lgsm_get_netreg_state(struct lgsm_handle *lh, /* CLIP, CLIR, COLP, Call Forwarding, Call Waiting, Call Deflecting */ /* TBD */ - -/* SMS related functions */ -/* TBD */ - - /* GPRS related functions */ /* TBD */ diff --git a/include/libgsmd/sms.h b/include/libgsmd/sms.h index 6a62c38..d389b21 100644 --- a/include/libgsmd/sms.h +++ b/include/libgsmd/sms.h @@ -61,16 +61,30 @@ extern int lgsm_sms_list(struct lgsm_handle *lh, enum gsmd_msg_sms_type stat); extern int lgsm_sms_read(struct lgsm_handle *lh, int index); /* Delete Message */ -extern int lgsmd_sms_delete(struct lgsm_handle *lh, +extern int lgsm_sms_delete(struct lgsm_handle *lh, const struct lgsm_sms_delete *sms_del); /* Send Message */ -extern int lgsmd_sms_send(struct lgsm_handle *lh, const struct lgsm_sms *sms); +extern int lgsm_sms_send(struct lgsm_handle *lh, const struct lgsm_sms *sms); /* Write Message to Memory */ -extern int lgsmd_sms_write(struct lgsm_handle *lh, +extern int lgsm_sms_write(struct lgsm_handle *lh, const struct lgsm_sms_write *sms_write); +/* Retrieve SMS storage information */ +extern int lgsm_sms_get_storage(struct lgsm_handle *lh); + +/* Set preferred SMS storage */ +extern int lgsm_sms_set_storage(struct lgsm_handle *lh, + enum ts0705_mem_type mem1, enum ts0705_mem_type mem2, + enum ts0705_mem_type mem3); + +/* Retrieve current default service centre address */ +extern int lgsm_sms_get_smsc(struct lgsm_handle *lh); + +/* Set new default service centre address */ +extern int lgsm_sms_set_smsc(struct lgsm_handle *lh, const char *number); + /* Packing of 7-bit characters, refer to GSM 03.38 subclause 6.1.2.1.1 */ extern int packing_7bit_character(const char *src, struct lgsm_sms *dest); |