Clock Entity¶
See the Clock Entity for generic information.
- group ClockEntity
Provides an interface to a real-time clock entity on a BrainStem module. The clock entity may be used to get and set the real time of the system. The clock entity has a one second resolution.
-
void clock_getYear(unsigned int *id, struct Result *result, const int index)¶
Get the four digit year value (0-4095).
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
value: Get the year portion of the real-time clock value.
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code and the requested value if successful.
index – The index of the entity in question.
-
void clock_setYear(unsigned int *id, struct Result *result, const int index, const unsigned short year)¶
Set the four digit year value (0-4095).
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code.
index – The index of the entity in question.
year – Set the year portion of the real-time clock value.
-
void clock_getMonth(unsigned int *id, struct Result *result, const int index)¶
Get the two digit month value (1-12).
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
value: The two digit month portion of the real-time clock value.
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code and the requested value if successful.
index – The index of the entity in question.
-
void clock_setMonth(unsigned int *id, struct Result *result, const int index, const unsigned char month)¶
Set the two digit month value (1-12).
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code.
index – The index of the entity in question.
month – The two digit month portion of the real-time clock value.
-
void clock_getDay(unsigned int *id, struct Result *result, const int index)¶
Get the two digit day of month value (1-28, 29, 30 or 31 depending on the month).
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
value: The two digit day portion of the real-time clock value.
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code and the requested value if successful.
index – The index of the entity in question.
-
void clock_setDay(unsigned int *id, struct Result *result, const int index, const unsigned char day)¶
Set the two digit day of month value (1-28, 29, 30 or 31 depending on the month).
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code.
index – The index of the entity in question.
day – The two digit day portion of the real-time clock value.
-
void clock_getHour(unsigned int *id, struct Result *result, const int index)¶
Get the two digit hour value (0-23).
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
value: The two digit hour portion of the real-time clock value.
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code and the requested value if successful.
index – The index of the entity in question.
-
void clock_setHour(unsigned int *id, struct Result *result, const int index, const unsigned char hour)¶
Set the two digit hour value (0-23).
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code.
index – The index of the entity in question.
hour – The two digit hour portion of the real-time clock value.
-
void clock_getMinute(unsigned int *id, struct Result *result, const int index)¶
Get the two digit minute value (0-59).
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
value: The two digit minute portion of the real-time clock value.
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code and the requested value if successful.
index – The index of the entity in question.
-
void clock_setMinute(unsigned int *id, struct Result *result, const int index, const unsigned char minute)¶
Set the two digit minute value (0-59).
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code.
index – The index of the entity in question.
minute – The two digit minute portion of the real-time clock value.
-
void clock_getSecond(unsigned int *id, struct Result *result, const int index)¶
Get the two digit second value (0-59).
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
value: The two digit second portion of the real-time clock value.
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code and the requested value if successful.
index – The index of the entity in question.
-
void clock_setSecond(unsigned int *id, struct Result *result, const int index, const unsigned char second)¶
Set the two digit second value (0-59).
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code.
index – The index of the entity in question.
second – The two digit second portion of the real-time clock value.