// Copyright 2015 The Weave Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef LIBWEAVE_INCLUDE_WEAVE_SETTINGS_H_ #define LIBWEAVE_INCLUDE_WEAVE_SETTINGS_H_ #include #include #include namespace weave { // Scopes in order of increasing privileges. enum class AuthScope { kNone, kViewer, kUser, kManager, kOwner, }; // Type client-device pairing. enum class PairingType { kPinCode, kEmbeddedCode, }; struct Settings { // Model specific information. Must be set by ConfigStore::LoadDefaults. std::string firmware_version; std::string serial_number; std::string oem_name; std::string model_name; std::string model_id; // Basic device information. Must be set from ConfigStore::LoadDefaults. std::string name; std::string description; std::string location; // OAuth 2.0 related options. Must be set from ConfigStore::LoadDefaults. std::string api_key; std::string client_id; std::string client_secret; // Options mirrored into "base" state. // Maximum role for local anonymous user. AuthScope local_anonymous_access_role{AuthScope::kViewer}; // If true, allows local pairing using Privet API, including mDNS. bool local_access_enabled{true}; // Set of pairing modes supported by device. std::set pairing_modes; // Embedded code. Will be used only if pairing_modes contains kEmbeddedCode. std::string embedded_code; // Optional cloud information. Can be used for testing or debugging. std::string oauth_url; std::string service_url; std::string xmpp_endpoint; // Cloud ID of the registered device. Empty if device is not registered. std::string cloud_id; // Local device id. std::string device_id; // Internal options to tweak some library functionality. External code should // avoid using them. bool allow_endpoints_override{false}; bool wifi_auto_setup_enabled{true}; std::string test_privet_ssid; }; } // namespace weave #endif // LIBWEAVE_INCLUDE_WEAVE_SETTINGS_H_