/****************************************************************************** * * BA08 SDK Project * ****************************************************************************** * * File : BillDepositLogDev.h * * Author : GRG Inc. * * Date : June.17.2016 * * History of modifications * Date Rev. Reason * ****************************************************************************** * FILE DESCRIPTION *//** @file * This file contains function definition of the BA08 API for Linux. * ***************************************************************************//* * * GRGBanking * * 9 Kelin Road, Science City, Luogang District, Guangzhou, China 510663 * Tel: +86(0)20 8218 8010/8218 9249 * * * http://www.GRGBanking.com * ************************* Copyright(c) GRGBanking 2016 * **************************** * * The information contained here - in is the property of GRGBanking and is not to be * disclosed or used without the prior written permission of GRGBanking.This * copyright extends to all media in which this information may be preserved * including magnetic storage, computer print - out or visual display. * *****************************************************************************/ #ifndef _BILL_DEPOSIT_LOG_DEV_H_ #define _BILL_DEPOSIT_LOG_DEV_H_ /* * Module Specific Include Files */ #include "ODevBase.h" #include "BillDepositDevDef.h" #include "BillDepositDevStruct.h" #ifdef __cplusplus extern "C" { #endif /** @ingroup BA08 Interface *Establish a connection for communication with the device. * * Issues a request through the USB to determine if the device is connected, and if * the devices is connected and powered, starts to communicate with it. * *All the settings of communication parameters are obtained from the GRGDTATM_CommCfg.ini file. *See comments in the GRGDTATM_CommCfg.ini file as follows: * [BILLDEPOSITDEV] //the devices Logical name * COMMTYPE = 1 //1:Serial 2:Serial board 3: USB * ComID = 1 //the serial port number * ComBaud =19200 //baud rate * ComBoardPort = //don't need to set it * ComBoardPortBaud = //don't need to set it * DevCommLogID =2100 //don't need to set it * DevTraceLogID =2101 //don't need to set it * IniCfgFileName =BillDepositDevCfg.ini //the device's configure file * * @param[out] p_psStatus the status struct * * @return if function call is successful, the return is #SUCCESS and the p_psStatus[0]->iLogicCode is equal to zero. * Otherwise, return is #FAIL, and the error code is equal to the parameter with p_psStatus[0]->iLogicCode. * * @see tDevReturn. */ int CIM_SetCommPara(tDevReturn* p_psStatus); /** @ingroup BA08 Interface *This method is used to put the device into a defined operational state and initialize the device when the device has a fault. . * * * @param[in] p_iAction if the p_iAction is set to 1, the banknote in escrow * will return to the outlet. If the p_iAction is 2, the * banknote in escrow will clear to the cassette. * @param[out] p_psStatus the status struct * * @return if function call is successful, the return is #SUCCESS and the p_psStatus[0]->iLogicCode is equal to zero. * Otherwise, return is #FAIL, and the p_psStatus[0]->iLogicCode is nonzero and represents the error code. * * @see CIM_CloseComm() */ int CIM_Init(const int p_iAction, tDevReturn* p_psStatus); /** @ingroup BA08 Interface * Ends the communication with the BA08. * * @return if function call is successful, the return always is #SUCCESS. * *@see CIM_SetCommPara() */ int CIM_CloseComm(); /** @ingroup BA08 Interface *Get status of the devices * * * @param[out] p_psStatusInfo the real-time status of device * * @param[out] p_psStatus the status struct * * @return if function call is successful, the return is #SUCCESS and the p_psStatus[0]->iLogicCode is equal to zero. * Otherwise, return is #FAIL, and the p_psStatus[0]->iLogicCode is nonzero and represents the error code. * */ int CIM_GetStatus(tCIMStatusInfo* p_psStatusInfo, tDevReturn* p_psStatus); /** @ingroup BA08 Interface *This command will cause inserted notes to be moved to the escrow. * * If the type of the cash acceptor is BA08Z, the genuine banknote will press into the cassette, *or return to the outlet. Otherwise, the inserted notes will be moved to the escrow no matter * what the banknote is real or not. Then through the CIM_GetCashInfo() to get the recognition * results with the banknote. If the banknote is real, the user could control the flow of banknote * that is to return to the outlet or press into the cassette, according to the transaction. * * @param[out] p_psStatus the status struct * * @return if function call is successful, the return is #SUCCESS and the p_psStatus[0]->iLogicCode is equal to zero. * Otherwise, return is #FAIL, and the p_psStatus[0]->iLogicCode is nonzero and represents the error code. * * @see CIM_CancelPrepare(). */ int CIM_PrepareDeposit(tDevReturn* p_psStatus); /** @ingroup BA08 Interface *This method is used to cancel the status of receiving notes that has been started by *CIM_PrepareDeposit() call. * * @param[out] p_psStatus the status struct * * @return if function call is successful, the return is #SUCCESS and the p_psStatus[0]->iLogicCode is equal to zero. * Otherwise, return is #FAIL, and the p_psStatus[0]->iLogicCode is nonzero and represents the error code. * * @see CIM_PrepareDeposit(). */ int CIM_CancelPrepare(tDevReturn* p_psStatus); /** @ingroup BA08 Interface *This method is used to get the inserted notes information. * * @param[out] p_psCashInfo The p_psCashInfo is an array, and the * size of array is up to the p_iCashNumber. * @param[out] p_iCashNumber For BA-08Z, the p_iCashNumber is up to the * number of cash pressed into the cassette. * The maximum value of the p_iCashNumber * is 30. * Otherwise, the p_iCashNumber always is equal to 1 * if the banknote is real. * * @param[out] p_psStatus the status struct * * @return if function call is successful, the return is #SUCCESS and the p_psStatus[0]->iLogicCode is equal to zero. * Otherwise, return is #FAIL, and the p_psStatus[0]->iLogicCode is nonzero and represents the error code. * */ int CIM_GetCashInfo(tCIMCashInfo *p_psCashInfo, int& p_iCashNumber, tDevReturn* p_psStatus); /** @ingroup BA08 Interface *This method is unsupported by the BA-08/BA-08Z. * * @param[out] p_wCashNum The number of cash * * @param[out] p_psOCRInfo The OCR information * * @param[out] p_psStatus the status struct * * @return if function call is successful, the return is #SUCCESS and the p_psStatus[0]->iLogicCode is equal to zero. * Otherwise, return is #FAIL, and the p_psStatus[0]->iLogicCode is nonzero and represents the error code. * */ int CIM_GetCashOCRInfo(WORD p_wCashNum, tCIMOCRInfo *p_psOCRInfo, tDevReturn* p_psStatus); /** @ingroup BA08 Interface *This method is used to press the note into the stacker or cassette. * * * @param[in] p_pcPosition The position to the stacker or cassette. * If this parameter is equal to 0x31, the inserted notes in escrow will be * moved to the stacker. But for the BA08 series product, the value of 0x31 * is not supported because the stacker means escrow. * If this parameter is equal to 0x32, the the inserted notes in escrow will be * pressed into the cassette. * * @param[out] p_psStatus the status struct * * @return if function call is successful, the return is #SUCCESS and the p_psStatus[0]->iLogicCode is equal to zero. *Otherwise, return is #FAIL, and the p_psStatus[0]->iLogicCode is nonzero and represents the error code. * * @see CIM_CashOutFrom() */ int CIM_CashInTo(char p_pcPosition, tDevReturn* p_psStatus); /** @ingroup BA08 Interface *This method is used to return the notes from the stacker or escrow. * * * @param[in] p_pcPosition The position to the stacker or escrow. * The inserted notes will be return to outlet * no matter whether this parameter is equal to * 0x31 or 0x32. * * @param[out] p_psStatus the status struct * * @return if function call is successful, the return is #SUCCESS and the p_psStatus[0]->iLogicCode is equal to zero. *Otherwise, return is #FAIL, and the p_psStatus[0]->iLogicCode is nonzero and represents the error code. * * @see CIM_CashInTo() */ int CIM_CashOutFrom(char p_pcPosition, tDevReturn* p_psStatus); /** @ingroup BA08 Interface *This method is unsupported by the BA08 series product. * * @param[in] p_psBR15Dispense the dispense struct of the BR15 ** * @param[out] p_psStatus the status struct * * @return if function call is successful, the return is #SUCCESS and the p_psStatus[0]->iLogicCode is equal to zero. * Otherwise, return is #FAIL, and the p_psStatus[0]->iLogicCode is nonzero and represents the error code. * */ int CIM_Dispense(tBR15Dispense* p_psBR15Dispense, tDevReturn* p_psStatus); /** @ingroup BA08 Interface *This method is unsupported by the BA08 series product. * * @param[in] p_iCashUnit the cash Unit * @param[in] p_wNumber the number * @param[in/out] p_iRetract the number of Retract * @param[in] p_psCashUnitInfo the cash Unit Information * @param[out] p_psStatus the status struct * * @return if function call is successful, the return is #SUCCESS and the p_psStatus[0]->iLogicCode is equal to zero. * Otherwise, return is #FAIL, and the p_psStatus[0]->iLogicCode is nonzero and represents the error code. * */ int CIM_Replenish(int p_iCashUnit, const WORD p_wNumber, int& p_iRetract, tCashUnitInfo *p_psCashUnitInfo, tDevReturn* p_psStatus); /** @ingroup BA08 Interface *This method is unsupported by the BA08 series product. * * @param[in/out] p_byCountNumber the number to count * @param[out] p_psCashUnitInfo the cash Unit Information * @param[out] p_psStatus the status struct * * @return if function call is successful, the return is #SUCCESS and the p_psStatus[0]->iLogicCode is equal to zero. * Otherwise, return is #FAIL, and the p_psStatus[0]->iLogicCode is nonzero and represents the error code. * */ int CIM_CashCount(LPBYTE p_byCountNumber, tCashUnitInfo *p_psCashUnitInfo, tDevReturn* p_psStatus); /** @ingroup BA08 Interface *This method is used to get the detailed information of the devices, e.g hardware version and DLL version. * * * @param[out] p_psCapablitiesInfo the tCIMCapabilities struct * * @param[out] p_psStatus the status struct * * @return if function call is successful, the return is #SUCCESS and the p_psStatus[0]->iLogicCode is equal to zero. *Otherwise, return is #FAIL, and the p_psStatus[0]->iLogicCode is nonzero and represents the error code. * */ int CIM_GetCapabilities(tCIMCapabilities* p_psCapablitiesInfo, tDevReturn* p_psStatus); /** @ingroup BA08 Interface *This method is unsupported by the BA08 series product. * * @param[out] p_psCashUnitInfo the cash Unit Information * @param[out] p_psStatus the status struct * * @return if function call is successful, the return is #SUCCESS and the p_psStatus[0]->iLogicCode is equal to zero. * Otherwise, return is #FAIL, and the p_psStatus[0]->iLogicCode is nonzero and represents the error code. * * @see CIM_SetCashUnitInfo() */ int CIM_GetCashUnitInfo(tCashUnitInfo *p_psCashUnitInfo, tDevReturn* p_psStatus); /** @ingroup BA08 Interface * This method is unsupported by the BA08 series product. * * @param[out] p_psCashUnitInfo the cash Unit Information * @param[out] p_psStatus the status struct * * @return if function call is successful, the return is #SUCCESS and the p_psStatus[0]->iLogicCode is equal to zero. * Otherwise, return is #FAIL, and the p_psStatus[0]->iLogicCode is nonzero and represents the error code. * * @see CIM_GetCashUnitInfo() */ int CIM_SetCashUnitInfo(tCashUnitInfo *p_psCashUnitInfo, tDevReturn* p_psStatus); /** @ingroup BA08 Interface * This method is used to get all of the currency code and denomination that can be identified by the device. * * This method is different from CIM_GetRecogniseAbility() call, because the former get #all of the currency code * and denomination that can be identified by the device and the latter only get a part of it because the user may * set up some currency code and denomination for nonsupport by the device. * * * @param[out] p_tCashProperty The tCIMCashProperty struct. * This parameter is an array, and the size of array is up to the p_iNum. * @param[in] p_iNum The total number of currency code and denomination that can be identified by the device. * The maximum of this parameter is 60. * * @param[out] p_psStatus the status struct * * @return if function call is successful, the return is #SUCCESS and the p_psStatus[0]->iLogicCode is equal to zero. *Otherwise, return is #FAIL, and the p_psStatus[0]->iLogicCode is nonzero and represents the error code. * * @see CIM_GetAllRecogniseNum() */ int CIM_GetAllRecogniseAbility(tCIMCashProperty* p_tCashProperty, int& p_iNum, tDevReturn* p_psStatus); /** @ingroup BA08 Interface *This method is used to get the total number of the currency code and denomination that can be identified by the device. * * @param[in] p_iNum The total number of currency code and denomination that can be identified by the device. * The maximum of this parameter is 60. * * @param[out] p_psStatus the status struct * * @return if function call is successful, the return is #SUCCESS and the p_psStatus[0]->iLogicCode is equal to zero. *Otherwise, return is #FAIL, and the p_psStatus[0]->iLogicCode is nonzero and represents the error code. * * @see CIM_GetAllRecogniseAbility(), CIM_GetRecogniseNum(), CIM_GetRecogniseAbility(), CIM_SetRecogniseAbility() */ int CIM_GetAllRecogniseNum(int& p_iNum, tDevReturn* p_psStatus); /** @ingroup BA08 Interface *This method is used to get the number of the currency code and denomination that can be identified by the device. * * @param[in] p_iNum The number of currency code and denomination that can be identified by the device. * The maximum of this parameter is 60. * * @param[out] p_psStatus the status struct * * @return if function call is successful, the return is #SUCCESS and the p_psStatus[0]->iLogicCode is equal to zero. *Otherwise, return is #FAIL, and the p_psStatus[0]->iLogicCode is nonzero and represents the error code. * * @see CIM_GetAllRecogniseAbility(), CIM_GetAllRecogniseNum(), CIM_GetRecogniseAbility(), CIM_SetRecogniseAbility() */ int CIM_GetRecogniseNum(int& p_iNum, tDevReturn* p_psStatus); /** @ingroup BA08 Interface *This method is used to get the currency code and denomination that can be identified by the device. * * @param[out] p_tCashProperty The tCIMCashProperty struct. * This parameter is an array, and the size of array is up to the p_iNum. * @param[in] p_iNum The number of currency code and denomination that can be identified by the device. * The maximum of this parameter is 60. * * @param[out] p_psStatus the status struct * * @return if function call is successful, the return is #SUCCESS and the p_psStatus[0]->iLogicCode is equal to zero. *Otherwise, return is #FAIL, and the p_psStatus[0]->iLogicCode is nonzero and represents the error code. * * @see CIM_GetAllRecogniseAbility(), CIM_GetAllRecogniseNum(), CIM_GetRecogniseNum(), CIM_SetRecogniseAbility() */ int CIM_GetRecogniseAbility(tCIMCashProperty* p_tCashProperty, int& p_iNum, tDevReturn* p_psStatus); /** @ingroup BA08 Interface *This method is used to set up the currency code and denomination that can be identified by the device. * * @param[in] p_tCashProperty The tCIMCashProperty struct. * This parameter is an array, and the size of array is up to the p_iNum. * @param[in/out] p_iNum The number of currency code and denomination that can be identified by the device. * The maximum of this parameter is 60. * * @param[out] p_psStatus the status struct * * @return if function call is successful, the return is #SUCCESS and the p_psStatus[0]->iLogicCode is equal to zero. *Otherwise, return is #FAIL, and the p_psStatus[0]->iLogicCode is nonzero and represents the error code. * * @see CIM_GetAllRecogniseAbility(), CIM_GetAllRecogniseNum(), CIM_GetRecogniseNum(), CIM_GetRecogniseAbility() */ int CIM_SetRecogniseAbility(tCIMCashProperty* p_tCashProperty, int p_iNum, tDevReturn* p_psStatus); /** @ingroup BA08 Interface * This method is unsupported by the BA08 series product. * * @param[in] p_psNoteQueryParas the tGRGNoteQueryParas struct * @param[in] p_psNoteDetails the tGRGNoteDetails struct * @param[in/out] p_uiNumOfItems the number of items * @param[in/out] p_bHaveItems the flag of database have items * @param[out] p_psStatus the status struct * * @return if function call is successful, the return is #SUCCESS and the p_psStatus[0]->iLogicCode is equal to zero. * Otherwise, return is #FAIL, and the p_psStatus[0]->iLogicCode is nonzero and represents the error code. * */ int CIM_QueryCashInfo(tGRGNoteQueryParas *p_psNoteQueryParas, tGRGNoteDetails *p_psNoteDetails, UINT &p_uiNumOfItems, BOOL &p_bHaveItems, tDevReturn* p_psStatus); /** @ingroup BA08 Interface * This method is unsupported by the BA08 series product. * * @param[in] p_psNoteDetails the tGRGNoteDetails struct * @param[in/out] p_uiNumOfItems the number of items * @param[in] p_byNoteType the type of Note * @param[out] p_psStatus the status struct * * @return if function call is successful, the return is #SUCCESS and the p_psStatus[0]->iLogicCode is equal to zero. * Otherwise, return is #FAIL, and the p_psStatus[0]->iLogicCode is nonzero and represents the error code. * */ int CIM_GetNvNotesInfo(tGRGNoteDetails *p_psNoteDetails, UINT &p_uiNumOfItems, BYTE p_byNoteType, tDevReturn* p_psStatus); /** @ingroup BA08 Interface * This method is unsupported by the BA08 series product. * * @param[in] p_psNoteQueryParas the tGRGNoteQueryParas struct * @param[in] p_psNoteDetails the tGRGNoteDetails struct * @param[in/out] p_uiNumOfItems the number of items * @param[out] p_psStatus the status struct * * @return if function call is successful, the return is #SUCCESS and the p_psStatus[0]->iLogicCode is equal to zero. * Otherwise, return is #FAIL, and the p_psStatus[0]->iLogicCode is nonzero and represents the error code. * */ int CIM_QueryCashInfoA(tGRGNoteSnQueryParas *p_psNoteSnQueryParas, tGRGNoteDetails *p_psNoteDetails, UINT &p_uiNumOfItems, tDevReturn* p_psStatus); /** @ingroup BA08 Interface * This method is unsupported by the BA08 series product. * * @param[out] p_psTransInfoParas the tGRGTransInfoParas struct * @param[out] p_psOcrSnSameList the tGRGOcrSnSameList struct * @param[out] p_psStatus the status struct * * @return if function call is successful, the return is #SUCCESS and the p_psStatus[0]->iLogicCode is equal to zero. * Otherwise, return is #FAIL, and the p_psStatus[0]->iLogicCode is nonzero and represents the error code. * */ int CIM_GetOcrSnSameInfo(tGRGTransInfoParas *p_psTransInfoParas, tGRGOcrSnSameList *p_psOcrSnSameList, tDevReturn* p_psStatus); /** @ingroup BA08 Interface * This method is unsupported by the BA08 series product. * * @param[in] p_tStart the tGRGDate struct * @param[in] p_tEnd the tGRGDate struct * @param[out] p_psStatus the status struct * * @return if function call is successful, the return is #SUCCESS and the p_psStatus[0]->iLogicCode is equal to zero. * Otherwise, return is #FAIL, and the p_psStatus[0]->iLogicCode is nonzero and represents the error code. * */ int CIM_GetLogData(tGRGDate* p_tStart, tGRGDate* p_tEnd, tDevReturn *p_psStatus); /** @ingroup BA08 Interface * This method is unsupported by the BA08 series product. * * @param[in] p_wYear the year * @param[in] p_wMonth the month * @param[in] p_wDay the day * @param[out] p_psStatus the status struct * @return if function call is successful, the return is #SUCCESS and the p_psStatus[0]->iLogicCode is equal to zero. * Otherwise, return is #FAIL, and the p_psStatus[0]->iLogicCode is nonzero and represents the error code. * */ int CIM_DeleteSerialRecords(WORD p_wYear, WORD p_wMonth, WORD p_wDay, tDevReturn* p_psStatus); /** @ingroup BA08 Interface * This method is unsupported by the BA08 series product. * * @param[in/out] p_wCashNum the number of cash * @param[in] p_psOCRInfo the tCIMOCRInfo struct * @param[out] p_psStatus the status struct * @return if function call is successful, the return is #SUCCESS and the p_psStatus[0]->iLogicCode is equal to zero. * Otherwise, return is #FAIL, and the p_psStatus[0]->iLogicCode is nonzero and represents the error code. * */ int CIM_GetReplenishOCRInfo(WORD &p_wCashNum, tCIMOCRInfo *p_psOCRInfo, tDevReturn *p_psStatus); /** @ingroup BA08 Interface * This method is unsupported by the BA08 series product. * * @param[in] p_pcSection the section name * @param[in] p_pcKeyName the key name * @param[out] p_iKeyValue the key value * @return if function call is successful, the return is #SUCCESS and the p_psStatus[0]->iLogicCode is equal to zero. * Otherwise, return is #FAIL, and the p_psStatus[0]->iLogicCode is nonzero and represents the error code. * */ int iGetIntValue(const char *p_pcSection, const char *p_pcKeyName, int &p_iKeyValue); /** @ingroup BA08 Interface * This method is unsupported by the BA08 series product. * * @param[in] p_pcSection the section name * @param[in] p_pcKeyName the key name * @param[out] p_lKeyValue the key value * @return if function call is successful, the return is #SUCCESS and the p_psStatus[0]->iLogicCode is equal to zero. * Otherwise, return is #FAIL, and the p_psStatus[0]->iLogicCode is nonzero and represents the error code. * */ int iSetIntValue(const char *p_pcSection, const char *p_pcKeyName, long p_lKeyValue); /** @ingroup BA08 Interface * This method is unsupported by the BA08 series product. * * @param[in] p_pcSection the section name * @param[in] p_pcKeyName the key name * @param[out] p_strKeyValue the key value * @return if function call is successful, the return is #SUCCESS and the p_psStatus[0]->iLogicCode is equal to zero. * Otherwise, return is #FAIL, and the p_psStatus[0]->iLogicCode is nonzero and represents the error code. * */ int iGetStringValue(const char *p_pcSection, const char *p_pcKeyName, Dunite::CString &p_strKeyValue); /** @ingroup BA08 Interface * This method is unsupported by the BA08 series product. * * @param[in] p_pcSection the section name * @param[in] p_pcKeyName the key name * @param[out] p_strKeyValue the key value * @return if function call is successful, the return is #SUCCESS and the p_psStatus[0]->iLogicCode is equal to zero. * Otherwise, return is #FAIL, and the p_psStatus[0]->iLogicCode is nonzero and represents the error code. * */ int iSetStringValue(const char *p_pcSection, const char *p_pcKeyName, Dunite::CString p_strKeyValue); #ifdef __cplusplus } #endif #endif