|
LinuxSDK
V1.4.0.5
|
Contains source code for Common API functions for the the SDK. Common means common to all wireless data technologies, CDMA, GSM, etc. More...
Contains source code for Common API functions for the the SDK. Common means common to all wireless data technologies, CDMA, GSM, etc.
Copyright: © 2011 Sierra Wireless, Inc. all rights reserved
| SWI_API SWI_RCODE SwiApiStartup | ( | struct SWI_STRUCT_ApiStartup * | pOpenParams | ) |
This function is used to start the API sub-system.
If an error is returned or to re-initialize the API, SwiApiShutdown must be called before calling this function again.
After calling this function, SwiGetAvailAirServers can be called to retrieve a list of air servers (devices). SwiSelectAirServer must be used to commit to a specific device before calling any control and status API functions.
Looking in the system log after a failure may provide more details about the cause
| pOpenParams,: | [IN] parameters to initialize the API in different modes |
| SWI_API SWI_RCODE SwiApiUnlock | ( | SWI_STRUCT_ApiUnlock * | pApiUnlock, |
| swi_uint32 | timeout | ||
| ) |
This function allows the host to unlock access to various password-protected other SWI APIs. Those APIs can be used to configure carrier-specific parameters and to enable limited diagnostic capabilities. Those APIs are required by OEMs and device provisioning applications. This object is not intended for use by end-users..
Typical cases to use this API
| pApiUnlock[IN] | See SWI_STRUCT_ApiUnlock. |
| timeout[IN] | Function timeout in milliseconds. |
| SWI_API SWI_RCODE SwiGetAirServerInfo | ( | struct SWI_STRUCT_AirServer | sAirServer, |
| struct SWI_STRUCT_AirServerExtended * | sInfo | ||
| ) |
This function is used to retrieve additional information about a particular air server.
See SWI_STRUCT_AirServerExtended for list of additional information that can be retrieved.
| [IN] | sAirServer: A structure of type SWI_STRUCT_AirServer which specifies the the air server of interest. |
| [OUT]sInfo,: | A structure of type SWI_STRUCT_AirServerExtended which contains additional information about the requested air server. |
| SWI_API SWI_RCODE SwiGetAvailAirServers | ( | struct SWI_STRUCT_AirServerList * | sList | ) |
This function is used to retrieve a list of available air servers.
Air servers are deemed available if the appropriate driver interface, is found. These interfaces must be capable of supporting a control and status command path to the air server. SwiSelectAirServer must be called to bind to the air server before any command and status functions are called.
Air servers locked for exclusive use by an application are also included.
| [OUT] | sList: A structure of type SWI_STRUCT_AirServerList which contains a list of available air servers. |
| SWI_API SWI_RCODE SwiGetBootAndHoldMode | ( | swi_bool * | pbootnhold, |
| swi_uint32 | timeout | ||
| ) |
Fetch the boot and hold state of the modem, if it's connected. There is a small window in which this information will be inaccurate if the state of the modem changes while this function is being called. However, the notification called SWI_NOTIFY_AirServerChange will always indicate a change in the execution state of the modem and interested callers should re-issue this Api to learn the modem's new Boot and Hold state, if they are expecting it to change.
| pbootnhold | [OUT]: TRUE - Modem is operating in boot-and-hold mode FALSE - Modem is executing its application |
| timeout | [IN]: Function timeout in milliseconds |
| SWI_API SWI_RCODE SwiGetBootloaderBuildDate | ( | swi_charp | szBLBldDate, |
| swi_uint32 * | nLength, | ||
| swi_uint32 | timeout | ||
| ) |
This function is used to retrieve the boot loader build date.
| szBLBldDate,: | [OUT] Pointer to store the build date information |
| nLength,: | [IN/OUT] Size of buffer available to store the build date information/required buffer space |
| Timeout,: | [IN] Response timeout value in milliseconds |
| SWI_API SWI_RCODE SwiGetBootVersion | ( | swi_charp | szBVVersion, |
| swi_uint32 | sizeBuffer, | ||
| swi_uint32 | timeout | ||
| ) |
This function returns the device's firmware loader version in a string.
| szBVVersion,: | [OUT] Bootloader version (NULL terminated). The version string varies in length. It is recommended that a character string of 80 characters be allocated to store this return value. |
| sizeBuffer,: | [IN] Size of buffer provided for the bootloader version |
| timeout,: | [IN] Response timeout value in milliseconds |
| SWI_API SWI_RCODE SwiGetCurrentRadioBand | ( | struct SWI_STRUCT_RadioBandList * | pRadioBand, |
| swi_int32 | timeout | ||
| ) |
This function is used to determine the current radio band(s) the device is currently using.
This API replaces SwiGetBandInfo.
For GSM/WCDMA devices and CDMA/EVDO devices operating in non-hybrid mode operation, only one band is supported at a time. In these cases, the band info list will only contain a single entry.
| pRadioBand,: | [OUT] Pointer to a SWI_STRUCT_RadioBandList structure to store the list of current radio bands |
| timeout,: | [IN] Response timeout value in milliseconds. |
| SWI_API SWI_RCODE SwiGetDeviceID | ( | swi_charp | pszDeviceID, |
| swi_uint32 | sizeBuffer, | ||
| swi_uint32 | timeout | ||
| ) |
This function returns the device's unique identity as a string. The returned value is the ESN (Electronic Serial Number) or EID (Electronic Identity) of the modem.
The ESN is in the form of an 14-character string of decimal numerals. The string is null terminated (adding a 15th byte to the length). The content of the ESN includes several concatenated components, as specified for GPRS.
| szDeviceID,: | [OUT] A string representing the Device ID (NULL terminated). |
| sizeBuffer,: | [IN] Size of buffer provided for the device ID. A buffer of 15 bytes is recommended. |
| timeout,: | [IN] Response timeout value in milliseconds |
| SWI_API SWI_RCODE SwiGetDeviceInformation | ( | struct SWI_STRUCT_DeviceInformation_Request * | sDeviceInformation_Requestp, |
| struct SWI_STRUCT_DeviceInformation_Response * | sDeviceInformation_Responsep, | ||
| swi_uint32 | timeout | ||
| ) |
This function is used to get fundamental information from the modem.
The information returned is determined by setting the eDeviceInformationType field of sDeviceInformation_Request.
| [OUT] | sDeviceInformation_Request: struct must be filled out to select type of information returned. |
| [IN] | sDeviceInformation_Response: struct returned will contain the requested information. |
| [IN] | timeout: Response timeout value in milliseconds. |
| SWI_API SWI_RCODE SwiGetDeviceTime | ( | struct SWI_STRUCT_DeviceTime * | pDeviceTime, |
| swi_uint32 | timeout | ||
| ) |
This function is used to retrieve the system time on the device.
| pDeviceTime,: | [OUT] Pointer to a SWI_STRUCT_DeviceTime structure to store the system time from the device. |
| timeout,: | [IN] Response timeout value in milliseconds. |
| SWI_API SWI_RCODE SwiGetFirmwareBuildDate | ( | swi_charp | szBuildDate, |
| swi_uint32 | sizeBuffer, | ||
| swi_uint32 | timeout | ||
| ) |
This function returns the date the device's firmware was created.
| szBuildDate,: | [OUT] Firmware build date. The firmware build date string is in the form of MM/DD/YY. |
| sizeBuffer,: | [IN] Size of buffer provided for the firmware build date |
| timeout,: | [IN] Response timeout value in milliseconds |
| SWI_API SWI_RCODE SwiGetFirmwareVersion | ( | swi_charp | szFWVersion, |
| swi_uint32 | sizeBuffer, | ||
| swi_uint32 | timeout | ||
| ) |
This function returns the device's firmware version in a string.
The firmware version string varies in length. It is recommended that a character string of 80 characters be allocated to store this return value
| szFWVersion,: | [OUT] Firmware version (NULL terminated) |
| sizeBuffer,: | [IN] Size of buffer provided for the firmware version. |
| timeout,: | [IN] Response timeout value in milliseconds |
| SWI_API SWI_RCODE SwiGetFlashImgInfo | ( | struct SWI_STRUCT_FlashImgInfo * | pFlashImgInfo, |
| swi_uint32 | timeout | ||
| ) |
This function is used to retrieve firmware flash information from the device.
| [IN/OUT] | pFlashImgInfo: Pointer to a SWI_STRUCT_FlashImgInfo which specifies the flash image type to retrieve. This structure also contains the flash image information returned from the device. See SWI_STRUCT_FlashImgInfo for additional information. |
| timeout,: | [IN] Response timeout value in milliseconds. |
| SWI_API SWI_RCODE SwiGetHardwareVersion | ( | swi_charp | szHWVersion, |
| swi_uint32 | sizeBuffer, | ||
| swi_uint32 | timeout | ||
| ) |
This function returns the device's hardware version in a string.
| szHWVersion,: | [OUT] Hardware version (NULL terminated). The firmware version string varies in length. It is recommended that a character string of 80 characters be allocated to store this return value. The returned string is null terminated. |
| sizeBuffer,: | [IN] Size of buffer provided for the hardware version |
| timeout,: | [IN] Response timeout value in milliseconds |
| SWI_API void SwiGetLastError | ( | swi_char * | szError, |
| swi_uint32 | sizeBuffer | ||
| ) |
This function is used to retrieve the last error that occurred during a CnS transaction.
Recommended length for the CnS buffer is 256 bytes.
| szError,: | [OUT] CnS transaction error |
| sizeBuffer,: | [IN] length of buffer provided for the CnS transaction error |
| SWI_API SWI_RCODE SwiGetModemType | ( | struct SWI_STRUCT_ModemType * | pSwiModemType, |
| swi_uint32 | timeout | ||
| ) |
This function is used to retrieve modem type information.
| pSwiModemType,: | [IN/OUT] Removable media configuration |
| timeout,: | [IN] Response timeout value in milliseconds. |
| SWI_API SWI_RCODE SwiGetObjRngRev | ( | struct SWI_STRUCT_ObjRngRev * | ObjRngRevp, |
| swi_uint32 | timeout | ||
| ) |
This function is used to retrieve the object ID range revision on the modem and the API.
| sObjRngRev,: | [OUT] Object range revision information |
| timeout,: | [IN] Response timeout value in milliseconds. |
| SWI_API SWI_RCODE SwiGetPriInfo | ( | struct SWI_STRUCT_PriInfo * | pPriInfo, |
| swi_uint32 | timeout | ||
| ) |
This function is used to retrieve PRI information of the device
| pPriInfo,: | [OUT] PRI information timeout: [IN] response timeout value is 1000 milliseconds |
| SWI_API SWI_RCODE SwiGetRadioBandCfg | ( | struct SWI_STRUCT_RadioBandConfig * | pRadioBand, |
| swi_int32 | timeout | ||
| ) |
This function is used to retrieve the current radio band setting of the device along with the list of all the device supported radio bands.
This API replaces SwiGetBandInfo.
| pRadioBand,: | [OUT] A pointer to a SWI_STRUCT_RadioBandConfig structure to store the current radio band configuration. |
| timeout,: | [IN] Response timeout value in milliseconds. |
| SWI_API SWI_RCODE SwiGetRadioBattery | ( | struct SWI_STRUCT_RadioBattery * | pRadioBattery, |
| swi_uint32 | timeout | ||
| ) |
This function is used to retrieve the current radio battery state.
Voltage changes can be monitored with SWI_NOTIFY_RadioBattery.
| pRadioBattery,: | [OUT] A pointer to a SWI_STRUCT_RadioBattery structure to store the current radio battery state. |
| timeout,: | [IN] Response timeout value in milliseconds. |
| SWI_API SWI_RCODE SwiGetRadioPower | ( | struct SWI_STRUCT_RadioPower * | pRadioPower, |
| swi_uint32 | timeout | ||
| ) |
This function is used to retrieve the current radio power mode.
| pRadioPower,: | [OUT] Pointer to a SWI_STRUCT_RadioPower structure to store the current radio power setting. |
| timeout,: | [IN] Response timeout value in milliseconds. |
| SWI_API SWI_RCODE SwiGetRadioTempState | ( | struct SWI_STRUCT_RadioTempState * | pRadioTemp, |
| swi_uint32 | timeout | ||
| ) |
This function is used to retrieve the current radio temperature state.
UMTS AirCards will always report that the temperature state is normal. Temperature state changes can be monitored with SWI_NOTIFY_RadioTempState.
| pRadioTemp,: | [OUT] Pointer to a SWI_STRUCT_RadioTempState to store the current radio temperature state. |
| timeout,: | [IN] Response timeout value in milliseconds. |
| SWI_API SWI_RCODE SwiGetRemoteDiagAgentSupport | ( | SWI_STRUCT_RDA_SUPPORT * | psRDA, |
| swi_uint32 | timeout | ||
| ) |
This function retrieves the modem's Remote Diagnostics Agent support information.
| psRDA[OUT] | Contains RDA support information. See SWI_STRUCT_RDA_SUPPORT. |
| timeout[IN] | Function timeout in milliseconds. |
| SWI_API SWI_RCODE SwiGetRemovableMediaSupport | ( | SWI_STRUCT_RM_CONFIG * | psRM, |
| swi_uint32 | timeout | ||
| ) |
This function retrieves the modem's Removable Media support information
| psRM[OUT] | Contains RM support information. See SWI_STRUCT_RM_CONFIG. |
| timeout[IN] | Function timeout in milliseconds. |
This function is used to retrieve the version of the SDK.
| sdkversionpp | : [OUT] pointer to pointer to returned string. |
| SWI_API SWI_RCODE SwiGetSwocCfg | ( | struct SWI_STRUCT_GetSwocCfg * | pSwocCfg, |
| swi_uint32 | timeout | ||
| ) |
This function is used to retrieve Software on Card (SWoC) configuration.
Configuration items returned determine if: -SWoC/TRU-Install feature supported/enabled -SWoC/TRU-Install media in modem mode supported/enabled -bypassing of the SWoC/TRU-Install feature after a software reboot is performed on the device
Some devices require that the OEM level is unlocked before some or all of the request options are attempted.
In order for the ‘SWoC access in modem mode’ feature to be enabled, general overall ‘SWoC’ TRU-Install support must be both supported by the product and currently enabled.
| pSwocCfg | [IN/OUT] |
| timeout | [IN] |
| SWI_API SWI_RCODE SwiGetUsbdInfo | ( | struct SWI_STRUCT_UsbdInfo * | pUsbdInfo, |
| swi_uint32 | timeout | ||
| ) |
This function is used to retrieve the USB descriptor build information.
| pUsbd,: | [OUT] structure to store USB descriptor build information |
| SWI_API SWI_RCODE SwiGetUsbPortName | ( | struct SWI_STRUCT_UsbPortName * | sPortNamep | ) |
This function is used to retrieve the Port Name for the data port.
| [OUT] | szPortName: Port Names of the device. |
| SWI_API SWI_RCODE SwiNVUpdateFromFile | ( | SWI_STRUCT_NVUpdateFromFile * | pNVUpdateFromFile, |
| swi_uint32 | timeout | ||
| ) |
This function Forces the modem to perform a NV update from an EFS file.
Note that this function does not return any data via pNVUpdateFromFile. Caller need to set the sizeStruct and szFileName member of pNVUpdateFromFile. The other members of SWI_STRUCT_NVUpdateFromFile are for notification use only.
| pNVUpdateFromFile[IN] | NV update settings. See SWI_STRUCT_NVUpdateFromFile. |
| timeout[IN] | Function timeout in milliseconds. |
| SWI_API SWI_RCODE SwiResetToBootHold | ( | swi_uint32 | timeout | ) |
This function causes the modem to reset into boot and hold operation. Boot and Hold operation is used for upgrading the modem's firmware. For USB-based devices, the driver will unload and reload on a modem reset.
The caller will receive a response very quickly, but receipt of a response does not indicate the modem's entry into boot and hold mode, only that the command was sent to the modem. The caller's next step should be to await a SWI_NOTIFY_AirServerChange message and when it's received, call SwiGetBootAndHoldMode() to determine the modem's operating state
If the modem is already in boot and hold operation when this command is issued, there will be no effect. The modem does not respond to reset requests when operating in boot and hold mode.
| timeout[IN],: | response timeout value in milliseconds |
Return: SWI_RCODE_OK - request was successfully sent to the modem SWI_RCODE_REQUEST_TIMEOUT - request timed out See SWI_RCODE for other error return codes
| SWI_API SWI_RCODE SwiSelectAirServer | ( | struct SWI_STRUCT_AirServer * | airServer | ) |
This function is used to bind the API to a specific air server.
Use SwiGetAvailAirServers to retrieve a list of available air servers. Modem control and status API calls can not be invoked until this call is completed. The API can only bind to one air server at a time.
If the API is already bound to an air server, calling this function will cancel all pending requests and re-bind to the new air server.
| [IN] | airServer: Air server you are connecting to. This tells the API what services are supported. |
| SWI_API SWI_RCODE SwiSetRadioBandCfg | ( | swi_uint64 | nRadioBandGroup, |
| swi_int32 | timeout | ||
| ) |
This function is used to request a new radio band setting.
This API replaces SwiSetBandInfo.
Setting the frequency band may cause a modem reset. The caller should use SwiGetRadioBandCfg to retrieve the list of supported bands before calling SwiSetRadioBandCfg.
| nRadioBandGroup,: | [IN] A bit mask value which specifies the radio band group to use. See SWI_RADIOBANDGROUP_xxx definitions. |
| timeout,: | [IN] Response timeout value in milliseconds. |
| SWI_API SWI_RCODE SwiSetRadioPower | ( | struct SWI_STRUCT_RadioPower * | pRadioPower, |
| swi_uint32 | timeout | ||
| ) |
This function is used to configure the radio power mode.
| pRadioPower,: | [IN] A pointer to a SWI_STRUCT_RadioPower structure which specifies the new radio power setting. |
| timeout,: | [IN] Response timeout value in milliseconds. |
| SWI_API SWI_RCODE SwiSetRemoteDiagAgentEnable | ( | swi_uint8 | bEnable, |
| swi_uint8 * | pStatus, | ||
| swi_uint32 | timeout | ||
| ) |
This function enables/disables the modem's Remote Diagnostics Agent.
| bEnable[IN] | Disable = 0, Enable = 1; |
| pStatus[OUT] | 0=Success, 1=Failed unspecified,2=Failed security access denied. |
| timeout[IN] | Function timeout in milliseconds. |
| SWI_API SWI_RCODE SwiSetRemovableMediaSupport | ( | const SWI_STRUCT_RM_CONFIG_SET * | psRM, |
| swi_uint8 * | pStatus, | ||
| swi_uint32 | timeout | ||
| ) |
This function sets the modem's Removable Media support information.
| psRM[IN] | Contains RM support config. See SWI_STRUCT_RM_CONFIG_SET. |
| pStatus[OUT] | Set status. |
| timeout[IN] | Function timeout in milliseconds. |
This function causes the modem to undergo a soft reset. SWI_NOTIFY_AirServerChange is generated after the reset has completed. Note that the driver may also unload and reload when a modem reset occurs.
This API will return very quickly but this does not indicate that the modem has reset, only that the reset command has been sent to the modem. When the modem finally resets a SWI_NOTIFY_AirServerChange notification will be generated. Callers may want to consider calling SwiGetBootAndHoldMode() to determine the operating state of the modem, however, modem resets generated by this API will always bring the modem back into full operation after the reset is complete
If the modem is already in boot and hold operation when this command is issued, there will be no effect. The modem does not respond to reset requests when operating in boot and hold mode.
| None |
Gracefully terminate the SDK process
The SDK process is designed to run forever once it is started, behaving as a daemon under Linux in the truest sense of the word. However in some applications there may be a requirement to shut down the daemon when a particular task has completed and this API allows an application to gracefully shut down the daemon
| None |