Merge commit 'f214e0ff43594ebf48a00f8debb96613c307c309'
fetch sources for CashAgentLib 3.3.
This commit is contained in:
@@ -1490,8 +1490,32 @@ void hwapi::request_ReadbackDeviceSettings() const
|
||||
void hwapi::readback_DeviceSettings(uint8_t *length, uint8_t *data) const
|
||||
{
|
||||
|
||||
epi_restoreDeviceSettings(length, data);
|
||||
epi_restoreRbDeviceSettings(length, data);
|
||||
/*
|
||||
buf66[0]=devPara.kindOfPrinter;
|
||||
buf66[1]=devPara.kindOfCoinChecker;
|
||||
buf66[2]=devPara.kindOfMifareReader;
|
||||
buf66[3]=devPara.suppressSleepMode;
|
||||
buf66[4]=devPara.kindOfModem;
|
||||
buf66[5]=devPara.kindOfCreditcard;
|
||||
buf66[6]=devPara.CoinEscrow;
|
||||
buf66[7]=devPara.CoinRejectUnit;
|
||||
buf66[8]=devPara.CoinShutter;
|
||||
buf66[9]=devPara.BillAcceptor;
|
||||
buf66[10]=devPara.usevaultLock;
|
||||
buf66[11]=devPara.autoAlarm;
|
||||
buf66[12]=devPara.autoOpen;
|
||||
buf66[13]=devPara.printAccReceipt;
|
||||
buf66[14]=devPara.printDoorReceipt;
|
||||
buf66[15]=devPara.printTokenTicket;
|
||||
uitmp=devPara.VaultFullWarnLevel;
|
||||
buf66[16]=swl_getOneByteFromUint(uitmp, GETLOWBYT);
|
||||
buf66[17]=swl_getOneByteFromUint(uitmp, GETHIGHBYT);
|
||||
uitmp=devPara.VaultFullErrorLevel;
|
||||
buf66[18]=swl_getOneByteFromUint(uitmp, GETLOWBYT);
|
||||
buf66[19]=swl_getOneByteFromUint(uitmp, GETHIGHBYT);
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
// ....................................................................................
|
||||
@@ -1530,6 +1554,22 @@ void hwapi::request_ReadbackMachineID() const
|
||||
void hwapi::readback_machineIDdata(uint8_t *length, uint8_t *data) const
|
||||
{
|
||||
epi_restoreMachineIDsettings(length, data);
|
||||
/*
|
||||
buf66[0]=swl_getOneByteFromUint(machPara.customerNumber, GETLOWBYT);
|
||||
buf66[1]=swl_getOneByteFromUint(machPara.customerNumber, GETHIGHBYT);
|
||||
buf66[2]=swl_getOneByteFromUint(machPara.machineNumber, GETLOWBYT);
|
||||
buf66[3]=swl_getOneByteFromUint(machPara.machineNumber, GETHIGHBYT);
|
||||
buf66[4]=swl_getOneByteFromUint(machPara.borough, GETLOWBYT);
|
||||
buf66[5]=swl_getOneByteFromUint(machPara.borough, GETHIGHBYT);
|
||||
buf66[6]=swl_getOneByteFromUint(machPara.zone, GETLOWBYT);
|
||||
buf66[7]=swl_getOneByteFromUint(machPara.zone, GETHIGHBYT);
|
||||
buf66[8]=swl_getOneByteFromUint(machPara.alias, GETLOWBYT);
|
||||
buf66[9]=swl_getOneByteFromUint(machPara.alias, GETHIGHBYT);
|
||||
for (pp=0; pp<32; pp++)
|
||||
buf66[10+pp]=machPara.location[pp];
|
||||
dc2prot_setReadData(42, buf66);
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
@@ -2831,6 +2871,10 @@ void hwapi::led_switchLedIllumination(uint8_t on) const
|
||||
|
||||
// neu, 25.3.23
|
||||
|
||||
// ------------------------------------------------------------------------------------
|
||||
// 27.3.2023: Use Device-Controller's Bootloader to send hex-file
|
||||
// ------------------------------------------------------------------------------------
|
||||
|
||||
void hwapi::bl_rebootDC(void) const
|
||||
{
|
||||
uint8_t len, buf[20];
|
||||
@@ -3014,4 +3058,361 @@ void hwapi::bl_sendFile(void) const
|
||||
*/
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------------
|
||||
// 6.4.2023: new functions for coin collection and printing
|
||||
// some new system functions
|
||||
// ------------------------------------------------------------------------------------
|
||||
|
||||
// use:
|
||||
// bool sendFDcmd_set(uint8_t nextWrCmd, uint8_t nextRdCmd, uint8_t blockNum, uint8_t dat1, uint8_t dat2, uint8_t dat3, uint8_t dat4);
|
||||
// write Command to memory, wait for transport
|
||||
|
||||
// bool longFDcmd_set(uint8_t nextWrCmd, uint8_t nextRdCmd, uint8_t blockNum, uint8_t length, uint8_t *data);
|
||||
// write Command to memory, wait for transport
|
||||
// data buffer size always 64! data[64], padded with 0
|
||||
|
||||
bool hwapi::rtc_setTimeDateDirect(struct Trtc_DateTime *DateTime) const
|
||||
{
|
||||
// return true if successful. could fail if more the 8 commands are waiting
|
||||
|
||||
uint8_t temp[66];
|
||||
bool b_ret;
|
||||
/* in interfaces.h:
|
||||
struct Trtc_DateTime
|
||||
{
|
||||
uint8_t rtc_hour;
|
||||
uint8_t rtc_min;
|
||||
uint8_t rtc_sec;
|
||||
uint8_t rtc_dayOfMonth;
|
||||
uint8_t rtc_month;
|
||||
uint8_t rtc_year;
|
||||
uint8_t rtc_dayOfWeek;
|
||||
};
|
||||
*/
|
||||
tslib_strclr(temp,0,66);
|
||||
temp[0]= DateTime->rtc_hour;
|
||||
temp[1]= DateTime->rtc_min;
|
||||
temp[2]= DateTime->rtc_sec;
|
||||
temp[3]= 20;
|
||||
temp[4]= DateTime->rtc_year;
|
||||
temp[5]= DateTime->rtc_month;
|
||||
temp[6]= DateTime->rtc_dayOfMonth;
|
||||
temp[7]= DateTime->rtc_dayOfWeek;
|
||||
b_ret=longFDcmd_set(20,0,0,8,temp);
|
||||
return b_ret;
|
||||
}
|
||||
|
||||
bool hwapi::rtc_getExtendedTime(uint8_t *leng, uint8_t *data) const
|
||||
{
|
||||
epi_restoreExtendedTime(leng, data);
|
||||
return true;
|
||||
|
||||
/*
|
||||
buf[0]=GlobTime.Hours;
|
||||
buf[1]=GlobTime.Min;
|
||||
buf[2]=GlobTime.Sec;
|
||||
buf[3]=GlobTime.Year;
|
||||
buf[4]=GlobTime.Month;
|
||||
buf[5]=GlobTime.Day;
|
||||
buf[6]=GlobTime.DOW;
|
||||
buf[7]=' '; // immer auf 32bit auffüllen sonst Speicherproblem beim Master!
|
||||
uitmp=GlobTime.MinOfDay;
|
||||
buf[8]=swl_getOneByteFromUint(uitmp, 0);
|
||||
buf[9]=swl_getOneByteFromUint(uitmp, 1);
|
||||
buf[10]=' ';
|
||||
buf[11]=' ';
|
||||
ultmp=GlobTime.SecOfDay;
|
||||
buf[12]=swl_getOneByteFromUlong(ultmp, 0);
|
||||
buf[13]=swl_getOneByteFromUlong(ultmp, 1);
|
||||
buf[14]=swl_getOneByteFromUlong(ultmp, 2);
|
||||
buf[15]=swl_getOneByteFromUlong(ultmp, 3);
|
||||
|
||||
buf[16]=swl_isLeap(GlobTime.Year);
|
||||
buf[17]=swl_getNextLeapYear(GlobTime.Year);
|
||||
buf[18]=swl_getLastLeapYear(GlobTime.Year);
|
||||
buf[19]=swl_hoursOfThisWeek(GlobTime.DOW, GlobTime.Hours);
|
||||
|
||||
uitmp=swl_minutesOfThisWeek(GlobTime.DOW, GlobTime.Hours, GlobTime.Min);
|
||||
buf[20]=swl_getOneByteFromUint(uitmp, 0); // 0=low byte 1=high byte
|
||||
buf[21]=swl_getOneByteFromUint(uitmp, 1);
|
||||
|
||||
uitmp=swl_hoursOfThisMonth(GlobTime.Day, GlobTime.Hours);
|
||||
buf[22]=swl_getOneByteFromUint(uitmp, 0);
|
||||
buf[23]=swl_getOneByteFromUint(uitmp, 1);
|
||||
|
||||
uitmp=swl_minutesOfThisMonth(GlobTime.Day, GlobTime.Hours, GlobTime.Min);
|
||||
buf[24]=swl_getOneByteFromUint(uitmp, 0);
|
||||
buf[25]=swl_getOneByteFromUint(uitmp, 1);
|
||||
|
||||
uitmp=swl_GetDaysOfYear(GlobTime.Year, GlobTime.Month, GlobTime.Day);
|
||||
buf[26]=swl_getOneByteFromUint(uitmp, 0);
|
||||
buf[27]=swl_getOneByteFromUint(uitmp, 1);
|
||||
|
||||
uitmp=swl_GetHoursOfYear(GlobTime.Year, GlobTime.Month, GlobTime.Day, GlobTime.Hours);
|
||||
buf[28]=swl_getOneByteFromUint(uitmp, 0);
|
||||
buf[29]=swl_getOneByteFromUint(uitmp, 1);
|
||||
buf[30]=0;
|
||||
buf[31]=0;
|
||||
ultmp= swl_GetMinutesOfYear(GlobTime.Year, GlobTime.Month, GlobTime.Day,
|
||||
GlobTime.Hours, GlobTime.Min);
|
||||
buf[32]=swl_getOneByteFromUlong(ultmp, 0);
|
||||
buf[33]=swl_getOneByteFromUlong(ultmp, 1);
|
||||
buf[34]=swl_getOneByteFromUlong(ultmp, 2);
|
||||
buf[35]=swl_getOneByteFromUlong(ultmp, 3);
|
||||
|
||||
buf[36]=rtc_getSqwaveSettings();
|
||||
buf[37]=0;
|
||||
buf[38]=0;
|
||||
buf[39]=0;
|
||||
|
||||
ultmp= 0; // Minutes of the Millenium
|
||||
buf[40]=swl_getOneByteFromUlong(ultmp, 0);
|
||||
buf[41]=swl_getOneByteFromUlong(ultmp, 1);
|
||||
buf[42]=swl_getOneByteFromUlong(ultmp, 2);
|
||||
buf[43]=swl_getOneByteFromUlong(ultmp, 3);
|
||||
|
||||
dc2prot_setReadData(44, buf);
|
||||
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
bool hwapi::sys_runCompleteTest(void) const
|
||||
{
|
||||
// warning: lasts 20s in one pace
|
||||
return sendFDcmd_set(149, 0,0, 0,0,0,0);
|
||||
}
|
||||
|
||||
bool hwapi::sys_ready4sending(void) const
|
||||
{
|
||||
// return true if a Json-file can be sent
|
||||
|
||||
// check free memory
|
||||
uint8_t frei=FDLONG_STACKDEPTH - check4FDlongCmd();
|
||||
// Command-Stack sollte 16 Commands fassen, je 64byte Nutzdaten = 1024byte
|
||||
// in check4FDlongCmd() steht wieviele Plaetze bereits belegt sind
|
||||
// frei gibt also die Anzahl freier 64byte Bloecke zurueck
|
||||
// das Json-File hat max 800 byte = 13 bloecke
|
||||
if (frei<16) // Puffer muss ganz leer sein! nicht dass was durcheinander kommt
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool hwapi::sys_sendJsonFileToDc(uint8_t kindOfFile, uint8_t nrOfTemplate, uint8_t *content ) const
|
||||
{
|
||||
// kindOfFile: 1=config, 2=device, 3=cash, 4=serial, 5=time, 6=printer
|
||||
// nrOfTemplate=1...32 if kindOfFile==6
|
||||
// content = content of the Json file, max 800byte ascii signs
|
||||
// file is 0-terminated
|
||||
// return false if sending is not possible, wait a second
|
||||
|
||||
uint8_t dateiArt, NummDesTempl;
|
||||
uint8_t inhaltOfJson[802], temp[66];
|
||||
uint16_t dateiLang, uitmp;
|
||||
uint8_t nrOfBlocks;
|
||||
uint8_t frei, bn=0;
|
||||
|
||||
dateiArt=kindOfFile;
|
||||
NummDesTempl=nrOfTemplate;
|
||||
tslib_strclr(inhaltOfJson,0,801);
|
||||
dateiLang=tslib_strlen(content);
|
||||
if (dateiLang>800) dateiLang=800;
|
||||
tslib_strcpy(content, inhaltOfJson, dateiLang); // enthaelt genaue Laenge, Rest =0
|
||||
nrOfBlocks=dateiLang/64;
|
||||
if (dateiLang%64>0)
|
||||
nrOfBlocks++;
|
||||
dateiLang=nrOfBlocks;
|
||||
dateiLang<<=6; // auf volle 64byte aufgerundet
|
||||
|
||||
// check free memory
|
||||
frei=FDLONG_STACKDEPTH - check4FDlongCmd();
|
||||
// Command-Stack sollte 16 Commands fassen, je 64byte Nutzdaten = 1024byte
|
||||
// in check4FDlongCmd() steht wieviele Plaetze bereits belegt sind
|
||||
// frei gibt also die Anzahl freier 64byte Bloecke zurueck
|
||||
// das Json-File hat max 800 byte = 13 bloecke
|
||||
if (frei<16) // Puffer muss ganz leer sein! nicht dass was durcheinander kommt
|
||||
return false;
|
||||
|
||||
// Start- und Stop auch als langes Kommando schicken
|
||||
// PROBLEM: wuerden sie in einem anderen Batch gespeichert (short command stack),
|
||||
// dann kann die Reihenfolge nicht gewaehrleistet werden
|
||||
// Das Startkommando muss sicher zuerst kommen
|
||||
// Das Abschlusskommando muss sicher zuletzt kommen
|
||||
|
||||
tslib_strclr(temp,0,65);
|
||||
temp[0]=dateiArt;
|
||||
temp[1]=NummDesTempl;
|
||||
longFDcmd_set(30, 0,0, 2,temp); // sende "Starte-file-DL"
|
||||
uitmp=0; bn=0;
|
||||
do
|
||||
{
|
||||
biox_CopyBlock(inhaltOfJson, uitmp, temp, 0, 64);
|
||||
longFDcmd_set(31,0, bn++, 64, temp);
|
||||
uitmp<<=6;
|
||||
} while(uitmp < dateiLang);
|
||||
|
||||
longFDcmd_set(32, 0,0, 0,temp); // Abschluss
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//char prn_dynPrnVal[8][8];
|
||||
bool hwapi::prn_sendDynamicPrnValues(uint8_t *dynPrnVal ) const
|
||||
// dynPrnVal = array of 8 Variables with 8 byte each, come as ascii string
|
||||
// like: char prn_dynPrnVal[8][8];
|
||||
// return true if sending, false if cmd-stack is full
|
||||
{
|
||||
|
||||
uint8_t temp[66];
|
||||
|
||||
|
||||
tslib_strcpy(dynPrnVal, temp, 64); // Vorsicht, kann \0en enthalten
|
||||
return longFDcmd_set(33,0,0, 64, temp);
|
||||
|
||||
}
|
||||
|
||||
bool hwapi::prn_printTemplate(uint8_t nrOftemplate) const
|
||||
// print one of the templates loaded by Json prior
|
||||
// nr = 1..32
|
||||
{
|
||||
// return true if sending, false if cmd-stack is full
|
||||
return sendFDcmd_set(152, 0,0, nrOftemplate,0,0,0);
|
||||
}
|
||||
|
||||
void hwapi::log_getHoldAccountNumbers(uint32_t *accNr ) const
|
||||
// returns all acc nrs of the backuped vault records
|
||||
// use: uint32_t backupedAccNumbers[8]
|
||||
{
|
||||
Q_UNUSED(accNr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool hwapi::log_selectVaultRecord(uint16_t accountNr ) const
|
||||
{
|
||||
// return true if sending, false if cmd-stack is full
|
||||
uint8_t dat1, dat2;
|
||||
|
||||
dat1=uint2uchar(accountNr, LOWBYTE);
|
||||
dat2=uint2uchar(accountNr, HIGHBYTE);
|
||||
return sendFDcmd_set(153, 0,0, dat1,dat2,0,0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//request, isAvailable
|
||||
void hwapi::log_getVaultRecord(struct T_vaultRecord *retVR) const
|
||||
// which was selected by: log_selectVaultRecord()
|
||||
// to be forwarded to Ismas
|
||||
{
|
||||
Q_UNUSED(retVR);
|
||||
}
|
||||
|
||||
bool hwapi::prn_printAccountReceipt(void) const
|
||||
{
|
||||
return sendFDcmd_set(154, 0,0, 0,0,0,0);
|
||||
}
|
||||
|
||||
bool hwapi::prn_printTestTicket(void) const
|
||||
{
|
||||
// return true if sending to DC OK, false if cmd-stack is full
|
||||
return sendFDcmd_set(157, 0,0, 0,0,0,0);
|
||||
|
||||
}
|
||||
|
||||
bool hwapi::cash_startPayment(uint16_t amount) const
|
||||
{
|
||||
uint8_t dat1, dat2;
|
||||
|
||||
epi_clearCurrentPayment();
|
||||
dat1=uint2uchar(amount, LOWBYTE);
|
||||
dat2=uint2uchar(amount, HIGHBYTE);
|
||||
return sendFDcmd_set(155, 0,0, dat1,dat2,0,0);
|
||||
|
||||
}
|
||||
|
||||
uint32_t hwapi::getInsertedAmount(void) const
|
||||
{
|
||||
return epi_CurrentPaymentGetAmount();
|
||||
}
|
||||
|
||||
uint16_t hwapi::getLastInsertedCoin(void) const
|
||||
{
|
||||
return epi_CurrentPaymentGetLastCoin();
|
||||
}
|
||||
|
||||
bool hwapi::getAllInsertedCoins(uint16_t *types, uint16_t *values) const
|
||||
{
|
||||
// alle bei diesem Verkauf eingeworfenen Münzen sind gespeichert, max 64
|
||||
return epi_CurrentPaymentGetAllCoins(types, values);
|
||||
|
||||
}
|
||||
|
||||
|
||||
bool hwapi::cash_cancelPayment(void) const
|
||||
// and return coins
|
||||
{
|
||||
// DB1: 1=encash 2=cancel & return coins
|
||||
// 3=stop and keep coins in escrow
|
||||
return sendFDcmd_set(156, 0,0, 2,0,0,0);
|
||||
}
|
||||
bool hwapi::cash_stopPayment(void) const
|
||||
// and keep coins in escrow
|
||||
{
|
||||
// DB1: 1=encash 2=cancel & return coins
|
||||
// 3=stop and keep coins in escrow
|
||||
return sendFDcmd_set(156, 0,0, 3,0,0,0);
|
||||
|
||||
}
|
||||
// after ticket/goods issue:
|
||||
bool hwapi::vend_success(void) const
|
||||
// conclude payment process, encash all inserted coins to vault. Printing was successful
|
||||
// if possible return change
|
||||
{
|
||||
// DB1: 1=encash 2=cancel & return coins
|
||||
// 3=stop and keep coins in escrow
|
||||
return sendFDcmd_set(156, 0,0, 1,0,0,0);
|
||||
|
||||
}
|
||||
bool hwapi::vend_failed(void) const
|
||||
// conclude payment process and return all inserted coins
|
||||
{
|
||||
// DB1: 1=encash 2=cancel & return coins
|
||||
// 3=stop and keep coins in escrow
|
||||
return sendFDcmd_set(156, 0,0, 2,0,0,0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
uint8_t hwapi::mif_getCardType(QString cardholder) const
|
||||
// return 1,2,3,4 = upper, lower access card, printer test, coin test
|
||||
// cardholder: 7byte Name-String
|
||||
{
|
||||
Q_UNUSED(cardholder);
|
||||
return 0; // to satisfy compiler
|
||||
}
|
||||
|
||||
uint64_t hwapi::sys_getWakeSource(void) const
|
||||
{
|
||||
// retval: 6 bytes, bit coded, 1=event keeps DC awake
|
||||
return epi_getWakeSources();
|
||||
}
|
||||
|
||||
//void hwapi::sys_getDeviceConditions(struct T_moduleCondition *devCond) const
|
||||
void hwapi::sys_getDeviceConditions(uint8_t *leng, uint8_t *data) const
|
||||
{
|
||||
//uint8_t leng, data[66];
|
||||
epi_restoreDeviceConditions(leng, data);
|
||||
}
|
||||
|
||||
//void hwapi::sys_getDynMachineConditions(struct T_dynamicCondition *dynMachCond) const
|
||||
void hwapi::sys_getDynMachineConditions(uint8_t *leng, uint8_t *data) const
|
||||
{
|
||||
epi_restoreDeviceConditions(leng, data);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user