cfw_sms.h 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245
  1. /* Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
  2. * All rights reserved.
  3. *
  4. * This software is supplied "AS IS" without any warranties.
  5. * RDA assumes no responsibility or liability for the use of the software,
  6. * conveys no license or title under any patent, copyright, or mask work
  7. * right to the product. RDA reserves the right to make changes in the
  8. * software without notification. RDA also make no representation or
  9. * warranty that such application will be suitable for the specified use
  10. * without further testing or modification.
  11. */
  12. /**
  13. *@file cfw_sms.h
  14. *@author UNISOC
  15. *@email
  16. *@version
  17. *@data
  18. */
  19. #ifndef _CFW_SMS_H_
  20. #define _CFW_SMS_H_
  21. #include <stdint.h>
  22. #include <stdbool.h>
  23. #include "cfw_cc.h"
  24. #include "cfw_config.h"
  25. #include "cfw_utility.h"
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. typedef struct _TM_SMS_TIME_STAMP
  30. {
  31. uint16_t uYear;
  32. uint8_t uMonth;
  33. uint8_t uDay;
  34. uint8_t uHour;
  35. uint8_t uMinute;
  36. uint8_t uSecond;
  37. int8_t iZone;
  38. } TM_SMS_TIME_STAMP;
  39. //
  40. // SMS Service
  41. //
  42. typedef struct _CFW_SMS_TXT_DELIVERED_NO_HRD_INFO
  43. {
  44. uint8_t oa[TEL_NUMBER_MAX_LEN]; ///< BCD
  45. uint8_t oa_size;
  46. uint8_t padding[2];
  47. TM_SMS_TIME_STAMP scts;
  48. uint8_t stat;
  49. uint8_t tooa;
  50. uint16_t length;
  51. uint8_t data[1];
  52. } CFW_SMS_TXT_DELIVERED_NO_HRD_INFO;
  53. typedef struct _CFW_SMS_TXT_DELIVERED_NO_HRD_INFO_V2
  54. {
  55. uint8_t oa[TEL_NUMBER_MAX_LEN]; ///< BCD
  56. uint8_t oa_size;
  57. uint8_t padding[2];
  58. TM_SMS_TIME_STAMP scts;
  59. uint8_t stat;
  60. uint8_t tooa;
  61. uint16_t length;
  62. uint8_t data[CFW_MAX_SMS_DATA_LEN];
  63. } CFW_SMS_TXT_DELIVERED_NO_HRD_INFO_V2;
  64. typedef struct _CFW_SMS_TXT_DELIVERED_WITH_HRD_INFO
  65. {
  66. uint8_t oa[TEL_NUMBER_MAX_LEN];
  67. uint8_t oa_size;
  68. uint8_t sca[TEL_NUMBER_MAX_LEN];
  69. uint8_t sca_size;
  70. TM_SMS_TIME_STAMP scts;
  71. uint8_t tooa;
  72. uint8_t tosca;
  73. uint8_t stat;
  74. uint8_t fo;
  75. uint8_t pid;
  76. uint8_t dcs;
  77. uint16_t length;
  78. uint8_t data[1];
  79. } CFW_SMS_TXT_DELIVERED_WITH_HRD_INFO;
  80. typedef struct _CFW_SMS_TXT_DELIVERED_WITH_HRD_INFO_V2
  81. {
  82. uint8_t oa[TEL_NUMBER_MAX_LEN];
  83. uint8_t oa_size;
  84. uint8_t sca[TEL_NUMBER_MAX_LEN];
  85. uint8_t sca_size;
  86. TM_SMS_TIME_STAMP scts;
  87. uint8_t tooa;
  88. uint8_t tosca;
  89. uint8_t stat;
  90. uint8_t fo;
  91. uint8_t pid;
  92. uint8_t dcs;
  93. uint16_t length;
  94. uint8_t data[CFW_MAX_SMS_DATA_LEN];
  95. } CFW_SMS_TXT_DELIVERED_WITH_HRD_INFO_V2;
  96. typedef struct _CFW_SMS_TXT_REPORT_INFO
  97. {
  98. TM_SMS_TIME_STAMP scts;
  99. TM_SMS_TIME_STAMP dt;
  100. uint8_t stat;
  101. uint8_t fo;
  102. uint8_t mr;
  103. uint8_t padding;
  104. uint32_t st;
  105. } CFW_SMS_TXT_REPORT_V0_INFO;
  106. typedef struct _CFW_SMS_TXT_REPORT_V1_INFO
  107. {
  108. uint8_t ra[TEL_NUMBER_MAX_LEN];
  109. uint8_t ra_size;
  110. TM_SMS_TIME_STAMP scts;
  111. TM_SMS_TIME_STAMP dt;
  112. uint8_t tora;
  113. uint8_t stat;
  114. uint8_t fo;
  115. uint8_t mr;
  116. uint32_t st;
  117. } CFW_SMS_TXT_REPORT_V1_INFO;
  118. typedef struct _CFW_SMS_PDU_INFO
  119. {
  120. uint16_t nTpUdl;
  121. uint16_t nDataSize;
  122. uint8_t nStatus;
  123. uint8_t padding[3];
  124. uint8_t pData[1];
  125. } CFW_SMS_PDU_INFO;
  126. typedef struct _CFW_SMS_PDU_INFO_V2
  127. {
  128. uint16_t nTpUdl;
  129. uint16_t nDataSize;
  130. uint8_t nStatus;
  131. uint8_t padding[3];
  132. uint8_t pData[CFW_MAX_SMS_PDU_LEN];
  133. } CFW_SMS_PDU_INFO_V2;
  134. typedef struct _CFW_SMS_TXT_SUBMITTED_NO_HRD_INFO
  135. {
  136. uint8_t da[TEL_NUMBER_MAX_LEN];
  137. uint8_t da_size;
  138. uint8_t stat;
  139. uint8_t padding;
  140. uint16_t length;
  141. uint8_t data[1];
  142. } CFW_SMS_TXT_SUBMITTED_NO_HRD_INFO;
  143. typedef struct _CFW_SMS_TXT_SUBMITTED_NO_HRD_INFO_V2
  144. {
  145. uint8_t da[TEL_NUMBER_MAX_LEN];
  146. uint8_t da_size;
  147. uint8_t stat;
  148. uint8_t padding;
  149. uint16_t length;
  150. uint8_t data[CFW_MAX_SMS_DATA_LEN];
  151. } CFW_SMS_TXT_SUBMITTED_NO_HRD_INFO_V2;
  152. typedef struct _CFW_SMS_TXT_SUBMITTED_WITH_HRD_INFO
  153. {
  154. uint8_t da[TEL_NUMBER_MAX_LEN];
  155. uint8_t da_size;
  156. uint8_t sca[TEL_NUMBER_MAX_LEN];
  157. uint8_t sca_size;
  158. uint8_t toda;
  159. uint8_t tosca;
  160. uint8_t stat;
  161. uint8_t fo;
  162. uint8_t pid;
  163. uint8_t dcs;
  164. uint8_t vp;
  165. uint8_t padding[3];
  166. uint16_t length;
  167. uint32_t nTime;
  168. uint8_t data[1];
  169. } CFW_SMS_TXT_SUBMITTED_WITH_HRD_INFO;
  170. typedef struct _CFW_SMS_TXT_SUBMITTED_WITH_HRD_INFO_V2
  171. {
  172. uint8_t da[TEL_NUMBER_MAX_LEN];
  173. uint8_t da_size;
  174. uint8_t sca[TEL_NUMBER_MAX_LEN];
  175. uint8_t sca_size;
  176. uint8_t toda;
  177. uint8_t tosca;
  178. uint8_t stat;
  179. uint8_t fo;
  180. uint8_t pid;
  181. uint8_t dcs;
  182. uint8_t vp;
  183. uint8_t padding[3];
  184. uint16_t length;
  185. uint32_t nTime;
  186. uint8_t data[CFW_MAX_SMS_DATA_LEN];
  187. } CFW_SMS_TXT_SUBMITTED_WITH_HRD_INFO_V2;
  188. typedef struct _CFW_SMS_TXT_NO_HRD_IND
  189. {
  190. uint8_t oa[TEL_NUMBER_MAX_LEN];
  191. uint8_t oa_size;
  192. uint8_t tooa;
  193. uint8_t dcs;
  194. TM_SMS_TIME_STAMP scts;
  195. uint16_t nStorageId;
  196. uint16_t nIndex;
  197. uint8_t padding;
  198. uint16_t nDataLen;
  199. uint8_t pData[1];
  200. } CFW_SMS_TXT_NO_HRD_IND, CFW_SMS_TXT_HRD_V0_IND;
  201. typedef struct _CFW_SMS_TXT_NO_HRD_IND_V2
  202. {
  203. uint8_t oa[TEL_NUMBER_MAX_LEN];
  204. uint8_t oa_size;
  205. uint8_t tooa;
  206. uint8_t dcs;
  207. TM_SMS_TIME_STAMP scts;
  208. uint16_t nStorageId;
  209. uint16_t nIndex;
  210. uint8_t padding;
  211. uint16_t nDataLen;
  212. uint8_t pData[CFW_MAX_SMS_DATA_LEN];
  213. } CFW_SMS_TXT_NO_HRD_IND_V2;
  214. typedef struct _CFW_SMS_TXT_HRD_V1_IND
  215. {
  216. uint8_t oa[TEL_NUMBER_MAX_LEN];
  217. uint8_t oa_size;
  218. uint8_t sca[TEL_NUMBER_MAX_LEN];
  219. uint8_t sca_size;
  220. TM_SMS_TIME_STAMP scts;
  221. uint8_t tosca;
  222. uint8_t tooa;
  223. uint8_t fo;
  224. uint8_t pid;
  225. uint8_t dcs;
  226. uint8_t real_dcs;
  227. uint8_t padding;
  228. uint16_t nStorageId;
  229. uint16_t nIndex;
  230. uint16_t nDataLen;
  231. uint8_t pData[1];
  232. } CFW_SMS_TXT_HRD_V1_IND;
  233. typedef struct _CFW_SMS_TXT_HRD_IND_V2
  234. {
  235. uint8_t oa[TEL_NUMBER_MAX_LEN];
  236. uint8_t oa_size;
  237. uint8_t sca[TEL_NUMBER_MAX_LEN];
  238. uint8_t sca_size;
  239. TM_SMS_TIME_STAMP scts;
  240. uint8_t tosca;
  241. uint8_t tooa;
  242. uint8_t fo;
  243. uint8_t pid;
  244. uint8_t dcs;
  245. uint8_t real_dcs;
  246. uint8_t padding;
  247. uint16_t nStorageId;
  248. uint16_t nIndex;
  249. uint16_t nDataLen;
  250. uint8_t pData[CFW_MAX_SMS_PDU_LEN];
  251. } CFW_SMS_TXT_HRD_IND_V2;
  252. typedef struct _CFW_SMS_TXT_STATUS_IND
  253. {
  254. uint8_t ra[TEL_NUMBER_MAX_LEN];
  255. uint8_t ra_size;
  256. uint8_t tora;
  257. uint8_t fo;
  258. uint8_t mr;
  259. uint8_t st;
  260. uint16_t nStorageId;
  261. uint16_t nIndex;
  262. TM_SMS_TIME_STAMP scts;
  263. TM_SMS_TIME_STAMP dt;
  264. } CFW_SMS_TXT_STATUS_IND;
  265. typedef union {
  266. CFW_SMS_TXT_STATUS_IND uTxtStatus;
  267. CFW_SMS_TXT_HRD_IND_V2 uTxtHRDV2;
  268. CFW_SMS_TXT_NO_HRD_IND_V2 uTxtNoHRD;
  269. CFW_SMS_TXT_SUBMITTED_WITH_HRD_INFO_V2 uSubmitWithHRDV2;
  270. CFW_SMS_TXT_SUBMITTED_NO_HRD_INFO_V2 uSubmitNoHRDV2;
  271. CFW_SMS_PDU_INFO_V2 uPDUV2;
  272. CFW_SMS_TXT_REPORT_V1_INFO uTxtReportV1;
  273. CFW_SMS_TXT_REPORT_V0_INFO uTxtReportV0;
  274. CFW_SMS_TXT_DELIVERED_WITH_HRD_INFO_V2 uTxtDevliveredWithHRDV2;
  275. CFW_SMS_TXT_DELIVERED_NO_HRD_INFO_V2 uTxtDeliveredNoHRDV2;
  276. CFW_SMS_TXT_STATUS_IND uTxtStatusInd;
  277. } CFW_SMS_INFO_UNION;
  278. typedef struct _CFW_SMS_MULTIPART_INFO
  279. {
  280. uint8_t id;
  281. uint8_t count;
  282. uint8_t current;
  283. uint8_t padding;
  284. } CFW_SMS_MULTIPART_INFO;
  285. typedef struct _CFW_SMS_LIST
  286. {
  287. uint16_t nCount;
  288. uint16_t nStartIndex;
  289. uint8_t nStorage;
  290. uint8_t nType;
  291. uint8_t nStatus;
  292. uint8_t nOption;
  293. uint8_t padding[3];
  294. } CFW_SMS_LIST;
  295. typedef struct _CFW_SMS_COPY
  296. {
  297. uint8_t nOption;
  298. uint8_t nStatus;
  299. uint16_t nCount;
  300. uint16_t nStartIndex;
  301. uint8_t padding[2];
  302. } CFW_SMS_COPY;
  303. typedef struct _CFW_SMS_PDU_PARAM
  304. {
  305. uint8_t vp; ///< 167
  306. uint8_t pid; ///< 0
  307. uint8_t dcs; ///< 0
  308. uint8_t mti; ///< 0x01
  309. uint8_t ssr; ///< 0
  310. uint8_t bearer; ///< 0
  311. uint8_t mr; ///< 0
  312. uint8_t SCAIndex; ///< default index
  313. uint8_t nNumber[12]; ///< BCD format
  314. uint8_t rp;
  315. } CFW_SMS_PDU_PARAM;
  316. typedef struct _CFW_SMS_WRITE
  317. {
  318. CFW_DIALNUMBER sNumber;
  319. uint8_t *pData;
  320. uint16_t nDataSize;
  321. uint16_t nIndex;
  322. uint8_t nStorage;
  323. uint8_t nType;
  324. uint8_t nStatus;
  325. uint8_t padding[1];
  326. } CFW_SMS_WRITE;
  327. typedef struct _CFW_SMS_NODE
  328. {
  329. void *pNode;
  330. uint16_t nStorage;
  331. uint16_t nStatus;
  332. uint16_t nConcatPrevIndex;
  333. uint16_t nConcatNextIndex;
  334. uint16_t nConcatCurrentIndex;
  335. uint8_t nType;
  336. uint8_t padding;
  337. } CFW_SMS_NODE;
  338. typedef struct
  339. {
  340. CFW_SMS_NODE node;
  341. CFW_SMS_INFO_UNION info;
  342. } CFW_SMS_NODE_EX;
  343. typedef struct _CFW_NEW_SMS_NODE
  344. {
  345. void *pNode;
  346. uint16_t nStorage;
  347. uint16_t nConcatPrevIndex;
  348. uint16_t nConcatCurrentIndex;
  349. uint8_t nType;
  350. } CFW_NEW_SMS_NODE;
  351. typedef struct
  352. {
  353. CFW_NEW_SMS_NODE node;
  354. CFW_SMS_INFO_UNION info;
  355. } CFW_NEW_SMS_NODE_EX;
  356. #define CFW_SMS_LIST_OPTION__TIME_DESCEND_ORDER 0x01
  357. #define CFW_SMS_STORED_STATUS_TIME_ASCEND_ORDER 0x02
  358. #define CFW_SMS_MULTIPART_OPTION_ALL 0x04
  359. #define CFW_SMS_MULTIPART_OPTION_FIRST 0x08
  360. #define CFW_SMS_MULTIPART_OPTION_SIM_BACKUP 0x10
  361. #define CFW_SMS_ROUT_LOCATION 0x20
  362. #define CFW_SMS_ROUT_DETAIL_INFO 0x40
  363. #define SCA_MAX_NUMBER 21
  364. typedef struct _CFW_SMS_HEADER
  365. {
  366. uint8_t pTelNumber[TEL_NUMBER_MAX_LEN];
  367. uint8_t nNumber_size;
  368. uint8_t nTelNumberType;
  369. uint8_t nStatus;
  370. uint16_t nStorage;
  371. uint16_t nConcatPrevIndex;
  372. uint16_t nConcatNextIndex;
  373. uint16_t nConcatCurrentIndex;
  374. TM_SMS_TIME_STAMP nTime;
  375. } CFW_SMS_HEADER;
  376. typedef struct _CFW_SMS_SCA
  377. {
  378. uint8_t nNumber[SCA_MAX_NUMBER];
  379. uint8_t nType;
  380. uint8_t nFlag;
  381. uint8_t padding[1];
  382. } CFW_SMS_SCA;
  383. typedef struct _CFW_SMS_INIT
  384. {
  385. uint8_t n_PrevStatus;
  386. uint8_t n_CurrStatus;
  387. bool bInitFlag;
  388. uint8_t padding[1];
  389. } CFW_SMS_INIT;
  390. #define CFW_CB_MAX_CH 20
  391. #define CFW_CB_MAX_DCS 17
  392. typedef struct _CB_CTX_
  393. {
  394. uint16_t SimFileSize;
  395. uint8_t CbActiveStatus;
  396. uint8_t CbType;
  397. uint8_t MidNb;
  398. uint16_t Mid[CFW_CB_MAX_CH];
  399. uint8_t MirNb;
  400. uint16_t Mir[CFW_CB_MAX_CH];
  401. uint8_t DcsNb;
  402. uint8_t Dcs[CFW_CB_MAX_DCS];
  403. } CB_CTX_T;
  404. typedef struct
  405. {
  406. uint16_t MId; ///< Message Id the SMS-CB belongs to
  407. uint8_t DCS; ///< Data Coding Scheme applicable to the SMS-CB message
  408. uint16_t DataLen;
  409. uint8_t Data[1]; ///< In fact, DataLen elts must be allocated for this
  410. ///< array
  411. } CB_MSG_IND_STRUCT;
  412. //[[hameina[+]2008.11.21 SMS data len
  413. #define CFW_SMS_LEN_7BIT_NOMAL 160
  414. #define CFW_SMS_LEN_UCS2_NOMAL 140
  415. #define CFW_SMS_LEN_7BIT_LONG 153
  416. #define CFW_SMS_LEN_UCS2_LONG 134
  417. //]]hameina[+]2008.11.21
  418. uint32_t CFW_SMSStorageReset(CFW_SIM_ID nSimID);
  419. /*! \This function is used by the MMI to send a notification to stack that
  420. the user has canceled to send SMS.
  421. \param [in] nSimID SIM ID
  422. \return \a ERR_SUCCESS on success, or error code
  423. */
  424. uint32_t CFW_SmsAbortSendMessage(
  425. CFW_SIM_ID nSimID);
  426. /*! \function deletes a SMS message from the current store.
  427. The result should be returned through the following \a EV_CFW_SMS_DELETE_MESSAGE_RSP event:
  428. \rst
  429. +------+-------+---------------+---------------+-------------+
  430. | UTI | nType | nParam1 | nParam2 | Description |
  431. +======+=======+===============+===============+=============+
  432. | nUTI | 0 | nStatus!=0 | memory | OK |
  433. | | | return: 0 | identifier | |
  434. | | | nStatus=0 | | |
  435. | | | return:nIndex | | |
  436. +------+-------+---------------+---------------+-------------+
  437. | nUTI | 0xF0 | Error code | nStatus!=0 | Error |
  438. | | | | return: 0 | |
  439. | | | | nStatus=0 | |
  440. | | | | return:nIndex | |
  441. +------+-------+---------------+---------------+-------------+
  442. \endrst
  443. \param [in] nIndex Specify the index of the SMS entry to delete from current store
  444. \param [in] nStatus Indicates the status of message in memory
  445. \param [in] nStorage Specify the memory identifier to delete message
  446. \param [in] nType check msg type, currently only support pp msg
  447. \param [in] nUTI UTI operation
  448. \param [in] nSimID SIM ID
  449. \return \a ERR_SUCCESS on success, or error code
  450. */
  451. uint32_t CFW_SmsDeleteMessage(
  452. uint16_t nIndex,
  453. uint8_t nStatus,
  454. uint8_t nStorage,
  455. uint8_t nType,
  456. uint16_t nUTI,
  457. CFW_SIM_ID nSimId);
  458. /*! \function changes the status of a SMS message from unread to read.
  459. The result should be returned through the following \a EV_CFW_SMS_SET_UNREAD2READ_RSP event:
  460. \rst
  461. +------+-------+------------+---------+-------------+
  462. | UTI | nType | nParam1 | nParam2 | Description |
  463. +======+=======+============+=========+=============+
  464. | nUTI | 0 | nIndex | 0 | OK |
  465. +------+-------+------------+---------+-------------+
  466. | nUTI | 0xF0 | Error code | nIndex | Error |
  467. +------+-------+------------+---------+-------------+
  468. \endrst
  469. \param [in] nStorage Specify the memory identifier to unread message
  470. \param [in] nType check msg type, currently only support pp msg
  471. \param [in] nIndex Specify the index of the SMS entry to read from current storage
  472. \param [in] nUTI UTI operation
  473. \param [in] nSimID SIM ID
  474. \return \a ERR_SUCCESS on success, or error code
  475. */
  476. uint32_t CFW_SmsSetUnRead2Read(
  477. uint8_t nStorage,
  478. uint8_t nType,
  479. uint16_t nIndex,
  480. uint16_t nUTI,
  481. CFW_SIM_ID nSimId);
  482. /*! \function lists SMS messages from the current store passed by status in memory.
  483. The result should be returned through the following \a EV_CFW_SMS_LIST_MESSAGE_RSP event:
  484. \rst
  485. +------+-------+------------+---------------+-------------+
  486. | UTI | nType | nParam1 | nParam2 | Description |
  487. +======+=======+============+===============+=============+
  488. | nUTI | 0 | 0 | AllMSGNumber | OK |
  489. +------+-------+------------+---------------+-------------+
  490. | nUTI | 0 | ListHead | ListMSGNumber | OK |
  491. | | | | EndMsgIndex | |
  492. | | | | 0 | |
  493. +------+-------+------------+---------------+-------------+
  494. | nUTI | 0xF0 | Error code | 0 | Error |
  495. +------+-------+------------+---------------+-------------+
  496. \endrst
  497. \param [in] pListInfo Specify the list condition to search, see CFW_SMS_LIST
  498. \param [in] nUTI UTI operation
  499. \param [in] nSimID SIM ID
  500. \return \a ERR_SUCCESS on success, or error code
  501. */
  502. uint32_t CFW_SmsListMessages(
  503. CFW_SMS_LIST *pListInfo,
  504. uint16_t nUTI,
  505. CFW_SIM_ID nSimId);
  506. /*! \function copy SMS messages from the current store passed by status in memory.
  507. The result should be returned through the following \a EV_CFW_SMS_COPY_MESSAGE_RSP event:
  508. \rst
  509. +------+-------+------------+--------------+-------------+
  510. | UTI | nType | nParam1 | nParam2 | Description |
  511. +======+=======+============+==============+=============+
  512. | nUTI | 0 | 0 | MemNotFull:0 | OK |
  513. | | | TotalMsg | MemFull:1 | |
  514. | | | | EndMsgIndex | |
  515. +------+-------+------------+--------------+-------------+
  516. | nUTI | 0xF0 | Error code | 0 | Error |
  517. +------+-------+------------+--------------+-------------+
  518. \endrst
  519. \param [in] pCopyInfo struct CFW_SMS_COPY,specify the copy information
  520. \param [in] nUTI UTI operation
  521. \param [in] nSimID SIM ID
  522. \return \a ERR_SUCCESS on success, or error code
  523. */
  524. uint32_t CFW_SmsCopyMessages(
  525. CFW_SMS_COPY *pCopyInfo,
  526. uint16_t nUTI,
  527. CFW_SIM_ID nSimId);
  528. /*! \function reads a SMS message from the current store.
  529. The result should be returned through the following \a EV_CFW_SMS_READ_MESSAGE_RSP event:
  530. \rst
  531. +------+-------+--------------+-------------+-------------+
  532. | UTI | nType | nParam1 | nParam2 | Description |
  533. +======+=======+==============+=============+=============+
  534. | nUTI | 0 | Pointer to | LongerSms:1 | OK |
  535. | | | CFW_SMS_NODE | NormalSms:0 | |
  536. +------+-------+--------------+-------------+-------------+
  537. | nUTI | 0xF0 | Error code | nIndex | Error |
  538. +------+-------+--------------+-------------+-------------+
  539. \endrst
  540. \param [in] nStorage Specify the memory identifier to delete message
  541. \param [in] nType check msg type, currently only support pp msg
  542. \param [in] nIndex Specify the index of the SMS entry to read from current storage
  543. \param [in] nUTI UTI operation
  544. \param [in] nSimID SIM ID
  545. \return \a ERR_SUCCESS on success, or error code
  546. */
  547. uint32_t CFW_SmsReadMessage(
  548. uint8_t nStorage,
  549. uint8_t nType,
  550. uint16_t nIndex,
  551. uint16_t nUTI,
  552. CFW_SIM_ID nSimId);
  553. uint32_t CFW_SimGetServiceProviderName(
  554. uint16_t nUTI,
  555. CFW_SIM_ID nSimID);
  556. uint32_t CFW_SmsSetRead2UnRead(
  557. uint8_t nStorage,
  558. uint8_t nType,
  559. uint16_t nIndex,
  560. uint16_t nUTI,
  561. CFW_SIM_ID nSimId);
  562. void CFW_CheckIfAllowedRecvSms(
  563. bool bIfAllowed,
  564. CFW_SIM_ID nSimId);
  565. /*! \function sends a SMS message from the current store.
  566. The result should be returned through the following \a EV_CFW_SMS_SEND_MESSAGE_RSP event:
  567. \rst
  568. +------+-------+------------+----------------+-------------+
  569. | UTI | nType | nParam1 | nParam2 | Description |
  570. +======+=======+============+================+=============+
  571. | nUTI | 0 | 0-255 | NormalMsg:0 | OK |
  572. | | | | CurrLongMsgVal | |
  573. +------+-------+------------+----------------+-------------+
  574. | nUTI | 0xF0 | Error code | 0 | Error |
  575. +------+-------+------------+----------------+-------------+
  576. \endrst
  577. \param [in] pNumber Pointer to the CFW_DIALNUMBER structure containing the telephone number to send
  578. \param [in] pData Pointer to the buffer to hold the the Text or PDU data(BCD format) to send
  579. \param [in] nDataSize If Send PDU message this parameter indicate the number of octets coded in the
  580. TP layer data unit to be given, and the max value for TP-User Data is 140 bytea.
  581. if send Text message, this parameter indicate the size of text to send in bytes
  582. \param [in] nUTI UTI operation
  583. \param [in] nSimID SIM ID
  584. \return \a ERR_SUCCESS on success, or error code
  585. */
  586. uint32_t CFW_SmsSendMessage(
  587. CFW_DIALNUMBER *pNumber,
  588. uint8_t *pData,
  589. uint16_t nDataSize,
  590. uint16_t nUTI,
  591. CFW_SIM_ID nSimId);
  592. /*! \function sends a PDU SMS message from the current store.
  593. The result should be returned through the following \a EV_CFW_SMS_SEND_MESSAGE_RSP event:
  594. \rst
  595. +------+-------+------------+----------------+-------------+
  596. | UTI | nType | nParam1 | nParam2 | Description |
  597. +======+=======+============+================+=============+
  598. | nUTI | 0 | 0-255 | NormalMsg:0 | OK |
  599. | | | | CurrLongMsgVal | |
  600. +------+-------+------------+----------------+-------------+
  601. | nUTI | 0xF0 | Error code | 0 | Error |
  602. +------+-------+------------+----------------+-------------+
  603. \endrst
  604. \param [in] pData Pointer to the buffer to hold the the Text or PDU data(BCD format) to send
  605. \param [in] nDataSize If Send PDU message this parameter indicate the number of octets coded in the
  606. TP layer data unit to be given, and the max value for TP-User Data is 140 bytea.
  607. if send Text message, this parameter indicate the size of text to send in bytes
  608. \param [in] nUTI UTI operation
  609. \param [in] nSimID SIM ID
  610. \return \a ERR_SUCCESS on success, or error code
  611. */
  612. uint32_t CFW_SmsSendPduMessage(
  613. uint8_t *pData,
  614. uint16_t nDataSize,
  615. uint16_t nUTI,
  616. CFW_SIM_ID nSimId);
  617. /*! \function sends a SMS message from the current store.
  618. The result should be returned through the following \a EV_CFW_SMS_SEND_MESSAGE_RSP event:
  619. \rst
  620. +------+-------+------------+----------------+-------------+
  621. | UTI | nType | nParam1 | nParam2 | Description |
  622. +======+=======+============+================+=============+
  623. | nUTI | 0 | 0-255 | NormalMsg:0 | OK |
  624. | | | | CurrLongMsgVal | |
  625. +------+-------+------------+----------------+-------------+
  626. | nUTI | 0xF0 | Error code | 0 | Error |
  627. +------+-------+------------+----------------+-------------+
  628. \endrst
  629. \param [in] pNumber Pointer to the CFW_DIALNUMBER_V2 structure containing the telephone number to send
  630. \param [in] pData Pointer to the buffer to hold the the Text or PDU data(BCD format) to send
  631. \param [in] nDataSize If Send PDU message this parameter indicate the number of octets coded in the
  632. TP layer data unit to be given, and the max value for TP-User Data is 140 bytea.
  633. if send Text message, this parameter indicate the size of text to send in bytes
  634. \param [in] nUTI UTI operation
  635. \param [in] nSimID SIM ID
  636. \return \a ERR_SUCCESS on success, or error code
  637. */
  638. uint32_t CFW_SmsSendMessage_V2(
  639. CFW_DIALNUMBER_V2 *pNumber,
  640. uint8_t *pData,
  641. uint16_t nDataSize,
  642. uint16_t nUTI,
  643. CFW_SIM_ID nSimId);
  644. uint32_t CFW_SmsSendMessage_V3(
  645. CFW_DIALNUMBER_V2 *pNumber,
  646. uint8_t *pData,
  647. uint16_t nDataSize,
  648. uint16_t nUTI,
  649. CFW_SIM_ID nSimID,
  650. uint8_t nFlag);
  651. /*! \function writes a SMS message to the current store.
  652. The result should be returned through the following \a EV_CFW_SMS_WRITE_MESSAGE_RSP event:
  653. \rst
  654. +------+-------+------------+----------------+-------------+
  655. | UTI | nType | nParam1 | nParam2 | Description |
  656. +======+=======+============+================+=============+
  657. | nUTI | 0 | MsgIndex | MsgNotFull:0 | OK |
  658. | | | | CurrLongMsgVal | |
  659. | | | | MsgFull:1 | |
  660. +------+-------+------------+----------------+-------------+
  661. | nUTI | 0xF0 | Error code | MsgIndex | Error |
  662. +------+-------+------------+----------------+-------------+
  663. \endrst
  664. \param [in] pSMSWrite Pointer to the CFW_SMS_WRITE structure
  665. \param [in] nUTI UTI operation
  666. \param [in] nSimID SIM ID
  667. \return \a ERR_SUCCESS on success, or error code
  668. */
  669. uint32_t CFW_SmsWriteMessage(
  670. CFW_SMS_WRITE *pSMSWrite,
  671. uint16_t nUTI,
  672. CFW_SIM_ID nSimId);
  673. /*! \function writes a SMS message to the current store.
  674. The result should be returned through the following \a EV_CFW_SMS_WRITE_MESSAGE_RSP event:
  675. \rst
  676. +------+-------+------------+----------------+-------------+
  677. | UTI | nType | nParam1 | nParam2 | Description |
  678. +======+=======+============+================+=============+
  679. | nUTI | 0 | MsgIndex | MsgNotFull:0 | OK |
  680. | | | | CurrLongMsgVal | |
  681. | | | | MsgFull:1 | |
  682. +------+-------+------------+----------------+-------------+
  683. | nUTI | 0xF0 | Error code | MsgIndex | Error |
  684. +------+-------+------------+----------------+-------------+
  685. \endrst
  686. \param [in] pNumber Pointer to the CFW_DIALNUMBER_V2 structure containing the telephone number to send
  687. \param [in] pData Pointer to the buffer to hold the the Text or PDU data(BCD format) to send
  688. \param [in] nDataSize If Send PDU message this parameter indicate the number of octets coded in the
  689. TP layer data unit to be given, and the max value for TP-User Data is 140 bytea.
  690. if send Text message, this parameter indicate the size of text to send in bytes
  691. \param [in] nIndex Specify the index of the SMS entry to read from current storage
  692. \param [in] nStorage Specify the memory identifier to delete message
  693. \param [in] nType check msg type, currently only support pp msg
  694. \param [in] nStatus Indicates the status of message in memory
  695. \param [in] nUTI UTI operation
  696. \param [in] nSimID SIM ID
  697. \return \a ERR_SUCCESS on success, or error code
  698. */
  699. uint32_t CFW_SmsWriteMessage_V2(
  700. CFW_DIALNUMBER_V2 *pNumber,
  701. uint8_t *pData,
  702. uint16_t nDataSize,
  703. uint16_t nIndex,
  704. uint8_t nStorage,
  705. uint8_t nType,
  706. uint8_t nStatus,
  707. uint16_t nUTI,
  708. CFW_SIM_ID nSimId);
  709. /*! \function changes the status of a SMS message from unsent to sent.
  710. The result should be returned through the following \a EV_CFW_SMS_SET_UNSENT2SENT_RSP event:
  711. \rst
  712. +------+-------+------------+----------+-------------+
  713. | UTI | nType | nParam1 | nParam2 | Description |
  714. +======+=======+============+==========+=============+
  715. | nUTI | 0 | MsgIndex | 0 | OK |
  716. +------+-------+------------+----------+-------------+
  717. | nUTI | 0xF0 | Error code | MsgIndex | Error |
  718. +------+-------+------------+----------+-------------+
  719. \endrst
  720. \param [in] nStorage Specify the memory identifier to delete message
  721. \param [in] nType check msg type, currently only support pp msg
  722. \param [in] nIndex Specify the index of the SMS entry to read from current storage
  723. \param [in] nSendStatus Indicates the status of message in memory
  724. \param [in] nUTI UTI operation
  725. \param [in] nSimID SIM ID
  726. \return \a ERR_SUCCESS on success, or error code
  727. */
  728. uint32_t CFW_SmsSetUnSent2Sent(
  729. uint8_t nStorage,
  730. uint8_t nType,
  731. uint16_t nIndex,
  732. uint8_t nSendStatus,
  733. uint16_t nUTI,
  734. CFW_SIM_ID nSimId);
  735. /*! \function composes PDU data according to the current setting.
  736. \param [in] pTpUd Pointer to the input user date
  737. \param [in] nTpUdl The size of the user date
  738. \param [in] pNumber Pointer to the CFW_DIALNUMBER structure containing the telephone number to send
  739. \param [in] pSmsParam Pointer to the CFW_SMS_PDU_PARAM structure, set the Sms parameters
  740. \param [in] pSmsData The output of the PDU date
  741. \param [in] nSimID SIM ID
  742. \param [in] pSmsDataSize The size of the PDU date for output
  743. \return \a ERR_SUCCESS on success, or error code
  744. */
  745. uint32_t CFW_SmsComposePdu(
  746. uint8_t *pTpUd, ///< "ABC"
  747. uint16_t nTpUdl, ///< 3
  748. CFW_DIALNUMBER *pNumber, ///< telephone number to send, 135XXX,
  749. CFW_SMS_PDU_PARAM *pSmsParam, ///< NULL
  750. uint8_t **pSmsData, ///< ouput need to maloc.
  751. CFW_SIM_ID nSimId,
  752. uint16_t *pSmsDataSize ///< size
  753. );
  754. /*! \function extracts message node from SMS message list return by EV_CFW_SMS_LIST_MESSAGE_RSP event.
  755. \param [in] pListResult Pointer to the message list head which produced by the notification's
  756. nParam1 of CFW_SmsListMessages function
  757. \param [in] nIndex Specify the index based on zero. This parameter is ranging from 0 t0 0xFFFF
  758. \param [in] pNode Pointer to the CFW_SMS_NODE type to receive the SMS message node
  759. \param [in] nSimID SIM ID
  760. \return \a ERR_SUCCESS on success, or error code
  761. */
  762. uint32_t CFW_SmsGetMessageNode(
  763. void *pListResult,
  764. uint16_t nIndex,
  765. CFW_SMS_NODE **pNode,
  766. CFW_SIM_ID nSimId);
  767. /*! \function extracts message node from SMS message list return by EV_CFW_SMS_LIST_MESSAGE_RSP event.
  768. \param [in] pListResult Pointer to the message list head which produced by the notification's
  769. nParam1 of CFW_SmsListMessages function
  770. \param [in] nIndex Specify the index based on zero. This parameter is ranging from 0 t0 0xFFFF
  771. \param [in] pNode Pointer to the CFW_SMS_NODE_EX type to receive the SMS message node
  772. \param [in] nSimID SIM ID
  773. \return \a ERR_SUCCESS on success, or error code
  774. */
  775. uint32_t CFW_SmsGetMessageNodeEx(
  776. void *pListResult,
  777. uint16_t nIndex,
  778. CFW_SMS_NODE_EX *pNode,
  779. CFW_SIM_ID nSimId);
  780. /*! \function extracts message node from SMS message list return by EV_CFW_SMS_LIST_MESSAGE_RSP event.
  781. \param [in] pListResult Pointer to the message list head which produced by the notification's
  782. nParam1 of CFW_SmsListMessages function
  783. \param [in] nIndex Specify the index based on zero. This parameter is ranging from 0 t0 0xFFFF
  784. \param [in] pNode Pointer to the CFW_SMS_NODE_EX type to receive the SMS message node
  785. \param [in] nSimID SIM ID
  786. \param [in] nFormat TEXT or PDU mode
  787. \return \a ERR_SUCCESS on success, or error code
  788. */
  789. uint32_t CFW_SmsGetMessageNodeV2(
  790. void *pListResult,
  791. uint16_t nIndex,
  792. CFW_SMS_NODE_EX *pNode,
  793. uint8_t nFormat,
  794. CFW_SIM_ID nSimId);
  795. uint32_t CFW_SmsInitComplete(
  796. uint16_t nUTI,
  797. CFW_SIM_ID nSIMID);
  798. uint32_t CFW_SetSMSConcat(
  799. bool bConcat,
  800. CFW_SIM_ID nSimID);
  801. bool CFW_GetSMSConcat(
  802. CFW_SIM_ID nSimID);
  803. uint32_t CFW_SimReadMessage(
  804. uint16_t nLocation,
  805. uint32_t nIndex,
  806. uint16_t nUTI,
  807. CFW_SIM_ID nSimID);
  808. uint32_t CFW_SimWriteMessage(
  809. uint16_t nLocation,
  810. uint32_t nIndex,
  811. uint8_t *pData,
  812. uint8_t nDataSize,
  813. uint16_t nUTI,
  814. CFW_SIM_ID nSimID);
  815. typedef struct _CFW_EMS_INFO
  816. {
  817. uint8_t nMaxNum; ///< Maximum number of short messages in the enhanced concatenated short message.
  818. uint8_t nCurrentNum; ///< Sequence number of the current short message
  819. uint16_t nRerNum; ///< reference number
  820. uint16_t nDesPortNum; ///< Destination port
  821. uint16_t nOriPortNum; ///< Originator port
  822. } CFW_EMS_INFO;
  823. //SMS Configuration
  824. #define CFW_SMS_STORAGE_AUTO 0x00
  825. // SMS module
  826. //message storage
  827. #define CFW_SMS_STORAGE_ME 0x01
  828. #define CFW_SMS_STORAGE_SM 0x02
  829. #define CFW_SMS_STORAGE_NS 0x04 //No Save
  830. #define CFW_SMS_STORAGE_MT 0x08 //SM preferred
  831. //message type
  832. #define CFW_SMS_TYPE_PP 0X01
  833. #define CFW_SMS_TYPE_CB 0X02
  834. #define CFW_SMS_TYPE_SR 0X04
  835. #define CFW_SMS_STORED_STATUS_UNREAD 0x01
  836. #define CFW_SMS_STORED_STATUS_READ 0x02
  837. #define CFW_SMS_STORED_STATUS_UNSENT 0x04
  838. #define CFW_SMS_STORED_STATUS_SENT_NOT_SR_REQ 0x08
  839. #define CFW_SMS_STORED_STATUS_SENT_SR_REQ_NOT_RECV 0x10
  840. #define CFW_SMS_STORED_STATUS_SENT_SR_REQ_NOT_STORE 0x20
  841. #define CFW_SMS_STORED_STATUS_SENT_SR_REQ_RECV_STORE 0x40
  842. #define CFW_SMS_STORED_STATUS_STORED_ALL 0x80
  843. #define CFW_SMS_COPY_ME2SM 0
  844. #define CFW_SMS_COPY_SM2ME 1
  845. typedef struct _CFW_SMS_PARAMETER
  846. {
  847. uint8_t vp;
  848. uint8_t pid;
  849. uint8_t dcs;
  850. uint8_t mti;
  851. uint8_t ssr;
  852. uint8_t bearer : 2;
  853. uint8_t bSimChange : 1;
  854. uint8_t bReserved : 5;
  855. uint8_t mr;
  856. uint8_t rp;
  857. uint8_t nNumber[12]; // nNumber[0]=len,nNumber[1]=[91] nNumber[2]=[86] ... in BCD.
  858. //added by fengwei 20080707 for AT command begin
  859. uint8_t udhi;
  860. uint8_t rd;
  861. uint8_t vpf;
  862. uint8_t nSaveToSimFlag; // 1 save sca to sim, 2 save pid to sim, 4 save dcs to sim, 8 save vp to sim, 0 not save to sim.
  863. uint8_t nIndex; //the index of param set, 0 to 4 is valuable
  864. uint8_t bDefault; //if set param to current(Default) param, TRUE: save, FALSE, not save.
  865. //added by fengwei 20080707 for AT command end
  866. } CFW_SMS_PARAMETER;
  867. typedef struct _CFW_SMS_STORAGE_INFO
  868. {
  869. uint16_t usedSlot;
  870. uint16_t totalSlot;
  871. uint16_t unReadRecords;
  872. uint16_t readRecords;
  873. uint16_t sentRecords;
  874. uint16_t unsentRecords;
  875. uint16_t unknownRecords;
  876. uint16_t storageId;
  877. } CFW_SMS_STORAGE_INFO;
  878. /*! \function select the current SMS memory storage to be used for reading,writing,deleting,etc.
  879. \param [in] nStorage Specify the memory identifier to read,list,delete,write and send message
  880. \param [in] nSimID SIM ID
  881. \return \a ERR_SUCCESS on success, or error code
  882. */
  883. uint32_t CFW_CfgSetSmsStorage(
  884. uint8_t nStorage,
  885. CFW_SIM_ID nSimID);
  886. /*! \function select the current SMS memory storage identifier.
  887. \param [out] nStorage Specify the memory identifier to read,list,delete,write and send message
  888. \param [in] nSimID SIM ID
  889. \return \a ERR_SUCCESS on success, or error code
  890. */
  891. uint32_t CFW_CfgGetSmsStorage(
  892. uint8_t *pStorage,
  893. CFW_SIM_ID nSimID);
  894. /*! \function selects the procedure how the receipt of new SMS messages from the network.
  895. \param [in] nOption Specify the rules to store message, nOption can be one of the following value
  896. \param [in] nNewSmsStorage Specify the memory identifier to received messages
  897. \param [in] nSimID SIM ID
  898. \return \a ERR_SUCCESS on success, or error code
  899. */
  900. uint32_t CFW_CfgSetNewSmsOption(
  901. uint8_t nOption,
  902. uint8_t nNewSmsStorage,
  903. CFW_SIM_ID nSimID);
  904. /*! \function selects the procedure how the receipt of new SMS messages from the network.
  905. \param [out] Specify the rules to store message, nOption can be one of the following value
  906. \param [in] nNewSmsStorage Specify the memory identifier to received messages
  907. \param [in] nSimID SIM ID
  908. \return \a ERR_SUCCESS on success, or error code
  909. */
  910. uint32_t CFW_CfgGetNewSmsOption(
  911. uint8_t *pOption,
  912. uint8_t *pNewSmsStorage,
  913. CFW_SIM_ID nSimID);
  914. /*! \function query the overflow presentation mode.This function is called by CFW internally.
  915. \param [in] nMode This parameter can be one of the following value
  916. \param [in] nSimID SIM ID
  917. \return \a ERR_SUCCESS on success, or error code
  918. */
  919. uint32_t CFW_CfgSetSmsOverflowInd(
  920. uint8_t nMode,
  921. CFW_SIM_ID nSimID);
  922. /*! \function sets overflow presentation mode.
  923. \param [out] nMode This parameter can be one of the following value
  924. \param [in] nSimID SIM ID
  925. \return \a ERR_SUCCESS on success, or error code
  926. */
  927. uint32_t CFW_CfgGetSmsOverflowInd(
  928. uint8_t *pMode,
  929. CFW_SIM_ID nSimID);
  930. /*! \function configure Supplementary service notifications.
  931. \param [in] nFormat This parameter can be one of the following value
  932. \param [in] nSimID SIM ID
  933. \return \a ERR_SUCCESS on success, or error code
  934. */
  935. uint32_t CFW_CfgSetSmsFormat(
  936. uint8_t nFormat,
  937. CFW_SIM_ID nSimID);
  938. /*! \function configure Supplementary service notifications.
  939. \param [out] nFormat This parameter can be one of the following value
  940. \param [in] nSimID SIM ID
  941. \return \a ERR_SUCCESS on success, or error code
  942. */
  943. uint32_t CFW_CfgGetSmsFormat(
  944. uint8_t *nFormat,
  945. CFW_SIM_ID nSimID);
  946. /*! \function sets whether or not detailed header information is shown in SMS text mode.
  947. \param [in] nShow This parameter can be one of the following value
  948. \param [in] nSimID SIM ID
  949. \return \a ERR_SUCCESS on success, or error code
  950. */
  951. uint32_t CFW_CfgSetSmsShowTextModeParam(
  952. uint8_t nShow,
  953. CFW_SIM_ID nSimID);
  954. /*! \function gets whether or not detailed header information is shown in SMS text mode.
  955. \param [out] pShow pointer to receive the show value which listed in one of the following value
  956. \param [in] nSimID SIM ID
  957. \return \a ERR_SUCCESS on success, or error code
  958. */
  959. uint32_t CFW_CfgGetSmsShowTextModeParam(
  960. uint8_t *pShow,
  961. CFW_SIM_ID nSimID);
  962. /*! \configures the additional parameters needed for SMS message.
  963. The result should be returned through the following \a EV_CFW_SMS_SET_PARAM_RSP event
  964. \rst
  965. +------+-------+------------+---------+-------------+
  966. | UTI | nType | nParam1 | nParam2 | Description |
  967. +======+=======+============+=========+=============+
  968. | nUTI | 0 | 0 | 0 | OK |
  969. +------+-------+------------+---------+-------------+
  970. | nUTI | 0xF0 | Error code | 0 | Error |
  971. +------+-------+------------+---------+-------------+
  972. \endrst
  973. \param [in] pInfo struct CFW_SMS_PARAMETER
  974. \param [in] nUTI UTI operation
  975. \param [in] nSimID SIM ID
  976. \return \a ERR_SUCCESS on success, or error code
  977. */
  978. uint32_t CFW_CfgSetSmsParam(
  979. CFW_SMS_PARAMETER *pInfo,
  980. uint16_t nUTI,
  981. CFW_SIM_ID nSimID);
  982. /*! \function retrieves the specified configuration parameters of SMS message.
  983. \param [out] pInfo Pointer to CFW_SMS_PARAMETER structure to contain the parameter.
  984. \param [in] nSimID SIM ID
  985. \return \a ERR_SUCCESS on success, or error code
  986. */
  987. uint32_t CFW_CfgGetSmsParam(
  988. CFW_SMS_PARAMETER *pInfo,
  989. uint8_t nIndex,
  990. CFW_SIM_ID nSimID);
  991. uint32_t CFW_CfgSetDefaultSmsParam(
  992. CFW_SMS_PARAMETER *pInfo,
  993. CFW_SIM_ID nSimID);
  994. uint32_t CFW_CfgGetDefaultSmsParam(
  995. CFW_SMS_PARAMETER *pInfo,
  996. CFW_SIM_ID nSimID);
  997. /*! \function Set the information about an SMS store.
  998. \param [in] pStorageInfo Pointer to the CFW_SMS_STORAGE_INFO structure to hold the storage information.
  999. \param [in] nStorage Specify the memory identifier to Storage message
  1000. \param [in] nSimID SIM ID
  1001. \return \a ERR_SUCCESS on success, or error code
  1002. */
  1003. uint32_t CFW_CfgSetSmsStorageInfo(
  1004. CFW_SMS_STORAGE_INFO *pStorageInfo,
  1005. uint16_t nStorage,
  1006. CFW_SIM_ID nSimID);
  1007. /*! \function receives the information about an SMS store.
  1008. \param [out] pStorageInfo Pointer to the CFW_SMS_STORAGE_INFO structure to hold the storage information.
  1009. \param [in] nStorage Specify the memory identifier to Storage message
  1010. \param [in] nSimID SIM ID
  1011. \return \a ERR_SUCCESS on success, or error code
  1012. */
  1013. uint32_t CFW_CfgGetSmsStorageInfo(
  1014. CFW_SMS_STORAGE_INFO *pStorageInfo,
  1015. uint16_t nStorage,
  1016. CFW_SIM_ID nSimID);
  1017. uint32_t CFW_SimGetSmsTotalNum(
  1018. uint16_t nUTI,
  1019. CFW_SIM_ID nSimID);
  1020. uint32_t CFW_CfgSelectSmsService(
  1021. uint8_t nService,
  1022. uint8_t *pSupportedType);
  1023. uint32_t CFW_CfgQuerySmsService(
  1024. uint8_t *pService);
  1025. uint32_t CFW_CfgSetSmsCB(
  1026. uint8_t mode,
  1027. uint8_t mids[6],
  1028. uint8_t dcss[6]);
  1029. uint32_t CFW_CfgGetSmsCB(
  1030. uint8_t *pMode,
  1031. uint8_t mids[6],
  1032. uint8_t dcss[6]);
  1033. uint32_t CFW_SmsMoInit(
  1034. uint16_t nUti,
  1035. CFW_SIM_ID nSimId);
  1036. uint32_t CFW_SimInit(
  1037. bool bRstSim,
  1038. CFW_SIM_ID nSimID);
  1039. uint32_t CFW_SendMtSmsAckPPError(uint8_t nCause, CFW_SIM_ID nSimID);
  1040. uint8_t CFW_GetSmsSeviceMode(void);
  1041. uint8_t CFW_SetSmsSeviceMode(uint8_t service);
  1042. uint32_t CFW_SendMtSmsAckPPError(uint8_t nCause, CFW_SIM_ID nSimID);
  1043. uint32_t CFW_CfgGetNewSmsOptionMT(uint8_t *nOption, uint8_t *nNewSmsStorage, CFW_SIM_ID nSimID);
  1044. uint32_t CFW_CfgSetNewSmsOptionMT(uint8_t nOption, uint8_t nNewSmsStorage, CFW_SIM_ID nSimID);
  1045. uint32_t CFW_SmsListFree(void *pListResult, uint8_t nCount, uint8_t nIndex, CFW_SIM_ID nSimID);
  1046. uint32_t CFW_SmsMtSmsPPAckReq(CFW_SIM_ID nSimId);
  1047. /*
  1048. ================================================================================
  1049. Structure : api_SmsCBPageInd_t
  1050. --------------------------------------------------------------------------------
  1051. Direction : API -> MMI
  1052. Scope : Used to indicate MMI that an SMS-CB page has been received
  1053. ================================================================================
  1054. */
  1055. typedef struct
  1056. {
  1057. uint8_t DataLen; // Page size, in byte
  1058. uint8_t Data[1]; // In fact, DataLen elts must be allocated for this
  1059. // array
  1060. } CB_PAGE_IND_STRUCT;
  1061. uint32_t CFW_CbWriteContext(CB_CTX_T CtxData, CFW_SIM_ID nSimID);
  1062. uint32_t CFW_CbReadContext(CB_CTX_T *CtxData, CFW_SIM_ID nSimID);
  1063. uint32_t CFW_CbAct(uint16_t nUTI, CFW_SIM_ID nSimID);
  1064. uint32_t CFW_CbDeAct(uint16_t nUTI, CFW_SIM_ID nSimID);
  1065. uint32_t CFW_SetMoSmsRetryCount(uint8_t smc_count, uint8_t smr_count, CFW_SIM_ID nSimID);
  1066. uint32_t CFW_CbSetType(uint8_t nCbType, CFW_SIM_ID nSimID);
  1067. #define CFW_CB_MSG_LEN 93
  1068. typedef struct
  1069. {
  1070. uint16_t MId;
  1071. uint8_t DCS;
  1072. uint8_t len;
  1073. uint8_t data[CFW_CB_MSG_LEN];
  1074. } CFW_SMS_CB_MSG_NODE_T;
  1075. uint32_t CFW_SmsCbGetNode(void *pCBList, uint8_t nIndex, uint8_t nCount, CFW_SMS_CB_MSG_NODE_T *pNode, CFW_SIM_ID nSimId);
  1076. uint32_t CFW_SmsMtSmsPPAckReqWithData(uint8_t *data, uint16_t length, CFW_SIM_ID nSimID);
  1077. uint32_t CFW_SendMtSmsAckPPErrorWithData(uint8_t nCause, uint8_t *data, uint16_t length, CFW_SIM_ID nSimID);
  1078. #endif