Vitaly Buka | 87eb788 | 2015-10-27 22:23:49 -0700 | [diff] [blame] | 1 | // Copyright 2015 The Weave 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 | |
| 5 | #include "src/privet/device_ui_kind.h" |
| 6 | |
| 7 | #include <base/logging.h> |
| 8 | |
| 9 | namespace weave { |
| 10 | namespace privet { |
| 11 | |
| 12 | std::string GetDeviceUiKind(const std::string& manifest_id) { |
| 13 | CHECK_EQ(5u, manifest_id.size()); |
| 14 | std::string kind = manifest_id.substr(0, 2); |
| 15 | if (kind == "AC") |
| 16 | return "accessPoint"; |
| 17 | if (kind == "AK") |
| 18 | return "aggregator"; |
| 19 | if (kind == "AM") |
| 20 | return "camera"; |
| 21 | if (kind == "AB") |
| 22 | return "developmentBoard"; |
Paul Westbrook | 149ae6f | 2015-11-13 11:59:30 -0800 | [diff] [blame] | 23 | if (kind == "AH") |
| 24 | return "acHeating"; |
| 25 | if (kind == "AI") |
| 26 | return "light"; |
| 27 | if (kind == "AO") |
| 28 | return "lock"; |
Vitaly Buka | 87eb788 | 2015-10-27 22:23:49 -0700 | [diff] [blame] | 29 | if (kind == "AE") |
| 30 | return "printer"; |
| 31 | if (kind == "AF") |
| 32 | return "scanner"; |
| 33 | if (kind == "AD") |
| 34 | return "speaker"; |
| 35 | if (kind == "AL") |
| 36 | return "storage"; |
| 37 | if (kind == "AJ") |
| 38 | return "toy"; |
| 39 | if (kind == "AA") |
| 40 | return "vendor"; |
| 41 | if (kind == "AN") |
| 42 | return "video"; |
| 43 | LOG(FATAL) << "Invalid model id: " << manifest_id; |
| 44 | return std::string(); |
| 45 | } |
| 46 | |
| 47 | } // namespace privet |
| 48 | } // namespace weave |