aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.h
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-04-06 08:14:08 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-04-06 08:14:08 +0000
commitc77f136661ae0fa779c02ef6efeab95aa4b92068 (patch)
treef01814bcc62d2498f733bc954c364283c0b721aa /Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.h
parentb9c7d196152652df918a822522061c3fe193d273 (diff)
downloadlufa-c77f136661ae0fa779c02ef6efeab95aa4b92068.tar.gz
lufa-c77f136661ae0fa779c02ef6efeab95aa4b92068.tar.bz2
lufa-c77f136661ae0fa779c02ef6efeab95aa4b92068.zip
Add bidirectional channel configuration -- remote device is not ACKing sent Configuration Requests, needs further debugging. Implement Bluetooth spec's channel states.
Use abbreviations for the structure and function names where possible to try to cut down on the code verbosity.
Diffstat (limited to 'Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.h')
-rw-r--r--Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.h60
1 files changed, 31 insertions, 29 deletions
diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.h b/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.h
index f6f8f769d..6038ea40e 100644
--- a/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.h
+++ b/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.h
@@ -42,7 +42,7 @@
/* Macros: */
#define BT_ACL_DEBUG(s, ...) printf_P(PSTR("(ACL) " s "\r\n"), __VA_ARGS__)
- #define ACL_DEBUG_LEVEL 2
+ #define ACL_DEBUG_LEVEL 1
#define BT_CHANNEL_SIGNALING 0x0001
#define BT_CHANNEL_CONNECTIONLESS 0x0002
@@ -76,26 +76,26 @@
{
uint16_t ConnectionHandle;
uint16_t DataLength;
- } Bluetooth_ACL_Header_t;
+ } BT_ACL_Header_t;
typedef struct
{
uint16_t PayloadLength;
uint16_t DestinationChannel;
- } Bluetooth_DataPacket_Header_t;
+ } BT_DataPacket_Header_t;
typedef struct
{
uint8_t Code;
uint8_t Identifier;
uint16_t Length;
- } Bluetooth_SignalCommand_Header_t;
+ } BT_Signal_Header_t;
typedef struct
{
uint16_t PSM;
uint16_t SourceChannel;
- } Bluetooth_SignalCommand_ConnectionRequest_t;
+ } BT_Signal_ConnectionReq_t;
typedef struct
{
@@ -103,64 +103,66 @@
uint16_t SourceChannel;
uint16_t Result;
uint16_t Status;
- } Bluetooth_SignalCommand_ConnectionResponse_t;
+ } BT_Signal_ConnectionResp_t;
typedef struct
{
uint16_t DestinationChannel;
uint16_t SourceChannel;
- } Bluetooth_SignalCommand_DisconnectionRequest_t;
+ } BT_Signal_DisconnectionReq_t;
typedef struct
{
uint16_t DestinationChannel;
uint16_t SourceChannel;
- } Bluetooth_SignalCommand_DisconnectionResponse_t;
+ } BT_Signal_DisconnectionResp_t;
typedef struct
{
uint16_t DestinationChannel;
uint16_t Flags;
- } Bluetooth_SignalCommand_ConfigurationRequest_t;
+ } BT_Signal_ConfigurationReq_t;
typedef struct
{
uint16_t SourceChannel;
uint16_t Flags;
uint16_t Result;
- } Bluetooth_SignalCommand_ConfigurationResponse_t;
+ } BT_Signal_ConfigurationResp_t;
typedef struct
{
uint16_t InfoType;
- } Bluetooth_SignalCommand_InformationRequest_t;
+ } BT_Signal_InformationReq_t;
typedef struct
{
uint16_t InfoType;
uint16_t Result;
- } Bluetooth_SignalCommand_InformationResponse_t;
+ } BT_Signal_InformationResp_t;
/* Function Prototypes: */
- void Bluetooth_ProcessACLPackets(void);
- void Bluetooth_SendPacket(uint8_t* Data, uint16_t DataLen, Bluetooth_Channel_t* Channel);
+ void Bluetooth_ACLTask(void);
+ uint8_t Bluetooth_SendPacket(uint8_t* Data, uint16_t DataLen, Bluetooth_Channel_t* Channel);
#if defined(INCLUDE_FROM_BLUETOOTH_ACLPACKETS_C)
- static inline void Bluetooth_SignalPacket_ConnectionRequest(Bluetooth_ACL_Header_t* ACLPacketHeader,
- Bluetooth_DataPacket_Header_t* DataHeader,
- Bluetooth_SignalCommand_Header_t* SignalCommandHeader);
- static inline void Bluetooth_SignalPacket_EchoRequest(Bluetooth_ACL_Header_t* ACLPacketHeader,
- Bluetooth_DataPacket_Header_t* DataHeader,
- Bluetooth_SignalCommand_Header_t* SignalCommandHeader);
- static inline void Bluetooth_SignalPacket_ConfigurationRequest(Bluetooth_ACL_Header_t* ACLPacketHeader,
- Bluetooth_DataPacket_Header_t* DataHeader,
- Bluetooth_SignalCommand_Header_t* SignalCommandHeader);
- static inline void Bluetooth_SignalPacket_DisconnectionRequest(Bluetooth_ACL_Header_t* ACLPacketHeader,
- Bluetooth_DataPacket_Header_t* DataHeader,
- Bluetooth_SignalCommand_Header_t* SignalCommandHeader);
- static inline void Bluetooth_SignalPacket_InformationRequest(Bluetooth_ACL_Header_t* ACLPacketHeader,
- Bluetooth_DataPacket_Header_t* DataHeader,
- Bluetooth_SignalCommand_Header_t* SignalCommandHeader);
+ static void Bluetooth_ProcessACLPackets(void);
+
+ static inline void Bluetooth_Signal_ConnectionReq(BT_ACL_Header_t* ACLPacketHeader,
+ BT_DataPacket_Header_t* DataHeader,
+ BT_Signal_Header_t* SignalCommandHeader);
+ static inline void Bluetooth_Signal_EchoReq(BT_ACL_Header_t* ACLPacketHeader,
+ BT_DataPacket_Header_t* DataHeader,
+ BT_Signal_Header_t* SignalCommandHeader);
+ static inline void Bluetooth_Signal_ConfigurationReq(BT_ACL_Header_t* ACLPacketHeader,
+ BT_DataPacket_Header_t* DataHeader,
+ BT_Signal_Header_t* SignalCommandHeader);
+ static inline void Bluetooth_Signal_DisconnectionReq(BT_ACL_Header_t* ACLPacketHeader,
+ BT_DataPacket_Header_t* DataHeader,
+ BT_Signal_Header_t* SignalCommandHeader);
+ static inline void Bluetooth_Signal_InformationReq(BT_ACL_Header_t* ACLPacketHeader,
+ BT_DataPacket_Header_t* DataHeader,
+ BT_Signal_Header_t* SignalCommandHeader);
#endif
#endif