LinuxSDK  V1.4.0.5
Functions
SwiApiCmLbs.c File Reference

Contains source code for common APIs related to the Location Based Services. More...

#include "SwiApiCmLbs.h"
#include "SwiIntPkCdmaLbs.h"
#include "SwiIntUpkCdmaLbs.h"
#include "SwiIntUpkCmLbs.h"
#include "SwiIntPkCmLbs.h"
#include "ap/apidefs.h"
#include "sl/sludefs.h"

Functions

package SWI_API SWI_RCODE SwiSetLbsPdGetPos (const struct SWI_STRUCT_LbsPdGetPos *psLbsPdGetPos, swi_uint32 timeout)
 
package SWI_API SWI_RCODE SwiGetLbsPdStatus (struct SWI_STRUCT_LbsPdGetStatus *psLbsPdGetStatus, swi_uint32 timeout)
 
package SWI_API SWI_RCODE SwiSetLbsPdTrack (const struct SWI_STRUCT_LbsPdTrack *psLbsPdTrack, swi_uint32 timeout)
 
package SWI_API SWI_RCODE SwiSetLbsPdEndSession (const struct SWI_STRUCT_LbsPdEndSession *psLbsPdEndSession, swi_uint32 timeout)
 
package SWI_API SWI_RCODE SwiGetLbsPaParam (struct SWI_STRUCT_LbsPaGetParam *psLbsPdGetParam, swi_uint32 timeout)
 
package SWI_API SWI_RCODE SwiGetLbsPdData (struct SWI_STRUCT_LbsPdData *psLbsPdData, swi_uint32 timeout)
 
package SWI_API SWI_RCODE SwiGetLbsPaIpAddr (struct SWI_STRUCT_LbsPaIpAddr *psPaIpAddr, swi_uint32 timeout)
 
package SWI_API SWI_RCODE SwiSetLbsPaIpAddr (const struct SWI_STRUCT_LbsPaIpAddr *psPaIpAddr, swi_uint32 timeout)
 
package SWI_API SWI_RCODE SwiGetLbsPaPortId (struct SWI_STRUCT_LbsPaPortId *psPaPortId, swi_uint32 timeout)
 
package SWI_API SWI_RCODE SwiSetLbsPaPortId (const struct SWI_STRUCT_LbsPaPortId *psPAPortID, swi_uint32 timeout)
 
SWI_API SWI_RCODE SwiGetLbsSatInfo (struct SWI_STRUCT_LbsSatInfo *psSatInfo, swi_uint32 timeout)
 
package SWI_API SWI_RCODE SwiSetLbsClearAssistance (const struct SWI_STRUCT_LbsClearAssistance *psLbsClearAssistance, swi_uint32 timeout)
 

Detailed Description

Contains source code for common APIs related to the Location Based Services.

Copyright: © 2011 Sierra Wireless, Inc. all rights reserved

Function Documentation

package SWI_API SWI_RCODE SwiGetLbsPaIpAddr ( struct SWI_STRUCT_LbsPaIpAddr psPaIpAddr,
swi_uint32  timeout 
)

This function is used to get GPS IP Address settings from the modem.

The PDE IP Address is a write only field and is not to be displayed to users. This API will return:

  • 0.0.0.0 : The IP address is 0.0.0.0 or PDE NV Item is inactive (GPS not supported).
  • 255.255.255.255 : The device has valid PDE IP address.
  • IP Address : The device is internally unlocked and will return the true address.
Parameters
psPaIpAddr,:[OUT] A pointer to a SWI_STRUCT_LbsPaIpAddr structure which contains the TCP/IP address information.
timeout,:[IN] Function timeout in milliseconds.
Returns
See SWI_RCODE for additional information.
package SWI_API SWI_RCODE SwiGetLbsPaParam ( struct SWI_STRUCT_LbsPaGetParam psLbsPdGetParam,
swi_uint32  timeout 
)

This function requests the modem's default parameter settings.

Parameters
psLbsPdGetParam,:[OUT] A pointer to a SWI_STRUCT_LbsPaGetParam structure which contains the position determination parameters.
timeout,:[IN] Function timeout in milliseconds.
Returns
See SWI_RCODE for additional information.
package SWI_API SWI_RCODE SwiGetLbsPaPortId ( struct SWI_STRUCT_LbsPaPortId psPaPortId,
swi_uint32  timeout 
)

This function is used to get the GPS port ID used in LBS sessions.

Parameters
psPaPortId,:[OUT] A pointer to a SWI_STRUCT_LbsPaPortId structure which contains the port ID.
timeout,:[IN] Function timeout in milliseconds.
Returns
See SWI_RCODE for additional information.
package SWI_API SWI_RCODE SwiGetLbsPdData ( struct SWI_STRUCT_LbsPdData psLbsPdData,
swi_uint32  timeout 
)

This function gets the results of the position fix.

Parameters
psLbsPdData,:[OUT] A pointer to a SWI_STRUCT_LbsPdData structure which contains the position fix results.
timeout,:[IN] Function timeout in milliseconds.
Returns
An error will be returned if there is no position fix information to report. See SWI_RCODE for additional information.
package SWI_API SWI_RCODE SwiGetLbsPdStatus ( struct SWI_STRUCT_LbsPdGetStatus psLbsPdGetStatus,
swi_uint32  timeout 
)

This function requests that the modem provide the current status of the LBS.

Parameters
psLbsPdGetStatus[OUT] A pointer to a SWI_STRUCT_LbsPdGetStatus structure which contains the current status of the LBS.
timeout,:[IN] Function timeout in milliseconds.
Returns
See SWI_RCODE for additional information.
SWI_API SWI_RCODE SwiGetLbsSatInfo ( struct SWI_STRUCT_LbsSatInfo psSatInfo,
swi_uint32  timeout 
)

Use this function to get current GPS satellite information.

Parameters
psSatInfo,:[OUT] A pointer to a SWI_STRUCT_LbsSatInfo structure which contains satellite information.
timeout,:[IN] Function timeout in milliseconds.
Returns
See SWI_RCODE for additional information.
package SWI_API SWI_RCODE SwiSetLbsClearAssistance ( const struct SWI_STRUCT_LbsClearAssistance psLbsClearAssistance,
swi_uint32  timeout 
)

This function requests that the modem clear various location parameters to simulate a cold start.

Parameters
psLbsClearAssistance,:[IN] A pointer to a SWI_STRUCT_LbsClearAssistance structure which contains parameters to clear.
timeout,:[IN] Function timeout in milliseconds.
Returns
See SWI_RCODE for additional information.
package SWI_API SWI_RCODE SwiSetLbsPaIpAddr ( const struct SWI_STRUCT_LbsPaIpAddr psPaIpAddr,
swi_uint32  timeout 
)

This function is used to set current GPS IP Address.

Parameters
psPaIpAddr,:[IN] A pointer to a SWI_STRUCT_LbsPaIpAddr structure which contains the TCP/IP address information.
timeout,:[IN] Function timeout in milliseconds.
Returns
See SWI_RCODE for additional information.
package SWI_API SWI_RCODE SwiSetLbsPaPortId ( const struct SWI_STRUCT_LbsPaPortId psPAPortID,
swi_uint32  timeout 
)

This function is used to set the GPS port ID used in LBS sessions.

Parameters
psPAPortID,:[IN] A pointer to a SWI_STRUCT_LbsPaPortId structure which contains the port ID.
timeout,:[IN] Function timeout in milliseconds.
Returns
See SWI_RCODE for additional information.
package SWI_API SWI_RCODE SwiSetLbsPdEndSession ( const struct SWI_STRUCT_LbsPdEndSession psLbsPdEndSession,
swi_uint32  timeout 
)

This function is used to end current LBS tracking session.

This API will respond with a SWI_NOTIFY_LbsPdDone/SWI_NOTIFY_LbsPdEnd notification that includes the End status.

There may be one of each type of session active simultaneously.

Parameters
psLbsPdEndSession,:[IN] A pointer to a SWI_STRUCT_LbsPdEndSession structure which contains the current tracking session to terminate.
timeout,:[IN] Function timeout in milliseconds.
Returns
See SWI_RCODE for additional information.
package SWI_API SWI_RCODE SwiSetLbsPdGetPos ( const struct SWI_STRUCT_LbsPdGetPos psLbsPdGetPos,
swi_uint32  timeout 
)

This function is used to initiate a location fix.

If the location fix initiation is successful, the following notifications will inform the host of the location fix progress and termination:

   - SWI_NOTIFY_LbsPdDone
   - SWI_NOTIFY_LbsPdData
   - SWI_NOTIFY_LbsPdEnd
   - SWI_NOTIFY_LbsPdBegin
   - SWI_NOTIFY_LbsPdUpdateFailure
   - SWI_NOTIFY_LbsSatInfo
Parameters
psLbsPdGetPos,:[IN] A pointer to a SWI_STRUCT_LbsPdGetPos structure which contains the location fix configuration.
timeout,:[IN] Function timeout in milliseconds.
Returns
SWI_RCODE_OK is returned if the modem is able to initiate a location fix.
If the modem is unable to initiate the location fix, an error code will be returned. See SwiRcodes.h for additional information.
package SWI_API SWI_RCODE SwiSetLbsPdTrack ( const struct SWI_STRUCT_LbsPdTrack psLbsPdTrack,
swi_uint32  timeout 
)

This function requests that the modem start a tracking session.

If the track session was initiated successfully, the following notifications will inform the host of the location fix progress and termination:

  • SWI_NOTIFY_LbsPdDone
  • SWI_NOTIFY_LbsPdData
  • SWI_NOTIFY_LbsPdEnd
  • SWI_NOTIFY_LbsPdBegin
  • SWI_NOTIFY_LbsPdUpdateFailure
  • SWI_NOTIFY_LbsSatInfo

This command should be used when an application requires multiple location fixes over a small period of time (ex. a fix between every 1 to 240 seconds).

Due to the potential need for first updating the ephemeris, almanac and/or location data, the "time to first fix" may require more time than the subsequent fixes. Tracking applications need to consider this possible initial delay and may want to behave "pro actively" by initiating a Data Download session and/or a single location fix as part of their startup sequence. As a guideline, almanac data is valid for 3 to 4 days, ephemeris data is valid for 30 to 120 minutes, coarse location data is valid for 4 minutes.

Parameters
psLbsPdTrack,:[IN] A pointer to a SWI_STRUCT_LbsPdTrack structure which contains the track session configuration.
timeout,:[IN] Function timeout in milliseconds.
Returns
SWI_RCODE_OK is returned if the modem is able to initiate a location fix.
If the modem is unable to initiate the location fix, an error code will be returned. See SwiRcodes.h for additional information.

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