- Add Strings for bluetooth events
- Use then in bluetooth server output git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29750 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#define HCI_COMMAND_HDR_SIZE 3
|
||||
|
||||
const char* GetCommand(uint16 command);
|
||||
const char* GetEvent(uint8 event);
|
||||
const char* GetManufacturer(uint16 manufacturer);
|
||||
const char* GetHciVersion(uint16 ver);
|
||||
const char* GetLmpVersion(uint16 ver);
|
||||
|
||||
@@ -548,6 +548,71 @@ const char* testingCommands[] = {
|
||||
};
|
||||
|
||||
|
||||
const char* bluetoothEvents[] = {
|
||||
"Inquiry Complete",
|
||||
"Inquiry Result",
|
||||
"Conn Complete",
|
||||
"Conn Request",
|
||||
"Disconnection Complete",
|
||||
"Auth Complete",
|
||||
"Remote Name Request Complete",
|
||||
"Encrypt Change",
|
||||
"Change Conn Link Key Complete",
|
||||
"Master Link Key Compl",
|
||||
"Rmt Features",
|
||||
"Rmt Version",
|
||||
"Qos Setup Complete",
|
||||
"Command Complete",
|
||||
"Command Status",
|
||||
"Hardware Error",
|
||||
"Flush Occur",
|
||||
"Role Change",
|
||||
"Num Comp Pkts",
|
||||
"Mode Change",
|
||||
"Return Link Keys",
|
||||
"Pin Code Req",
|
||||
"Link Key Req",
|
||||
"Link Key Notify",
|
||||
"Loopback Command",
|
||||
"Data Buffer Overflow",
|
||||
"Max Slot Change",
|
||||
"Read Clock Offset Compl",
|
||||
"Con Pkt Type Changed",
|
||||
"Qos Violation",
|
||||
"Reserved",
|
||||
"Page Scan Rep Mode Change",
|
||||
"Flow Specification",
|
||||
"Inquiry Result With Rssi",
|
||||
"Remote Extended Features",
|
||||
"Reserved",
|
||||
"Reserved",
|
||||
"Reserved",
|
||||
"Reserved",
|
||||
"Reserved",
|
||||
"Reserved",
|
||||
"Reserved",
|
||||
"Reserved",
|
||||
"Synchronous Connection Completed",
|
||||
"Synchronous Connection Changed",
|
||||
"Reserved",
|
||||
"Extended Inquiry Result",
|
||||
"Encryption Key Refersh Complete",
|
||||
"Io Capability Request",
|
||||
"Io Capability Response",
|
||||
"User Confirmation Request",
|
||||
"User Passkey Request",
|
||||
"Oob Data Request",
|
||||
"Simple Pairing Complete",
|
||||
"Reserved",
|
||||
"Link Supervision Timeout Changed",
|
||||
"Enhanced Flush Complete",
|
||||
"Reserved",
|
||||
"Reserved",
|
||||
"Keypress Notification",
|
||||
"Remote Host Supported Features Notification"
|
||||
};
|
||||
|
||||
|
||||
const char* hciVersion[] = { "1.0B" , "1.1 " , "1.2 " , "2.0 " , "2.1 "};
|
||||
const char* lmpVersion[] = { "1.0 " , "1.1 " , "1.2 " , "2.0 " , "2.1 "};
|
||||
|
||||
@@ -610,6 +675,16 @@ GetCommand(uint16 command)
|
||||
}
|
||||
|
||||
|
||||
const char*
|
||||
GetEvent(uint8 event) {
|
||||
if (event < sizeof(bluetoothEvents)/sizeof(const char*)) {
|
||||
return bluetoothEvents[event-1];
|
||||
} else {
|
||||
return "Event out of Range!";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const char*
|
||||
GetManufacturer(uint16 manufacturer) {
|
||||
if (manufacturer < sizeof(bluetoothManufacturers)/sizeof(const char*)) {
|
||||
@@ -620,4 +695,3 @@ GetManufacturer(uint16 manufacturer) {
|
||||
return "not assigned";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -73,6 +73,9 @@ LocalDeviceImpl::HandleEvent(struct hci_event_header* event)
|
||||
}
|
||||
printf("### \n");
|
||||
|
||||
Output::Instance()->Postf(BLACKBOARD_LD(GetID()),"Incomming %s event\n",
|
||||
GetEvent(event->ecode));
|
||||
|
||||
// Events here might have not been initated by us
|
||||
// TODO: ML mark as handled pass a reply by parameter and reply in common
|
||||
switch (event->ecode) {
|
||||
|
||||
Reference in New Issue
Block a user