HSMADM_AdjustTime
Synopsis
#include hsmadmin.h HSMADM_RV HSMADM_AdjustTime(unsigned int hsmIndex,const HSMADM_TimeVal_t * delta,HSMADM_TimeVal_t * oldDelta );
Description
Either adjust the time, or obtain the current adjustment value.
The parameter, delta, indicates the adjustment to be applied to the HSM RTC. The HSM is only capable of performing Slew Adjustment when updating the Real Time Clock (RTC). This prevents large (multiple second) negative or positive steps of the current RTC. The RTC has a Slew Adjustment of 1 second for every 10 seconds of elapsed time, hence if the RTC was out by 1000 seconds, it will take approx 10000 seconds (2.7 hours) to match the external time source.
Because Slew Adjustment is the means by which the RTC is updated, the HSM may not have completed making an adjustment requested by a previous HSMADM_AdjustTime call. If there is an adjustment being performed when this function is called, then this adjustment is discarded, and the new adjustment value is used instead.
This function can alternatively be used to obtain the value of the time adjustment that remains to be completed. If the parameter delta is NULL, and oldDelta is a valid pointer, it will return the pending adjustment.
Parameters
hsmIndex |
Zero-based index of the HSM number to be used |
delta |
Amount of adjustment to be made to the RTC. This parameter must be NULL if oldDelta is not NULL. HSMADM_TimeVal_t is defined in hsmadmin.h |
oldDelta |
Address of the variable that will receive the value of the adjustment that remains to be completed. HSMADM_TimeVal_t is defined in hsmadmin.h. If this parameter is not NULL, delta must be NULL |