File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,36 @@ bool bluetoothIsConnected()
118
118
return (false );
119
119
}
120
120
121
+ // Return true if the BLE Command channel is connected
122
+ bool bluetoothCommandIsConnected ()
123
+ {
124
+ #ifdef COMPILE_BT
125
+ if (bluetoothGetState () == BT_OFF)
126
+ return (false );
127
+
128
+ if (settings.bluetoothRadioType == BLUETOOTH_RADIO_SPP_AND_BLE)
129
+ {
130
+ if (bluetoothSerialBleCommands->connected () == true )
131
+ return (true );
132
+ }
133
+ else if (settings.bluetoothRadioType == BLUETOOTH_RADIO_SPP)
134
+ {
135
+ return (false );
136
+ }
137
+ else if (settings.bluetoothRadioType == BLUETOOTH_RADIO_BLE)
138
+ {
139
+ if (bluetoothSerialBleCommands->connected () == true )
140
+ return (true );
141
+ }
142
+ else if (settings.bluetoothRadioType == BLUETOOTH_RADIO_SPP_ACCESSORY_MODE)
143
+ {
144
+ return (false );
145
+ }
146
+ #endif // COMPILE_BT
147
+
148
+ return (false );
149
+ }
150
+
121
151
// Return the Bluetooth state
122
152
byte bluetoothGetState ()
123
153
{
You can’t perform that action at this time.
0 commit comments