blob: 05e29b9e88e82ce57541ebff4d3ce4cc4f8d65d9 [file] [log] [blame]
// Copyright 2018 The Fuchsia 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 "status.h"
#include "util.h"
namespace bt {
// static
std::string ProtocolErrorTraits<hci::StatusCode>::ToString(
hci::StatusCode ecode) {
return fxl::StringPrintf("%s (HCI %#.2x)", StatusCodeToString(ecode).c_str(),
static_cast<unsigned int>(ecode));
}
namespace hci {
using Base = bt::Status<StatusCode>;
Status::Status(HostError ecode) : Base(ecode) {}
// HCI has a "success" status code which we specially handle while constructing
// a success Status.
Status::Status(hci::StatusCode proto_code)
: Base(proto_code == StatusCode::kSuccess ? Base() : Base(proto_code)) {}
} // namespace hci
} // namespace bt