Add master device Host demo makefile.
[pub/lufa.git] / Demos / Host / Incomplete / BluetoothHost / BluetoothACLPackets.h
diff --git a/Demos/Host/Incomplete/BluetoothHost/BluetoothACLPackets.h b/Demos/Host/Incomplete/BluetoothHost/BluetoothACLPackets.h
new file mode 100644 (file)
index 0000000..20c6cca
--- /dev/null
@@ -0,0 +1,121 @@
+/*\r
+             LUFA Library\r
+     Copyright (C) Dean Camera, 2009.\r
+              \r
+  dean [at] fourwalledcubicle [dot] com\r
+      www.fourwalledcubicle.com\r
+*/\r
+\r
+/*\r
+  Copyright 2009  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
+\r
+  Permission to use, copy, modify, and distribute this software\r
+  and its documentation for any purpose and without fee is hereby\r
+  granted, provided that the above copyright notice appear in all\r
+  copies and that both that the copyright notice and this\r
+  permission notice and warranty disclaimer appear in supporting\r
+  documentation, and that the name of the author not be used in\r
+  advertising or publicity pertaining to distribution of the\r
+  software without specific, written prior permission.\r
+\r
+  The author disclaim all warranties with regard to this\r
+  software, including all implied warranties of merchantability\r
+  and fitness.  In no event shall the author be liable for any\r
+  special, indirect or consequential damages or any damages\r
+  whatsoever resulting from loss of use, data or profits, whether\r
+  in an action of contract, negligence or other tortious action,\r
+  arising out of or in connection with the use or performance of\r
+  this software.\r
+*/\r
+\r
+#ifndef _BLUETOOTH_ACLPACKETS_\r
+#define _BLUETOOTH_ACLPACKETS_\r
+\r
+       /* Includes: */\r
+               #include <avr/io.h>\r
+               #include <string.h>\r
+               #include <stdbool.h>\r
+\r
+               #include <LUFA/Drivers/USB/USB.h>\r
+               \r
+               #include "BluetoothStack.h"\r
+               \r
+       /* Macros: */\r
+               #define BLUETOOTH_CHANNEL_SIGNALING              0x0001\r
+               #define BLUETOOTH_CHANNEL_CONNECTIONLESS         0x0002\r
+               \r
+               #define BLUETOOTH_SIGNAL_CONNECTION_REQUEST      0x02\r
+               #define BLUETOOTH_SIGNAL_CONNECTION_RESPONSE     0x03\r
+               #define BLUETOOTH_SIGNAL_CONFIGURATION_REQUEST   0x04\r
+               #define BLUETOOTH_SIGNAL_CONFIGURATION_RESPONSE  0x05\r
+               \r
+               #define BLUETOOTH_CONNECTION_SUCCESSFUL          0x0000\r
+               #define BLUETOOTH_CONNECTION_REFUSED_RESOURCES   0x0004\r
+               \r
+               #define BLUETOOTH_CONFIGURATION_SUCCESSFUL       0x0000\r
+               #define BLUETOOTH_CONFIGURATION_REJECTED         0x0002\r
+               #define BLUETOOTH_CONFIGURATION_UNKNOWNOPTIONS   0x0003\r
+\r
+               \r
+       /* Type Defines: */\r
+               typedef struct\r
+               {\r
+                       uint16_t ConnectionHandle;\r
+                       uint16_t DataLength;\r
+               } Bluetooth_ACL_Header_t;\r
+\r
+               typedef struct\r
+               {\r
+                       uint16_t PayloadLength;\r
+                       uint16_t DestinationChannel;\r
+               } Bluetooth_DataPacket_Header_t;\r
+               \r
+               typedef struct\r
+               {\r
+                       uint8_t  Code;\r
+                       uint8_t  Identifier;\r
+                       uint16_t Length;\r
+               } Bluetooth_SignalCommand_Header_t;\r
+               \r
+               typedef struct\r
+               {\r
+                       uint16_t PSM;\r
+                       uint16_t SourceChannel;\r
+               } Bluetooth_SignalCommand_ConnectionRequest_t;\r
+\r
+               typedef struct\r
+               {\r
+                       uint16_t DestinationChannel;\r
+                       uint16_t SourceChannel;\r
+                       uint16_t Result;\r
+                       uint16_t Status;\r
+               } Bluetooth_SignalCommand_ConnectionResponse_t;\r
+               \r
+               typedef struct\r
+               {\r
+                       uint16_t DestinationChannel;\r
+                       uint16_t Flags;\r
+                       uint8_t  Options[];\r
+               } Bluetooth_SignalCommand_ConfigurationRequest_t;\r
+\r
+               typedef struct\r
+               {\r
+                       uint16_t SourceChannel;\r
+                       uint16_t Flags;\r
+                       uint16_t Result;\r
+                       uint8_t  Config;\r
+               } Bluetooth_SignalCommand_ConfigurationResponse_t;\r
+               \r
+       /* Function Prototypes: */\r
+               void Bluetooth_ProcessACLPackets(void);\r
+\r
+               #if defined(INCLUDE_FROM_BLUETOOTH_ACLPACKETS_C)\r
+                       static inline void Bluetooth_ProcessSignalPacket_ConnectionRequest(Bluetooth_ACL_Header_t* ACLPacketHeader,\r
+                                                                   Bluetooth_DataPacket_Header_t* DataHeader,\r
+                                                                   Bluetooth_SignalCommand_Header_t* SignalCommandHeader);\r
+                       static inline void Bluetooth_ProcessSignalPacket_ConfigurationRequest(Bluetooth_ACL_Header_t* ACLPacketHeader,\r
+                                                                   Bluetooth_DataPacket_Header_t* DataHeader,\r
+                                                                   Bluetooth_SignalCommand_Header_t* SignalCommandHeader);\r
+               #endif\r
+               \r
+#endif\r