|
LinuxSDK
V1.4.0.5
|
Contains source code for Basic Demux API functions for the the SDK. More...
#include "apdxidefs.h"Variables | |
| struct apdxcb | apdxcbk |
| swi_uint8 | apdxmsgarray [APDXBUFSIZE] |
| swi_uint8 | inbuf [APDXBUFSIZE] |
Contains source code for Basic Demux API functions for the the SDK.
Copyright: © 2011 Sierra Wireless, Inc. all rights reserved
Determine whether the device is present
| package swi_uint32 SwiApDxDevToChan | ( | swi_uint16 | deviceservice | ) |
Maps a deviceservice to a predefined channel id
| deviceservice,: | [IN] device service - diagnostics, NMEA, etc... |
| package swi_uint8* SwiApDxDevToName | ( | swi_uint16 | deviceservice | ) |
Return a pointer to identification string for a device service
| deviceservice,: | [IN] device service - diagnostics, NMEA, etc.. |
|
read |
Return a pointer to the APDX package's control block
|
read |
Return a pointer to the APDX package's IPC control block for a particular device service
| deviceservice,: | [IN] device service - diagnostic or NMEA |
Determine whether the API has been previously started
| 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
| deviceservice | : device service requested - diagnostic or NMEA |
| 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
| deviceservice | : device service requested |
| 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
| 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 |
| 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
| 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 |
| 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
| numchannels,: | [IN] the number of channels the Application intends to use (for verification purposes) |
| pOpenParams,: | [IN] parameters to initialize the API in different modes |
| 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
| 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) |
| 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.
| struct apdxcb apdxcbk |
| swi_uint8 apdxmsgarray[APDXBUFSIZE] |
| swi_uint8 inbuf[APDXBUFSIZE] |