-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathCoinChanger.h
More file actions
73 lines (53 loc) · 1.66 KB
/
CoinChanger.h
File metadata and controls
73 lines (53 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#pragma once
#include "MDBDevice.h"
#define PAYOUT 0x02
#define PAYOUT_STATUS 0x03
#define PAYOUT_VALUE_POLL 0x04
#define SEND_DIAGNOSTIC_STATUS 0x05
class CoinChanger : public MDBDevice
{
public:
CoinChanger(MDBSerial &mdb);
bool Reset();
void Update(unsigned long &change);
bool Dispense(unsigned long value);
void Print();
inline unsigned long GetDispensedValue() { unsigned long val = m_dispensed_value; m_dispensed_value = 0; return val; }
inline unsigned long GetCredit() { return m_credit; }
inline void ClearCredit() { m_credit = 0; }
private:
bool init();
int poll();
bool setup(int it = 0);
void tube_status(int it = 0);
void type(int it = 0);
bool dispense(int coin, int count);
void expansion_identification(int it = 0);
void expansion_feature_enable(int it = 0);
bool expansion_payout(int value);
void expansion_payout_status(int it = 0);
void expansion_payout_value_poll();
void expansion_send_diagnostic_status();
int ADDRESS;
int STATUS;
int DISPENSE;
unsigned int m_acceptedCoins;
unsigned int m_dispenseableCoins;
unsigned long m_credit;
unsigned long m_change;
unsigned long m_value_to_dispense;
unsigned long m_dispensed_value;
char m_coin_scaling_factor;
char m_decimal_places;
unsigned int m_coin_type_routing;
char m_coin_type_credit[16]; //coin value divided by coin scaling factor
unsigned int m_tube_full_status;
char m_tube_status[16];
unsigned long m_software_version;
unsigned long m_optional_features;
bool m_alternative_payout_supported;
bool m_extended_diagnostic_supported;
bool m_manual_fill_and_payout_supported;
bool m_file_transport_layer_supported;
int m_update_count;
};