cast_sys_info.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // Copyright 2015 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef CHROMECAST_PUBLIC_CAST_SYS_INFO_H_
  5. #define CHROMECAST_PUBLIC_CAST_SYS_INFO_H_
  6. #include <string>
  7. #include <vector>
  8. #include "chromecast_export.h" // NOLINT(build/include)
  9. namespace chromecast {
  10. // Pure abstract interface for system information which is accessed by other
  11. // processes as well as cast_shell browser process. All information should be
  12. // immutable.
  13. // It should be possible to instantiate multiple instances of CastSysInfo and
  14. // should be able to be instantiated at any point in the startup process. Other
  15. // processes must be able to create an instance of CastSysInfo.
  16. class CastSysInfo {
  17. public:
  18. enum BuildType {
  19. BUILD_ENG,
  20. BUILD_BETA,
  21. BUILD_PRODUCTION,
  22. };
  23. virtual ~CastSysInfo() {}
  24. // Returns the system build type.
  25. virtual BuildType GetBuildType() = 0;
  26. // Returns release channel of system.
  27. virtual std::string GetSystemReleaseChannel() = 0;
  28. // Returns serial number of the device.
  29. virtual std::string GetSerialNumber() = 0;
  30. // Returns product code name of the device.
  31. virtual std::string GetProductName() = 0;
  32. // Returns product sku code name of the device.
  33. static CHROMECAST_EXPORT std::string GetProductSkuName(
  34. CastSysInfo* cast_sys_info) __attribute__((__weak__));
  35. // Returns model name of device (eg: Chromecast, Nexus Player, ...).
  36. virtual std::string GetDeviceModel() = 0;
  37. // Returns the board's name.
  38. virtual std::string GetBoardName() = 0;
  39. // Returns the revision of board (eg: 514, ...).
  40. virtual std::string GetBoardRevision() = 0;
  41. // Returns device manufacturer (eg: Google, ...).
  42. virtual std::string GetManufacturer() = 0;
  43. // Returns the system's build number (eg: 100, 20000 ...).
  44. // This describes system version which may be different with
  45. // CAST_BUILD_NUMBER.
  46. virtual std::string GetSystemBuildNumber() = 0;
  47. // Returns signing epoch time.
  48. static CHROMECAST_EXPORT std::string GetSigningEpoch()
  49. __attribute__((__weak__));
  50. // Returns default country and locale baked from the factory.
  51. virtual std::string GetFactoryCountry() = 0;
  52. // Returns arbitrary number of factory locales, should return {"en-US"} if no
  53. // locales are configured.
  54. virtual std::vector<std::string> GetFactoryLocaleList() = 0;
  55. // Returns the name of the wifi interface used to connect to the internet.
  56. virtual std::string GetWifiInterface() = 0;
  57. // Returns the name of the software AP interface.
  58. virtual std::string GetApInterface() = 0;
  59. // Returns the setup SSID suffix to use, if configured, an empty string
  60. // otherwise.
  61. virtual std::string GetProductSsidSuffix() = 0;
  62. };
  63. } // namespace chromecast
  64. #endif // CHROMECAST_PUBLIC_CAST_SYS_INFO_H_