3 Copyright (C) Dean Camera, 2010.
5 dean [at] fourwalledcubicle [dot] com
6 www.fourwalledcubicle.com
10 Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
21 The author disclaim all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
31 #ifndef _BLUETOOTH_ACLPACKETS_
32 #define _BLUETOOTH_ACLPACKETS_
39 #include <LUFA/Drivers/USB/USB.h>
41 #include "BluetoothStack.h"
44 #define BT_ACL_DEBUG(s, ...) printf_P(PSTR("(ACL) " s "\r\n"), __VA_ARGS__)
45 #define ACL_DEBUG_LEVEL 1
47 #define BLUETOOTH_CHANNEL_SIGNALING 0x0001
48 #define BLUETOOTH_CHANNEL_CONNECTIONLESS 0x0002
50 #define BLUETOOTH_SIGNAL_CONNECTION_REQUEST 0x02
51 #define BLUETOOTH_SIGNAL_CONNECTION_RESPONSE 0x03
52 #define BLUETOOTH_SIGNAL_CONFIGURATION_REQUEST 0x04
53 #define BLUETOOTH_SIGNAL_CONFIGURATION_RESPONSE 0x05
54 #define BLUETOOTH_SIGNAL_DISCONNECTION_REQUEST 0x06
55 #define BLUETOOTH_SIGNAL_DISCONNECTION_RESPONSE 0x07
56 #define BLUETOOTH_SIGNAL_ECHO_REQUEST 0x08
57 #define BLUETOOTH_SIGNAL_ECHO_RESPONSE 0x09
58 #define BLUETOOTH_SIGNAL_INFORMATION_REQUEST 0x0A
59 #define BLUETOOTH_SIGNAL_INFORMATION_RESPONSE 0x0B
61 #define BLUETOOTH_CONNECTION_SUCCESSFUL 0x0000
62 #define BLUETOOTH_CONNECTION_REFUSED_RESOURCES 0x0004
64 #define BLUETOOTH_CONFIGURATION_SUCCESSFUL 0x0000
65 #define BLUETOOTH_CONFIGURATION_REJECTED 0x0002
66 #define BLUETOOTH_CONFIGURATION_UNKNOWNOPTIONS 0x0003
71 uint16_t ConnectionHandle
;
73 } Bluetooth_ACL_Header_t
;
77 uint16_t PayloadLength
;
78 uint16_t DestinationChannel
;
79 } Bluetooth_DataPacket_Header_t
;
86 } Bluetooth_SignalCommand_Header_t
;
91 uint16_t SourceChannel
;
92 } Bluetooth_SignalCommand_ConnectionRequest_t
;
96 uint16_t DestinationChannel
;
97 uint16_t SourceChannel
;
100 } Bluetooth_SignalCommand_ConnectionResponse_t
;
104 uint16_t DestinationChannel
;
105 uint16_t SourceChannel
;
106 } Bluetooth_SignalCommand_DisconnectionRequest_t
;
110 uint16_t DestinationChannel
;
111 uint16_t SourceChannel
;
112 } Bluetooth_SignalCommand_DisconnectionResponse_t
;
116 uint16_t DestinationChannel
;
119 } Bluetooth_SignalCommand_ConfigurationRequest_t
;
123 uint16_t SourceChannel
;
127 } Bluetooth_SignalCommand_ConfigurationResponse_t
;
129 /* Function Prototypes: */
130 void Bluetooth_ProcessACLPackets(void);
132 #if defined(INCLUDE_FROM_BLUETOOTH_ACLPACKETS_C)
133 static inline void Bluetooth_SignalPacket_ConnectionRequest(Bluetooth_ACL_Header_t
* ACLPacketHeader
,
134 Bluetooth_DataPacket_Header_t
* DataHeader
,
135 Bluetooth_SignalCommand_Header_t
* SignalCommandHeader
);
136 static inline void Bluetooth_SignalPacket_EchoRequest(Bluetooth_ACL_Header_t
* ACLPacketHeader
,
137 Bluetooth_DataPacket_Header_t
* DataHeader
,
138 Bluetooth_SignalCommand_Header_t
* SignalCommandHeader
);
139 static inline void Bluetooth_SignalPacket_ConfigurationRequest(Bluetooth_ACL_Header_t
* ACLPacketHeader
,
140 Bluetooth_DataPacket_Header_t
* DataHeader
,
141 Bluetooth_SignalCommand_Header_t
* SignalCommandHeader
);
142 static inline void Bluetooth_SignalPacket_DisconnectionRequest(Bluetooth_ACL_Header_t
* ACLPacketHeader
,
143 Bluetooth_DataPacket_Header_t
* DataHeader
,
144 Bluetooth_SignalCommand_Header_t
* SignalCommandHeader
);