CmSetSystemTime
Description
Using time specifications on implementing time-limited license models
Since embedded systems may often have no real-time clock, CmEmbedded features the function CmSetSystemTime to implement time-based license models. If time-limited license options, e.g. Expiration Time or Usage Period, are to be considered, previous to calling API functions, e.g. CmCrypt2, the current time must be set using the API function CmSetSystemTime.
CmSetSystemTime sets the internal clock of a CmContainer to the time transferred by the structure CMTIME.
This internal time cannot be set back, i.e. in the case of such an attempt, the call is ignored.
Syntax
int CMAPIENTRY CmSetSystemTime( HCMSysEntry hcmse, CMTIME * newSystemTime )
Parameter
hcmse contains a handle opened by CmAccess2.
newSystemTime holds the new time. The member 'mulSecondsSince01_01_2000' of the structure
CMTIME is used.
|
CMTIME sets or gets the time to or from a CmContainer. Syntax
Parameter musYear specifies the value of the year (e.g. 2003). musMonth specifies the value of the month (1..12). musDay specifies the value of the day (1..31). musHours specifies the value of the hours (0..23). musMinutes specifies the value of the minutes (0..59). musSeconds specifies the value of the seconds (0..59). mulSecondsSince01_01_2000 specifies the time in seconds since 01/01/2000.
|
Notes
|
When using time-dependent license options, e.g. Usage Period, you must call this function before using other essential functions, e.g. CmCrypt2. |
If you use CmDongle, it is sufficient to repeat this call every hour.
If you use CmActLicense, Wibu-Systems recommends to call this function more often, e.g. before each CmCrypt2 call, if the time is not forwarded by internal mechanisms. You test internal forwarding on a platform by repeated detecting the time every other minute using the function CmGetInfo(CM_GEI_BOXTIME) to prove the correct time.