#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 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
uint8_t RemoteAddress[6];\r
} BT_HCIEvent_PinCodeReq_t;\r
- \r
+\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
- uint8_t Reason;\r
- } BT_HCICommand_RejectConnectionReq_t;\r
+ } BT_HCICommand_LinkKeyNAKResp_t;\r
\r
typedef struct\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
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
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