Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / src / app / clusters / barrier-control-server / barrier-control-server.h
1 /**
2  *
3  *    Copyright (c) 2020 Project CHIP Authors
4  *
5  *    Licensed under the Apache License, Version 2.0 (the "License");
6  *    you may not use this file except in compliance with the License.
7  *    You may obtain a copy of the License at
8  *
9  *        http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *    Unless required by applicable law or agreed to in writing, software
12  *    distributed under the License is distributed on an "AS IS" BASIS,
13  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *    See the License for the specific language governing permissions and
15  *    limitations under the License.
16  */
17
18 /**
19  *
20  *    Copyright (c) 2020 Silicon Labs
21  *
22  *    Licensed under the Apache License, Version 2.0 (the "License");
23  *    you may not use this file except in compliance with the License.
24  *    You may obtain a copy of the License at
25  *
26  *        http://www.apache.org/licenses/LICENSE-2.0
27  *
28  *    Unless required by applicable law or agreed to in writing, software
29  *    distributed under the License is distributed on an "AS IS" BASIS,
30  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31  *    See the License for the specific language governing permissions and
32  *    limitations under the License.
33  */
34 /****************************************************************************
35  * @file
36  * @brief APIs for the Barrier Control Server plugin.
37  *******************************************************************************
38  ******************************************************************************/
39
40 #pragma once
41
42 #include <stdbool.h>
43 #include <stdint.h>
44
45 #include <app/util/basic-types.h>
46
47 #ifndef DOXYGEN_SHOULD_SKIP_THIS
48 // There are helper getter/setting APIs that are shared between the core
49 // implementation and the CLI code. They are private to the plugin.
50
51 // This will always either return the current BarrierPosition attribute value
52 // or assert.
53 uint8_t emAfPluginBarrierControlServerGetBarrierPosition(chip::EndpointId endpoint);
54
55 // This will always either set the current BarrierPosition attribute value or
56 // assert.
57 void emAfPluginBarrierControlServerSetBarrierPosition(chip::EndpointId endpoint, uint8_t barrierPosition);
58
59 // This will either return whether or not the PartialBarrier bit is set in the
60 // Capabilities attribute value, or it will assert.
61 bool emAfPluginBarrierControlServerIsPartialBarrierSupported(chip::EndpointId endpoint);
62
63 // This will increment the OpenEvents, CloseEvents, CommandOpenEvents, and
64 // CommandCloseEvents attribute values depending on which combination of the
65 // open and command arguments are passed, or assert.
66 void emAfPluginBarrierControlServerIncrementEvents(chip::EndpointId endpoint, bool open, bool command);
67
68 // This will read the SafetyStatus attribute and return the value, or assert.
69 uint16_t emAfPluginBarrierControlServerGetSafetyStatus(chip::EndpointId endpoint);
70
71 // We use a minimum delay so that our barrier changes position in a realistic
72 // amount of time.
73 #define MIN_POSITION_CHANGE_DELAY_MS 30
74
75 #endif