Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.9.0.2
openapi_timeranges.h
Go to the documentation of this file.
1 
9 /*********************************************************************
10 *
11 * Copyright 2017-2018 Broadcom
12 *
13 * Licensed under the Apache License, Version 2.0 (the "License");
14 * you may not use this file except in compliance with the License.
15 * You may obtain a copy of the License at
16 *
17 * http://www.apache.org/licenses/LICENSE-2.0
18 *
19 * Unless required by applicable law or agreed to in writing, software
20 * distributed under the License is distributed on an "AS IS" BASIS,
21 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 * See the License for the specific language governing permissions and
23 * limitations under the License.
24 *
25 **********************************************************************
26 *
27 * @filename openapi_timeranges.h
28 *
29 * @purpose Time Range Configuration
30 *
31 * @component OpEN
32 *
33 * @note This code must not include any ICOS header files.
34 *
35 * @create 09/20/2017
36 *
37 * @end
38 *
39 **********************************************************************/
40 #ifndef OPENAPI_TIMERANGES_H_INCLUDED
41 #define OPENAPI_TIMERANGES_H_INCLUDED
42 
43 #include "openapi_common.h"
44 
45 #define OPEN_TIMERANGE_BUF_LEN 32
46 #define OPEN_TIMERANGE_NAME_LEN_MAX 32
47 #define OPEN_TIMERANGE_DATE_TIME_BUF_LEN 20
48 #define OPEN_TIMERANGE_DATE_TIME_PARAM_COUNT 5
49 #define OPEN_TIMERANGE_DATE_PARAM_COUNT 3
50 
51 #define OPEN_TIMERANGE_PERIODIC_FREQUENCY_MIN 0
52 #define OPEN_TIMERANGE_PERIODIC_FREQUENCY_MAX 255
53 
54 typedef enum
55 {
56  OPEN_TIMERANGE_STATUS_ACTIVE = 1,
57  OPEN_TIMERANGE_STATUS_INACTIVE = 2
58 }OPEN_TIMERANGESTATUS_t;
59 
60 /* Time range periodic entry recurrence pattern */
61 typedef enum
62 {
63  OPEN_TIMERANGE_PATTERN_WEEKLY = 0,
64  OPEN_TIMERANGE_PATTERN_DAILY = 1,
65  OPEN_TIMERANGE_PATTERN_MONTHLY = 2
66 }OPEN_TIMERANGE_PERIODIC_ENTRY_PATTERN_t;
67 
68 typedef enum
69 {
70  OPEN_TIMERANGE_EVERY_WEEKDAY = 0,
71  OPEN_TIMERANGE_EVERY_WEEKEND = 1,
72  OPEN_TIMERANGE_EVERY_DAY = 2
73 }OPEN_TIMERANGE_DAILY_t;
74 
75 typedef enum
76 {
77  OPEN_TIMERANGE_DAY_SUN = (1 << 1),
78  OPEN_TIMERANGE_DAY_MON = (1 << 2),
79  OPEN_TIMERANGE_DAY_TUE = (1 << 3),
80  OPEN_TIMERANGE_DAY_WED = (1 << 4),
81  OPEN_TIMERANGE_DAY_THU = (1 << 5),
82  OPEN_TIMERANGE_DAY_FRI = (1 << 6),
83  OPEN_TIMERANGE_DAY_SAT = (1 << 7)
84 }OPEN_TIMERANGE_DAY_t;
85 
87 {
88  uint16_t year;
89  uint8_t month;
90  uint8_t day;
91  uint8_t hour;
92  uint8_t minute;
94 
96 {
97  OPEN_TIMERANGE_DATE_AND_TIME_t openDateAndTime; /* year-month-day hh:mm */
98  OPEN_TIMERANGE_PERIODIC_ENTRY_PATTERN_t pattern;
99  uint8_t dayMask; /* mask of OPEN_TIMERANGE_DAY_t values or day in a month */
100  uint16_t frequency;
102 
103 /*****************************************************************/
119  OPEN_CONTROL_t val);
120 
121 /*****************************************************************/
137  OPEN_CONTROL_t *val);
138 
139 /*****************************************************************/
155  uint32_t *val);
156 
157 /*****************************************************************/
173  uint32_t *val);
174 
175 /*****************************************************************/
191  open_buffdesc *name);
192 
193 /*****************************************************************/
210  open_buffdesc *prevName,
211  open_buffdesc *name);
212 
213 /*****************************************************************/
230  open_buffdesc *name,
231  OPEN_TIMERANGESTATUS_t *val);
232 
233 /*****************************************************************/
250  open_buffdesc *name,
251  uint32_t *val);
252 
253 /*****************************************************************/
270  open_buffdesc *name,
271  uint32_t *val);
272 
273 /*****************************************************************/
289  open_buffdesc *name);
290 
291 /*****************************************************************/
307  open_buffdesc *name);
308 
309 /*****************************************************************/
326  open_buffdesc *name,
327  open_buffdesc *val);
328 
329 /*****************************************************************/
346  open_buffdesc *name,
347  open_buffdesc *val);
348 
349 /*****************************************************************/
366  open_buffdesc *name,
367  open_buffdesc *val);
368 
369 /*****************************************************************/
386  open_buffdesc *name,
387  open_buffdesc *val);
388 
389 /*****************************************************************/
407  open_buffdesc *name,
408  uint32_t val);
409 
410 /*****************************************************************/
428  open_buffdesc *name,
430 
431 /*****************************************************************/
450  open_buffdesc *name,
451  uint32_t entry,
453 
454 /*****************************************************************/
473  open_buffdesc *name,
474  uint32_t entry,
476 
477 /*****************************************************************/
496  open_buffdesc *name,
497  uint32_t entry,
499 
500 #endif
501