Start low energy advertisements.
Synopsis:
#include <btapi/btle.h>
int bt_le_start_advertisement(bt_le_advert_parm_t *advertParm, uint16_t *intervalMin, uint16_t *intervalMax)
Arguments:
- advertParm
-
(Optional) The advertisement parameters. Use this argument when you require specific advertisement parameters; set to
NULL otherwise to use the following default values.
- minAdvertInterval1 = 20ms
- maxAdvertInterval1 = 30ms
- time1 = 30sec
- minAdvertInterval2 = 1sec
- maxAdvertInterval2 = 2.5sec
- time2 = 60sec
- intervalMin
-
(Optional) Returns the minimum current advertisement interval.
- intervalMax
-
(Optional) Returns the maximum current advertisement interval.
Library:
libbtapi (For the qcc command, use the -l btapi option to link against this library)
Returns:
EOK on successful start of low energy advertisements,
-1 if an error occurred with the
errno value set. These are some of the error codes that can be returned:
- EAGAIN: The link to the Bluetooth stack is unavailable. You can try again.
- EBUSY: The stack is currently busy or there is an active connection or connection request.
- EINVAL: Advertisement parameters provided were invalid.
- EMLINK: Advertising cannot be performed as there is already an existing low energy connection.
- ENOMEM: Sufficient memory is not available to perform the request.
- ENOTSUP: Starting advertisements is not supported.
- ESRVRFAULT: An internal error has occurred.