File tree 2 files changed +29
-0
lines changed
2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -250,6 +250,11 @@ enum PublicEventTypes
250
250
* Signals that BLE is deinitialized.
251
251
*/
252
252
kBLEDeinitialized ,
253
+
254
+ /* *
255
+ * Signals that secure session is established.
256
+ */
257
+ kSecureSessionEstablished ,
253
258
};
254
259
255
260
/* *
@@ -533,6 +538,15 @@ struct ChipDeviceEvent final
533
538
{
534
539
OtaState newState;
535
540
} OtaStateChanged;
541
+
542
+ struct
543
+ {
544
+ uint64_t PeerNodeId;
545
+ uint8_t FabricIndex;
546
+ uint8_t SecureSessionType;
547
+ uint8_t TransportType;
548
+ uint16_t LocalSessionId;
549
+ } SecureSessionEstablished;
536
550
};
537
551
538
552
bool IsPublic () const { return DeviceEventType::IsPublic (Type); }
Original file line number Diff line number Diff line change 22
22
#include < lib/core/CHIPConfig.h>
23
23
#include < lib/core/TLVTypes.h>
24
24
#include < lib/support/SafeInt.h>
25
+ #include < lib/support/TypeTraits.h>
26
+ #include < platform/CHIPDeviceEvent.h>
27
+ #include < platform/PlatformManager.h>
25
28
#include < transport/SessionManager.h>
26
29
27
30
namespace chip {
@@ -78,6 +81,18 @@ void PairingSession::Finish()
78
81
if (err == CHIP_NO_ERROR)
79
82
{
80
83
VerifyOrDie (mSecureSessionHolder );
84
+ DeviceLayer::ChipDeviceEvent event;
85
+ event.Type = DeviceLayer::DeviceEventType::kSecureSessionEstablished ;
86
+ event.SecureSessionEstablished .TransportType = to_underlying (address.GetTransportType ());
87
+ event.SecureSessionEstablished .SecureSessionType =
88
+ to_underlying (mSecureSessionHolder ->AsSecureSession ()->GetSecureSessionType ());
89
+ event.SecureSessionEstablished .LocalSessionId = mSecureSessionHolder ->AsSecureSession ()->GetLocalSessionId ();
90
+ event.SecureSessionEstablished .PeerNodeId = mSecureSessionHolder ->GetPeer ().GetNodeId ();
91
+ event.SecureSessionEstablished .FabricIndex = mSecureSessionHolder ->GetPeer ().GetFabricIndex ();
92
+ if (DeviceLayer::PlatformMgr ().PostEvent (&event) != CHIP_NO_ERROR)
93
+ {
94
+ ChipLogError (SecureChannel, " Failed to post Secure Session established event" );
95
+ }
81
96
// Make sure to null out mDelegate so we don't send it any other
82
97
// notifications.
83
98
auto * delegate = mDelegate ;
You can’t perform that action at this time.
0 commit comments