Added/merged from sources of Thomas (version CashAgentLib 3.3, 12.04.2023)

This commit is contained in:
2023-04-13 10:55:37 +02:00
parent debade9942
commit c1b945225b
11 changed files with 2412 additions and 254 deletions

View File

@@ -1522,20 +1522,17 @@ qDebug()<<"read emp data, nr "<<ctr_gotCoin << "valid: " << *valid
static uint8_t Sdata_NrOfDeviceSetting;
static uint8_t Sdata_DeviceSettingBuff[66];
void gpi_storeDeviceSettings(uint8_t leng, uint8_t *data)
void gpi_storeRbDeviceSettings(uint8_t leng, uint8_t *data) // getestet am 12.4.23TS
{
if (leng>64) leng=64;
Sdata_NrOfDeviceSetting=leng;
tslib_strcpy(data, Sdata_DeviceSettingBuff, leng);
tslib_strcpy(data, Sdata_DeviceSettingBuff, leng); // getestet am 12.4.23TS
}
void epi_restoreDeviceSettings(uint8_t *leng, uint8_t *data)
void epi_restoreRbDeviceSettings(uint8_t *leng, uint8_t *data) // getestet am 12.4.23TS
{
*leng=Sdata_NrOfDeviceSetting;
@@ -1563,10 +1560,134 @@ void epi_restoreMachineIDsettings(uint8_t *leng, uint8_t *data)
}
static uint32_t store_insertedAmount;
static uint16_t store_lastCoinType[64];
static uint16_t store_lastCoinValue[64];
static uint8_t p_lastCoin;
void epi_clearCurrentPayment(void)
{
// call at beginning of coin collection
store_insertedAmount=0;
p_lastCoin=0;
}
void gpi_storeCurrentPayment(uint32_t insertedAmount, uint16_t lastCoinType, uint16_t lastCoinValue)
{
store_insertedAmount=insertedAmount;
store_lastCoinType[p_lastCoin]=lastCoinType;
store_lastCoinValue[p_lastCoin]=lastCoinValue;
p_lastCoin++;
}
uint32_t epi_CurrentPaymentGetAmount(void)
{
return store_insertedAmount;
}
uint16_t epi_CurrentPaymentGetLastCoin(void)
{
uint8_t pp;
pp=p_lastCoin;
if (pp==0)
return 0; // noch keine Münze erhalten
if (pp>0) pp--;
return store_lastCoinValue[pp];
}
bool epi_CurrentPaymentGetAllCoins(uint16_t *types, uint16_t *values)
{
// alle bei diesem Verkauf eingeworfenen Münzen sind gespeichert falls die jmd. braucht
uint8_t nn;
if (p_lastCoin==0)
return false;
for (nn=0; nn<64; nn++)
{
types[nn]=store_lastCoinType[nn];
values[nn]=store_lastCoinValue[nn];
}
return true;
}
uint64_t stor_wakSrc;
void gpi_storeWakeSources(uint8_t *receivedData)
{
uint8_t uctmp;
int nn;
stor_wakSrc=0;
for (nn=7; nn>=0; nn--)
{
uctmp=receivedData[nn];
stor_wakSrc |=uctmp;
stor_wakSrc<<=8;
}
}
uint64_t epi_getWakeSources(void)
{
return stor_wakSrc;
}
static uint8_t store_rbDevParamLen;
static uint8_t store_rbDevParams[66];
void gpi_storeExtendedTime(uint8_t leng, uint8_t *data)
{
if (leng>64) leng=64;
store_rbDevParamLen=leng;
tslib_strcpy(data, store_rbDevParams, leng);
}
void epi_restoreExtendedTime(uint8_t *leng, uint8_t *data)
{
*leng=store_rbDevParamLen;
tslib_strcpy(store_rbDevParams, data, store_rbDevParamLen);
}
// store device conditions
static uint8_t store_deviceCondLen;
static uint8_t store_deviceCond[66];
void gpi_storeDeviceConditions(uint8_t leng, uint8_t *data)
{
if (leng>64) leng=64;
store_deviceCondLen=leng;
tslib_strcpy(data, store_deviceCond, leng);
}
void epi_restoreDeviceConditions(uint8_t *leng, uint8_t *data)
{
*leng=store_deviceCondLen;
tslib_strcpy(store_deviceCond, data, store_deviceCondLen);
}
// store dynamic machine conditions
static uint8_t store_machCondLen;
static uint8_t store_machCond[66];
void gpi_storeDynMachineConditions(uint8_t leng, uint8_t *data)
{
if (leng>64) leng=64;
store_machCondLen=leng;
tslib_strcpy(data, store_machCond, leng);
}
void epi_restoreDynMachineConditions(uint8_t *leng, uint8_t *data)
{
*leng=store_machCondLen;
tslib_strcpy(store_machCond, data, store_machCondLen);
}