ex
Fork of mbed-os-example-mbed5-blinky by
Diff: DuerOS-Light-SDK-v1.1.0/duer-os-light/src/iot-baidu-ca/source/baidu_ca_util_network.h
- Revision:
- 47:9e361da97763
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DuerOS-Light-SDK-v1.1.0/duer-os-light/src/iot-baidu-ca/source/baidu_ca_util_network.h Tue Jul 18 16:54:45 2017 +0800 @@ -0,0 +1,34 @@ +// Copyright 2017 Baidu Inc. All Rights Reserved. +// Author: Su Hao (suhao@baidu.com) +// +// Description: Network util tools. + +#ifndef BAIDU_IOT_TINYDU_IOT_OS_SRC_IOT_BAIDU_CA_SOURCE_BAIDU_CA_UTIL_NETWORK_H +#define BAIDU_IOT_TINYDU_IOT_OS_SRC_IOT_BAIDU_CA_SOURCE_BAIDU_CA_UTIL_NETWORK_H + +#include "baidu_ca_types.h" + +/* + * Determine whether the system byte order is little endian + * + * @Return bca_ut_t, if big endian return 0, else return 1. + */ +BCA_INT bca_u8_t bca_is_little_endian(void); + +/* + * Convert the byte order from host to network for 16bit value + * + * @Param value, in, the host value + * @Param bca_u16_t, the network result + */ +BCA_INT bca_u16_t bca_htons(bca_u16_t value); + +/* + * Convert the byte order from host to network for 32bit value + * + * @Param value, in, the host value + * @Param bca_u32_t, the network result + */ +BCA_INT bca_u32_t bca_htonl(bca_u32_t value); + +#endif // BAIDU_IOT_TINYDU_IOT_OS_SRC_IOT_BAIDU_CA_SOURCE_BAIDU_CA_UTIL_NETWORK_H
