Firmware.hh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // Copyright (C) 2014 Michael McMaster <michael@codesrc.com>
  2. //
  3. // This file is part of SCSI2SD.
  4. //
  5. // SCSI2SD is free software: you can redistribute it and/or modify
  6. // it under the terms of the GNU General Public License as published by
  7. // the Free Software Foundation, either version 3 of the License, or
  8. // (at your option) any later version.
  9. //
  10. // SCSI2SD is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. // GNU General Public License for more details.
  14. //
  15. // You should have received a copy of the GNU General Public License
  16. // along with SCSI2SD. If not, see <http://www.gnu.org/licenses/>.
  17. #ifndef Firmware_HH
  18. #define Firmware_HH
  19. #if __cplusplus >= 201103L
  20. #include <cstdint>
  21. #else
  22. #include <stdint.h>
  23. #endif
  24. #include <string>
  25. namespace SCSI2SD
  26. {
  27. //
  28. // Warning: The Cypress API (used by the Firmware class) uses global data and
  29. // is NOT thread safe.
  30. //
  31. class Firmware
  32. {
  33. public:
  34. Firmware(const std::string& path);
  35. ~Firmware();
  36. uint64_t siliconId() const { return mySiliconId; }
  37. int siliconRev() const { return mySiliconRev; }
  38. int totalFlashRows() const { return myTotalFlashRows; }
  39. private:
  40. uint64_t mySiliconId;
  41. int mySiliconRev;
  42. int myTotalFlashRows;
  43. };
  44. } // namespace
  45. #endif