Skip to content

bt_core

YYBartT edited this page Oct 10, 2023 · 2 revisions

Bluetooth Core

This module presents a collection of core functions common to both Bluetooth Classic and Bluetooth Low Energy.

Functions

This module offers a collection of functions designed to address specific tasks and provide utilities for various purposes. Explore the available functions to make the most of the functionalities provided by this module.



Back To Top

bt_is_enabled

This function returns true if the Bluetooth module is enabled, false otherwise.


Syntax:

bt_is_enabled()

Returns:

Boolean




Back To Top

bt_request_enable

This function shows a system activity that allows the user to turn on Bluetooth.

This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.


Syntax:

bt_request_enable()

Returns:

N/A


Triggers:

Social Async Event

Key Type Description
type String The value "bt_request_enable"
success Boolean true if the user accepted, false if not



Back To Top

bt_get_name

This function gets the friendly name of the local Bluetooth adapter.


Syntax:

bt_get_name()

Returns:

String




Back To Top

bt_get_address

This function returns the hardware address of the local Bluetooth adapter.


Syntax:

bt_get_address()

Returns:

String




Back To Top

bt_paired_devices

This function returns an array of BluetoothDevice objects that are bonded (paired) to the local adapter.


Syntax:

bt_paired_devices()

Returns:

Array of BluetoothDevice