bt_le_invoke_decode_scan_result()

This function is used to parse the advertisement data received over the invoke interface when "bb.action.bluetooth.SCANRESULT" occurs.

Synopsis:

#include <btapi/btle.h>
 
int bt_le_invoke_decode_scan_result(const char *invoke_dat, int invoke_len, const char **bdaddr, int8_t *rssi, const char **data, int *len)

Since:

BlackBerry 10.3.0

Arguments:

invoke_dat

The data provided by the invoke interface.

invoke_len

The length of the data provided by the invoke interface.

bdaddr

A pointer to the Bluetooth address of the advertisement from within the invoke data. This pointer is only valid for the lifespan of the invoke data.

rssi

The Remote Signal Strength Indicator (RSSI) of the advertisement.

data

A pointer to the advertisement data that is received from the remote device. This pointer is only valid for the lifespan of the invoke data.

len

The length of the advertisement data that is received from the remote device.

Library:

libbtapi (For the qcc command, use the -l btapi option to link against this library)

Description:

The data that is provided must have the mime-type of "application/vnd.blackberry.bluetooth.scanresult". You must call bt_le_init() before calling this function.

Returns:

EOK on success, -1 if an error occurred with the errno value set. These are some of the error codes that can be returned:
  • EAGAIN: bt_le_init() was not called.
  • EPROTO: The data provided is not properly formatted to the required mime-type.
  • EINVAL: One or more of the variables provided are invalid.
  • ESRVRFAULT: An internal error has occurred.