Readsms – Argox PT-9130 User Manual

Page 134

Advertising
background image

PT-90 Mobile Computer SDK Programming Manual 127

ReadSMS

Read a SMS message in SIM card.

DWORD ReadSMS

{

int

nIndex

,

int *

nStatus

,

LPTSTR

lpNumber

,

LPTSTR

lpData

,

LPTSTR

lpTimeStamp

}

Parameters

nIndex

[in] The one-based index of a SMS message.

nStatus

[out] Receive the message status. The return value can be one of the values in the following table.

Value

Message Status

0

"REC UNREAD", received unread message

1

"REC READ", received read message

2

"STO UNSENT", stored unsent message

3

"STO SENT", stored sent message

lpNumber

[out] Receive the sender phone number.

lpData

[out] Receive the SMS message data.

lpTimeStamp

[out] Receive the service center time stamp. Format: "yy/MM/dd,hh:mm:ss", where characters indicate

year (two last digits), month, day, hour, minute, second.

Returned Values

If the action succeeds, the returned value is

E_FUNC_SUCCEED

. If the action fails, possible returned values are

E_FUNC_ERROR

,

E_FUNC_PAR_ERROR

,

GPRS_ERR_DEVICE_ERROR

.

Example

int iStatus;

WCHAR szNumber[30], szData[512], szTimpStamp[30];

if(ReadSMS(1, &iStatus, szNumber, szData, szTimpStamp) != E_FUNC_SUCCEED)

AfxMessageBox(_T("Read SMS fail!"));

Advertising