projects
/
pub
/
lufa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add HCI debugging with verbosity control to the BluetoothHost demo.
[pub/lufa.git]
/
Demos
/
Host
/
Incomplete
/
BluetoothHost
/
Lib
/
BluetoothHCICommands.h
diff --git
a/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothHCICommands.h
b/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothHCICommands.h
index
9c1adf0
..
6a241ea
100644
(file)
--- a/
Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothHCICommands.h
+++ b/
Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothHCICommands.h
@@
-42,6
+42,9
@@
#include "BluetoothClassCodes.h"
\r
\r
/* Macros: */
\r
#include "BluetoothClassCodes.h"
\r
\r
/* Macros: */
\r
+ #define BT_HCI_DEBUG(l, s, ...) do { if (HCI_DEBUG_LEVEL >= l) printf_P(PSTR("(HCI) " s "\r\n"), __VA_ARGS__); } while (0)
\r
+ #define HCI_DEBUG_LEVEL 1
\r
+
\r
#define OGF_LINK_CONTROL 0x01
\r
#define OGF_CTRLR_BASEBAND 0x03
\r
#define OGF_CTRLR_INFORMATIONAL 0x04
\r
#define OGF_LINK_CONTROL 0x01
\r
#define OGF_CTRLR_BASEBAND 0x03
\r
#define OGF_CTRLR_INFORMATIONAL 0x04
\r
@@
-79,6
+82,7
@@
#define EVENT_DISCONNECTION_COMPLETE 0x05
\r
#define EVENT_REMOTE_NAME_REQUEST_COMPLETE 0x07
\r
#define EVENT_PIN_CODE_REQUEST 0x16
\r
#define EVENT_DISCONNECTION_COMPLETE 0x05
\r
#define EVENT_REMOTE_NAME_REQUEST_COMPLETE 0x07
\r
#define EVENT_PIN_CODE_REQUEST 0x16
\r
+ #define EVENT_LINK_KEY_REQUEST 0x17
\r
\r
#define ERROR_LIMITED_RESOURCES 0x0D
\r
#define ERROR_UNACCEPTABLE_BDADDR 0x0F
\r
\r
#define ERROR_LIMITED_RESOURCES 0x0D
\r
#define ERROR_UNACCEPTABLE_BDADDR 0x0F
\r
@@
-142,18
+146,16
@@
{
\r
uint8_t RemoteAddress[6];
\r
} BT_HCIEvent_PinCodeReq_t;
\r
{
\r
uint8_t RemoteAddress[6];
\r
} BT_HCIEvent_PinCodeReq_t;
\r
-
\r
+
\r
typedef struct
\r
{
\r
uint8_t RemoteAddress[6];
\r
typedef struct
\r
{
\r
uint8_t RemoteAddress[6];
\r
- uint8_t SlaveRole;
\r
- } BT_HCICommand_AcceptConnectionReq_t;
\r
-
\r
+ } BT_HCIEvent_LinkKeyReq_t;
\r
+
\r
typedef struct
\r
{
\r
uint8_t RemoteAddress[6];
\r
typedef struct
\r
{
\r
uint8_t RemoteAddress[6];
\r
- uint8_t Reason;
\r
- } BT_HCICommand_RejectConnectionReq_t;
\r
+ } BT_HCICommand_LinkKeyNAKResp_t;
\r
\r
typedef struct
\r
{
\r
\r
typedef struct
\r
{
\r
@@
-162,6
+164,18
@@
char PINCode[16];
\r
} BT_HCICommand_PinCodeResp_t;
\r
\r
char PINCode[16];
\r
} BT_HCICommand_PinCodeResp_t;
\r
\r
+ typedef struct
\r
+ {
\r
+ uint8_t RemoteAddress[6];
\r
+ uint8_t SlaveRole;
\r
+ } BT_HCICommand_AcceptConnectionReq_t;
\r
+
\r
+ typedef struct
\r
+ {
\r
+ uint8_t RemoteAddress[6];
\r
+ uint8_t Reason;
\r
+ } BT_HCICommand_RejectConnectionReq_t;
\r
+
\r
/* Enums: */
\r
enum BT_ScanEnable_Modes_t
\r
{
\r
/* Enums: */
\r
enum BT_ScanEnable_Modes_t
\r
{
\r
@@
-182,6
+196,7
@@
Bluetooth_Conn_AcceptConnection = 6,
\r
Bluetooth_Conn_RejectConnection = 7,
\r
Bluetooth_Conn_SendPINCode = 8,
\r
Bluetooth_Conn_AcceptConnection = 6,
\r
Bluetooth_Conn_RejectConnection = 7,
\r
Bluetooth_Conn_SendPINCode = 8,
\r
+ Bluetooth_Conn_SendLinkKeyNAK = 9,
\r
};
\r
\r
/* External Variables: */
\r
};
\r
\r
/* External Variables: */
\r
@@
-191,7
+206,8
@@
void Bluetooth_HCITask(void);
\r
\r
#if defined(INCLUDE_FROM_BLUETOOTHHCICOMMANDS_C)
\r
void Bluetooth_HCITask(void);
\r
\r
#if defined(INCLUDE_FROM_BLUETOOTHHCICOMMANDS_C)
\r
- static uint8_t Bluetooth_SendHCICommand(void* Parameters, uint16_t ParameterLength);
\r
+ static uint8_t Bluetooth_SendHCICommand(BT_HCICommand_Header_t* HCICommandHeader, void* Parameters,
\r
+ uint16_t ParameterLength);
\r
#endif
\r
\r
#endif
\r
#endif
\r
\r
#endif
\r