* @param[in] cod: Class of Device
* @return major service bits
*/
-inline uint32_t esp_bt_gap_get_cod_srvc(uint32_t cod)
+static inline uint32_t esp_bt_gap_get_cod_srvc(uint32_t cod)
{
return (cod & ESP_BT_COD_SRVC_BIT_MASK) >> ESP_BT_COD_SRVC_BIT_OFFSET;
}
* @param[in] cod: Class of Device
* @return major device bits
*/
-inline uint32_t esp_bt_gap_get_cod_major_dev(uint32_t cod)
+static inline uint32_t esp_bt_gap_get_cod_major_dev(uint32_t cod)
{
return (cod & ESP_BT_COD_MAJOR_DEV_BIT_MASK) >> ESP_BT_COD_MAJOR_DEV_BIT_OFFSET;
}
* @param[in] cod: Class of Device
* @return minor service bits
*/
-inline uint32_t esp_bt_gap_get_cod_minor_dev(uint32_t cod)
+static inline uint32_t esp_bt_gap_get_cod_minor_dev(uint32_t cod)
{
return (cod & ESP_BT_COD_MINOR_DEV_BIT_MASK) >> ESP_BT_COD_MINOR_DEV_BIT_OFFSET;
}
* @param[in] cod: Class of Device
* @return format type
*/
-inline uint32_t esp_bt_gap_get_cod_format_type(uint32_t cod)
+static inline uint32_t esp_bt_gap_get_cod_format_type(uint32_t cod)
{
return (cod & ESP_BT_COD_FORMAT_TYPE_BIT_MASK);
}
* - true if cod is valid
* - false otherise
*/
-inline bool esp_bt_gap_is_valid_cod(uint32_t cod)
+static inline bool esp_bt_gap_is_valid_cod(uint32_t cod)
{
if (esp_bt_gap_get_cod_format_type(cod) == ESP_BT_COD_FORMAT_TYPE_1 &&
esp_bt_gap_get_cod_srvc(cod) != ESP_BT_COD_SRVC_NONE) {
#include <stdlib.h>
#include <stdint.h>
+#include <arpa/inet.h>
#include "bt_common.h"
#include "common/bt_target.h"
#define CPU_LITTLE_ENDIAN
#endif
-inline uint16_t swap_byte_16(uint16_t x)
-{
- return (((x & 0x00ffU) << 8) |
- ((x & 0xff00U) >> 8));
-}
-
-inline uint32_t swap_byte_32(uint32_t x)
-{
- return (((x & 0x000000ffUL) << 24) |
- ((x & 0x0000ff00UL) << 8) |
- ((x & 0x00ff0000UL) >> 8) |
- ((x & 0xff000000UL) >> 24));
-}
-
-#ifndef ntohs
-inline uint16_t ntohs(uint16_t x)
-{
-#ifdef CPU_LITTLE_ENDIAN
- return swap_byte_16(x);
-#else
- return x;
-#endif
-}
-#endif /* #ifndef ntohs */
-
-#ifndef htons
-inline uint16_t htons(uint16_t x)
-{
-#ifdef CPU_LITTLE_ENDIAN
- return swap_byte_16(x);
-#else
- return x;
-#endif
-}
-#endif /* #ifndef htons */
-
-#ifndef ntohl
-inline uint32_t ntohl(uint32_t x)
-{
-#ifdef CPU_LITTLE_ENDIAN
- return swap_byte_32(x);
-#else
- return x;
-#endif
-}
-#endif /* #ifndef ntohl*/
-
-#ifndef htonl
-inline uint32_t htonl(uint32_t x)
-{
-#ifdef CPU_LITTLE_ENDIAN
- return swap_byte_32(x);
-#else
- return x;
-#endif
-}
-#endif /* #ifndef htonl*/
-
#endif /* _BT_DEFS_H_ */
#include "stack/bt_types.h"
#include "bt_common.h"
-inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t len)
+static inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t len)
{
uint16_t i;
OI_UINT bitcount,
OI_UINT *excess);
-INLINE OI_INT allocAdjustedBits(OI_UINT8 *dest,
+OI_INT allocAdjustedBits(OI_UINT8 *dest,
OI_INT bits,
OI_INT excess);
-INLINE OI_INT allocExcessBits(OI_UINT8 *dest,
+OI_INT allocExcessBits(OI_UINT8 *dest,
OI_INT excess);
PRIVATE OI_UINT32 internal_CalculateBitrate(OI_CODEC_SBC_FRAME_INFO *frame);
OI_INT16 *pcmData,
OI_UINT32 *pcmBytes);
-INLINE OI_STATUS internal_DecoderReset(OI_CODEC_SBC_DECODER_CONTEXT *context,
+OI_STATUS internal_DecoderReset(OI_CODEC_SBC_DECODER_CONTEXT *context,
OI_UINT32 *decoderData,
OI_UINT32 decoderDataBytes,
OI_BYTE maxChannels,
OI_BOOL enhanced,
OI_BOOL msbc_enable);
-INLINE OI_UINT16 OI_SBC_CalculateFrameAndHeaderlen(OI_CODEC_SBC_FRAME_INFO *frame, OI_UINT *headerLen_);
+OI_UINT16 OI_SBC_CalculateFrameAndHeaderlen(OI_CODEC_SBC_FRAME_INFO *frame, OI_UINT *headerLen_);
PRIVATE OI_UINT32 OI_SBC_MaxBitpool(OI_CODEC_SBC_FRAME_INFO *frame);
PRIVATE void cosineModulateSynth4(SBC_BUFFER_T *RESTRICT out, OI_INT32 const *RESTRICT in);
PRIVATE void SynthWindow40_int32_int32_symmetry_with_sum(OI_INT16 *pcm, SBC_BUFFER_T buffer[80], OI_UINT strideShift);
-INLINE void dct3_4(OI_INT32 *RESTRICT out, OI_INT32 const *RESTRICT in);
+void dct3_4(OI_INT32 *RESTRICT out, OI_INT32 const *RESTRICT in);
PRIVATE void analyze4_generated(SBC_BUFFER_T analysisBuffer[RESTRICT 40],
OI_INT16 *pcm,
OI_UINT strideShift,
OI_INT32 subband[4]);
-INLINE void dct3_8(OI_INT32 *RESTRICT out, OI_INT32 const *RESTRICT in);
+void dct3_8(OI_INT32 *RESTRICT out, OI_INT32 const *RESTRICT in);
PRIVATE void analyze8_generated(SBC_BUFFER_T analysisBuffer[RESTRICT 80],
OI_INT16 *pcm,
/* Decoder functions */
-INLINE void OI_SBC_ReadHeader(OI_CODEC_SBC_COMMON_CONTEXT *common, const OI_BYTE *data);
+void OI_SBC_ReadHeader(OI_CODEC_SBC_COMMON_CONTEXT *common, const OI_BYTE *data);
PRIVATE void OI_SBC_ReadScalefactors(OI_CODEC_SBC_COMMON_CONTEXT *common, const OI_BYTE *b, OI_BITSTREAM *bs);
PRIVATE void OI_SBC_ReadSamples(OI_CODEC_SBC_DECODER_CONTEXT *common, OI_BITSTREAM *ob);
PRIVATE void OI_SBC_ReadSamplesJoint(OI_CODEC_SBC_DECODER_CONTEXT *common, OI_BITSTREAM *global_bs);
PRIVATE void OI_SBC_SynthFrame(OI_CODEC_SBC_DECODER_CONTEXT *context, OI_INT16 *pcm, OI_UINT start_block, OI_UINT nrof_blocks);
-INLINE OI_INT32 OI_SBC_Dequant(OI_UINT32 raw, OI_UINT scale_factor, OI_UINT bits);
+OI_INT32 OI_SBC_Dequant(OI_UINT32 raw, OI_UINT scale_factor, OI_UINT bits);
PRIVATE OI_BOOL OI_SBC_ExamineCommandPacket(OI_CODEC_SBC_DECODER_CONTEXT *context, const OI_BYTE *data, OI_UINT32 len);
PRIVATE void OI_SBC_GenerateTestSignal(OI_INT16 pcmData[][2], OI_UINT32 sampleCount);
#include <math.h>
-INLINE float dequant_float(OI_UINT32 raw, OI_UINT scale_factor, OI_UINT bits)
+static INLINE float dequant_float(OI_UINT32 raw, OI_UINT scale_factor, OI_UINT bits)
{
float result = (1 << (scale_factor + 1)) * ((raw * 2.0f + 1.0f) / ((1 << bits) - 1.0f) - 1.0f);
#endif
#ifdef USE_WIDE_CRC
-INLINE OI_CHAR crc_iterate(OI_UINT8 oldcrc, OI_UINT8 next)
+static INLINE OI_CHAR crc_iterate(OI_UINT8 oldcrc, OI_UINT8 next)
{
OI_UINT crc;
OI_UINT idx;
return crc;
}
-INLINE OI_CHAR crc_iterate_top4(OI_UINT8 oldcrc, OI_UINT8 next)
+static INLINE OI_CHAR crc_iterate_top4(OI_UINT8 oldcrc, OI_UINT8 next)
{
OI_UINT crc;
OI_UINT idx;
#else // USE_WIDE_CRC
-INLINE OI_UINT8 crc_iterate_top4(OI_UINT8 oldcrc, OI_UINT8 next)
+static INLINE OI_UINT8 crc_iterate_top4(OI_UINT8 oldcrc, OI_UINT8 next)
{
return (oldcrc << 4) ^ crc8_narrow[(oldcrc ^ next) >> 4];
}
#ifdef USE_NIBBLEWISE_CRC
-INLINE OI_UINT8 crc_iterate(OI_UINT8 crc, OI_UINT8 next)
+static INLINE OI_UINT8 crc_iterate(OI_UINT8 crc, OI_UINT8 next)
{
crc = (crc << 4) ^ crc8_narrow[(crc ^ next) >> 4];
crc = (crc << 4) ^ crc8_narrow[((crc >> 4)^next) & 0xf];
}
#else // USE_NIBBLEWISE_CRC
-INLINE OI_UINT8 crc_iterate(OI_UINT8 crc, OI_UINT8 next)
+static INLINE OI_UINT8 crc_iterate(OI_UINT8 crc, OI_UINT8 next)
{
return crc8_narrow[crc ^ next];
}
* @return A signed 32-bit value corresponding to the 32 most significant bits
* of the 64-bit product of u and v.
*/
-INLINE OI_INT32 default_mul_32s_32s_hi(OI_INT32 u, OI_INT32 v)
+static INLINE OI_INT32 default_mul_32s_32s_hi(OI_INT32 u, OI_INT32 v)
{
OI_UINT32 u0, v0;
OI_INT32 u1, v1, w1, w2, t;
* @return A signed 32-bit value corresponding to the 32 most significant bits
* of the 48-bit product of u and v.
*/
-INLINE OI_INT32 default_mul_16s_32s_hi(OI_INT16 u, OI_INT32 v)
+static INLINE OI_INT32 default_mul_16s_32s_hi(OI_INT16 u, OI_INT32 v)
{
OI_UINT16 v0;
OI_INT16 v1;