bt_le_enable_advert_invoke()

This function enables the invoking of a service application when a local advertisement change or completed event occurs.

Synopsis:

#include <btapi/btle.h>
 
int bt_le_enable_advert_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, after the application is terminated or bt_le_deinit is called, the first advertisement is received that meets the set scan parameters and filters. When invoked, the invoke action is bb.action.bluetooth.ADVERTCHANGE or bb.action.bluetooth.ADVERTCOMPLETE. You can use bt_le_invoke_decode_advert_changed() and bt_le_invoke_decode_advert_complete() to retrieve the event data. You must perform this operation from the headless application. The setup values persist until the timeout has completed or until bt_le_stop_advertisement() is called.

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.
  • EPERM: The application that requests the invoke does not have permission, as it is not a headless application.
  • EACCES: The current application is not the owner of the supplied target.
  • ESRVRFAULT: An internal error has occurred.