Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.6.0.3
Macros | Enumerations | Functions
Date & Time Configuration And Status [OPENAPI_TIME]

Macros

#define OPEN_DATE_TIME_BUF_LEN   20 /* includes trailing '\0' */
 
#define OPEN_TIMEZONE_BUF_LEN   15 /* includes trailing '\0' */
 

Enumerations

enum  OPEN_TIME_CLOCK_SRC_t { OPEN_CLOCK_SRC_NONE = 0, OPEN_CLOCK_SRC_SNTP = 1 }
 

Functions

open_error_t openapiClockGet (openapiClientHandle_t *client_handle, open_buffdesc *bufd, OPEN_TIME_CLOCK_SRC_t *clockSrc)
 Get the date and time from the system clock. More...
 
open_error_t openapiClockSet (openapiClientHandle_t *client_handle, open_buffdesc *bufd)
 Set the system clock date and time. More...
 
open_error_t openapiTimeZoneGet (openapiClientHandle_t *client_handle, open_buffdesc *bufd)
 Get the time zone from the system clock. More...
 
open_error_t openapiTimeZoneSet (openapiClientHandle_t *client_handle, open_buffdesc *bufd)
 Set the system clock time zone. More...
 

Detailed Description

Function Documentation

open_error_t openapiClockGet ( openapiClientHandle_t client_handle,
open_buffdesc bufd,
OPEN_TIME_CLOCK_SRC_t *  clockSrc 
)

Get the date and time from the system clock.

Parameters
[in]client_handleclient handle from registration API
[out]bufdbuffer descriptor containing date and time Buffer length value OPEN_DATE_TIME_BUF_LEN
[out]clockSrcindicates clock source Possible values OPEN_TIME_CLOCK_SRC_t
Return values
OPEN_E_NONEGet successful.
OPEN_E_FAILGet failed.
OPEN_E_PARAMError in parameter passed.
OPEN_E_INTERNALSNTP internal error.
Note
System clock is returned in "yyyy-mm-dd HH:mm:ss" format.

OpEN API Version: 1.14

open_error_t openapiClockSet ( openapiClientHandle_t client_handle,
open_buffdesc bufd 
)

Set the system clock date and time.

Parameters
[in]client_handleclient handle from registration API
[in]bufdbuffer descriptor containing date and time Buffer length value OPEN_DATE_TIME_BUF_LEN
Return values
OPEN_E_NONESet successful.
OPEN_E_FAILSet failed.
OPEN_E_PARAMError in parameter passed.
OPEN_E_INTERNALSNTP is not supported on the platform or an SNTP internal error.
Note
Calling this API will change the running configuration of the switch.
Supported date format is "yyyy-mm-dd".
Supported time format is "HH:mm:ss", where HH is 24-hour format.
Leading zeros are not required for the 'set' operation, (e.g. 6:5:4 implies 06:05:04, 2016-8-1 implies 2016-08-01).

OpEN API Version: 1.14

open_error_t openapiTimeZoneGet ( openapiClientHandle_t client_handle,
open_buffdesc bufd 
)

Get the time zone from the system clock.

Parameters
[in]client_handleclient handle from registration API
[out]bufdbuffer descriptor containing time zone Buffer length value OPEN_TIMEZONE_BUF_LEN
Return values
OPEN_E_NONEGet successful.
OPEN_E_FAILGet failed.
OPEN_E_PARAMError in parameter passed.
Note
Time zone with acronym ZZZZ, if set, is returned in "UTC+hh:mm ZZZZ" or "UTC-hh:mm ZZZZ" format.
Time zone without acronym is returned in "UTC+hh:mm" or "UTC-hh:mm" format.

OpEN API Version: 1.14

open_error_t openapiTimeZoneSet ( openapiClientHandle_t client_handle,
open_buffdesc bufd 
)

Set the system clock time zone.

Parameters
[in]client_handleclient handle from registration API
[in]bufdbuffer descriptor containing time zone Buffer length value OPEN_TIMEZONE_BUF_LEN
Return values
OPEN_E_NONESet successful.
OPEN_E_FAILSet failed.
OPEN_E_PARAMError in parameter passed.
Note
Calling this API will change the running configuration of the switch.
Supported input string format is "UTC+hh:mm ZZZZ" or "UTC-hh:mm ZZZZ", where ZZZZ represents a time zone acronym from 1-4 alpha characters [a-zA-Z].
Leading zeros are not required for the hh, mm 'set' operation, (e.g. UTC+1 implies UTC+01:00).

OpEN API Version: 1.14