1 // Copyright 2023 The Pigweed Authors 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); you may not 4 // use this file except in compliance with the License. You may obtain a copy of 5 // the License at 6 // 7 // https://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 // License for the specific language governing permissions and limitations under 13 // the License. 14 15 #pragma once 16 #include <string> 17 18 #include "pw_bluetooth_sapphire/internal/host/hci-spec/protocol.h" 19 20 namespace bt::hci_spec { 21 22 // Helper functions to convert HCI data types to library objects. 23 24 // Returns a user-friendly string representation of |version|. 25 std::string HCIVersionToString( 26 pw::bluetooth::emboss::CoreSpecificationVersion version); 27 28 // Returns a user-friendly string representation of |status|. 29 std::string StatusCodeToString(pw::bluetooth::emboss::StatusCode code); 30 31 // Returns a user-friendly string representation of |link_type|. 32 const char* LinkTypeToString(pw::bluetooth::emboss::LinkType link_type); 33 34 // Returns a user-friendly string representation of |key_type|. 35 const char* LinkKeyTypeToString(hci_spec::LinkKeyType key_type); 36 37 // Returns a user-friendly string representation of |role|. 38 std::string ConnectionRoleToString(pw::bluetooth::emboss::ConnectionRole role); 39 40 } // namespace bt::hci_spec 41