Share via


SmsGetTime (Compact 2013)

3/26/2014

This function retrieves an estimate of the current time approximated from the Short Message Service Center (SMSC) clock, based on the last outgoing message that requested a status report message, and the corresponding status report message.

Syntax

HRESULT SmsGetTime (
    SYSTEMTIME* const ptsCurrentTime,
    DWORD* const pdwErrorMargin
);

Parameters

  • ptsCurrentTime
    Estimate of the current time based on the most recently received SMSC timestamp. This estimate is expressed in Universal Coordinated Time (UTC). It is up to the user to convert this time to local time if desired.
  • pdwErrorMargin
    Maximum error (expressed in seconds) of the time reported by SmsGetTime. If the error margin is unknown or could not be determined, this value is set to 0xFFFFFFFF.

Return Value

  • E_FAIL
    Indicates an unspecified failure.
  • E_INVALIDARG
    Indicates one or more invalid arguments.
  • E_OUTOFMEMORY
    Indicates an out-of-memory error.
  • E_UNEXPECTED
    Unexpected failure.
  • S_OK
    The method completed successfully.

For information about additional return values, see SMS Specific Errors and SMS General Errors.

Remarks

The Short Message Service (SMS) router maintains three variables: the last SMSC timestamp received, the system clock at the time the corresponding SMS was received, and the error margin. At startup, these values are unknown and any calls to SmsGetTime will return the SMS_E_TIMEUNAVAILABLE error.

If any SMS message is sent with a status report requested, the time the original message was sent, the timestamp of the resulting status report SMS, and the current system time are used to calculate the UTC time according to the SMSC.

Note

If the SMSC internal time is not correct, then the estimate provided by this API will be incorrect.

Subsequent calls to the SmsGetTime API will return the UTC estimate adjusted for the time elapsed since the estimate was made.

Note that altering the system time after a timestamp has been recorded will alter the results of subsequent SmsGetTime calls.

If the last SMSC timestamp received, the system clock at the time the corresponding SMS was received, and the error margin are unknown, then the call to SmsGetTimeSmsGetTime will return an error.

Note

This function is not supported for code division multiple access (CDMA).

Requirements

Header

sms.h

Library

sms.lib

See Also

Reference

Short Message Service Functions
SMS General Errors
SMS Specific Errors
SmsSendMessage