pub unsafe extern "C" fn bt_data_parse(
ad: *mut net_buf_simple,
func: Option<unsafe extern "C" fn(_: *mut bt_data, _: *mut c_void) -> bool>,
user_data: *mut c_void,
)
Expand description
@brief Helper for parsing advertising (or EIR or OOB) data.
A helper for parsing the basic AD Types used for Extended Inquiry Response (EIR), Advertising Data (AD), and OOB data blocks. The most common scenario is to call this helper on the advertising data received in the callback that was given to @ref bt_le_scan_start.
@warning This helper function will consume @p ad when parsing. The user should make a copy if the original data is to be used afterwards. This can be done by using @ref net_buf_simple_save to store the state prior to the function call, and then using @ref net_buf_simple_restore to restore the state afterwards.
@param ad Advertising data as given to the @ref bt_le_scan_cb_t callback. @param func Callback function which will be called for each element that’s found in the data. The callback should return true to continue parsing, or false to stop parsing. @param user_data User data to be passed to the callback.