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_nsdl_adapter.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: Adapter between nsdl and Baidu CA CoAP. |
| TMBOY | 47:9e361da97763 | 5 | |
| TMBOY | 47:9e361da97763 | 6 | #ifndef BAIDU_IOT_TINYDU_IOT_OS_SRC_IOT_BAIDU_CA_SOURCE_BAIDU_CA_NSDL_ADAPTER_H |
| TMBOY | 47:9e361da97763 | 7 | #define BAIDU_IOT_TINYDU_IOT_OS_SRC_IOT_BAIDU_CA_SOURCE_BAIDU_CA_NSDL_ADAPTER_H |
| TMBOY | 47:9e361da97763 | 8 | |
| TMBOY | 47:9e361da97763 | 9 | #include "ns_types.h" |
| TMBOY | 47:9e361da97763 | 10 | #include "sn_nsdl.h" |
| TMBOY | 47:9e361da97763 | 11 | #include "sn_coap_header.h" |
| TMBOY | 47:9e361da97763 | 12 | #include "baidu_ca_internal.h" |
| TMBOY | 47:9e361da97763 | 13 | |
| TMBOY | 47:9e361da97763 | 14 | /* |
| TMBOY | 47:9e361da97763 | 15 | * Set the nsdl address from ca |
| TMBOY | 47:9e361da97763 | 16 | * |
| TMBOY | 47:9e361da97763 | 17 | * @Param target, in, the target will be evaluated |
| TMBOY | 47:9e361da97763 | 18 | * @Param source, the CA address |
| TMBOY | 47:9e361da97763 | 19 | */ |
| TMBOY | 47:9e361da97763 | 20 | BCA_INT void bca_nsdl_address_set(sn_nsdl_addr_s* target, |
| TMBOY | 47:9e361da97763 | 21 | const bca_addr_t* source); |
| TMBOY | 47:9e361da97763 | 22 | |
| TMBOY | 47:9e361da97763 | 23 | /* |
| TMBOY | 47:9e361da97763 | 24 | * Set the nsdl CoAP header from ca |
| TMBOY | 47:9e361da97763 | 25 | * |
| TMBOY | 47:9e361da97763 | 26 | * @Param target, in, the target will be evaluated |
| TMBOY | 47:9e361da97763 | 27 | * @Param opt, in, the CoAP options |
| TMBOY | 47:9e361da97763 | 28 | * @Param source, the CA message header |
| TMBOY | 47:9e361da97763 | 29 | */ |
| TMBOY | 47:9e361da97763 | 30 | BCA_INT void bca_nsdl_header_set(sn_coap_hdr_s* target, |
| TMBOY | 47:9e361da97763 | 31 | sn_coap_options_list_s* opt, |
| TMBOY | 47:9e361da97763 | 32 | const bca_msg_t* source); |
| TMBOY | 47:9e361da97763 | 33 | |
| TMBOY | 47:9e361da97763 | 34 | /* |
| TMBOY | 47:9e361da97763 | 35 | * Set the CoAP address from nsdl |
| TMBOY | 47:9e361da97763 | 36 | * |
| TMBOY | 47:9e361da97763 | 37 | * @Param target, in, the target will be evaluated |
| TMBOY | 47:9e361da97763 | 38 | * @Param source, the nsdl address |
| TMBOY | 47:9e361da97763 | 39 | */ |
| TMBOY | 47:9e361da97763 | 40 | BCA_INT void bca_coap_address_set(bca_addr_t* target, |
| TMBOY | 47:9e361da97763 | 41 | const sn_nsdl_addr_s* source); |
| TMBOY | 47:9e361da97763 | 42 | |
| TMBOY | 47:9e361da97763 | 43 | /* |
| TMBOY | 47:9e361da97763 | 44 | * Set the CoAP header from nsdl |
| TMBOY | 47:9e361da97763 | 45 | * |
| TMBOY | 47:9e361da97763 | 46 | * @Param target, in, the target will be evaluated |
| TMBOY | 47:9e361da97763 | 47 | * @Param source, the nsdl message header |
| TMBOY | 47:9e361da97763 | 48 | */ |
| TMBOY | 47:9e361da97763 | 49 | BCA_INT void bca_coap_header_set(bca_msg_t* target, |
| TMBOY | 47:9e361da97763 | 50 | const sn_coap_hdr_s* source); |
| TMBOY | 47:9e361da97763 | 51 | |
| TMBOY | 47:9e361da97763 | 52 | #endif // BAIDU_IOT_TINYDU_IOT_OS_SRC_IOT_BAIDU_CA_SOURCE_BAIDU_CA_NSDL_ADAPTER_H |
