Clock¶
- class brainstem.entity.Clock(module, index)[source]¶
The ClockClass is the interface to the realtime clock.
For modules that support realtime clocks, this class supports getting and setting clock values for year, month, day, hour, minute and second.
- getDay()[source]¶
Get the current day of the month
- Returns:
- Result object, containing NO_ERROR and current day or
a non zero Error code.
- Return type:
- getHour()[source]¶
Get the current hour
- Returns:
- Result object, containing NO_ERROR and current hour or
a non zero Error code.
- Return type:
- getMinute()[source]¶
Get the current minute
- Returns:
- Result object, containing NO_ERROR and current minute or
a non zero Error code.
- Return type:
- getMonth()[source]¶
Get the current month
- Returns:
- Result object, containing NO_ERROR and current month or
a non zero Error code.
- Return type:
- getSecond()[source]¶
Get the current second
- Returns:
- Result object, containing NO_ERROR and current second or
a non zero Error code.
- Return type:
- getYear()[source]¶
Get the current year
- Returns:
- Result object, containing NO_ERROR and current year or
a non zero Error code.
- Return type:
- setDay(day)[source]¶
Set the current day of the month
- Param:
value (int): Current 2 digit day.
- Returns:
Return NO_ERROR on success, or one of the common sets of return error codes on failure.
- Return type:
Result.error
- setHour(hour)[source]¶
Set the current hour
- Param:
value (int): Current 2 digit hour.
- Returns:
Return NO_ERROR on success, or one of the common sets of return error codes on failure.
- Return type:
Result.error
- setMinute(minute)[source]¶
Set the current minute
- Param:
value (int): Current 2 digit minute.
- Returns:
Return NO_ERROR on success, or one of the common sets of return error codes on failure.
- Return type:
Result.error
- setMonth(month)[source]¶
Set the current month
- Param:
value (int): Current 2 digit month.
- Returns:
Return NO_ERROR on success, or one of the common sets of return error codes on failure.
- Return type:
Result.error