aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothHCICommands.h
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-04-22 14:08:00 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-04-22 14:08:00 +0000
commit5993e1efe789418e3773d37aae119f48093a3439 (patch)
tree347f581dc48d44e74970c7627d6dfc60810866b4 /Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothHCICommands.h
parent8252b4febd928718c4b416d7be262afa6a39075f (diff)
downloadlufa-5993e1efe789418e3773d37aae119f48093a3439.tar.gz
lufa-5993e1efe789418e3773d37aae119f48093a3439.tar.bz2
lufa-5993e1efe789418e3773d37aae119f48093a3439.zip
Added ability to search by Channel PSM to the GetChannelData() function in the BluetoothHost demo.
Added new HCI states to properly initialize the bluetooth dongle and retrieve the local BDADDR. Factored out Bluetooth state information into a new state structure for easy reference in the user application. Added new StackInitialized() Bluetooth stack callback function.
Diffstat (limited to 'Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothHCICommands.h')
-rw-r--r--Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothHCICommands.h49
1 files changed, 20 insertions, 29 deletions
diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothHCICommands.h b/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothHCICommands.h
index 282fcbc7f..6682619b3 100644
--- a/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothHCICommands.h
+++ b/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothHCICommands.h
@@ -47,9 +47,9 @@
#define BT_HCI_DEBUG(l, s, ...) do { if (HCI_DEBUG_LEVEL >= l) printf_P(PSTR("(HCI) " s "\r\n"), ##__VA_ARGS__); } while (0)
#define HCI_DEBUG_LEVEL 0
- #define OGF_LINK_CONTROL 0x01
- #define OGF_CTRLR_BASEBAND 0x03
- #define OGF_CTRLR_INFORMATIONAL 0x04
+ #define OGF_LINK_CONTROL (0x01 << 10)
+ #define OGF_CTRLR_BASEBAND (0x03 << 10)
+ #define OGF_CTRLR_INFORMATIONAL (0x04 << 10)
#define OCF_LINK_CONTROL_INQUIRY 0x0001
#define OCF_LINK_CONTROL_INQUIRY_CANCEL 0x0002
@@ -75,7 +75,8 @@
#define OCF_CTRLR_BASEBAND_WRITE_CLASS_OF_DEVICE 0x0024
#define OCF_CTRLR_BASEBAND_WRITE_SIMPLE_PAIRING_MODE 0x0056
#define OCF_CTRLR_BASEBAND_WRITE_AUTHENTICATION_ENABLE 0x0020
- #define OGF_CTRLR_INFORMATIONAL_READBUFFERSIZE 0x0005
+ #define OCF_CTRLR_INFORMATIONAL_READBUFFERSIZE 0x0005
+ #define OCF_CTRLR_INFORMATIONAL_READBDADDR 0x0009
#define EVENT_COMMAND_STATUS 0x0F
#define EVENT_COMMAND_COMPLETE 0x0E
@@ -92,12 +93,7 @@
/* Type Defines: */
typedef struct
{
- struct
- {
- int OCF : 10;
- int OGF : 6;
- } OpCode;
-
+ uint16_t OpCode;
uint8_t ParameterLength;
uint8_t Parameters[];
} BT_HCICommand_Header_t;
@@ -110,19 +106,14 @@
typedef struct
{
- uint8_t Status;
- uint8_t Packets;
-
- struct
- {
- int OCF : 10;
- int OGF : 6;
- } OpCode;
+ uint8_t Status;
+ uint8_t Packets;
+ uint16_t OpCode;
} BT_HCIEvent_CommandStatus_t;
typedef struct
{
- uint8_t HCLPacketsAllowable;
+ uint8_t HCIPacketsAllowable;
uint16_t Opcode;
uint8_t ReturnParams[];
} BT_HCIEvent_CommandComplete_t;
@@ -192,18 +183,18 @@
Bluetooth_ProcessEvents = 0,
Bluetooth_Init = 1,
Bluetooth_Init_Reset = 2,
- Bluetooth_Init_SetLocalName = 3,
- Bluetooth_Init_SetDeviceClass = 4,
- Bluetooth_Init_WriteScanEnable = 5,
- Bluetooth_Conn_AcceptConnection = 6,
- Bluetooth_Conn_RejectConnection = 7,
- Bluetooth_Conn_SendPINCode = 8,
- Bluetooth_Conn_SendLinkKeyNAK = 9,
+ Bluetooth_Init_ReadBufferSize = 3,
+ Bluetooth_Init_GetBDADDR = 4,
+ Bluetooth_Init_SetLocalName = 5,
+ Bluetooth_Init_SetDeviceClass = 6,
+ Bluetooth_Init_WriteScanEnable = 7,
+ Bluetooth_Init_FinalizeInit = 8,
+ Bluetooth_Conn_AcceptConnection = 9,
+ Bluetooth_Conn_RejectConnection = 10,
+ Bluetooth_Conn_SendPINCode = 11,
+ Bluetooth_Conn_SendLinkKeyNAK = 12,
};
- /* External Variables: */
- extern uint8_t Bluetooth_HCIProcessingState;
-
/* Function Prototypes: */
void Bluetooth_HCITask(void);