Exported Functions

group Mesh_Common_Exported_Functions

Defines

MESH_SW_TIMER_ENTER_CRITICAL()
MESH_SW_TIMER_EXIT_CRITICAL()
MESH_SW_TIMER_CHECK(exp)

Functions

void device_info_cb_reg(device_info_cb_pf cb)

reg the callback to indicate the information of neighbor mesh devices

参数:

cb[in] callback

返回:

none

void mesh_init(void)

init the mesh stack

返回:

none

void mesh_start(uint8_t event_mesh, uint8_t event_app, void *event_queue, void *app_queue)

start the mesh stack

参数:
  • event_mesh[in] the event type of the mesh inner msg

  • event_app[in] the event type sent to app by the mesh stack

  • event_queue[in] the event queue to send event

  • app_queue[in] the app queue to send message

返回:

none

void mesh_deinit(void)

deinit the mesh stack

release all the resources and reset the global variables

返回:

none

void mesh_reboot(mesh_reboot_reason_t reason, uint32_t delay_ms)

reboot with delay

参数:
  • reason[in] reboot reason

  • delay_ms[in] if it is 0, reboot right now

返回:

none

bool mesh_inner_msg_send(mesh_inner_msg_t *pmsg)

send the mesh inner msg

参数:

pmsg[in] message

返回:

operation result

void mesh_inner_msg_handle(uint8_t event)

handle the mesh inner message

参数:

event[in] mesh event

返回:

none

void mesh_tick_timer_start(uint32_t tick_ms, tick_timeout_cb tick_cb)

start the tick timer

The mesh stack provides a gerneral tick timer

参数:
  • tick_ms[in] tick

  • tick_cb[in] timeout callback

返回:

none

void mesh_tick_timer_stop(void)

stop the tick timer

返回:

none

bool mesh_tick_timer_is_running(void)

get the tick timer state

返回值:
  • true – running

  • false – not running

返回:

tick timer state

void mesh_model_delay_execution_init(model_delay_execution_timeout_cb delay_cb)

initialize model delay execution

参数:

delay_cb[in] delay execution timeout callback function

返回:

none

int mesh_version_check(const char *sdk_ver, uint32_t gcid)

check the compatibility between the sdk and lib

参数:
  • sdk_ver[in] the sdk version

  • gcid[in] the git commit id

返回值:
  • 0 – compatible

  • >0 – incompatible due to the lib is old

  • <0 – incompatible due to the sdk is old

返回:

the compatibility