diff --git a/ba/ba1500.h b/ba/ba1500.h index ffba3ed2d..94c52b67b 100755 --- a/ba/ba1500.h +++ b/ba/ba1500.h @@ -1,60 +1,10 @@ #ifndef __BA1500_H__ #define __BA1500_H__ -#ifndef __STRINGS_H -#include +#ifndef __DONGLE_H +#include #endif -class TDongle : public TObject -{ -public: - enum KeyType { _user_key, _aga_key, _prassi_key, _procom_key }; - -private: - word _serno, _max_users, _year_assist; - KeyType _type; - word _eprom[64]; - TDate _last_update; - -#if XVT_OS == XVT_OS_SCOUNIX - word _port; -#endif - - TBit_array _module; - bool _dirty; - -protected: - bool already_programmed() const; - bool write_octect(word reg, word data[4]) const; - -public: - - bool login(bool test_all_keys = FALSE); - bool logout(); - - word number() const { return _serno; } - bool ok() const { return _serno != 0xFFFF; } - word max_users() const { return _max_users; } - word year_assist() const { return _year_assist; } - - void garble(word data[4]) const; - - KeyType type() const { return _type; } - - bool active(word module) const { return _module[module]; } - void activate(word module, bool on = TRUE) { _module.set(module, on); _dirty = TRUE; } - void deactivate(word module) { activate(module, FALSE); } - void set_max_users(word u) { _max_users = u; _dirty = TRUE; } - void set_year_assist(word y) { _year_assist = y; _dirty = TRUE; } - const TDate& last_update() const { return _last_update; } - - bool dirty() const { return _dirty; } - bool burn(); - - TDongle(); - virtual ~TDongle() { logout(); } -}; - const int MAX_AUT = 48 * 3; class TInformazione_moduli : public TObject @@ -70,8 +20,8 @@ public: const char* get_description(int module); const char* get_name(int module); int get_index(int module); - TDongle::KeyType get_owner(int module) const; - bool test_owner(int module, TDongle::KeyType owner) const; + TDongleType get_owner(int module) const; + bool test_owner(int module, TDongleType owner) const; int unassigned() const { return _unassigned_modules; } int items() const { return _infos.items(); } TInformazione_moduli();