Skip to content

Commit f4f5109

Browse files
committed
include:hw: Add support for BLE supported hardware
Signed-off-by: Ajay Bhargav <[email protected]>
1 parent 235f3d4 commit f4f5109

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

include/hw/bluetooth.h

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,36 @@
88

99
#ifndef PLATFORM_BC20
1010
/**
11-
* @note Bluetooth is only available on GSM platforms.
11+
* @note Bluetooth is not available on MT2625 (NB-IoT) Platform.
1212
*/
1313

1414
/**
1515
* Maximum length for BT device name
1616
*/
1717
#define BTDEV_NAME_LEN_MAX 56 /* 18 * 3 + 2 */
1818

19+
/**
20+
* Bluetooth Operation mode
21+
*/
22+
enum btmode_e {
23+
BT_CLASSIC, /**< BT+EDR Classic mode */
24+
BT_LE, /**< Bluetooth Low Energy */
25+
};
26+
1927
/**
2028
* Bluetooth error code
2129
*/
2230
enum bterr_e {
23-
BT_ERR_NONE = 0, /**< No error */
31+
BT_OK = 0, /**< No error */
2432
BT_ERR_ARG = -1, /**< Invalid argument */
2533
BT_ERR_OPFAIL = -2, /**< Fail to perform operation */
2634
BT_ERR_BUSY = -3, /**< Hardware busy */
2735
BT_ERR_NODEV = -4, /**< No device found */
2836
BT_ERR_SCAN = -5, /**< BT Scan error */
2937
BT_ERR_PAIR = -6, /**< BT Pair error */
3038
BT_ERR_TIMEOUT = -7,/**< BT operation timeout */
39+
BT_ERR_NOTSUPP = -8,/**< BT operation not supported */
40+
BT_ERR_NOMEM = -9, /**< No memory */
3141
};
3242

3343
/**
@@ -58,13 +68,14 @@ struct btinfo_t {
5868

5969
/**
6070
* Initialize Bluetooth hardware
71+
* @param mode [in] Bluetooth controller mode see @ref btmode_e
6172
* @param name [in] Name of device shown to other bluetooth device while searching
6273
* @param use_btcli [in] Bluetooth console select (1 to enable, 0 to disable).
6374
* When enabled, /dev/bthost0 device file will not be available
6475
* to the application.
6576
* @return For return value see @ref bterr_e
6677
*/
67-
int bt_device_init(const char *name, int use_btcli);
78+
int bt_device_init(int mode, const char *name, int use_btcli);
6879

6980
/**
7081
* Turn on/off bluetooth hardware. Bluetooth is enabled by default when device is initialized.

0 commit comments

Comments
 (0)