bt_le_enable_scan_invoke()

This function enables the invoking of a service application when a remote advertisement is received.

Synopsis:

#include <btapi/btle.h>
 
int bt_le_enable_scan_invoke(const char *target)

Since:

BlackBerry 10.3.0

Arguments:

target

The target key that is defined in the application manifest.

Library:

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

Description:

The application is invoked when the first advertisement is received that meets the set scan parameters and filters, and if the application has been deregistered (exited) or placed in the stop partition. When invoked, the action is bb.action.bluetooth.SCANRESULT. Upon receiving the event, you can retrieve the advertisement data by calling bt_le_invoke_decode_scan_result(). You must perform the invoke setup from the headless application. If the application is deregistered or terminated, the invoke setup will remain until the first invoke event is sent or if the application restarts and calls bt_le_init() prior to any invoke event.

Returns:

EOK on successfully enabling the invoke interface, -1 if an error occurred with the errno value set. These are some of the error codes that can be returned:
  • ENOMEM: Sufficient memory is not available to perform the request.
  • EACCES: The current application does not have permission to invoke the supplied trigger.
  • ESRVRFAULT: An internal error has occurred.