1 #ifndef _FBT_HCI_OPCODES_H
2 #define _FBT_HCI_OPCODES_H
3 
4 // Opcode Group Field (OGF) codes
5 #define FBT_HCI_OGF_LINK_CONTROL                      			0x01	// Link control group
6 #define FBT_HCI_OGF_LINK_POLICY                       			0x02	// Link polic group
7 #define FBT_HCI_OGF_CONTROL_BASEBAND                  			0x03	// Host Controller & Baseband group
8 #define FBT_HCI_OGF_INFORMATIONAL_PARAMETERS          			0x04	// Information parameters group
9 #define FBT_HCI_OGF_STATUS_PARAMETERS                 			0x05	// Status parameters group
10 #define FBT_HCI_OGF_TESTING                           			0x06	// Test group
11 
12 // Opcode Command Field (OCF) codes
13 // Link control commands
14 #define FBT_HCI_OCF_INQUIRY                                   	0x0001
15 #define FBT_HCI_OCF_INQUIRY_CANCEL                            	0x0002
16 #define FBT_HCI_OCF_PERIODIC_INQUIRY_MODE                     	0x0003
17 #define FBT_HCI_OCF_EXIT_PERIODIC_INQUIRY_MODE                	0x0004
18 #define FBT_HCI_OCF_CREATE_CONNECTION                         	0x0005
19 #define FBT_HCI_OCF_DISCONNECT                                	0x0006
20 #define FBT_HCI_OCF_ADD_SCO_CONNECTION                        	0x0007
21 
22 #define FBT_HCI_OCF_ACCEPT_CONNECTION_REQUEST                 	0x0009
23 #define FBT_HCI_OCF_REJECT_CONNECTION_REQUEST                 	0x000A
24 #define FBT_HCI_OCF_LINK_KEY_REQUEST_REPLY                    	0x000B
25 #define FBT_HCI_OCF_LINK_KEY_REQUEST_NEGATIVE_REPLY           	0x000C
26 #define FBT_HCI_OCF_PIN_CODE_REQUEST_REPLY                    	0x000D
27 #define FBT_HCI_OCF_PIN_CODE_REQUEST_NEGATIVE_REPLY           	0x000E
28 #define FBT_HCI_OCF_CHANGE_CONNECTION_PACKET_TYPE             	0x000F
29 
30 #define FBT_HCI_OCF_AUTHENTICATION_REQUESTED                  	0x0011
31 #define FBT_HCI_OCF_SET_CONNECTION_ENCRYPTION                 	0x0013
32 #define FBT_HCI_OCF_CHANGE_CONNECTION_LINK_KEY                	0x0015
33 #define FBT_HCI_OCF_MASTER_LINK_KEY                           	0x0017
34 #define FBT_HCI_OCF_REMOTE_NAME_REQUEST                       	0x0019
35 #define FBT_HCI_OCF_READ_REMOTE_SUPPORTED_FEATURES            	0x001B
36 #define FBT_HCI_OCF_READ_REMOTE_VERSION_INFORMATION           	0x001D
37 #define FBT_HCI_OCF_READ_CLOCK_OFFSET                         	0x001F
38 
39 // Link policy commands
40 #define FBT_HCI_OCF_HOLD_MODE                                 	0x0001
41 #define FBT_HCI_OCF_SNIFF_MODE                                	0x0003
42 #define FBT_HCI_OCF_EXIT_SNIFF_MODE                           	0x0004
43 #define FBT_HCI_OCF_PARK_MODE                                 	0x0005
44 #define FBT_HCI_OCF_EXIT_PARK_MODE                            	0x0006
45 #define FBT_HCI_OCF_QOS_SETUP                                 	0x0007
46 #define FBT_HCI_OCF_ROLE_DISCOVERY                            	0x0009
47 #define FBT_HCI_OCF_SWITCH_ROLE                               	0x000B
48 #define FBT_HCI_OCF_READ_LINK_POLICY_SETTINGS                 	0x000C
49 #define FBT_HCI_OCF_WRITE_LINK_POLICY_SETTINGS                	0x000D
50 
51 // Host controller & baseband commands
52 #define FBT_HCI_OCF_SET_EVENT_MASK                            	0x0001
53 #define FBT_HCI_OCF_RESET                                     	0x0003
54 #define FBT_HCI_OCF_SET_EVENT_FILTER                          	0x0005
55 #define FBT_HCI_OCF_FLUSH                                     	0x0008
56 #define FBT_HCI_OCF_READ_PIN_TYPE                             	0x0009
57 #define FBT_HCI_OCF_WRITE_PIN_TYPE                            	0x000A
58 #define FBT_HCI_OCF_CREATE_NEW_UNIT_KEY                       	0x000B
59 #define FBT_HCI_OCF_READ_STORED_LINK_KEY                      	0x000D
60 #define FBT_HCI_OCF_WRITE_STORED_LINK_KEY                     	0x0011
61 #define FBT_HCI_OCF_DELETE_STORED_LINK_KEY                    	0x0012
62 #define FBT_HCI_OCF_CHANGE_LOCAL_NAME                         	0x0013
63 #define FBT_HCI_OCF_READ_LOCAL_NAME                           	0x0014
64 #define FBT_HCI_OCF_READ_CONNECTION_ACCEPT_TIMEOUT            	0x0015
65 #define FBT_HCI_OCF_WRITE_CONNECTION_ACCEPT_TIMEOUT			  	0x0016
66 #define FBT_HCI_OCF_READ_PAGE_TIMEOUT                         	0x0017
67 #define FBT_HCI_OCF_WRITE_PAGE_TIMEOUT                        	0x0018
68 #define FBT_HCI_OCF_READ_SCAN_ENABLE                          	0x0019
69 #define FBT_HCI_OCF_WRITE_SCAN_ENABLE                         	0x001A
70 #define FBT_HCI_OCF_READ_PAGE_SCAN_ACTIVITY                   	0x001B
71 #define FBT_HCI_OCF_WRITE_PAGE_SCAN_ACTIVITY                  	0x001C
72 #define FBT_HCI_OCF_READ_INQUIRY_SCAN_ACTIVITY                	0x001D
73 #define FBT_HCI_OCF_WRITE_INQUIRY_SCAN_ACTIVITY               	0x001E
74 #define FBT_HCI_OCF_READ_AUTHENTICATION_ENABLE                	0x001F
75 #define FBT_HCI_OCF_WRITE_AUTHENTICATION_ENABLE               	0x0020
76 #define FBT_HCI_OCF_READ_ENCRYPTION_MODE                      	0x0021
77 #define FBT_HCI_OCF_WRITE_ENCRYPTION_MODE                     	0x0022
78 #define FBT_HCI_OCF_READ_CLASS_OF_DEVICE                      	0x0023
79 #define FBT_HCI_OCF_WRITE_CLASS_OF_DEVICE                     	0x0024
80 #define FBT_HCI_OCF_READ_VOICE_SETTING                        	0x0025
81 #define FBT_HCI_OCF_WRITE_VOICE_SETTING                       	0x0026
82 #define FBT_HCI_OCF_READ_AUTOMATIC_FLUSH_TIMEOUT              	0x0027
83 #define FBT_HCI_OCF_WRITE_AUTOMATIC_FLUSH_TIMEOUT             	0x0028
84 #define FBT_HCI_OCF_READ_NUM_BROADCAST_RETRANSMISSIONS        	0x0029
85 #define FBT_HCI_OCF_WRITE_NUM_BROADCAST_RETRANSMISSIONS       	0x002A
86 #define FBT_HCI_OCF_READ_HOLD_MODE_ACTIVITY                   	0x002B
87 #define FBT_HCI_OCF_WRITE_HOLD_MODE_ACTIVITY                  	0x002C
88 #define FBT_HCI_OCF_READ_TRANSMIT_POWER_LEVEL                 	0x002D
89 #define FBT_HCI_OCF_READ_SCO_FLOW_CONTROL_ENABLE              	0x002E
90 #define FBT_HCI_OCF_WRITE_SCO_FLOW_CONTROL_ENABLE             	0x002F
91 #define FBT_HCI_OCF_SET_HOST_CONTROLLER_TO_HOST_FLOW_CONTROL  	0x0031
92 #define FBT_HCI_OCF_HOST_BUFFER_SIZE                          	0x0033
93 #define FBT_HCI_OCF_HOST_NUMBER_OF_COMPLETED_PACKETS          	0x0035
94 #define FBT_HCI_OCF_READ_LINK_SUPERVISION_TIMEOUT             	0x0036
95 #define FBT_HCI_OCF_WRITE_LINK_SUPERVISION_TIMEOUT            	0x0037
96 #define FBT_HCI_OCF_READ_NUMBER_OF_SUPPORTED_IAC              	0x0038
97 #define FBT_HCI_OCF_READ_CURRENT_IAC_LAP                      	0x0039
98 #define FBT_HCI_OCF_WRITE_CURRENT_IAC_LAP                     	0x003A
99 #define FBT_HCI_OCF_READ_PAGE_SCAN_PERIOD_MODE                	0x003B
100 #define FBT_HCI_OCF_WRITE_PAGE_SCAN_PERIOD_MODE               	0x003C
101 #define FBT_HCI_OCF_READ_PAGE_SCAN_MODE                       	0x003D
102 #define FBT_HCI_OCF_WRITE_PAGE_SCAN_MODE                      	0x003E
103 
104 // Informational parameter commands
105 #define FBT_HCI_OCF_READ_LOCAL_VERSION_INFORMATION            	0x0001
106 #define FBT_HCI_OCF_LOCAL_SUPPPROTED_FEATURES                 	0x0003
107 #define FBT_HCI_OCF_READ_BUFFER_SIZE                          	0x0005
108 #define FBT_HCI_OCF_READ_COUNTRY_CODE                         	0x0007
109 #define FBT_HCI_OCF_READ_BD_ADDR                              	0x0009
110 
111 // Status parameters commands
112 #define FBT_HCI_OCF_READ_FAILED_CONTACT_COUNTER               	0x0001
113 #define FBT_HCI_OCF_RESET_FAILED_CONTACT_COUNTER              	0x0002
114 #define FBT_HCI_OCF_GET_LINK_QUALITY                          	0x0003
115 #define FBT_HCI_OCF_READ_RSSI                                 	0x0005
116 
117 // Test commands
118 #define FBT_HCI_OCF_READ_LOOPBACK_MODE                        	0x0001
119 #define FBT_HCI_OCF_WRITE_LOOPBACK_MODE                       	0x0002
120 #define FBT_HCI_OCF_ENABLE_DEVICE_UNDER_TEST_MODE             	0x0003
121 
122 #define FBT_HCI_OGF_FROM_COMMAND(cmd)							(cmd>>10)
123 #define FBT_HCI_OCF_FROM_COMMAND(cmd)							(cmd&0x3FF)
124 
125 #endif // _FBT_HCI_OPCODES_H
126