Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.11.1.2
Data Structures | Typedefs | Enumerations | Functions
This Code Implements The Open The TimesZone API [OPENAPI_TIMEZONE]

Data Structures

struct  open_clocktime_t
 

Typedefs

typedef struct open_clocktime_t open_clocktime
 

Enumerations

enum  OPEN_ST_NON_RECURRING_PARAM_t {
  OPEN_ST_NON_RECURRING_PARAM_START_DAY = 1, OPEN_ST_NON_RECURRING_PARAM_START_MONTH, OPEN_ST_NON_RECURRING_PARAM_START_YEAR, OPEN_ST_NON_RECURRING_PARAM_START_HOUR,
  OPEN_ST_NON_RECURRING_PARAM_START_MINUTE, OPEN_ST_NON_RECURRING_PARAM_END_DAY, OPEN_ST_NON_RECURRING_PARAM_END_MONTH, OPEN_ST_NON_RECURRING_PARAM_END_YEAR,
  OPEN_ST_NON_RECURRING_PARAM_END_HOUR, OPEN_ST_NON_RECURRING_PARAM_END_MINUTE, OPEN_ST_NON_RECURRING_PARAM_OFFSET_MINUTES, OPEN_ST_NON_RECURRING_PARAM_ZONE_ACRONYM
}
 OpEN uses this enumeration to define the summer time non recurring parameters. More...
 
enum  OPEN_ST_RECURRING_PARAM_t {
  OPEN_ST_RECURRING_PARAM_START_DAY = 1, OPEN_ST_RECURRING_PARAM_START_MONTH, OPEN_ST_RECURRING_PARAM_START_WEEK, OPEN_ST_RECURRING_PARAM_START_HOUR,
  OPEN_ST_RECURRING_PARAM_START_MINUTE, OPEN_ST_RECURRING_PARAM_END_DAY, OPEN_ST_RECURRING_PARAM_END_MONTH, OPEN_ST_RECURRING_PARAM_END_WEEK,
  OPEN_ST_RECURRING_PARAM_END_HOUR, OPEN_ST_RECURRING_PARAM_END_MINUTE, OPEN_ST_RECURRING_PARAM_OFFSET_MINUTES, OPEN_ST_RECURRING_PARAM_ZONE_ACRONYM
}
 OpEN uses this enumeration to define the summer time recurring parameters. More...
 
enum  OPEN_SUMMER_TIME_MODE_t {
  OPEN_NO_SUMMER_TIME_MODE = 0, OPEN_SUMMER_TIME_MODE_RECURRING, OPEN_SUMMER_TIME_MODE_RECURRING_EU, OPEN_SUMMER_TIME_MODE_RECURRING_USA,
  OPEN_SUMMER_TIME_MODE_NON_RECURRING
}
 OpEN uses this enumeration to define summer time mode. More...
 

Functions

open_error_t openapiAdjustedTimeGet (openapiClientHandle_t *client_handle, uint32_t *year, uint32_t *month, uint32_t *day, uint32_t *hour, uint32_t *minutes, uint32_t *seconds)
 Adjusts current time for timezone and summer time. More...
 
open_error_t openapiMinutesOffsetConvert (openapiClientHandle_t *client_handle, int32_t minutes, uint32_t *pHour, uint32_t *pMin)
 Convert minute offset into hour and minutes. More...
 
uint32_t openapiRawAdjustedTimeGet (openapiClientHandle_t *client_handle, uint32_t rawTime)
 Converts the given Raw time to UTC and then adds the timezone and summer time offsets if configured. More...
 
open_error_t openapiStModeGet (openapiClientHandle_t *client_handle, OPEN_SUMMER_TIME_MODE_t *mode)
 Get the summer-time mode. More...
 
open_error_t openapiStModeSet (openapiClientHandle_t *client_handle, OPEN_SUMMER_TIME_MODE_t mode)
 Set the summer-time mode. More...
 
open_error_t openapiStNonRecurringGet (openapiClientHandle_t *client_handle, OPEN_ST_NON_RECURRING_PARAM_t parameter, open_buffdesc *bufd)
 Get non-recurring summertime parameters. More...
 
open_error_t openapiStNonRecurringSet (openapiClientHandle_t *client_handle, OPEN_ST_NON_RECURRING_PARAM_t parameter, open_buffdesc *bufd)
 Set non-recurring summertime parameters. More...
 
open_error_t openapiStRecurringGet (openapiClientHandle_t *client_handle, OPEN_ST_RECURRING_PARAM_t parameter, open_buffdesc *bufd)
 Get recurring summertime parameters. More...
 
open_error_t openapiStRecurringSet (openapiClientHandle_t *client_handle, OPEN_ST_RECURRING_PARAM_t parameter, open_buffdesc *bufd)
 Set recurring summertime parameters. More...
 
OPEN_BOOL_t openapiSummerTimeIsInEffect (openapiClientHandle_t *client_handle)
 know whether the summer-time is in effect or not. More...
 
open_error_t openapiSystemTimeZoneAcronymGet (openapiClientHandle_t *client_handle, open_buffdesc *zoneName)
 Gets the timezone acronym string. More...
 
open_error_t openapiTimeConvert (openapiClientHandle_t *client_handle, open_buffdesc *bufd, uint32_t *pHour, uint32_t *pMin)
 Convert hh:mm string to int values. More...
 
open_error_t openapiTimeZoneAcronymGet (openapiClientHandle_t *client_handle, open_buffdesc *acronym)
 Get the time zone acronym parameter. More...
 
open_error_t openapiTimeZoneAcronymSet (openapiClientHandle_t *client_handle, open_buffdesc *acronym)
 Set the time zone acronym parameter. More...
 
open_error_t openapiUTCTimeGet (openapiClientHandle_t *client_handle, open_clocktime *ct)
 Get the current UTC time since the Unix Epoch. More...
 
int32_t openapiUTCTimeNow (openapiClientHandle_t *client_handle)
 Get the current synchronized UTC time since the Unix Epoch. More...
 
open_error_t openapiWeekNumberGet (openapiClientHandle_t *client_handle, open_buffdesc *name, uint32_t *number)
 Convert month name to number value. More...
 

Detailed Description

Enumeration Type Documentation

OpEN uses this enumeration to define the summer time non recurring parameters.

Enumerator
OPEN_ST_NON_RECURRING_PARAM_START_DAY 

start day : none(0) | (1..31)

OPEN_ST_NON_RECURRING_PARAM_START_MONTH 

start month : none(0),jan(1),feb(2),mar(3),apr(4),may(5),jun(6), jul(7),aug(8),sep(9),oct(10),nov(11),dec(12)

OPEN_ST_NON_RECURRING_PARAM_START_YEAR 

start year : (0 |2000..2097)

OPEN_ST_NON_RECURRING_PARAM_START_HOUR 

start hour : (0..23)

OPEN_ST_NON_RECURRING_PARAM_START_MINUTE 

start minute : (0..59)

OPEN_ST_NON_RECURRING_PARAM_END_DAY 

end day : none(0) | (1..31)

OPEN_ST_NON_RECURRING_PARAM_END_MONTH 

end month : none(0),jan(1),feb(2),mar(3),apr(4),may(5),jun(6), jul(7),aug(8),sep(9),oct(10),nov(11),dec(12)

OPEN_ST_NON_RECURRING_PARAM_END_YEAR 

end year : (0 |2000..2097)

OPEN_ST_NON_RECURRING_PARAM_END_HOUR 

end hour : (0..23)

OPEN_ST_NON_RECURRING_PARAM_END_MINUTE 

end minute : (0..59)

OPEN_ST_NON_RECURRING_PARAM_OFFSET_MINUTES 

offset minutes : (1..1440)

OPEN_ST_NON_RECURRING_PARAM_ZONE_ACRONYM 

zone acronym : String

Definition at line 73 of file openapi_timezone.h.

OpEN uses this enumeration to define the summer time recurring parameters.

Enumerator
OPEN_ST_RECURRING_PARAM_START_DAY 

start day : none(0),sun(1),mon(2),tue(3),wed(4),thu(5),fri(6),sat(7)

OPEN_ST_RECURRING_PARAM_START_MONTH 

start month : none(0),jan(1),feb(2),mar(3),apr(4),may(5),jun(6), jul(7),aug(8),sep(9),oct(10),nov(11),dec(12)

OPEN_ST_RECURRING_PARAM_START_WEEK 

start week : none(0),first(1),second(2),third(3),fourth(4),last(5)

OPEN_ST_RECURRING_PARAM_START_HOUR 

start hour : (0..23)

OPEN_ST_RECURRING_PARAM_START_MINUTE 

start minute : (0..59)

OPEN_ST_RECURRING_PARAM_END_DAY 

end day : none(0),sun(1),mon(2),tue(3),wed(4),thu(5),fri(6),sat(7)

OPEN_ST_RECURRING_PARAM_END_MONTH 

end month : none(0),jan(1),feb(2),mar(3),apr(4),may(5),jun(6), jul(7),aug(8),sep(9),oct(10),nov(11),dec(12)

OPEN_ST_RECURRING_PARAM_END_WEEK 

end week : none(0),first(1),second(2),third(3),fourth(4),last(5)

OPEN_ST_RECURRING_PARAM_END_HOUR 

end hour : (0..23)

OPEN_ST_RECURRING_PARAM_END_MINUTE 

end minute : (0..59)

OPEN_ST_RECURRING_PARAM_OFFSET_MINUTES 

offset minutes : (1..1440)

OPEN_ST_RECURRING_PARAM_ZONE_ACRONYM 

zone acronym : String

Definition at line 54 of file openapi_timezone.h.

OpEN uses this enumeration to define summer time mode.

Enumerator
OPEN_NO_SUMMER_TIME_MODE 

No summer time.

OPEN_SUMMER_TIME_MODE_RECURRING 

recurring

OPEN_SUMMER_TIME_MODE_RECURRING_EU 

recurring EU

OPEN_SUMMER_TIME_MODE_RECURRING_USA 

recurring USA

OPEN_SUMMER_TIME_MODE_NON_RECURRING 

non recurring

Definition at line 44 of file openapi_timezone.h.

Function Documentation

open_error_t openapiAdjustedTimeGet ( openapiClientHandle_t client_handle,
uint32_t *  year,
uint32_t *  month,
uint32_t *  day,
uint32_t *  hour,
uint32_t *  minutes,
uint32_t *  seconds 
)

Adjusts current time for timezone and summer time.

Parameters
[in]client_handleclient handle from registration API
[out]yearyear
[out]monthmonth of the year
[out]dayday of the month
[out]hourhour of the day
[out]minutesminutes of the hour
[out]secondsseconds of the hour
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.

OpEN API Version: 1.25

Examples:
timezone_example.c.
open_error_t openapiMinutesOffsetConvert ( openapiClientHandle_t client_handle,
int32_t  minutes,
uint32_t *  pHour,
uint32_t *  pMin 
)

Convert minute offset into hour and minutes.

Parameters
[in]client_handleclient handle from registration API
[in]minutesHolds minutes
[out]pHourpointer to Hour
[out]pMinpointer to minutes
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.
Note
Converts minute offset into hour and minute offset properly

OpEN API Version: 1.25

Examples:
timezone_example.c.
uint32_t openapiRawAdjustedTimeGet ( openapiClientHandle_t client_handle,
uint32_t  rawTime 
)

Converts the given Raw time to UTC and then adds the timezone and summer time offsets if configured.

Parameters
[in]client_handleclient handle from registration API
[in]rawTimeRaw time
Returns
uint32_t Adjusted time
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.

OpEN API Version: 1.25

Examples:
timezone_example.c.
open_error_t openapiStModeGet ( openapiClientHandle_t client_handle,
OPEN_SUMMER_TIME_MODE_t mode 
)

Get the summer-time mode.

Parameters
[in]client_handleclient handle from registration API
[out]modeSummer-time mode to be returned
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.

OpEN API Version: 1.25

Examples:
timezone_example.c.
open_error_t openapiStModeSet ( openapiClientHandle_t client_handle,
OPEN_SUMMER_TIME_MODE_t  mode 
)

Set the summer-time mode.

Parameters
[in]client_handleclient handle from registration API
[in]modesummer-time mode
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.

OpEN API Version: 1.25

Examples:
timezone_example.c.
open_error_t openapiStNonRecurringGet ( openapiClientHandle_t client_handle,
OPEN_ST_NON_RECURRING_PARAM_t  parameter,
open_buffdesc bufd 
)

Get non-recurring summertime parameters.

Parameters
[in]client_handleclient handle from registration API
[in]parametersummer-time parameter
[out]bufdsummer-time parameter value to be returned
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.

OpEN API Version: 1.25

Examples:
timezone_example.c.
open_error_t openapiStNonRecurringSet ( openapiClientHandle_t client_handle,
OPEN_ST_NON_RECURRING_PARAM_t  parameter,
open_buffdesc bufd 
)

Set non-recurring summertime parameters.

Parameters
[in]client_handleclient handle from registration API
[in]parametersummer-time parameter
[in]bufdsummer-time parameter value to be set
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.

OpEN API Version: 1.25

Examples:
timezone_example.c.
open_error_t openapiStRecurringGet ( openapiClientHandle_t client_handle,
OPEN_ST_RECURRING_PARAM_t  parameter,
open_buffdesc bufd 
)

Get recurring summertime parameters.

Parameters
[in]client_handleclient handle from registration API
[in]parametersummer-time parameter
[out]bufdsummer-time parameter value to be returned
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.

OpEN API Version: 1.25

Examples:
timezone_example.c.
open_error_t openapiStRecurringSet ( openapiClientHandle_t client_handle,
OPEN_ST_RECURRING_PARAM_t  parameter,
open_buffdesc bufd 
)

Set recurring summertime parameters.

Parameters
[in]client_handleclient handle from registration API
[in]parametersummer-time parameter
[in]bufdsummer-time parameter value to be set
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.

OpEN API Version: 1.25

Examples:
timezone_example.c.
OPEN_BOOL_t openapiSummerTimeIsInEffect ( openapiClientHandle_t client_handle)

know whether the summer-time is in effect or not.

Parameters
[in]client_handleclient handle from registration API
Returns
OPEN_TRUE when summer-time is in effect
OPEN_FALSE when summer-time is not in effect

OpEN API Version: 1.25

Examples:
timezone_example.c.
open_error_t openapiSystemTimeZoneAcronymGet ( openapiClientHandle_t client_handle,
open_buffdesc zoneName 
)

Gets the timezone acronym string.

Parameters
[in]client_handleclient handle from registration API
[out]zoneNametimezone name
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.

OpEN API Version: 1.25

Examples:
timezone_example.c.
open_error_t openapiTimeConvert ( openapiClientHandle_t client_handle,
open_buffdesc bufd,
uint32_t *  pHour,
uint32_t *  pMin 
)

Convert hh:mm string to int values.

Parameters
[in]client_handleclient handle from registration API
[in]bufdptr to buffer discription to hold time string
[out]pHourpointer to Hour
[out]pMinpointer to minutes
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.
Note
time may be between 00:00 and 23:59

OpEN API Version: 1.25

Examples:
timezone_example.c.
open_error_t openapiTimeZoneAcronymGet ( openapiClientHandle_t client_handle,
open_buffdesc acronym 
)

Get the time zone acronym parameter.

Parameters
[in]client_handleclient handle from registration API
[out]acronymminutes in timezone structure.
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.

OpEN API Version: 1.25

Examples:
timezone_example.c.
open_error_t openapiTimeZoneAcronymSet ( openapiClientHandle_t client_handle,
open_buffdesc acronym 
)

Set the time zone acronym parameter.

Parameters
[in]client_handleclient handle from registration API
[in]acronymminutes in timezone structure.
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.

OpEN API Version: 1.25

Examples:
timezone_example.c.
open_error_t openapiUTCTimeGet ( openapiClientHandle_t client_handle,
open_clocktime ct 
)

Get the current UTC time since the Unix Epoch.

Parameters
[in]client_handleclient handle from registration API
[out]unitUTC time
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.
Note
NTP epoch is different from Unix epoch.

OpEN API Version: 1.25

Examples:
timezone_example.c.
int32_t openapiUTCTimeNow ( openapiClientHandle_t client_handle)

Get the current synchronized UTC time since the Unix Epoch.

Parameters
[in]client_handleclient handle from registration API
Returns
int32_t seconds since Unix epoch.
Note
This is a utility routine for SNTP internal timestamping.
Note that NTP epoch is different from Unix epoch. This
routine attempts not to return negative time if the clock
has not been synchronized at least once.

OpEN API Version: 1.25

Examples:
timezone_example.c.
open_error_t openapiWeekNumberGet ( openapiClientHandle_t client_handle,
open_buffdesc name,
uint32_t *  number 
)

Convert month name to number value.

Parameters
[in]client_handleclient handle from registration API
[in]namecharacter buffer with week name string
[out]numberpointer to week sequence number
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.
Note
Convert month name to week number value

OpEN API Version: 1.25

Examples:
timezone_example.c.