ex
Fork of mbed-os-example-mbed5-blinky by
DuerOS-Light-SDK-v1.1.0/duer-os-light/src/iot-baidu-ca/source/baidu_ca_trans_encrypted.h@47:9e361da97763, 2017-07-18 (annotated)
- Committer:
- TMBOY
- Date:
- Tue Jul 18 16:54:45 2017 +0800
- Revision:
- 47:9e361da97763
?
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| TMBOY | 47:9e361da97763 | 1 | // Copyright 2017 Baidu Inc. All Rights Reserved. |
| TMBOY | 47:9e361da97763 | 2 | // Author: Su Hao (suhao@baidu.com) |
| TMBOY | 47:9e361da97763 | 3 | // |
| TMBOY | 47:9e361da97763 | 4 | // Description: Define the encrypted networks I/O. |
| TMBOY | 47:9e361da97763 | 5 | |
| TMBOY | 47:9e361da97763 | 6 | #ifndef BAIDU_IOT_TINYDU_IOT_OS_SRC_IOT_BAIDU_CA_SOURCE_BAIDU_CA_TRANS_ENCRYPTED_H |
| TMBOY | 47:9e361da97763 | 7 | #define BAIDU_IOT_TINYDU_IOT_OS_SRC_IOT_BAIDU_CA_SOURCE_BAIDU_CA_TRANS_ENCRYPTED_H |
| TMBOY | 47:9e361da97763 | 8 | |
| TMBOY | 47:9e361da97763 | 9 | #include "baidu_ca_transport.h" |
| TMBOY | 47:9e361da97763 | 10 | |
| TMBOY | 47:9e361da97763 | 11 | /* |
| TMBOY | 47:9e361da97763 | 12 | * Connect to the host. |
| TMBOY | 47:9e361da97763 | 13 | * |
| TMBOY | 47:9e361da97763 | 14 | * @Param hdlr, in, the context for the transport |
| TMBOY | 47:9e361da97763 | 15 | * @Param addr, in, the target address infomations |
| TMBOY | 47:9e361da97763 | 16 | * @Return bca_status_t, the operation result |
| TMBOY | 47:9e361da97763 | 17 | */ |
| TMBOY | 47:9e361da97763 | 18 | BCA_INT bca_status_t bca_trans_encrypted_connect(bca_trans_ptr trans, |
| TMBOY | 47:9e361da97763 | 19 | const bca_addr_t* addr); |
| TMBOY | 47:9e361da97763 | 20 | |
| TMBOY | 47:9e361da97763 | 21 | /* |
| TMBOY | 47:9e361da97763 | 22 | * Send data. |
| TMBOY | 47:9e361da97763 | 23 | * |
| TMBOY | 47:9e361da97763 | 24 | * @Param hdlr, in, the context for the transport |
| TMBOY | 47:9e361da97763 | 25 | * @Param data, in, the data will be sent |
| TMBOY | 47:9e361da97763 | 26 | * @Param size, in, the data size |
| TMBOY | 47:9e361da97763 | 27 | * @Param addr, in, the target address infomations |
| TMBOY | 47:9e361da97763 | 28 | * @Return bca_status_t, the operation result |
| TMBOY | 47:9e361da97763 | 29 | */ |
| TMBOY | 47:9e361da97763 | 30 | BCA_INT bca_status_t bca_trans_encrypted_send(bca_trans_ptr trans, |
| TMBOY | 47:9e361da97763 | 31 | const void* data, |
| TMBOY | 47:9e361da97763 | 32 | bca_size_t size, |
| TMBOY | 47:9e361da97763 | 33 | const bca_addr_t* addr); |
| TMBOY | 47:9e361da97763 | 34 | |
| TMBOY | 47:9e361da97763 | 35 | /* |
| TMBOY | 47:9e361da97763 | 36 | * Set the timeout for receiving data. |
| TMBOY | 47:9e361da97763 | 37 | * |
| TMBOY | 47:9e361da97763 | 38 | * @Param hdlr, in, the context for the transport |
| TMBOY | 47:9e361da97763 | 39 | * @Param timeout, in, the recv data timeout interval |
| TMBOY | 47:9e361da97763 | 40 | * @Return bca_status_t, the operation result |
| TMBOY | 47:9e361da97763 | 41 | */ |
| TMBOY | 47:9e361da97763 | 42 | BCA_INT bca_status_t bca_trans_encrypted_set_read_timeout(bca_trans_ptr trans, |
| TMBOY | 47:9e361da97763 | 43 | bca_u32_t timeout); |
| TMBOY | 47:9e361da97763 | 44 | |
| TMBOY | 47:9e361da97763 | 45 | /* |
| TMBOY | 47:9e361da97763 | 46 | * Receive data. |
| TMBOY | 47:9e361da97763 | 47 | * |
| TMBOY | 47:9e361da97763 | 48 | * @Param hdlr, in, the context for the transport |
| TMBOY | 47:9e361da97763 | 49 | * @Param data, out, the data will be read |
| TMBOY | 47:9e361da97763 | 50 | * @Param size, in, the data size |
| TMBOY | 47:9e361da97763 | 51 | * @Param addr, out, the target address infomations |
| TMBOY | 47:9e361da97763 | 52 | * @Return bca_status_t, the operation result |
| TMBOY | 47:9e361da97763 | 53 | */ |
| TMBOY | 47:9e361da97763 | 54 | BCA_INT bca_status_t bca_trans_encrypted_recv(bca_trans_ptr trans, |
| TMBOY | 47:9e361da97763 | 55 | void* data, |
| TMBOY | 47:9e361da97763 | 56 | bca_size_t size, |
| TMBOY | 47:9e361da97763 | 57 | bca_addr_t* addr); |
| TMBOY | 47:9e361da97763 | 58 | |
| TMBOY | 47:9e361da97763 | 59 | /* |
| TMBOY | 47:9e361da97763 | 60 | * Disconnect from the remote host. |
| TMBOY | 47:9e361da97763 | 61 | * |
| TMBOY | 47:9e361da97763 | 62 | * @Param hdlr, in, the context for the transport |
| TMBOY | 47:9e361da97763 | 63 | * @Return bca_status_t, the operation result |
| TMBOY | 47:9e361da97763 | 64 | */ |
| TMBOY | 47:9e361da97763 | 65 | BCA_INT bca_status_t bca_trans_encrypted_close(bca_trans_ptr trans); |
| TMBOY | 47:9e361da97763 | 66 | |
| TMBOY | 47:9e361da97763 | 67 | #endif // BAIDU_IOT_TINYDU_IOT_OS_SRC_IOT_BAIDU_CA_SOURCE_BAIDU_CA_TRANS_ENCRYPTED_H |
