wrapper 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  1. WRAPPER_NOTE:
  2. /**
  3. * NOTE:
  4. *
  5. * HAL_TCP_xxx API reference implementation: wrappers/os/ubuntu/HAL_TCP_linux.c
  6. *
  7. */
  8. HAL_Malloc:
  9. /**
  10. * @brief Allocates a block of size bytes of memory, returning a pointer to the beginning of the block.
  11. *
  12. * @param [in] size @n specify block size in bytes.
  13. * @return A pointer to the beginning of the block.
  14. * @see None.
  15. * @note Block value is indeterminate.
  16. */
  17. HAL_Free:
  18. /**
  19. * @brief Deallocate memory block
  20. *
  21. * @param[in] ptr @n Pointer to a memory block previously allocated with platform_malloc.
  22. * @return None.
  23. * @see None.
  24. * @note None.
  25. */
  26. HAL_Printf:
  27. /**
  28. * @brief Writes formatted data to stream.
  29. *
  30. * @param [in] fmt: @n String that contains the text to be written, it can optionally contain embedded format specifiers
  31. that specifies how subsequent arguments are converted for output.
  32. * @param [in] ...: @n the variable argument list, for formatted and inserted in the resulting string replacing their respective specifiers.
  33. * @return None.
  34. * @see None.
  35. * @note None.
  36. */
  37. HAL_Snprintf:
  38. /**
  39. * @brief Writes formatted data to string.
  40. *
  41. * @param [out] str: @n String that holds written text.
  42. * @param [in] len: @n Maximum length of character will be written
  43. * @param [in] fmt: @n Format that contains the text to be written, it can optionally contain embedded format specifiers
  44. that specifies how subsequent arguments are converted for output.
  45. * @param [in] ...: @n the variable argument list, for formatted and inserted in the resulting string replacing their respective specifiers.
  46. * @return bytes of character successfully written into string.
  47. * @see None.
  48. * @note None.
  49. */
  50. HAL_SleepMs:
  51. /**
  52. * @brief Sleep thread itself.
  53. *
  54. * @param [in] ms @n the time interval for which execution is to be suspended, in milliseconds.
  55. * @return None.
  56. * @see None.
  57. * @note None.
  58. */
  59. HAL_UptimeMs:
  60. /**
  61. * @brief Retrieves the number of milliseconds that have elapsed since the system was boot.
  62. *
  63. * @return the number of milliseconds.
  64. * @see None.
  65. * @note None.
  66. */
  67. HAL_MutexCreate:
  68. /**
  69. * @brief Create a mutex.
  70. *
  71. * @retval NULL : Initialize mutex failed.
  72. * @retval NOT_NULL : The mutex handle.
  73. * @see None.
  74. * @note None.
  75. */
  76. HAL_MutexDestroy:
  77. /**
  78. * @brief Destroy the specified mutex object, it will release related resource.
  79. *
  80. * @param [in] mutex @n The specified mutex.
  81. * @return None.
  82. * @see None.
  83. * @note None.
  84. */
  85. HAL_MutexLock:
  86. /**
  87. * @brief Waits until the specified mutex is in the signaled state.
  88. *
  89. * @param [in] mutex @n the specified mutex.
  90. * @return None.
  91. * @see None.
  92. * @note None.
  93. */
  94. HAL_MutexUnlock:
  95. /**
  96. * @brief Releases ownership of the specified mutex object..
  97. *
  98. * @param [in] mutex @n the specified mutex.
  99. * @return None.
  100. * @see None.
  101. * @note None.
  102. */
  103. HAL_GetProductKey:
  104. /**
  105. * @brief Get product key from user's system persistent storage
  106. *
  107. * @param [ou] product_key: array to store product key, max length is IOTX_PRODUCT_KEY_LEN
  108. * @return the actual length of product key
  109. */
  110. HAL_GetDeviceName:
  111. /**
  112. * @brief Get device name from user's system persistent storage
  113. *
  114. * @param [ou] device_name: array to store device name, max length is IOTX_DEVICE_NAME_LEN
  115. * @return the actual length of device name
  116. */
  117. HAL_GetDeviceSecret:
  118. /**
  119. * @brief Get device secret from user's system persistent storage
  120. *
  121. * @param [ou] device_secret: array to store device secret, max length is IOTX_DEVICE_SECRET_LEN
  122. * @return the actual length of device secret
  123. */
  124. HAL_GetFirmwareVersion:
  125. /**
  126. * @brief Get firmware version
  127. *
  128. * @param [ou] version: array to store firmware version, max length is IOTX_FIRMWARE_VER_LEN
  129. * @return the actual length of firmware version
  130. */
  131. HAL_TCP_Establish:
  132. /**
  133. * @brief Establish a TCP connection.
  134. *
  135. * @param [in] host: @n Specify the hostname(IP) of the TCP server
  136. * @param [in] port: @n Specify the TCP port of TCP server
  137. *
  138. * @return The handle of TCP connection.
  139. @retval (uintptr_t)(-1): Fail.
  140. @retval All other values(0 included): Success, the value is handle of this TCP connection.
  141. */
  142. HAL_TCP_Destroy:
  143. /**
  144. * @brief Destroy the specific TCP connection.
  145. *
  146. * @param [in] fd: @n Specify the TCP connection by handle.
  147. *
  148. * @return The result of destroy TCP connection.
  149. * @retval < 0 : Fail.
  150. * @retval 0 : Success.
  151. */
  152. HAL_TCP_Write:
  153. /**
  154. * @brief Write data into the specific TCP connection.
  155. * The API will return immediately if 'len' be written into the specific TCP connection.
  156. *
  157. * @param [in] fd @n A descriptor identifying a connection.
  158. * @param [in] buf @n A pointer to a buffer containing the data to be transmitted.
  159. * @param [in] len @n The length, in bytes, of the data pointed to by the 'buf' parameter.
  160. * @param [in] timeout_ms @n Specify the timeout value in millisecond. In other words, the API block 'timeout_ms' millisecond maximumly.
  161. *
  162. * @retval < 0 : TCP connection error occur..
  163. * @retval 0 : No any data be write into the TCP connection in 'timeout_ms' timeout period.
  164. * @retval (0, len] : The total number of bytes be written in 'timeout_ms' timeout period.
  165. * @see None.
  166. */
  167. HAL_TCP_Read:
  168. /**
  169. * @brief Read data from the specific TCP connection with timeout parameter.
  170. * The API will return immediately if 'len' be received from the specific TCP connection.
  171. *
  172. * @param [in] fd @n A descriptor identifying a TCP connection.
  173. * @param [out] buf @n A pointer to a buffer to receive incoming data.
  174. * @param [out] len @n The length, in bytes, of the data pointed to by the 'buf' parameter.
  175. * @param [in] timeout_ms @n Specify the timeout value in millisecond. In other words, the API block 'timeout_ms' millisecond maximumly.
  176. *
  177. * @retval -2 : TCP connection error occur.
  178. * @retval -1 : TCP connection be closed by remote server.
  179. * @retval 0 : No any data be received in 'timeout_ms' timeout period.
  180. * @retval (0, len] : The total number of bytes be received in 'timeout_ms' timeout period.
  181. * @see None.
  182. */
  183. wrapper_mqtt_init:
  184. /**
  185. * @brief Init the MQTT client
  186. * This function initialize the data structures.
  187. *
  188. * @param [in] mqtt_params: specify the MQTT client parameter.
  189. *
  190. * @retval NULL : Init failed.
  191. * @retval NOT_NULL : The handle of MQTT client.
  192. * @see None.
  193. */
  194. wrapper_mqtt_connect:
  195. /**
  196. * @brief Establish MQTT connection.
  197. * This function establish MQTT connection.
  198. *
  199. * @param [in] client: The handle of MQTT client.
  200. *
  201. * @retval 0 : MQTT connect seccuss.
  202. * @retval < 0 : MQTT connect failed.
  203. * @see None.
  204. */
  205. wrapper_mqtt_yield:
  206. /**
  207. * @brief Handle MQTT packet from remote server and process timeout request
  208. * which include the MQTT subscribe, unsubscribe, publish(QOS >= 1), reconnect, etc..
  209. *
  210. * @param [in] client: specify the MQTT client.
  211. * @param [in] timeout_ms: specify the timeout in millisecond in this loop.
  212. *
  213. * @return status.
  214. * @see None.
  215. */
  216. wrapper_mqtt_check_state:
  217. /**
  218. * @brief check whether MQTT connection is established or not.
  219. *
  220. * @param [in] client: specify the MQTT client.
  221. *
  222. * @retval 1 : MQTT in abnormal state.
  223. * @retval 0 : MQTT in normal state.
  224. * @see None.
  225. */
  226. wrapper_mqtt_subscribe:
  227. /**
  228. * @brief Subscribe MQTT topic.
  229. *
  230. * @param [in] client: specify the MQTT client.
  231. * @param [in] topic_filter: specify the topic filter.
  232. * @param [in] qos: specify the MQTT Requested QoS.
  233. * @param [in] topic_handle_func: specify the topic handle callback-function.
  234. * @param [in] pcontext: specify context. When call 'topic_handle_func', it will be passed back.
  235. *
  236. * @retval -1 : Subscribe failed.
  237. * @retval >=0 : Subscribe successful.
  238. The value is a unique ID of this request.
  239. The ID will be passed back when callback 'iotx_mqtt_param_t:handle_event'.
  240. * @see None.
  241. */
  242. wrapper_mqtt_subscribe_sync:
  243. /**
  244. * @brief Subscribe MQTT topic and wait suback.
  245. *
  246. * @param [in] client: specify the MQTT client.
  247. * @param [in] topic_filter: specify the topic filter.
  248. * @param [in] qos: specify the MQTT Requested QoS.
  249. * @param [in] topic_handle_func: specify the topic handle callback-function.
  250. * @param [in] pcontext: specify context. When call 'topic_handle_func', it will be passed back.
  251. * @param [in] timeout_ms: time in ms to wait.
  252. *
  253. * @retval -1 : Subscribe failed.
  254. * @retval >=0 : Subscribe successful.
  255. The value is a unique ID of this request.
  256. The ID will be passed back when callback 'iotx_mqtt_param_t:handle_event'.
  257. * @see None.
  258. */
  259. wrapper_mqtt_unsubscribe:
  260. /**
  261. * @brief Unsubscribe MQTT topic.
  262. *
  263. * @param [in] client: specify the MQTT client.
  264. * @param [in] topic_filter: specify the topic filter.
  265. *
  266. * @retval -1 : Unsubscribe failed.
  267. * @retval >=0 : Unsubscribe successful.
  268. The value is a unique ID of this request.
  269. The ID will be passed back when callback 'iotx_mqtt_param_t:handle_event'.
  270. * @see None.
  271. */
  272. wrapper_mqtt_publish:
  273. /**
  274. * @brief Publish message to specific topic.
  275. *
  276. * @param [in] client: specify the MQTT client.
  277. * @param [in] topic_name: specify the topic name.
  278. * @param [in] topic_msg: specify the topic message.
  279. *
  280. * @retval -1 : Publish failed.
  281. * @retval 0 : Publish successful, where QoS is 0.
  282. * @retval >0 : Publish successful, where QoS is >= 0.
  283. The value is a unique ID of this request.
  284. The ID will be passed back when callback 'iotx_mqtt_param_t:handle_event'.
  285. * @see None.
  286. */
  287. wrapper_mqtt_release:
  288. /**
  289. * @brief Release the MQTT client
  290. * This function disconnect MQTT connection and release the related resource.
  291. *
  292. * @param [in] client: pointer of handle, specify the MQTT client.
  293. *
  294. * @retval 0 : Release success.
  295. * @retval -1 : Release failed.
  296. * @see None.
  297. */
  298. wrapper_mqtt_nwk_event_handler:
  299. /**
  300. * @brief Only used in async network stack and FEATURE_ASYNC_PROTOCOL_STACK must be selected
  301. *
  302. * @param [in] client: specify the MQTT client.
  303. * @param [in] event: specify the network event.
  304. * @param [in] param: specify the network params.
  305. *
  306. * @retval -1 : Handle failed.
  307. * @retval 0 : Handle successful.
  308. *
  309. */
  310. HAL_SemaphoreCreate:
  311. /**
  312. * @brief create a semaphore
  313. *
  314. * @return semaphore handle.
  315. * @see None.
  316. * @note The recommended value of maximum count of the semaphore is 255.
  317. */
  318. HAL_SemaphoreDestroy:
  319. /**
  320. * @brief destory a semaphore
  321. *
  322. * @param[in] sem @n the specified sem.
  323. * @return None.
  324. * @see None.
  325. * @note None.
  326. */
  327. HAL_SemaphorePost:
  328. /**
  329. * @brief signal thread wait on a semaphore
  330. *
  331. * @param[in] sem @n the specified semaphore.
  332. * @return None.
  333. * @see None.
  334. * @note None.
  335. */
  336. HAL_SemaphoreWait:
  337. /**
  338. * @brief wait on a semaphore
  339. *
  340. * @param[in] sem @n the specified semaphore.
  341. * @param[in] timeout_ms @n timeout interval in millisecond.
  342. If timeout_ms is PLATFORM_WAIT_INFINITE, the function will return only when the semaphore is signaled.
  343. * @return
  344. @verbatim
  345. = 0: The state of the specified object is signaled.
  346. = -1: The time-out interval elapsed, and the object's state is nonsignaled.
  347. @endverbatim
  348. * @see None.
  349. * @note None.
  350. */
  351. HAL_ThreadCreate:
  352. /**
  353. * @brief create a thread
  354. *
  355. * @param[out] thread_handle @n The new thread handle, memory allocated before thread created and return it, free it after thread joined or exit.
  356. * @param[in] start_routine @n A pointer to the application-defined function to be executed by the thread.
  357. This pointer represents the starting address of the thread.
  358. * @param[in] arg @n A pointer to a variable to be passed to the start_routine.
  359. * @param[in] hal_os_thread_param @n A pointer to stack params.
  360. * @param[out] stack_used @n if platform used stack buffer, set stack_used to 1, otherwise set it to 0.
  361. * @return
  362. @verbatim
  363. = 0: on success.
  364. = -1: error occur.
  365. @endverbatim
  366. * @see None.
  367. * @note None.
  368. */
  369. HAL_AT_Uart_Init:
  370. /**
  371. * Initialises a UART interface
  372. *
  373. *
  374. * @param[in] uart the interface which should be initialised
  375. *
  376. * @return 0 : on success, EIO : if an error occurred with any step
  377. */
  378. HAL_AT_Uart_Deinit:
  379. /**
  380. * Deinitialises a UART interface
  381. *
  382. * @param[in] uart the interface which should be deinitialised
  383. *
  384. * @return 0 : on success, EIO : if an error occurred with any step
  385. */
  386. HAL_AT_Uart_Send:
  387. /**
  388. * Transmit data on a UART interface
  389. *
  390. * @param[in] uart the UART interface
  391. * @param[in] data pointer to the start of data
  392. * @param[in] size number of bytes to transmit
  393. * @param[in] timeout timeout in milisecond, set this value to HAL_WAIT_FOREVER
  394. * if you want to wait forever
  395. *
  396. * @return 0 : on success, EIO : if an error occurred with any step
  397. */
  398. HAL_AT_Uart_Recv:
  399. /**
  400. * Receive data on a UART interface
  401. *
  402. * @param[in] uart the UART interface
  403. * @param[out] data pointer to the buffer which will store incoming data
  404. * @param[in] expect_size number of bytes to receive
  405. * @param[out] recv_size number of bytes received
  406. * @param[in] timeout timeout in milisecond, set this value to HAL_WAIT_FOREVER
  407. * if you want to wait forever
  408. *
  409. * @return 0 : on success, EIO : if an error occurred with any step
  410. */
  411. HAL_AT_CONN_Init:
  412. /**
  413. * Module low level init so that it's ready to setup socket connection.
  414. *
  415. * @return 0 - success, -1 - failure
  416. */
  417. HAL_AT_CONN_Start:
  418. /**
  419. * Start a socket connection via module.
  420. *
  421. * @param[in] conn - connect parameters which are used to setup
  422. * the socket connection.
  423. *
  424. * @return 0 - success, -1 - failure
  425. */
  426. HAL_AT_CONN_Send:
  427. /**
  428. * Send data via module.
  429. * This function does not return until all data sent.
  430. *
  431. * @param[in] fd - the file descripter to operate on.
  432. * @param[in] data - pointer to data to send.
  433. * @param[in] len - length of the data.
  434. * @param[in] remote_ip - remote port number (optional).
  435. * @param[in] remote_port - remote port number (optional).
  436. *
  437. * @return 0 - success, -1 - failure
  438. */
  439. HAL_AT_CONN_DomainToIp:
  440. /**
  441. * Get IP information of the corresponding domain.
  442. * Currently only one IP string is returned (even when the domain
  443. * coresponses to mutliple IPs). Note: only IPv4 is supported.
  444. *
  445. * @param[in] domain - the domain string.
  446. * @param[out] ip - the place to hold the dot-formatted ip string.
  447. *
  448. * @return 0 - success, -1 - failure
  449. */
  450. HAL_AT_CONN_Close:
  451. /**
  452. * Close the socket connection.
  453. *
  454. * @param[in] fd - the file descripter to operate on.
  455. * @param[in] remote_port - remote port number (optional).
  456. *
  457. * @return 0 - success, -1 - failure
  458. */
  459. HAL_AT_CONN_Deinit:
  460. /**
  461. * Destroy or exit low level state if necessary.
  462. *
  463. * @return 0 - success, -1 - failure
  464. */
  465. HAL_AT_CONN_RegInputCb:
  466. /**
  467. * Register network connection data input function
  468. * Input data from module.
  469. * This callback should be called when the data is received from the module
  470. * It should tell the sal where the data comes from.
  471. * @param[in] fd - the file descripter to operate on.
  472. * @param[in] data - the received data.
  473. * @param[in] len - expected length of the data when IN,
  474. * and real read len when OUT.
  475. * @param[in] addr - remote ip address. Caller manages the
  476. memory (optional).
  477. * @param[in] port - remote port number (optional).
  478. *
  479. * @return 0 - success, -1 - failure
  480. */
  481. HAL_AT_MQTT_Init:
  482. /**
  483. * Initialize low layer
  484. *
  485. * @param[in] iotx_mqtt_param_t a struct contain usename, password, etc.
  486. *
  487. * @return 0 - success, -1 - failure
  488. */
  489. int HAL_AT_MQTT_Deinit:
  490. /**
  491. * Deinit low layer
  492. *
  493. * @return 0 - success, -1 - failure
  494. */
  495. int HAL_AT_MQTT_Connect:
  496. /**
  497. * Setup MQTT Connection
  498. *
  499. * @param[in] product key (optional).
  500. * @param[in] device name (optional).
  501. * @param[in] device Secret (optional).
  502. *
  503. * @return 0 - success, -1 - failure
  504. */
  505. HAL_AT_MQTT_Disconnect:
  506. /**
  507. * Close MQTT connection
  508. *
  509. * @return 0 - success, -1 - failure
  510. */
  511. HAL_AT_MQTT_Subscribe:
  512. /**
  513. * Subscribe topic
  514. *
  515. * @param[in] topic
  516. * @param[in] qos
  517. * @param[in] mqtt_packet_id
  518. * @param[out] mqtt_status
  519. * @param[in] timeout_ms
  520. *
  521. * @return 0 - success, -1 - failure
  522. */
  523. HAL_AT_MQTT_Unsubscribe:
  524. /**
  525. * Unsubscribe topic
  526. *
  527. * @param[in] topic
  528. * @param[in] mqtt_packet_id
  529. * @param[out] mqtt_status
  530. *
  531. * @return 0 - success, -1 - failure
  532. */
  533. HAL_AT_MQTT_Publish:
  534. /**
  535. * Publish message
  536. *
  537. * @param[in] topic
  538. * @param[in] qos
  539. * @param[in] message
  540. * @param[in] msg_len
  541. *
  542. * @return 0 - success, -1 - failure
  543. */
  544. HAL_AT_MQTT_State:
  545. /**
  546. * Check connection status
  547. *
  548. * @return 0 - invalid, 1 - initialized, 2 - connected, 3 - disconnected, 4 - disconnect-reconnecting
  549. */
  550. HAL_DTLSHooks_set:
  551. /**
  552. * @brief Set malloc/free function.
  553. *
  554. * @param [in] hooks: @n Specify malloc/free function you want to use
  555. *
  556. * @retval DTLS_SUCCESS : Success.
  557. @retval other : Fail.
  558. * @see None.
  559. * @note None.
  560. */
  561. HAL_DTLSSession_create:
  562. /**
  563. * @brief Establish a DSSL connection.
  564. *
  565. * @param [in] p_options: @n Specify paramter of DTLS
  566. @verbatim
  567. p_host : @n Specify the hostname(IP) of the DSSL server
  568. port : @n Specify the DSSL port of DSSL server
  569. p_ca_cert_pem : @n Specify the root certificate which is PEM format.
  570. @endverbatim
  571. * @return DSSL handle.
  572. * @see None.
  573. * @note None.
  574. */
  575. HAL_DTLSSession_write:
  576. /**
  577. * @brief Write data into the specific DSSL connection.
  578. *
  579. * @param [in] context @n A descriptor identifying a connection.
  580. * @param [in] p_data @n A pointer to a buffer containing the data to be transmitted.
  581. * @param [in] p_datalen @n The length, in bytes, of the data pointed to by the 'p_data' parameter.
  582. * @retval DTLS_SUCCESS : Success.
  583. @retval other : Fail.
  584. * @see None.
  585. */
  586. HAL_DTLSSession_read:
  587. /**
  588. * @brief Read data from the specific DSSL connection with timeout parameter.
  589. * The API will return immediately if len be received from the specific DSSL connection.
  590. *
  591. * @param [in] context @n A descriptor identifying a DSSL connection.
  592. * @param [in] p_data @n A pointer to a buffer to receive incoming data.
  593. * @param [in] p_datalen @n The length, in bytes, of the data pointed to by the 'p_data' parameter.
  594. * @param [in] timeout_ms @n Specify the timeout value in millisecond. In other words, the API block 'timeout_ms' millisecond maximumly.
  595. * @return The result of read data from DSSL connection
  596. * @retval DTLS_SUCCESS : Read success.
  597. * @retval DTLS_FATAL_ALERT_MESSAGE : Recv peer fatal alert message.
  598. * @retval DTLS_PEER_CLOSE_NOTIFY : The DTLS session was closed by peer.
  599. * @retval DTLS_READ_DATA_FAILED : Read data fail.
  600. * @see None.
  601. */
  602. HAL_DTLSSession_free:
  603. /**
  604. * @brief Destroy the specific DSSL connection.
  605. *
  606. * @param[in] context: @n Handle of the specific connection.
  607. *
  608. * @return The result of free dtls session
  609. * @retval DTLS_SUCCESS : Read success.
  610. * @retval DTLS_INVALID_PARAM : Invalid parameter.
  611. * @retval DTLS_INVALID_CA_CERTIFICATE : Invalid CA Certificate.
  612. * @retval DTLS_HANDSHAKE_IN_PROGRESS : Handshake in progress.
  613. * @retval DTLS_HANDSHAKE_FAILED : Handshake failed.
  614. * @retval DTLS_FATAL_ALERT_MESSAGE : Recv peer fatal alert message.
  615. * @retval DTLS_PEER_CLOSE_NOTIFY : The DTLS session was closed by peer.
  616. * @retval DTLS_SESSION_CREATE_FAILED : Create session fail.
  617. * @retval DTLS_READ_DATA_FAILED : Read data fail.
  618. */