/*===========================================================================
FILE: 
   GobiImageMgmtAPI.h

DESCRIPTION:
   QUALCOMM Image Management API for Gobi 3000

Copyright (C) 2011 QUALCOMM Incorporated. All rights reserved.
                   QUALCOMM Proprietary/GTDR

All data and information contained in or disclosed by this document is
confidential and proprietary information of QUALCOMM Incorporated and all
rights therein are expressly reserved.  By accepting this material the
recipient agrees that this material and the information contained therein
is held in confidence and in trust and will not be used, copied, reproduced
in whole or in part, nor its contents revealed in any manner to others
without the express written permission of QUALCOMM Incorporated.
==========================================================================*/

/*=========================================================================*/
// Pragmas
/*=========================================================================*/
#pragma once

//---------------------------------------------------------------------------
// Definitions
//---------------------------------------------------------------------- -----

// The actual Gobi IM API functions are tagged/exported with this
#ifndef IMPORTGOBI
#define IMPORTGOBI extern "C" __declspec( dllimport ) 
#endif

// Calling convention for API
#define GOBIAPI __cdecl

/*=========================================================================*/
// Definitions
/*=========================================================================*/

/** 
* \defgroup GroupGIM Gobi Image Management API
*/
/*@{*/

/*=========================================================================*/
// Structs
/*=========================================================================*/

#ifdef __cplusplus
   extern "C" {
#endif

#define UNIQUE_ID_LEN           16
#define MAX_BUILDID_LEN         255
#define MAX_NO_OF_FW			5

typedef struct
{
   BYTE 	imageType;
   CHAR 	uniqueID[UNIQUE_ID_LEN];
   BYTE		buildIDLen;
   CHAR		buildID[MAX_BUILDID_LEN];
} curFwImageList;

typedef struct
{
    BYTE      		numInstances;
    curFwImageList 	fwImage[MAX_NO_OF_FW];
} arrFwImageList;



#ifdef __cplusplus
   };
#endif

/*=========================================================================*/
// Prototypes
/*=========================================================================*/





//////////////////////////////////////////////////////////////////////////////
///
/// This function returns the boot and recovery image download mode
///
/// \param	ppBARMode    [ O ] - Boot and recovery image download mode
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBIAPI GetBARMode( ULONG * pBARMode );

/*=========================================================================*/
//////////////////////////////////////////////////////////////////////////////
///
/// This function requests the device enter boot and recovery image download
/// mode after the next reset
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBIAPI SetBARMode();



//////////////////////////////////////////////////////////////////////////////
///
/// This function returns info about the specified image from the device
///
/// \param	imageInfoSize  [ I ] - The size in BYTEs of the image info array
/// \param	pImageInfo     [ I ] - The image info array
/// \param	pMajorVersion  [ O ] - Major version of compatible boot downloader
/// \param	pMinorVersion  [ O ] - Minor version of compatible boot downloader
/// \param	pVersionID     [ O ] - Image version ID
/// \param	pInfo          [ O ] - Image info string
/// \param	pLockID        [ O ] - Image OEM lock ID
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBIAPI GetStoredImageInfo( 
   ULONG                      imageInfoSize, 
   BYTE *                     pImageInfo,
   ULONG *                    pMajorVersion, 
   ULONG *                    pMinorVersion,
   ULONG *                    pVersionID,
   CHAR *                     pInfo,
   ULONG *                    pLockID );

//////////////////////////////////////////////////////////////////////////////
///
/// This function deletes the specified image from the device
///
/// \param	imageInfoSize  [ I ] - The size in BYTEs of the image info array
/// \param	pImageInfo     [ I ] - The image info array
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBIAPI DeleteStoredImage( 
   ULONG                      imageInfoSize, 
   BYTE *                     pImageInfo );


/*@}*/ // End of GIM group