| // 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. |
| #include "src/privet/device_ui_kind.h" |
| #include <base/logging.h> |
| std::string GetDeviceUiKind(const std::string& manifest_id) { |
| // Map of device short id to ui device kind |
| static const std::unordered_map<std::string, std::string> device_kind_map = { |
| {"AB", "developmentBoard"}, |
| CHECK_EQ(5u, manifest_id.size()); |
| std::string short_id = manifest_id.substr(0, 2); |
| auto iter = device_kind_map.find(short_id); |
| if (iter != device_kind_map.end()) |
| LOG(FATAL) << "Invalid model id: " << manifest_id; |