LinuxSDK  V1.4.0.5
Data Structures | Macros | Enumerations | Functions
SwiApiDemux.h File Reference

This file contains definitions, enumerations, structures and forward declarations for SwiApiDxBasic.c file. More...

#include "SwiDataTypes.h"
#include "SwiRcodes.h"
#include "SwiApiCmBasic.h"

Go to the source code of this file.

Data Structures

struct  SWI_STRUCT_DemuxRequest
 
struct  SWI_STRUCT_DemuxCtlInd
 
struct  SWI_STRUCT_DemuxDataInd
 

Macros

#define APDXCALLERLEN   5 /* length of caller id */
 
#define LENGTH_DxErrorString   40
 
#define LENGTH_DxData   4500
 

Enumerations

enum  SWI_TYPE_DeviceService { SWI_DIAG, SWI_NMEA }
 
enum  SWI_TYPE_OperationCode { SWI_DxStart, SWI_DxStop }
 
enum  SWI_TYPE_DevicePresent { SWI_OFFLINE, SWI_ONLINE }
 
enum  SWI_TYPE_OperationType {
  SWI_MdmStatusChange, SWI_APDXShutdown, SWI_SDKShutdown, SWI_StartReqResponse,
  SWI_StopReqResponse
}
 

Functions

SWI_API SWI_RCODE SwiApiDxStartup (swi_uint16 numchannels, struct SWI_STRUCT_ApiStartup *pOpenParams)
 
SWI_API SWI_RCODE SwiApiDxRegister (swi_uint16 deviceservice, void(*datacbfp)(swi_uint16 deviceservice, swi_uint8 *datap, swi_uint32 datalen, void *userp), void *datauserp, void(*ctlcbfp)(swi_uint16 deviceservice, swi_uint8 *ctldatap, void *userp), void *ctluserp)
 
SWI_API SWI_RCODE SwiApiDxBegin (swi_uint16 deviceservice)
 
SWI_API SWI_RCODE SwiApiDxEnd (swi_uint16 deviceservice)
 
SWI_API SWI_RCODE SwiApiDxSend (swi_uint16 deviceservice, swi_uint8 *datap, swi_uint32 datalen)
 
SWI_API SWI_RCODE SwiWaitDxIndication (swi_uint16 deviceservice)
 
swi_bool SwiApDxRunning (void)
 
swi_bool SwiApDxAirServerPresent (void)
 
struct apdxcb * SwiApDxGetCbp (void)
 
swi_uint8SwiApDxDevToName (swi_uint16 deviceservice)
 
swi_uint32 SwiApDxDevToChan (swi_uint16 deviceservice)
 
SWI_API SWI_RCODE SwiGetDataPldOffset (swi_uint8 *bufferp, swi_uint32 datalen, swi_uint8 **payloadpp, swi_uint32 *bytesbuildp)
 

Detailed Description

This file contains definitions, enumerations, structures and forward declarations for SwiApiDxBasic.c file.

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

Macro Definition Documentation

#define APDXCALLERLEN   5 /* length of caller id */
#define LENGTH_DxData   4500
#define LENGTH_DxErrorString   40

Enumeration Type Documentation

This enumeration contains Device Present for Demux Control Indication message

Enumerator
SWI_OFFLINE 

device offline.

SWI_ONLINE 

device online.

This enumeration contains the Device Service indication

Enumerator
SWI_DIAG 

Diagnostic service.

SWI_NMEA 

NMEA service.

This enumeration contains the Operation Code for Demux Request message

Enumerator
SWI_DxStart 

API to SDK: Start Demux device service.

SWI_DxStop 

API to SDK: Stop Demux device service.

This enumeration contains the Operation Type for Demux Control Indication message

Enumerator
SWI_MdmStatusChange 

SDK to API: Modem Status Change.

SWI_APDXShutdown 

API to SDK: Application Shutdown.

SWI_SDKShutdown 

SDK to API: SDK shutdown.

SWI_StartReqResponse 

SDK to API: Response to Start Request.

SWI_StopReqResponse 

SDK to API: Response to Stop Request.

Function Documentation

swi_bool SwiApDxAirServerPresent ( void  )

Determine whether the device is present

Returns
TRUE - air server present
FALSE - air server is not loaded onto the system
swi_uint32 SwiApDxDevToChan ( swi_uint16  deviceservice)

Maps a deviceservice to a predefined channel id

Parameters
deviceservice,:[IN] device service - diagnostics, NMEA, etc...
Returns
the channel id if successful mapping
CIMAXIPCCHAN if the device service is not supported
swi_uint8* SwiApDxDevToName ( swi_uint16  deviceservice)

Return a pointer to identification string for a device service

Parameters
deviceservice,:[IN] device service - diagnostics, NMEA, etc..
Returns
pointer to string structure
struct apdxcb* SwiApDxGetCbp ( void  )
read

Return a pointer to the APDX package's control block

Returns
pointer to apdxcb structure
swi_bool SwiApDxRunning ( void  )

Determine whether the API has been previously started

Returns
TRUE - API is initialized and running
FALSE - API was not properly started. Go back and start it up
SWI_API SWI_RCODE SwiApiDxBegin ( swi_uint16  deviceservice)

This function is used to format and send a Demux Request to Start a specific device service. After this command SDK starts to send data for that particular device service

If an error is returned or to re-initialize the API, SwiApiDxShutdown must be called before calling this function again.

Looking in the system log after a failure may provide more details about the cause

Parameters
deviceservice: device service requested - diagnostic or NMEA
Returns
SWI_RCODE_OK - API control indication send successfully
See SWI_RCODE for other error return codes
SWI_API SWI_RCODE SwiApiDxEnd ( swi_uint16  deviceservice)

This function is used to format and send a Demux Request to Stop a specific device service. After this command SDK stops to send data for that particular device service

If an error is returned or to re-initialize the API, SwiApiDxShutdown must be called before calling this function again.

Looking in the system log after a failure may provide more details about the cause

Parameters
deviceservice: device service requested
Returns
SWI_RCODE_OK - API control indication send successfully
See SWI_RCODE for other error return codes
SWI_API SWI_RCODE SwiApiDxRegister ( swi_uint16  deviceservice,
void(*)(swi_uint16 deviceservice, swi_uint8 *datap, swi_uint32 datalen, void *userp)  datacbfp,
void *  datauserp,
void(*)(swi_uint16 deviceservice, swi_uint8 *ctldatap, void *userp)  ctlcbfp,
void *  ctluserp 
)

This function is used to register for device service with the API Demux sub-system.

If an error is returned or to re-initialize the API, SwiApiDxShutdown must be called before calling this function again.

Looking in the system log after a failure may provide more details about the cause

Parameters
deviceservice: device service requested - diagnostic or NMEA
datacbfp: pointer to user callback function for Demux Data
datauserp: user parameter for data callback
ctlcbfp: pointer to user callback for control indication
ctluserp: User parameter for control indication callback
Returns
SWI_RCODE_OK - API registered successfully
SWI_RCODE_FAILED - The API sub-system was not registered successfully.
SWI_RCODE_SYSTEM_ERROR - This may be due to limited system resources when the API requested memory from the OS.
See SWI_RCODE for other error return codes
SWI_API SWI_RCODE SwiApiDxSend ( swi_uint16  deviceservice,
swi_uint8 datap,
swi_uint32  datalen 
)

This function is used to send a Demux Data Indication to a specific device service.

If an error is returned or to re-initialize the API, SwiApiDxShutdown must be called before calling this function again.

Looking in the system log after a failure may provide more details about the cause

Parameters
deviceservice,:[IN] device service requested
datap,:[IN] pointer to the beginning of the buffer to be send
datalen,:[IN] length of total data to be send
Returns
SWI_RCODE_OK - API data indication send successfully
SWI_RCODE_INVALID_PAR - device service does not have open channel
SWI_RCODE_DEVICE_UNAVAIL - air server is not loaded onto the system
SWI_RCODE_NOT_INIT - this is not initialized data packet
See Also
Returns
See SWI_RCODE for other error return codes
SWI_API SWI_RCODE SwiApiDxStartup ( swi_uint16  numchannels,
struct SWI_STRUCT_ApiStartup pOpenParams 
)

This function is used to start the API Demux sub-system.

If an error is returned or to re-initialize the API, SwiApiDxShutdown must be called before calling this function again.

Looking in the system log after a failure may provide more details about the cause

Parameters
numchannels,:[IN] the number of channels the Application intends to use (for verification purposes)
pOpenParams,:[IN] parameters to initialize the API in different modes
Returns
SWI_RCODE_OK - API initialized successfully
SWI_RCODE_FAILED - The API sub-system was not initialized successfully.
SWI_RCODE_SYSTEM_ERROR - This may be due to limited system resources when the API requested memory from the OS.
SWI_RCODE_BUSY - If another application has the SDK open. Only 1 application at a time is allowed
SWI_RCODE_NOT_COMPATIBLE - the SDK and the Application cannot work together
See SWI_RCODE for other error return codes
SWI_API SWI_RCODE SwiGetDataPldOffset ( swi_uint8 bufferp,
swi_uint32  datalen,
swi_uint8 **  payloadpp,
swi_uint32 bytesbuildp 
)

This function is used to obtain the payload pointer within Demux Data Indication packet.

If an error is returned or to re-initialize the API, SwiApiDxShutdown must be called before calling this function again.

Looking in the system log after a failure may provide more details about the cause

Parameters
bufferp,:[IN] pointer to the beginning of caller-allocated buffer which will contain data to send
datalen,:[IN] length of data to be send
payloadpp,:[OUT] pointer to pointer to beginning of payload
bytesbuildp,:[OUT] number of bytes added at the beginning of the buffer (i.e. the number of bytes in the header)
Returns
SWI_RCODE_OK - API data indication send successfully
SWI_RCODE_INVALID_PAR - data length requested is too long
See SWI_RCODE for other error return codes
SWI_API SWI_RCODE SwiWaitDxIndication ( swi_uint16  deviceservice)

The Demux receive API main entry point

When the received packet is wrong type the message "Wrong packet type" is logged and program terminates.

This function waits to receive demux indications and invokes the user callback function if registered. This function does not return unless there is an error.

Returns
SWI_RCODE_OK - The function executed properly.
SWI_RCODE_FAILED - The function failed to execute correctly.
SWI_RCODE_API_NOT_OPEN - SDK is not running.
See Also
See SWI_RCODE for additional information.

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