Broadcom Logo WICED Smart™ v2.2.3 - API Reference Guide WICED Logo
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
blemesh_util.h File Reference

BLE mesh utility functions. More...

Macros

#define HCIULP_ADV_CONNECTABLE_UNDIRECT_EVENT   0x00
 Adv type to be used in function blemesh_start_adv() More...
 
#define HCIULP_ADV_CONNECTABLE_DIRECT_EVENT   0x01
 
#define HCIULP_ADV_DISCOVERABLE_EVENT   0x02
 
#define HCIULP_ADV_NONCONNECTABLE_EVENT   0x03
 

Functions

void blemesh_trace0 (const char *p_str)
 BLE mesh trace functions to increase the code portability.
 
void blemesh_trace1 (const char *fmt_str, UINT32 p1)
 
void blemesh_trace2 (const char *fmt_str, UINT32 p1, UINT32 p2)
 
void blemesh_trace3 (const char *fmt_str, UINT32 p1, UINT32 p2, UINT32 p3)
 
void blemesh_trace4 (const char *fmt_str, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4)
 
void blemesh_trace5 (const char *fmt_str, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4, UINT32 p5)
 
void blemesh_trace6 (const char *fmt_str, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4, UINT32 p5, UINT32 p6)
 
void blemesh_tracen (char *p_str, UINT16 len)
 
void blemesh_util_init (void)
 Initialize the BLE mesh utility library. More...
 
void * blemesh_util_permanent_alloc (UINT32 size)
 Permanently allocate a chunk of memory for the particular size. More...
 
UINT32 blemesh_util_get_32bit_crc (UINT32 *data, UINT32 len_in_words)
 Return the 32-bit CRC value for the input data packet. More...
 
UINT32 blemesh_rand (void)
 Return a 32-bit random number. More...
 
void blemesh_set_adv_data (const UINT8 *data, INT32 len)
 Set the advertisement data packet. More...
 
void blemesh_start_adv (INT32 adv_type, INT32 adv_interval, UINT32 adv_repeat_times, void(*adv_done)(void), void(*on_adv)(void))
 Start advertisement. More...
 
void blemesh_stop_adv (void)
 Stop advertisement. More...
 
void blemesh_restart_adv_on_connup (void)
 Restart the adv after connection comes up. More...
 
void blemesh_delayed_callback (void(*callback)(UINT32 ctx), UINT32 callback_ctx, UINT32 delay)
 Register a one-time delayed callback. More...
 

Detailed Description

BLE mesh utility functions.

Macro Definition Documentation

#define HCIULP_ADV_CONNECTABLE_UNDIRECT_EVENT   0x00

Adv type to be used in function blemesh_start_adv()

Function Documentation

void blemesh_delayed_callback ( void(*)(UINT32 ctx)  callback,
UINT32  callback_ctx,
UINT32  delay 
)

Register a one-time delayed callback.

Parameters: callback: The one-time callback function delay: The amount of delay in ms

Return: None

UINT32 blemesh_rand ( void  )

Return a 32-bit random number.

Parameters: None

Return: an unsigned 32-bit integer random number

void blemesh_restart_adv_on_connup ( void  )

Restart the adv after connection comes up.

Parameters: None

Return: None

void blemesh_set_adv_data ( const UINT8 *  data,
INT32  len 
)

Set the advertisement data packet.

Parameters: data: The advertisement data packet len: The advertisement data packet length

Return: None

void blemesh_start_adv ( INT32  adv_type,
INT32  adv_interval,
UINT32  adv_repeat_times,
void(*)(void)  adv_done,
void(*)(void)  on_adv 
)

Start advertisement.

Parameters: adv_type: The advertisement type whether connectable etc adv_interval: The advertisement data packet adv_repeat_times: How many times to send the adv. 0 means forever adv_done: The ADV completed

Return: None

void blemesh_stop_adv ( void  )

Stop advertisement.

Parameters: None

Return: None

UINT32 blemesh_util_get_32bit_crc ( UINT32 *  data,
UINT32  len_in_words 
)

Return the 32-bit CRC value for the input data packet.

Parameters: data: 32-bit word data buffer len_in_words: Number of words in the data buffer

Return: Returns the 32-bit CRC value for the input packet

void blemesh_util_init ( void  )

Initialize the BLE mesh utility library.

Parameters: None

Return: None

void* blemesh_util_permanent_alloc ( UINT32  size)

Permanently allocate a chunk of memory for the particular size.

Parameters: size: Number of bytes to allocate

Return: Returns the memory pointer allocated.