#ifndef __GOBIAPI_H__
/*===========================================================================
FILE: 
   GobiAPI.h

DESCRIPTION:
   Sierra Wirless CE Gobi SDK Top level header file

Copyright (C) 2015 Sierra Wireless Incorporated. All rights reserved.
                   Sierra Wireless Proprietary/GTDR
==========================================================================*/




/*=========================================================================*/
// ANSI/UNICODE Varaints 
/*=========================================================================*/
#ifdef UNICODE
   #define GetFirmwareID GetFirmwareIDW
   #define UpgradeFirmware UpgradeFirmwareW
   #define UpgradeFirmware2k UpgradeFirmware2kW
   #define GetImageInfo GetImageInfoW 
   #define GetImageStore GetImageStoreW 

#else
   #define GetFirmwareID GetFirmwareIDA
   #define UpgradeFirmware UpgradeFirmwareA
   #define UpgradeFirmware2k UpgradeFirmware2kA
   #define GetImageInfo GetImageInfoA 
   #define GetImageStore GetImageStoreA 
#endif

#include <Windows.h>
#include <GobiAPIDefs.h>

/** 
* \defgroup GroupBasic Basic Gobi APIs
*/
/*@{*/

// Device removal callback function
typedef void (GOBICALLBACK * tFNDeviceRemoval)();


//////////////////////////////////////////////////////////////////////////////
///
/// This function enables/disables the device removal callback
///
/// \param	pCallback   [ I ] - Callback function
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI SetDeviceRemovalCallback( 
   tFNDeviceRemoval           pCallback );

//////////////////////////////////////////////////////////////////////////////
///
/// Returns the image store folder, i.e., the folder containing one or 
/// more carrier-specific image subfolders compatible with the currently 
/// connected Gobi device (ANSI variant)
/// 
/// \param	pathSize          [ I ] - Maximum number of characters (including NULL
///                           terminator) that can be copied to the image
///                           store path array
/// \param	pImageStorePath   [ O ] - The path to the image store
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI GetImageStoreA( 
   WORD                       pathSize,
   CHAR *                     pImageStorePath );

//////////////////////////////////////////////////////////////////////////////
///
/// Returns image information obtained from the firmware located at the
/// provided path (ANSI variant)
///
/// \param pPath          [ I ] - Location of the firmware
/// \param pFirmwareID    [ O ] - Firmware ID obtained from the PRI image
/// \param pTechnology    [ O ] - Technology (0xFFFFFFFF if unknown)
/// \param pCarrier       [ O ] - Carrier (0xFFFFFFFF if unknown)
/// \param pRegion        [ O ] - Region (0xFFFFFFFF if unknown)
/// \param pGPSCapability [ O ] - GPS capability (0xFFFFFFFF if unknown)
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI GetImageInfoA( 
   CHAR *                     pPath, 
   ULONG *                    pFirmwareID,
   ULONG *                    pTechnology,
   ULONG *                    pCarrier,
   ULONG *                    pRegion,
   ULONG *                    pGPSCapability );
   
   
//////////////////////////////////////////////////////////////////////////////
///
/// Returns image information obtained from the firmware located at the
/// provided path (UNICODE variant)
///
/// \param	pPath          [ I ] - Location of the firmware
/// \param	pFirmwareID    [ O ] - Firmware ID obtained from the PRI image
/// \param	pTechnology    [ O ] - Technology (0xFFFFFFFF if unknown)
/// \param	pCarrier       [ O ] - Carrier (0xFFFFFFFF if unknown)
/// \param	pRegion        [ O ] - Region (0xFFFFFFFF if unknown)
/// \param	pGPSCapability [ O ] - GPS capability (0xFFFFFFFF if unknown)
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI GetImageInfoW( 
   WCHAR *                    pPath, 
   ULONG *                    pFirmwareID,
   ULONG *                    pTechnology,
   ULONG *                    pCarrier,
   ULONG *                    pRegion,
   ULONG *                    pGPSCapability );
   
 
//////////////////////////////////////////////////////////////////////////////
///
/// This function performs the following set of steps:
///   a)	Verifies arguments
///   b)	Updates images preference on device
///   c)	Resets the device
///   (ANSI variant)
/// 
/// NOTE: Upon successful completion the above steps will have been completed, 
///      however the actual upgrade of the firmware will necessarily then 
///      follow.
///
/// \param	   pDestinationPath  [ I ] - The fully qualified path to desired firmware
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI UpgradeFirmware2kA( CHAR * pDestinationPath );

//////////////////////////////////////////////////////////////////////////////
///
/// This function performs the following set of steps:
///   a)	Verifies arguments
///   b)	Updates images preference on device
///   c)	Resets the device
/// (UNICODE variant)
/// 
/// NOTE: Upon successful completion the above steps will have been completed, 
///      however the actual upgrade of the firmware will necessarily then 
///      follow.
/// 
/// \param	pDestinationPath  [ I ] - The fully qualified path to desired firmware
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI UpgradeFirmware2kW( WCHAR * pDestinationPath );

//////////////////////////////////////////////////////////////////////////////
///
/// This function performs the following set of steps:
///   a)	Verifies arguments
///   b)	Updates images preference on device
///   c)	Resets the device
/// (ANSI variant)
/// 
///      NOTE: Upon successful completion the above steps will have been completed, 
///      however the actual upgrade of the firmware will necessarily then 
///      follow.
/// 
/// \param	pDestinationPath  [ I ] - The fully qualified path to desired firmware
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI UpgradeFirmware2kA( CHAR * pDestinationPath );


   
//////////////////////////////////////////////////////////////////////////////
///
/// Returns the image store folder, i.e., the folder containing one or 
/// more carrier-specific image subfolders compatible with the currently 
/// connected Gobi device (UNICODE variant)
///
/// \param	pathSize          [ I ] - Maximum number of characters (including NULL
///                          terminator) that can be copied to the image
///                          store path array
/// \param	pImageStorePath   [ O ] - The path to the image store
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI GetImageStoreW(
   WORD                       pathSize,
   WCHAR *                    pImageStorePath );

//////////////////////////////////////////////////////////////////////////////
///
/// UpgradeFirmwareA (Deprecated)
/// 
/// This function performs the following set of steps:
///   a)	Verifies arguments
///   b)	Updates images preference on device
///   c) Resets the device
/// (ANSI variant)
/// NOTE: Upon successful completion the above steps will have been completed, 
///      however the actual upgrade of the firmware will necessarily then 
///      follow.
/// 
/// \param	pSourcePath       [ I ] - No longer used
/// \param	pDestinationPath  [ O ] - The fully qualified path to desired firmware
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI UpgradeFirmwareA( 
   CHAR *                     pSourcePath, 
   CHAR *                     pDestinationPath );
   
//////////////////////////////////////////////////////////////////////////////
///
/// UpgradeFirmwareW (Deprecated)
/// 
/// DESCRIPTION:
/// This function performs the following set of steps:
///   a)	Verifies arguments
///   b)	Updates images preference on device
///   c)	Resets the device
/// (UNICODE variant)
/// 
/// NOTE: Upon successful completion the above steps will have been completed, 
///      however the actual upgrade of the firmware will necessarily then 
///      follow.
/// 
/// \param	pSourcePath       [ I ] - No longer used
/// \param	pDestinationPath  [ I ] - The fully qualified path to desired firmware 
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI UpgradeFirmwareW( 
   WCHAR *                    pSourcePath, 
   WCHAR *                    pDestinationPath );



//////////////////////////////////////////////////////////////////////////////
///
/// Returns the ID for the firmware located at the path provided as input
///    (ANSI variant)
/// 
/// 
/// \param	pPath          [ I ] - Location of the firmware
/// \param	pFirmwareID    [ O ] - Firmware ID obtained from the PRI image 
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI GetFirmwareIDA( 
   CHAR *                     pPath, 
   ULONG *                    pFirmwareID );
   
//////////////////////////////////////////////////////////////////////////////
///
/// Returns the ID for the firmware located at the path provided as input
/// (UNICODE variant)
/// 
/// \param	pPath          [ I ] - Location of the firmware
/// \param	pFirmwareID    [ O ] - Firmware ID obtained from the PRI image 
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI GetFirmwareIDW( 
   WCHAR *                    pPath, 
   ULONG *                    pFirmwareID );
  

//////////////////////////////////////////////////////////////////////////////
///
/// This function enumerates the Gobi devices currently attached to the
/// system
///
/// \param pDevicesSize   [I/O] - Upon input the maximum number of elements that the 
///                       device array can contain.  Upon successful output 
///                       the actual number of elements in the device array
/// \param pDevices       [ O ] - The device array 
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI QCWWAN2kEnumerateDevices( 
   BYTE *                     pDevicesSize, 
   BYTE *                     pDevices );

//////////////////////////////////////////////////////////////////////////////
///
/// This function connects the CM API library to the specified Gobi 
/// device
///
/// \param	pDeviceID   [ I ] - The device ID as reported by Windows
/// \param	pDeviceKey  [ I ] - The device key (unique, stored on-device)
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI QCWWAN2kConnect(
   CHAR *                     pDeviceID,
   CHAR *                     pDeviceKey );

//////////////////////////////////////////////////////////////////////////////
///
/// QCWWANConnect (Deprecated)
/// 
/// This function connects the CM API library to the first Gobi 
/// device detected
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI QCWWANConnect();

//////////////////////////////////////////////////////////////////////////////
///
/// 
///   This function cancels the most recent outstanding request
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI QCWWANCancel();

//////////////////////////////////////////////////////////////////////////////
///
/// This function disconnects the CM API library from the currently 
/// connected Gobi device
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI QCWWANDisconnect();

//////////////////////////////////////////////////////////////////////////////
///
/// This function returns the ID/key of the device the Gobi CM API library 
/// is currently connected to
/// 
/// \param	deviceIDSize   [ I ] - The maximum number of characters (including NULL 
///                        terminator) that the device ID array can contain
/// \param	pDeviceID      [ O ] - Device ID (NULL terminated string)
/// \param	deviceKeySize  [ I ] - The maximum number of characters (including NULL 
///                        terminator) that the device key array can contain
/// \param	pDeviceKey     [ O ] - Device key (NULL terminated string)
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI QCWWAN2kGetConnectedDeviceID( 
   ULONG                      deviceIDSize, 
   CHAR *                     pDeviceID,
   ULONG                      deviceKeySize, 
   CHAR *                     pDeviceKey );

//////////////////////////////////////////////////////////////////////////////
///
/// This function returns the ID of the deivce the Gobi CM API library 
/// is currently connected to
///
/// \param	stringSize  [ I ] - The maximum number of characters (including NULL 
///                     terminator) that the string array can contain
/// \param	pString     [ O ] - NULL terminated string
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI QCWWANGetConnectedDeviceID( 
   ULONG                      stringSize, 
   CHAR *                     pString );

/*@}*/ // End of basic group



#include <SwiWwanCmApi.h>
#include <GobiConnectionMgmtAPI.h>
#include <QMIDMS.h>
#include <GobiImageMgmtAPI.h>
#include <GobiPBMgmtAPI.h>
#include <GobiUIMMgmtAPI.h>
#include <GobiVoiceMgmtAPI.h>
#include <QCWWANCMAPI2k.h>
#include <SwiM2MAVAPI.h>
#include <QmiWDS.h>
#include <QmiNAS.h>
#include <SwiDMS.h>
#include <QmiCAT.h>
#include <QmiPDS.h>
#include <QmiWMS.h>
#include <QmiOMA.h>
#include <QmiRMS.h>
#include <SwiOMADMEX.h>
#include <PlaceHolder.h>


   
#endif