LinuxSDK  V1.4.0.5
Functions | Variables
SwiApiCdmaSms.c File Reference

SWI CDMA specific SMS related APIs. More...

#include "SwiApiCdmaSms.h"
#include "SwiIntUpkCdmaSms.h"
#include "ap/apidefs.h"

Functions

SWI_API SWI_RCODE SwiPriGetSMSMask (swi_uint16 *smsMask, swi_uint32 timeout)
 
SWI_API SWI_RCODE SwiPriGetMaxMosmsLen (swi_uint16 *puMaxLen, swi_uint32 timeout)
 
SWI_API SWI_RCODE SwiSendCdmaSMS (swi_uint32 timeout)
 
SWI_API SWI_RCODE SwiGetCdmaSMSMessageStatus (SWI_STRUCT_CDMA_SMS_Status *pSMS_Status, swi_uint32 timeout)
 
local swi_uint32 UnpackCnsSmsHeader (swi_uint8 *paramfieldp, CNS_SMS_HEADER *psmsPacketHeader)
 
local void UnpackCdmaSmsHeader (swi_uint8 *paramfieldp, SWI_STRUCT_SMS_CdmaHeader *pcdmaHeader)
 
local void UnpackSmsHeader (swi_uint8 *paramfieldp, CNS_SMS_HEADER *psmsPacketHeader, SWI_STRUCT_SMS_CdmaHeader *pcdmaHeader)
 
local SWI_RCODE RetrieveSMSHeader (CNS_SMS_HEADER *psmsPacketHeader, SWI_STRUCT_SMS_CdmaHeader *pcdmaHeader, swi_uint32 timeout)
 
local void UnpackSmsBody (swi_uint8 *paramfieldp, CNS_SMS_HEADER *psmsPacketHeader, swi_uint8 *pMsgBody, swi_uint32 *pSizeSegment)
 
local SWI_RCODE RetrieveSMSBody (swi_uint8 previousSegmentNumber, CNS_SMS_HEADER *psmsPacketHeader, swi_uint8 *pMsgBody, swi_uint32 *psizeSegment, swi_uint32 timeout)
 
local SWI_RCODE RetrieveSMSMessageEx (SWI_STRUCT_CDMA_SMS_RetrieveSms *pSms, swi_bool bDeleteAfterRetrieve, swi_uint32 timeout)
 
SWI_API SWI_RCODE SwiRetrieveCdmaSMSMessage (SWI_STRUCT_CDMA_SMS_RetrieveSms *pSms, swi_uint32 timeout)
 
SWI_API SWI_RCODE SwiRetrieveSMSMessageEx (SWI_STRUCT_CDMA_SMS_RetrieveSms *pSms, swi_bool bDeleteAfterRetrieve, swi_uint32 timeout)
 
SWI_API SWI_RCODE SwiSetMessageRetrieved (swi_uint16 msgID, swi_uint32 timeout)
 
local swi_uint32 PackSmsHeader (swi_uint8 *paramfieldp, SWI_STRUCT_CDMA_SMS_StoreSms *psStoreSms)
 
local SWI_RCODE SendSMSHeader (SWI_STRUCT_CDMA_SMS_StoreSms *psStoreSms, swi_uint32 timeout)
 
swi_uint32 PackSmsBody (swi_uint8 *paramfieldp, swi_uint16 msgID, swi_uint8 segmentType, swi_uint8 packetSeqNumber, swi_uint8 *pSegmentBody, swi_uint32 lenByteArray)
 
local SWI_RCODE SendSMSBody (swi_uint16 msgID, swi_uint8 segmentType, swi_uint8 packetSeqNumber, swi_uint8 *pSegmentBody, swi_uint32 lenByteArray, swi_uint32 timeout)
 
SWI_API SWI_RCODE SwiStoreCdmaSMSMessage (SWI_STRUCT_CDMA_SMS_StoreSms *psStoreSms, swi_uint32 timeout)
 

Variables

SMSAPIUsage g_eSmsApiUsage = SMS_Use_Uninitialized
 

Detailed Description

SWI CDMA specific SMS related APIs.

Copyright (c) 2011 Sierra Wireless, Inc. All rights reserved

Function Documentation

swi_uint32 PackSmsBody ( swi_uint8 paramfieldp,
swi_uint16  msgID,
swi_uint8  segmentType,
swi_uint8  packetSeqNumber,
swi_uint8 pSegmentBody,
swi_uint32  lenByteArray 
)

Pack SMS body.

Parameters
paramfieldp[OUT],:Pointer to parameter field in set request.
msgID[IN]Message ID.
segmentType[IN]Segment type. See SWI_SMS_PACKET_TYPE.
packetSeqNumber[IN]Packet segment number.
pSegmentBody[IN]Segment body.
lenByteArray[IN]Length of segment body in byte.
Returns
Number of bytes packed.
local swi_uint32 PackSmsHeader ( swi_uint8 paramfieldp,
SWI_STRUCT_CDMA_SMS_StoreSms psStoreSms 
)

Pack SMS header.

Parameters
paramfieldp[OUT]Pointer to parameter field in set request.
psStoreSms[IN]Pointer to SMS header to pack.
Returns
Number of bytes packed.
local SWI_RCODE RetrieveSMSBody ( swi_uint8  previousSegmentNumber,
CNS_SMS_HEADER psmsPacketHeader,
swi_uint8 pMsgBody,
swi_uint32 psizeSegment,
swi_uint32  timeout 
)

This function retrieves SMS body

Parameters
previousSegmentNumber[IN]Previous segment number.
psmsPacketHeader[IN]SMS packet header.
pMsgBody[OUT]Memory Location to store message body retrieved.
psizeSegment[OUT]Segment size.
timeout[IN]Function timeout in milliseconds.
Returns
See SwiRcodes.h
local SWI_RCODE RetrieveSMSHeader ( CNS_SMS_HEADER psmsPacketHeader,
SWI_STRUCT_SMS_CdmaHeader pcdmaHeader,
swi_uint32  timeout 
)

This function retrieves SMS header

Parameters
psmsPacketHeader[OUT]Memory location to store the unpacked contents of CnS SMS header.
pcdmaHeader[OUT]Memory location to store the unpacked contents of CDMA SMS header.
timeout[IN]Function timeout in milliseconds.
Returns
See SwiRcodes.h
local SWI_RCODE RetrieveSMSMessageEx ( SWI_STRUCT_CDMA_SMS_RetrieveSms pSms,
swi_bool  bDeleteAfterRetrieve,
swi_uint32  timeout 
)

This function retrieves SMS.

Parameters
pSms[OUT]Memory location to store message body retrieved.
bDeleteAfterRetrieve[IN]Delete after SMS is retrieved if true. Otherwise not delete.
timeout[IN]Function timeout in milliseconds.
Returns
See SwiRcodes.h
local SWI_RCODE SendSMSBody ( swi_uint16  msgID,
swi_uint8  segmentType,
swi_uint8  packetSeqNumber,
swi_uint8 pSegmentBody,
swi_uint32  lenByteArray,
swi_uint32  timeout 
)

Send SMS body.

Parameters
msgID[IN]Message ID.
segmentType[IN]Segment type. See SWI_SMS_PACKET_TYPE.
packetSeqNumber[IN]Packet segment number.
pSegmentBody[IN]Segment body.
lenByteArray[IN]Length of segment body in byte.
timeout[IN]Function timeout in milliseconds.
Returns
See SwiRcodes.h
local SWI_RCODE SendSMSHeader ( SWI_STRUCT_CDMA_SMS_StoreSms psStoreSms,
swi_uint32  timeout 
)

Send SMS header.

Parameters
psStoreSms[IN]Pointer to SMS header to send.
timeout[IN]Function timeout in milliseconds.
Returns
See SwiRcodes.h
SWI_API SWI_RCODE SwiGetCdmaSMSMessageStatus ( SWI_STRUCT_CDMA_SMS_Status pSMS_Status,
swi_uint32  timeout 
)

This function queries the outstanding SMS message status

Parameters
pSMS_Status[OUT]Outstanding SMS message status.
timeout[IN]Function timeout in milliseconds.
Returns
See SwiRcodes.h
SWI_API SWI_RCODE SwiPriGetMaxMosmsLen ( swi_uint16 puMaxLen,
swi_uint32  timeout 
)

This function gets maximum outgoing SMS length

Parameters
puMaxLen[OUT]The destination in which the maximum length in bytes is returned.
timeout[IN]Function timeout in milliseconds.
Returns
See SwiRcodes.h
SWI_API SWI_RCODE SwiPriGetSMSMask ( swi_uint16 smsMask,
swi_uint32  timeout 
)

This function reports the modem's SMS capabilities.

Parameters
smsMask[OUT]The destination in which the the data is returned. Possible mask bit values are defined in SWI_TYPE_PRI_SmsMask.
timeout[IN]Function timeout in milliseconds.
Returns
See SwiRcodes.h
SWI_API SWI_RCODE SwiRetrieveCdmaSMSMessage ( SWI_STRUCT_CDMA_SMS_RetrieveSms pSms,
swi_uint32  timeout 
)

This function retrieves an SMS message

Parameters
pSms[OUT]SMS message struct.
timeout[IN]Function timeout in milliseconds.
Returns
See SwiRcodes.h
SWI_API SWI_RCODE SwiRetrieveSMSMessageEx ( SWI_STRUCT_CDMA_SMS_RetrieveSms pSms,
swi_bool  bDeleteAfterRetrieve,
swi_uint32  timeout 
)

This function retrieves an SMS message along with an option to delete it or not.

Parameters
pSms[OUT]Memory to save SMS message retrieved.
bDeleteAfterRetrieve[IN]Delete the message from modem after retrieval if TRUE; Otherwise leave it in the modem store.
timeout[IN]Function timeout in milliseconds.
Returns
See SwiRcodes.h
SWI_API SWI_RCODE SwiSendCdmaSMS ( swi_uint32  timeout)

This function starts sending stored SMS messages.

Parameters
timeout[IN]Function timeout in milliseconds.
Returns
See SwiRcodes.h
SWI_API SWI_RCODE SwiSetMessageRetrieved ( swi_uint16  msgID,
swi_uint32  timeout 
)

This function sets a message as retrieved so modem can delete it

Parameters
msgID[IN]SMS message ID to be deleted.
timeout[IN]Function timeout in milliseconds.
Returns
See SwiRcodes.h
SWI_API SWI_RCODE SwiStoreCdmaSMSMessage ( SWI_STRUCT_CDMA_SMS_StoreSms psStoreSms,
swi_uint32  timeout 
)

This function is used to store an SMS message.

Parameters
psStoreSms[OUT]SMS message to store.
timeout[IN]Function timeout in milliseconds.
Returns
See SwiRcodes.h
local void UnpackCdmaSmsHeader ( swi_uint8 paramfieldp,
SWI_STRUCT_SMS_CdmaHeader pcdmaHeader 
)

Unpacks the CDMA SMS header parameter field

Parameters
paramp,:[IN] Pointer to parameter field in set request.
pcdmaHeader[OUT]Memory location to store the unpacked contents of CDMA SMS header.
local swi_uint32 UnpackCnsSmsHeader ( swi_uint8 paramfieldp,
CNS_SMS_HEADER psmsPacketHeader 
)

Unpacks the CnS SMS header parameter field.

Parameters
paramp,:[IN] Pointer to parameter field in set request.
psmsPacketHeader[OUT]Memory location to store the unpacked contents of CnS SMS header.
Returns
Number of bytes unpacked.
local void UnpackSmsBody ( swi_uint8 paramfieldp,
CNS_SMS_HEADER psmsPacketHeader,
swi_uint8 pMsgBody,
swi_uint32 pSizeSegment 
)

Unpacks SMS body

Parameters
paramp,:[IN] Pointer to parameter field in set request.
psmsPacketHeader[OUT]Memory location to store the unpacked contents of CnS SMS header.
pMsgBody[OUT]Memory location to store the unpacked contents of SMS body.
pSizeSegment[OUT]Memory location to store the unpacked . contents of segment size.
local void UnpackSmsHeader ( swi_uint8 paramfieldp,
CNS_SMS_HEADER psmsPacketHeader,
SWI_STRUCT_SMS_CdmaHeader pcdmaHeader 
)

Unpacks the SMS header parameter field

Parameters
paramp,:[IN] Pointer to parameter field in set request.
psmsPacketHeader[OUT]Memory location to store the unpacked contents of CnS SMS header.
pcdmaHeader[OUT]Memory location to store the unpacked contents of CDMA SMS header.

Variable Documentation

There are two set of SMS APIs. The first SMS related API call decides which set of the APIs is used, which is indicated by this flag.


Linux SDK V1.4.0.5
Copyright (c) 2011 Sierra Wireless, Inc. All rights reserved