bt_adv_conn_start()

bt_adv_conn_start()

Description

Starts connectable advertising. This does not override device name in GATT server settings, which is advertised in the scan response packet.

Syntax

bt_adv_conn_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_array[9] = [0x03, 0x16, 0x09, 0x6C, 0x04, 0xFF, 0xAB, 0x41, 0x30]; main() { bt_init(); /* GATT server init code start */ /* GATT server init code end */ bt_adv_conn_data_set(demo_adv_array, sizeof(demo_adv_array)); bt_adv_conn_start(); for(;;) { Delay(100); } }