rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | /*============================================================================= |
| 2 | # FileName: lynq_sms.h |
| 3 | # Desc: about sms api |
| 4 | # Author: zhouqunchao |
| 5 | # Version: |
| 6 | # LastChange: 2020-07-29 |
| 7 | # History: |
| 8 | |
| 9 | =============================================================================*/ |
| 10 | |
| 11 | #ifndef YLNQ_SMS_H |
| 12 | #define YLNQ_SMS_H 1 |
| 13 | #include <sys/types.h> |
| 14 | #include "lib_tele.h" |
| 15 | #ifdef __cplusplus |
| 16 | extern "C" { |
| 17 | #endif |
| 18 | #define MIN_MSM_PARAM_NUM 4 |
| 19 | #define MIN_IMS_MSM_PARAM_NUM 6 |
| 20 | #define MIN_WRITE_MSM_PARAM_NUM 5 |
| 21 | #define MSG_MAX_LEN 256 |
| 22 | typedef struct { |
| 23 | char *telephonyNumber; |
| 24 | char *charset; |
| 25 | char *msg; |
| 26 | char *smsc; |
| 27 | } SmsSendData; |
| 28 | typedef struct{ |
| 29 | lynqBase base; |
| 30 | RIL_SMS_Response smsResp; |
| 31 | }smsResponse; |
| 32 | typedef struct { |
| 33 | char *telephonyNumber; |
| 34 | char *charset; |
| 35 | char *msg; |
| 36 | char *retryNum; |
| 37 | char *messageRef; |
| 38 | char *smsc; |
| 39 | } SmsImsSendData; |
| 40 | |
| 41 | typedef struct { |
| 42 | int smsStatus; //UnRead\Read\UnSent\Sent |
| 43 | char *recPhonNum; |
| 44 | char *charset; |
| 45 | char *msg; |
| 46 | char *smsc; |
| 47 | } SmsInfo; |
| 48 | |
| 49 | typedef struct{ |
| 50 | lynqBase base; |
| 51 | int msgStoreIndex; |
| 52 | }messageStoreInfo; |
| 53 | |
| 54 | typedef struct{ |
| 55 | lynqBase base; |
| 56 | char *smsc; |
| 57 | }smscCbInfo; |
| 58 | typedef struct |
| 59 | { |
| 60 | int index;// the index of sms in memory,0-100. |
| 61 | int status;//read:0,unread:1 |
| 62 | int smslen;//the length of sms,the maximum length shall not exceed the length specified in 3GGP protocol(160/70) |
| 63 | char message[MSG_MAX_LEN];//sms content |
| 64 | RIL_SOCKET_ID soc_id; |
| 65 | char teleNum[50];//telephony number |
| 66 | int numLen; |
| 67 | }storeMessageInfo; |
| 68 | int lynq_send_sms(const char *telephonyNumber, const int charset,const char *msg, const char *smsc, smsResponse* smsResp); |
| 69 | int lynq_Ims_send_sms(const char *telephonyNumber, const int charset,const char *msg, const char*retryNum,const char *messageRef, const char *smsc,smsResponse *smsResp); |
| 70 | int lynq_write_sms_to_sim(const int smsStatus,const char *recPhonNum,const int charset,const char *msg,const char *smsc,messageStoreInfo *msgstroeInfo); |
| 71 | int lynq_report_sms_memory_status(const int status,lynqBase *base); |
| 72 | int lynq_delet_sms_on_sim(const int index,lynqBase *base); |
| 73 | int lynq_get_smsc_address(smscCbInfo *smscInfo); |
| 74 | int lynq_set_smsc_address(const char* serviceNumber,lynqBase *base); |
| 75 | void lynq_recive_new_sms_cb(RIL_SOCKET_ID soc_id,char * num, char * smsc, char * msg, int charset); |
| 76 | int lynq_store_sms_to_memory(RIL_SOCKET_ID soc_id,const int status,char * num,const char* sms,lynqBase *base); |
| 77 | int lynq_get_sms_from_memory(const int index, storeMessageInfo* sms,lynqBase *base); |
| 78 | int lynq_delete_message_from_memory(const int index,lynqBase *base); |
| 79 | |
| 80 | #ifdef __cplusplus |
| 81 | } |
| 82 | #endif |
| 83 | #endif |