From bd88ac97072aa936effb9b87f859383b375e1b73 Mon Sep 17 00:00:00 2001 From: Oliver Ruiz Dorantes Date: Sat, 21 Mar 2009 21:18:51 +0000 Subject: [PATCH] - Move and implement some helper functions to a non private header(revision version etc) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29637 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/os/bluetooth/HCI/btHCI_command.h | 13 +++++++++---- headers/private/bluetooth/CommandManager.h | 4 ---- src/kits/bluetooth/CommandManager.cpp | 18 ++++++++++++++++++ 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/headers/os/bluetooth/HCI/btHCI_command.h b/headers/os/bluetooth/HCI/btHCI_command.h index 475ce8ba50..2560b5afd5 100644 --- a/headers/os/bluetooth/HCI/btHCI_command.h +++ b/headers/os/bluetooth/HCI/btHCI_command.h @@ -10,6 +10,11 @@ #define HCI_COMMAND_HDR_SIZE 3 +const char* GetCommand(uint16 command); +const char* GetManufacturer(uint16 manufacturer); +const char* GetHciVersion(uint16 ver); +const char* GetLmpVersion(uint16 ver); + struct hci_command_header { uint16 opcode; /* OCF & OGF */ uint8 clen; @@ -28,11 +33,11 @@ struct hci_command_header { #define OCF_READ_LOCAL_VERSION 0x0001 struct hci_rp_read_loc_version { uint8 status; - uint8 hci_ver; - uint16 hci_rev; - uint8 lmp_ver; + uint8 hci_version; + uint16 hci_revision; + uint8 lmp_version; uint16 manufacturer; - uint16 lmp_subver; + uint16 lmp_subversion; } __attribute__ ((packed)); #define OCF_READ_LOCAL_FEATURES 0x0003 diff --git a/headers/private/bluetooth/CommandManager.h b/headers/private/bluetooth/CommandManager.h index f8edce996c..b32aaeacfc 100644 --- a/headers/private/bluetooth/CommandManager.h +++ b/headers/private/bluetooth/CommandManager.h @@ -53,10 +53,6 @@ private: struct hci_command_header* fHeader; }; - -const char* GetCommand(uint16 command); -const char* GetManufacturer(uint16 manufacturer); - /* CONTROL BASEBAND */ void* buildReset(size_t* outsize); void* buildReadLocalName(size_t* outsize); diff --git a/src/kits/bluetooth/CommandManager.cpp b/src/kits/bluetooth/CommandManager.cpp index f4c4d50fb1..92f54fb458 100644 --- a/src/kits/bluetooth/CommandManager.cpp +++ b/src/kits/bluetooth/CommandManager.cpp @@ -548,6 +548,24 @@ const char* testingCommands[] = { }; +const char* hciVersion[] = { "1.0B" , "1.1 " , "1.2 " , "2.0 "}; +const char* lmpVersion[] = { "1.0 " , "1.1 " , "1.2 " , "2.0 "}; + + +const char* +GetHciVersion(uint16 ver) +{ + return hciVersion[ver]; +} + + +const char* +GetLmpVersion(uint16 ver) +{ + return lmpVersion[ver]; +} + + const char* GetCommand(uint16 command) {