|
8 | 8 |
|
9 | 9 | #ifndef PLATFORM_BC20
|
10 | 10 | /**
|
11 |
| - * @note Bluetooth is only available on GSM platforms. |
| 11 | + * @note Bluetooth is not available on MT2625 (NB-IoT) Platform. |
12 | 12 | */
|
13 | 13 |
|
14 | 14 | /**
|
15 | 15 | * Maximum length for BT device name
|
16 | 16 | */
|
17 | 17 | #define BTDEV_NAME_LEN_MAX 56 /* 18 * 3 + 2 */
|
18 | 18 |
|
| 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 | + |
19 | 27 | /**
|
20 | 28 | * Bluetooth error code
|
21 | 29 | */
|
22 | 30 | enum bterr_e {
|
23 |
| - BT_ERR_NONE = 0, /**< No error */ |
| 31 | + BT_OK = 0, /**< No error */ |
24 | 32 | BT_ERR_ARG = -1, /**< Invalid argument */
|
25 | 33 | BT_ERR_OPFAIL = -2, /**< Fail to perform operation */
|
26 | 34 | BT_ERR_BUSY = -3, /**< Hardware busy */
|
27 | 35 | BT_ERR_NODEV = -4, /**< No device found */
|
28 | 36 | BT_ERR_SCAN = -5, /**< BT Scan error */
|
29 | 37 | BT_ERR_PAIR = -6, /**< BT Pair error */
|
30 | 38 | BT_ERR_TIMEOUT = -7,/**< BT operation timeout */
|
| 39 | + BT_ERR_NOTSUPP = -8,/**< BT operation not supported */ |
| 40 | + BT_ERR_NOMEM = -9, /**< No memory */ |
31 | 41 | };
|
32 | 42 |
|
33 | 43 | /**
|
@@ -58,13 +68,14 @@ struct btinfo_t {
|
58 | 68 |
|
59 | 69 | /**
|
60 | 70 | * Initialize Bluetooth hardware
|
| 71 | + * @param mode [in] Bluetooth controller mode see @ref btmode_e |
61 | 72 | * @param name [in] Name of device shown to other bluetooth device while searching
|
62 | 73 | * @param use_btcli [in] Bluetooth console select (1 to enable, 0 to disable).
|
63 | 74 | * When enabled, /dev/bthost0 device file will not be available
|
64 | 75 | * to the application.
|
65 | 76 | * @return For return value see @ref bterr_e
|
66 | 77 | */
|
67 |
| -int bt_device_init(const char *name, int use_btcli); |
| 78 | +int bt_device_init(int mode, const char *name, int use_btcli); |
68 | 79 |
|
69 | 80 | /**
|
70 | 81 | * Turn on/off bluetooth hardware. Bluetooth is enabled by default when device is initialized.
|
|
0 commit comments