3 * Copyright (c) 2021 Project CHIP Authors
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
21 * This file defines the Delegate class that contains callbacks to
22 * establish a secure session and update status of the session establishment process.
28 #include <system/SystemPacketBuffer.h>
29 #include <transport/raw/MessageHeader.h>
30 #include <transport/raw/PeerAddress.h>
34 class DLL_EXPORT SessionEstablishmentDelegate
39 * Called when the session establishment process generates a new message that should be sent to peer.
41 * @param header the message header for the sent message
42 * @param peerAddress the destination of the message
43 * @param msgBuf the raw data for the message being sent
44 * @return CHIP_ERROR Error thrown when sending the message
46 * TODO: Rename function as per issue: https://github.com/project-chip/connectedhomeip/issues/4468
48 virtual CHIP_ERROR SendSessionEstablishmentMessage(const PacketHeader & header, const Transport::PeerAddress & peerAddress,
49 System::PacketBufferHandle msgBuf)
51 return CHIP_ERROR_NOT_IMPLEMENTED;
56 * Called when session establishment fails with an error
58 * @param error error code
60 * TODO: Rename function as per issue: https://github.com/project-chip/connectedhomeip/issues/4468
62 virtual void OnSessionEstablishmentError(CHIP_ERROR error) {}
66 * Called when the new secure session has been established
68 * TODO: Rename function as per issue: https://github.com/project-chip/connectedhomeip/issues/4468
70 virtual void OnSessionEstablished() {}
72 virtual ~SessionEstablishmentDelegate() {}