/src/opendnp3/cpp/lib/src/outstation/EventBufferConfig.cpp
Line | Count | Source |
1 | | /* |
2 | | * Copyright 2013-2022 Step Function I/O, LLC |
3 | | * |
4 | | * Licensed to Green Energy Corp (www.greenenergycorp.com) and Step Function I/O |
5 | | * LLC (https://stepfunc.io) under one or more contributor license agreements. |
6 | | * See the NOTICE file distributed with this work for additional information |
7 | | * regarding copyright ownership. Green Energy Corp and Step Function I/O LLC license |
8 | | * this file to you under the Apache License, Version 2.0 (the "License"); you |
9 | | * may not use this file except in compliance with the License. You may obtain |
10 | | * a copy of the License at: |
11 | | * |
12 | | * http://www.apache.org/licenses/LICENSE-2.0 |
13 | | * |
14 | | * Unless required by applicable law or agreed to in writing, software |
15 | | * distributed under the License is distributed on an "AS IS" BASIS, |
16 | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
17 | | * See the License for the specific language governing permissions and |
18 | | * limitations under the License. |
19 | | */ |
20 | | #include "opendnp3/outstation/EventBufferConfig.h" |
21 | | |
22 | | namespace opendnp3 |
23 | | { |
24 | | |
25 | | EventBufferConfig EventBufferConfig::AllTypes(uint16_t sizes) |
26 | 0 | { |
27 | 0 | return EventBufferConfig(sizes, sizes, sizes, sizes, sizes, sizes, sizes, sizes); |
28 | 0 | } |
29 | | |
30 | | EventBufferConfig::EventBufferConfig(uint16_t maxBinaryEvents, |
31 | | uint16_t maxDoubleBinaryEvents, |
32 | | uint16_t maxAnalogEvents, |
33 | | uint16_t maxCounterEvents, |
34 | | uint16_t maxFrozenCounterEvents, |
35 | | uint16_t maxBinaryOutputStatusEvents, |
36 | | uint16_t maxAnalogOutputStatusEvents, |
37 | | uint16_t maxOctetStringEvents) |
38 | | : |
39 | | |
40 | 8.94k | maxBinaryEvents(maxBinaryEvents), |
41 | 8.94k | maxDoubleBinaryEvents(maxDoubleBinaryEvents), |
42 | 8.94k | maxAnalogEvents(maxAnalogEvents), |
43 | 8.94k | maxCounterEvents(maxCounterEvents), |
44 | 8.94k | maxFrozenCounterEvents(maxFrozenCounterEvents), |
45 | 8.94k | maxBinaryOutputStatusEvents(maxBinaryOutputStatusEvents), |
46 | 8.94k | maxAnalogOutputStatusEvents(maxAnalogOutputStatusEvents), |
47 | 8.94k | maxOctetStringEvents(maxOctetStringEvents) |
48 | 8.94k | { |
49 | 8.94k | } |
50 | | |
51 | | uint32_t EventBufferConfig::TotalEvents() const |
52 | 8.94k | { |
53 | 8.94k | return maxBinaryEvents + maxDoubleBinaryEvents + maxAnalogEvents + maxCounterEvents + maxFrozenCounterEvents |
54 | 8.94k | + maxBinaryOutputStatusEvents + maxAnalogOutputStatusEvents + maxOctetStringEvents; |
55 | 8.94k | } |
56 | | |
57 | | } // namespace opendnp3 |