/***************************************************************************
**
**    $Header:   D:/EPSLDV1/SRC/LOG/ABISPA.CPP   1.8   20 Jun 1996 09:25:38   ZJRD  $
**
**    $Log:   D:/EPSLDV1/SRC/LOG/ABISPA.CPP  $
** 
**    Rev 1.8   20 Jun 1996 09:25:38   ZJRD
** EasyPack/SLD Version 1.20a
** 
**    Rev 1.6   10 Jun 1996 10:20:16   ZJRD
** EasyPack/SLD Version 1.20
** 
**    Rev 1.4   29 May 1996 09:29:46   ZJRD
** No change.
** 
**    Rev 1.3   16 May 1996 09:07:02   ZJRD
** No change.
** 
**    Rev 1.2   10 May 1996 09:10:02   ZJRD
** No change.
** 
**    Rev 1.1   02 May 1996 10:26:40   ZJRD
** EasyPack/SLD Version 1.92
** 
**    Rev 1.1   18 Apr 1996 12:54:34   Shirley
** No change.
** 
**    Rev 1.0   12 Apr 1996 10:36:32   Shirley
** Initial revision.
** 
****************************************************************************/
/***************************************************************************
**
** File name : abispa.CPP
**
** Description: 
**
**
** Programmer: John Chow  96.3
**
**    Copyright (C) 1995 Microtek International, Inc.
**    All Rights Reserved
**
****************************************************************************/
#include "stdafx.h"

#include <stdio.h>
#include <string.h>

#include "abitype.h"
#include "abimacro.h"
#include "abispa.h"
                     
/////////////////////////////////////////////////////////////////
// call ABI sub rountine 
//
extern STATUS SendReceive(UINT uintLoop, int tcount);                     
                                                
                                                
//ID=0x38                                       
/*****************************************************
**
** Name : AbiCoverageGo()
**
** Function
**
**    Input  : coverageGoInfor
**
**    Output : abi status
**
** Notes:
**
*****************************************************/
STATUS AbiCoverageGo(COVERAGEGOINFO coverageGoInfor)
{                                              
    STATUS status;
    UINT uintLoop;

    uintLoop = 0;
    SaveId(FW_COVERAGE_GO,uintLoop);
    SaveVar(coverageGoInfor, uintLoop, sizeof(COVERAGEGOINFO));

    status = SendReceive(uintLoop, BASE_TIME);
    return status;
 
 }          
                      
//ID=x39                                                
/*****************************************************
**
** Name : AbiCoverageGet()
**
** Function
**
**    Input  : 
**
**    Output : abi status & coverageGetInfor
**
** Notes:
**
*****************************************************/
STATUS AbiCoverageGet(COVERAGEGETINFO* coverageGetInfor)
{
    STATUS status;
    UINT uintLoop;

    uintLoop = 0;
    SaveId(FW_COVERAGE_GET,uintLoop);

    status = SendReceive(uintLoop, BASE_TIME);
    if (status == ICE_OK) {
        coverageGetInfor->uchNumber = (unsigned char) inputStream[1];
        if((coverageGetInfor->uchNumber)>16) coverageGetInfor->uchNumber = 16;
        memcpy(&(coverageGetInfor->usAddr[0]), 
               &(inputStream[2]), 
               (coverageGetInfor->uchNumber)*4);
    }
    return status;
} 
            
//ID = 0x4b                                 
/*****************************************************
**
** Name : AbiSpaBpSet()
**
** Function
**
**    Input  : spaBpSetInfor
**
**    Output : abi status 
**
** Notes:
**
*****************************************************/
STATUS AbiSpaBpSet(SPABPSETINFO spaBpSetInfor)
{                                              
    STATUS status;
    UINT uintLoop;

    uintLoop = 0;
    SaveId(FW_SPA_BP_SET,uintLoop);
    SaveVar(spaBpSetInfor, uintLoop, sizeof(spaBpSetInfor));

    status = SendReceive(uintLoop, BASE_TIME);
    return status;
 
}
