bt_adv_start()
Description
Starts advertising operation.
Syntax
bt_adv_start();
Parameters
This function has no parameters.
Returns
Return value | Return explanation |
SCRIPT_OPERATION_SUCCESS | Successfully managed to send start advertisement command to Bluetooth. |
SCRIPT_OPERATION_FAILED | Failed to send start advertisement command to Bluetooth. |
SCRIPT_NO_ACCESS | This error signifies that Bluetooth communication was not initialized. |
Function call example
#include <io>
#include <read>
#include <float>
#include <string>
#include <core>
#include <write>
#include <define>
#include <socket>
#include <bluetooth>
new demo_adv_name[17] = ''My_XG_Beacon'';
new demo_adv_array[9] = [0x03, 0x16, 0x09, 0x6C, 0x04, 0xFF, 0xAB, 0x41, 0x30];
main()
{
bt_init();
bt_adv_config(BT_ADV_OPT_USE_IDENTITY | BT_ADV_OPT_SCANNABLE, BT_GAP_ADV_INT_FAST_MIN_2, BT_GAP_ADV_INT_FAST_MAX_2);
bt_adv_data_set(demo_adv_array, sizeof(demo_adv_array));
bt_adv_name_set(demo_adv_name, strlen(demo_adv_name));
bt_adv_start();
for(;;)
{
Delay(100);
}
}Notes and Warnings
Prior to initiating the advertisement process, it is necessary to call the bt_adv_config function.