Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.13.1.2
openapi_timeranges.h
Go to the documentation of this file.
1 
9 /*********************************************************************
10 *
11 * Copyright 2017-2023 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_MIN 1
47 #define OPEN_TIMERANGE_NAME_LEN_MAX 32
48 #define OPEN_TIMERANGE_DATE_TIME_BUF_LEN 20
49 #define OPEN_TIMERANGE_DATE_TIME_PARAM_COUNT 5
50 #define OPEN_TIMERANGE_DATE_PARAM_COUNT 3
51 
52 #define OPEN_TIMERANGE_PERIODIC_FREQUENCY_MIN 0
53 #define OPEN_TIMERANGE_PERIODIC_FREQUENCY_MAX 255
54 
55 typedef enum
56 {
57  OPEN_TIMERANGE_STATUS_ACTIVE = 1,
58  OPEN_TIMERANGE_STATUS_INACTIVE = 2
59 }OPEN_TIMERANGESTATUS_t;
60 
61 /* Time range periodic entry recurrence pattern */
62 typedef enum
63 {
64  OPEN_TIMERANGE_PATTERN_WEEKLY = 0,
65  OPEN_TIMERANGE_PATTERN_DAILY = 1,
66  OPEN_TIMERANGE_PATTERN_MONTHLY = 2
67 }OPEN_TIMERANGE_PERIODIC_ENTRY_PATTERN_t;
68 
69 typedef enum
70 {
71  OPEN_TIMERANGE_EVERY_WEEKDAY = 0,
72  OPEN_TIMERANGE_EVERY_WEEKEND = 1,
73  OPEN_TIMERANGE_EVERY_DAY = 2
74 }OPEN_TIMERANGE_DAILY_t;
75 
76 typedef enum
77 {
78  OPEN_TIMERANGE_DAY_SUN = (1 << 1),
79  OPEN_TIMERANGE_DAY_MON = (1 << 2),
80  OPEN_TIMERANGE_DAY_TUE = (1 << 3),
81  OPEN_TIMERANGE_DAY_WED = (1 << 4),
82  OPEN_TIMERANGE_DAY_THU = (1 << 5),
83  OPEN_TIMERANGE_DAY_FRI = (1 << 6),
84  OPEN_TIMERANGE_DAY_SAT = (1 << 7)
85 }OPEN_TIMERANGE_DAY_t;
86 
88 {
89  uint16_t year;
90  uint8_t month;
91  uint8_t day;
92  uint8_t hour;
93  uint8_t minute;
95 
97 {
98  OPEN_TIMERANGE_DATE_AND_TIME_t openDateAndTime; /* year-month-day hh:mm */
99  OPEN_TIMERANGE_PERIODIC_ENTRY_PATTERN_t pattern;
100  uint8_t dayMask; /* mask of OPEN_TIMERANGE_DAY_t values or day in a month */
101  uint16_t frequency;
103 
104 /*****************************************************************/
120  OPEN_CONTROL_t val);
121 
122 /*****************************************************************/
138  OPEN_CONTROL_t *val);
139 
140 /*****************************************************************/
156  uint32_t *val);
157 
158 /*****************************************************************/
174  uint32_t *val);
175 
176 /*****************************************************************/
192  open_buffdesc *name);
193 
194 /*****************************************************************/
211  open_buffdesc *prevName,
212  open_buffdesc *name);
213 
214 /*****************************************************************/
231  open_buffdesc *name,
232  OPEN_TIMERANGESTATUS_t *val);
233 
234 /*****************************************************************/
251  open_buffdesc *name,
252  uint32_t *val);
253 
254 /*****************************************************************/
271  open_buffdesc *name,
272  uint32_t *val);
273 
274 /*****************************************************************/
290  open_buffdesc *name);
291 
292 /*****************************************************************/
308  open_buffdesc *name);
309 
310 /*****************************************************************/
327  open_buffdesc *name,
328  open_buffdesc *val);
329 
330 /*****************************************************************/
347  open_buffdesc *name,
348  open_buffdesc *val);
349 
350 /*****************************************************************/
367  open_buffdesc *name,
368  open_buffdesc *val);
369 
370 /*****************************************************************/
387  open_buffdesc *name,
388  open_buffdesc *val);
389 
390 /*****************************************************************/
408  open_buffdesc *name,
409  uint32_t val);
410 
411 /*****************************************************************/
429  open_buffdesc *name,
431 
432 /*****************************************************************/
451  open_buffdesc *name,
452  uint32_t entry,
454 
455 /*****************************************************************/
474  open_buffdesc *name,
475  uint32_t entry,
477 
478 /*****************************************************************/
497  open_buffdesc *name,
498  uint32_t entry,
500 
501 #endif
502 
open_error_t openapiTimeRangeDelete(openapiClientHandle_t *client_handle, open_buffdesc *name)
Deletes a time range.
open_error_t openapiTimeRangeAbsoluteEntryStartDateAndTimeGet(openapiClientHandle_t *client_handle, open_buffdesc *name, open_buffdesc *val)
Get start date and time for the given absolute time range entry.
open_error_t openapiTimeRangeNumEntriesGet(openapiClientHandle_t *client_handle, open_buffdesc *name, uint32_t *val)
Get the current number of entries configures for the specified time range.
open_error_t openapiTimeRangeNameFirstGet(openapiClientHandle_t *client_handle, open_buffdesc *name)
Get the first time range created in the system.
open_error_t
OPEN uses these enumerators to indicate the error codes.
open_error_t openapiTimeRangeAdminModeGet(openapiClientHandle_t *client_handle, OPEN_CONTROL_t *val)
Get the admin mode of time range.
open_error_t openapiTimeRangeAbsoluteEntryEndDateAndTimeAdd(openapiClientHandle_t *client_handle, open_buffdesc *name, open_buffdesc *val)
Set end date and time for the given absolute time range entry.
open_error_t openapiTimeRangeMaxNumGet(openapiClientHandle_t *client_handle, uint32_t *val)
Get the maximum number of time ranges that can be configured.
open_error_t openapiTimeRangePeriodicEntryEndDateAndTimeSet(openapiClientHandle_t *client_handle, open_buffdesc *name, uint32_t entry, OPEN_TIMERANGE_PERIODIC_ENTRY_t val)
Set periodic end date and time at which the time range becomes inactive.
open_error_t openapiTimeRangePeriodicEntryStartDateAndTimeSet(openapiClientHandle_t *client_handle, open_buffdesc *name, OPEN_TIMERANGE_PERIODIC_ENTRY_t val)
Set periodic start date and time at which the time range becomes active.
open_error_t openapiTimeRangeAbsoluteEntryStartDateAndTimeAdd(openapiClientHandle_t *client_handle, open_buffdesc *name, open_buffdesc *val)
Set start date and time for the given absolute time range entry.
open_error_t openapiTimeRangeEntryDelete(openapiClientHandle_t *client_handle, open_buffdesc *name, uint32_t val)
Remove an entry from an existing time range.
open_error_t openapiTimeRangeAdd(openapiClientHandle_t *client_handle, open_buffdesc *name)
Creates a time range.
open_error_t openapiTimeRangePeriodicEntryStartDateAndTimeGet(openapiClientHandle_t *client_handle, open_buffdesc *name, uint32_t entry, OPEN_TIMERANGE_PERIODIC_ENTRY_t *val)
Gets periodic start date and time at which the time range becomes active.
OPEN_CONTROL_t
OPEN uses these enumerators to indicate enable or disable for a given config or status parameter...
open_error_t openapiTimeRangeAdminModeSet(openapiClientHandle_t *client_handle, OPEN_CONTROL_t val)
Set the admin mode of time range.
open_error_t openapiTimeRangeAbsoluteEntryNumGet(openapiClientHandle_t *client_handle, open_buffdesc *name, uint32_t *val)
Get the absolute time range entry number for the given time range.
open_error_t openapiTimeRangeCurrNumGet(openapiClientHandle_t *client_handle, uint32_t *val)
Get the current number of time ranges configured.
open_error_t openapiTimeRangeStatusGet(openapiClientHandle_t *client_handle, open_buffdesc *name, OPEN_TIMERANGESTATUS_t *val)
Get the status for the given time range.
open_error_t openapiTimeRangeNameNextGet(openapiClientHandle_t *client_handle, open_buffdesc *prevName, open_buffdesc *name)
Get the next time range for the given time range.
open_error_t openapiTimeRangeAbsoluteEntryEndDateAndTimeGet(openapiClientHandle_t *client_handle, open_buffdesc *name, open_buffdesc *val)
Get end date and time for the given absolute time range entry.
open_error_t openapiTimeRangePeriodicEntryEndDateAndTimeGet(openapiClientHandle_t *client_handle, open_buffdesc *name, uint32_t entry, OPEN_TIMERANGE_PERIODIC_ENTRY_t *val)
Gets periodic end date and time at which the time range becomes inactive.