diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2010-04-11 06:19:58 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2010-04-11 06:19:58 +0000 |
commit | 6cfa3b7db8b5585a8443f457dcb728b65a7f7ffd (patch) | |
tree | 6a025eed9d7e5054a7f86433e94271d91d5dea83 /Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothHCICommands.h | |
parent | 26421b38cd59191cd42d8e6f0d1499c3775e75d7 (diff) | |
download | lufa-6cfa3b7db8b5585a8443f457dcb728b65a7f7ffd.tar.gz lufa-6cfa3b7db8b5585a8443f457dcb728b65a7f7ffd.tar.bz2 lufa-6cfa3b7db8b5585a8443f457dcb728b65a7f7ffd.zip |
Add HCI debugging with verbosity control to the BluetoothHost demo.
Add Link Key Request event processing so that paired devices always re-authenticate until appropriate link key store/retrieve callbacks are implemented.
Diffstat (limited to 'Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothHCICommands.h')
-rw-r--r-- | Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothHCICommands.h | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothHCICommands.h b/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothHCICommands.h index 9c1adf0f4..6a241eaa3 100644 --- a/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothHCICommands.h +++ b/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothHCICommands.h @@ -42,6 +42,9 @@ #include "BluetoothClassCodes.h"
/* Macros: */
+ #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 1
+
#define OGF_LINK_CONTROL 0x01
#define OGF_CTRLR_BASEBAND 0x03
#define OGF_CTRLR_INFORMATIONAL 0x04
@@ -79,6 +82,7 @@ #define EVENT_DISCONNECTION_COMPLETE 0x05
#define EVENT_REMOTE_NAME_REQUEST_COMPLETE 0x07
#define EVENT_PIN_CODE_REQUEST 0x16
+ #define EVENT_LINK_KEY_REQUEST 0x17
#define ERROR_LIMITED_RESOURCES 0x0D
#define ERROR_UNACCEPTABLE_BDADDR 0x0F
@@ -142,18 +146,16 @@ {
uint8_t RemoteAddress[6];
} BT_HCIEvent_PinCodeReq_t;
-
+
typedef struct
{
uint8_t RemoteAddress[6];
- uint8_t SlaveRole;
- } BT_HCICommand_AcceptConnectionReq_t;
-
+ } BT_HCIEvent_LinkKeyReq_t;
+
typedef struct
{
uint8_t RemoteAddress[6];
- uint8_t Reason;
- } BT_HCICommand_RejectConnectionReq_t;
+ } BT_HCICommand_LinkKeyNAKResp_t;
typedef struct
{
@@ -162,6 +164,18 @@ char PINCode[16];
} BT_HCICommand_PinCodeResp_t;
+ typedef struct
+ {
+ uint8_t RemoteAddress[6];
+ uint8_t SlaveRole;
+ } BT_HCICommand_AcceptConnectionReq_t;
+
+ typedef struct
+ {
+ uint8_t RemoteAddress[6];
+ uint8_t Reason;
+ } BT_HCICommand_RejectConnectionReq_t;
+
/* Enums: */
enum BT_ScanEnable_Modes_t
{
@@ -182,6 +196,7 @@ Bluetooth_Conn_AcceptConnection = 6,
Bluetooth_Conn_RejectConnection = 7,
Bluetooth_Conn_SendPINCode = 8,
+ Bluetooth_Conn_SendLinkKeyNAK = 9,
};
/* External Variables: */
@@ -191,7 +206,8 @@ void Bluetooth_HCITask(void);
#if defined(INCLUDE_FROM_BLUETOOTHHCICOMMANDS_C)
- static uint8_t Bluetooth_SendHCICommand(void* Parameters, uint16_t ParameterLength);
+ static uint8_t Bluetooth_SendHCICommand(BT_HCICommand_Header_t* HCICommandHeader, void* Parameters,
+ uint16_t ParameterLength);
#endif
#endif
|