Zang MingJie | 76e0d7b | 2020-10-29 12:26:25 +0800 | [diff] [blame] | 1 | /* |
| 2 | * |
Kevin Schoedel | 8ea423a | 2021-03-11 11:49:18 -0500 | [diff] [blame] | 3 | * Copyright (c) 2020-2021 Project CHIP Authors |
Zang MingJie | 76e0d7b | 2020-10-29 12:26:25 +0800 | [diff] [blame] | 4 | * 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 MingJie | 53dd583 | 2021-09-03 03:05:16 +0800 | [diff] [blame] | 26 | #include <lib/support/BitFlags.h> |
Zang MingJie | 76e0d7b | 2020-10-29 12:26:25 +0800 | [diff] [blame] | 27 | #include <stdint.h> |
| 28 | |
| 29 | namespace chip { |
Yufeng Wang | 01031e7 | 2020-12-01 09:57:42 -0800 | [diff] [blame] | 30 | namespace Messaging { |
Zang MingJie | 76e0d7b | 2020-10-29 12:26:25 +0800 | [diff] [blame] | 31 | |
| 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 | */ |
| 38 | enum class MessageFlagValues : uint32_t |
| 39 | { |
Zang MingJie | 76e0d7b | 2020-10-29 12:26:25 +0800 | [diff] [blame] | 40 | /**< Indicates that the message is a duplicate of a previously received message. */ |
Boris Zbarsky | 99ec7e9 | 2022-01-26 22:30:32 -0500 | [diff] [blame] | 41 | kDuplicateMessage = 0x00000001, |
Zang MingJie | 76e0d7b | 2020-10-29 12:26:25 +0800 | [diff] [blame] | 42 | }; |
| 43 | |
Kevin Schoedel | 8ea423a | 2021-03-11 11:49:18 -0500 | [diff] [blame] | 44 | using MessageFlags = BitFlags<MessageFlagValues>; |
Yufeng Wang | 01031e7 | 2020-12-01 09:57:42 -0800 | [diff] [blame] | 45 | |
Zang MingJie | 76e0d7b | 2020-10-29 12:26:25 +0800 | [diff] [blame] | 46 | enum class SendMessageFlags : uint16_t |
| 47 | { |
Yufeng Wang | ab9dda6 | 2021-01-12 15:56:54 -0800 | [diff] [blame] | 48 | kNone = 0x0000, |
Zang MingJie | 76e0d7b | 2020-10-29 12:26:25 +0800 | [diff] [blame] | 49 | /**< Used to indicate that a response is expected within a specified timeout. */ |
Boris Zbarsky | 99ec7e9 | 2022-01-26 22:30:32 -0500 | [diff] [blame] | 50 | kExpectResponse = 0x0001, |
Zang MingJie | 76e0d7b | 2020-10-29 12:26:25 +0800 | [diff] [blame] | 51 | /**< Suppress the auto-request acknowledgment feature when sending a message. */ |
Boris Zbarsky | 99ec7e9 | 2022-01-26 22:30:32 -0500 | [diff] [blame] | 52 | kNoAutoRequestAck = 0x0002, |
Zang MingJie | 76e0d7b | 2020-10-29 12:26:25 +0800 | [diff] [blame] | 53 | }; |
| 54 | |
Kevin Schoedel | 8ea423a | 2021-03-11 11:49:18 -0500 | [diff] [blame] | 55 | using SendFlags = BitFlags<SendMessageFlags>; |
Yufeng Wang | 01031e7 | 2020-12-01 09:57:42 -0800 | [diff] [blame] | 56 | |
| 57 | } // namespace Messaging |
Zang MingJie | 76e0d7b | 2020-10-29 12:26:25 +0800 | [diff] [blame] | 58 | } // namespace chip |