Fix mask and endline style
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34880 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
2e095ebca8
commit
d923116745
@ -1,64 +1,67 @@
|
|||||||
#ifndef _CODEHANDLER_H_
|
#ifndef _CODEHANDLER_H_
|
||||||
#define _CODEHANDLER_H_
|
#define _CODEHANDLER_H_
|
||||||
|
|
||||||
#include <bluetooth/HCI/btHCI.h>
|
#include <bluetooth/HCI/btHCI.h>
|
||||||
|
|
||||||
namespace Bluetooth
|
namespace Bluetooth
|
||||||
{
|
{
|
||||||
|
|
||||||
class CodeHandler {
|
class CodeHandler {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/*
|
/*
|
||||||
* TODO: Handler and protocol could be fit in 16 bits 12
|
* TODO: Handler and protocol could be fit in 16 bits 12
|
||||||
* for handler and 4 for the protocol
|
* for handler and 4 for the protocol
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Used:
|
* Used:
|
||||||
* - From HCI layer to send events to bluetooth server.
|
* - From HCI layer to send events to bluetooth server.
|
||||||
* - L2cap lower to dispatch TX packets to HCI Layer informing about connection handle
|
* - L2cap lower to dispatch TX packets to HCI Layer
|
||||||
* - Transport drivers dispatch its data to HCI layer
|
* - informing about connection handle
|
||||||
*
|
* - Transport drivers dispatch its data to HCI layer
|
||||||
*/
|
*
|
||||||
static inline hci_id Device(uint32 code)
|
*/
|
||||||
{
|
static hci_id Device(uint32 code)
|
||||||
return ((code & 0xFF) >> 24);
|
{
|
||||||
}
|
return ((code & 0xFF000000) >> 24);
|
||||||
|
}
|
||||||
|
|
||||||
static inline void SetDevice(uint32* code, hci_id device)
|
|
||||||
{
|
static void SetDevice(uint32* code, hci_id device)
|
||||||
*code = *code | ((device & 0xFF) << 24);
|
{
|
||||||
}
|
*code = *code | ((device & 0xFF) << 24);
|
||||||
|
}
|
||||||
|
|
||||||
static inline uint16 Handler(uint32 code)
|
|
||||||
{
|
static uint16 Handler(uint32 code)
|
||||||
return ((code & 0xFFFF) >> 0);
|
{
|
||||||
}
|
return ((code & 0xFFFF) >> 0);
|
||||||
|
}
|
||||||
|
|
||||||
static void SetHandler(uint32* code, uint16 handler)
|
|
||||||
{
|
static void SetHandler(uint32* code, uint16 handler)
|
||||||
*code = *code | ((handler & 0xFFFF) << 0);
|
{
|
||||||
}
|
*code = *code | ((handler & 0xFFFF) << 0);
|
||||||
|
}
|
||||||
|
|
||||||
static bt_packet_t Protocol(uint32 code)
|
|
||||||
{
|
static bt_packet_t Protocol(uint32 code)
|
||||||
return (bt_packet_t)((code && 0xFF) >> 16);
|
{
|
||||||
}
|
return (bt_packet_t)((code & 0xFF0000) >> 16);
|
||||||
|
}
|
||||||
|
|
||||||
static void SetProtocol(uint32* code, bt_packet_t protocol)
|
|
||||||
{
|
static void SetProtocol(uint32* code, bt_packet_t protocol)
|
||||||
*code = *code | ((protocol & 0xFF) << 16);
|
{
|
||||||
}
|
*code = *code | ((protocol & 0xFF) << 16);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
|
||||||
|
};
|
||||||
} // namespace
|
|
||||||
|
|
||||||
#endif
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user