File tree 3 files changed +18
-1
lines changed
3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 129
129
#define BLE_READ_REQUEST_CONTEXT void *
130
130
#endif // BLE_READ_REQUEST_CONTEXT
131
131
132
+ /**
133
+ * @def BLE_USES_DEVICE_EVENTS
134
+ *
135
+ * @brief Whether the platform uses / supports BLE-related device events.
136
+ * @see chip::DeviceLayer::ChipDeviceEvent
137
+ */
138
+ #ifndef BLE_USES_DEVICE_EVENTS
139
+ #define BLE_USES_DEVICE_EVENTS 1
140
+ #endif
141
+
132
142
/**
133
143
* @def BLE_MAX_RECEIVE_WINDOW_SIZE
134
144
*
Original file line number Diff line number Diff line change @@ -223,7 +223,7 @@ class DLL_EXPORT BleLayer
223
223
kState_NotInitialized = 0 ,
224
224
kState_Initialized = 1 ,
225
225
kState_Disconnecting = 2
226
- } mState ; // /< [READ-ONLY] Current state
226
+ } mState ; // /< [READ-ONLY] external access is deprecated, use IsInitialized() / IsBleClosing()
227
227
228
228
// This app state is not used by ble transport etc, it will be used by external ble implementation like Android
229
229
void * mAppState = nullptr ;
@@ -236,7 +236,9 @@ class DLL_EXPORT BleLayer
236
236
chip::System::Layer * systemLayer);
237
237
CHIP_ERROR Init (BlePlatformDelegate * platformDelegate, BleConnectionDelegate * connDelegate,
238
238
BleApplicationDelegate * appDelegate, chip::System::Layer * systemLayer);
239
+ bool IsInitialized () { return mState != kState_NotInitialized ; }
239
240
void IndicateBleClosing ();
241
+ bool IsBleClosing () { return mState == kState_Disconnecting ; }
240
242
void Shutdown ();
241
243
242
244
CHIP_ERROR CancelBleIncompleteConnection ();
Original file line number Diff line number Diff line change @@ -381,7 +381,10 @@ typedef void (*AsyncWorkFunct)(intptr_t arg);
381
381
#include CHIPDEVICEPLATFORMEVENT_HEADER
382
382
#endif // defined(CHIP_DEVICE_LAYER_TARGET)
383
383
384
+ #if CONFIG_NETWORK_LAYER_BLE
384
385
#include < ble/Ble.h>
386
+ #endif
387
+
385
388
#include < inet/InetInterface.h>
386
389
#include < lib/support/LambdaBridge.h>
387
390
#include < system/SystemEvent.h>
@@ -467,6 +470,7 @@ struct ChipDeviceEvent final
467
470
uint8_t SessionType;
468
471
bool IsCommissioner;
469
472
} SessionEstablished;
473
+ #if CONFIG_NETWORK_LAYER_BLE && BLE_USES_DEVICE_EVENTS
470
474
struct
471
475
{
472
476
BLE_CONNECTION_OBJECT ConId;
@@ -493,6 +497,7 @@ struct ChipDeviceEvent final
493
497
{
494
498
BLE_CONNECTION_OBJECT ConId;
495
499
} CHIPoBLENotifyConfirm;
500
+ #endif // CONFIG_NETWORK_LAYER_BLE && BLE_USES_DEVICE_EVENTS
496
501
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
497
502
struct
498
503
{
You can’t perform that action at this time.
0 commit comments