SPIKE-RT C API Reference [English]
An RTOS-based software platform for LEGO® Education SPIKE™.
Functions
Bluetooth

API for bluetooth. More...

Functions

pbio_error_t hub_bluetooth_enable_advertising (void)
 Enable the bluetooth advertising. More...
 
pbio_error_t hub_bluetooth_disable_advertising (void)
 Disable the bluetooth advertising. More...
 
pbio_error_t hub_bluetooth_is_connected (bool *connected)
 Check whether the bluetooth is connected. More...
 

Detailed Description

API for bluetooth.

Normally, you don't need to be aware of these APIs.

Function Documentation

◆ hub_bluetooth_disable_advertising()

pbio_error_t hub_bluetooth_disable_advertising ( void  )

Disable the bluetooth advertising.

Advertising is inactive if and only if it is disabled and the bluetooth is connected.

Returns
Error number.

◆ hub_bluetooth_enable_advertising()

pbio_error_t hub_bluetooth_enable_advertising ( void  )

Enable the bluetooth advertising.

Advertising is active if and only if it is enabled and the bluetooth is not connected. Calling serial_opn_por() on the bluetooth serial executes this API, so normally you don't need to manually call this API.

Returns
Error number.

◆ hub_bluetooth_is_connected()

pbio_error_t hub_bluetooth_is_connected ( bool *  connected)

Check whether the bluetooth is connected.

Returns
Error number.
Parameters
[out]connectedWhether the Bluetooth is connected. true if connected, false if not conencted.