// 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> | |
namespace weave { | |
namespace privet { | |
std::string GetDeviceUiKind(const std::string& manifest_id) { | |
CHECK_EQ(5u, manifest_id.size()); | |
std::string kind = manifest_id.substr(0, 2); | |
if (kind == "AC") | |
return "accessPoint"; | |
if (kind == "AK") | |
return "aggregator"; | |
if (kind == "AM") | |
return "camera"; | |
if (kind == "AB") | |
return "developmentBoard"; | |
if (kind == "AH") | |
return "acHeating"; | |
if (kind == "AI") | |
return "light"; | |
if (kind == "AO") | |
return "lock"; | |
if (kind == "AE") | |
return "printer"; | |
if (kind == "AF") | |
return "scanner"; | |
if (kind == "AD") | |
return "speaker"; | |
if (kind == "AL") | |
return "storage"; | |
if (kind == "AJ") | |
return "toy"; | |
if (kind == "AA") | |
return "vendor"; | |
if (kind == "AN") | |
return "video"; | |
LOG(FATAL) << "Invalid model id: " << manifest_id; | |
return std::string(); | |
} | |
} // namespace privet | |
} // namespace weave |