blob: d39a0258343190719fb8a8763b7f6c29522129bc [file] [log] [blame]
Zang MingJie76e0d7b2020-10-29 12:26:25 +08001/*
2 *
Kevin Schoedel8ea423a2021-03-11 11:49:18 -05003 * Copyright (c) 2020-2021 Project CHIP Authors
Zang MingJie76e0d7b2020-10-29 12:26:25 +08004 * All rights reserved.
5 *
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
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
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.
17 */
18
19/**
20 * @file
21 * This file defines flags for messaging layer.
22 */
23
24#pragma once
25
Zang MingJie53dd5832021-09-03 03:05:16 +080026#include <lib/support/BitFlags.h>
Zang MingJie76e0d7b2020-10-29 12:26:25 +080027#include <stdint.h>
28
29namespace chip {
Yufeng Wang01031e72020-12-01 09:57:42 -080030namespace Messaging {
Zang MingJie76e0d7b2020-10-29 12:26:25 +080031
32/**
33 * @brief
34 * Flags associated with a inbound or outbound CHIP message.
35 *
36 * The values defined here are for use within the ChipMessageInfo.Flags field.
37 */
38enum class MessageFlagValues : uint32_t
39{
Zang MingJie76e0d7b2020-10-29 12:26:25 +080040 /**< Indicates that the message is a duplicate of a previously received message. */
Boris Zbarsky99ec7e92022-01-26 22:30:32 -050041 kDuplicateMessage = 0x00000001,
Zang MingJie76e0d7b2020-10-29 12:26:25 +080042};
43
Kevin Schoedel8ea423a2021-03-11 11:49:18 -050044using MessageFlags = BitFlags<MessageFlagValues>;
Yufeng Wang01031e72020-12-01 09:57:42 -080045
Zang MingJie76e0d7b2020-10-29 12:26:25 +080046enum class SendMessageFlags : uint16_t
47{
Yufeng Wangab9dda62021-01-12 15:56:54 -080048 kNone = 0x0000,
Zang MingJie76e0d7b2020-10-29 12:26:25 +080049 /**< Used to indicate that a response is expected within a specified timeout. */
Boris Zbarsky99ec7e92022-01-26 22:30:32 -050050 kExpectResponse = 0x0001,
Zang MingJie76e0d7b2020-10-29 12:26:25 +080051 /**< Suppress the auto-request acknowledgment feature when sending a message. */
Boris Zbarsky99ec7e92022-01-26 22:30:32 -050052 kNoAutoRequestAck = 0x0002,
Zang MingJie76e0d7b2020-10-29 12:26:25 +080053};
54
Kevin Schoedel8ea423a2021-03-11 11:49:18 -050055using SendFlags = BitFlags<SendMessageFlags>;
Yufeng Wang01031e72020-12-01 09:57:42 -080056
57} // namespace Messaging
Zang MingJie76e0d7b2020-10-29 12:26:25 +080058} // namespace chip