haiku/headers/os/bluetooth/bluetooth.h
Oliver Tappe e0ef64750f * fix #6373 by switching the BD... macros to take the address of corresponding
constants, which had to be defined in several places in order to be available
  in the kernel addons, network protocols and the server/kit.
* enable -Werror for all servers

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38213 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-17 21:46:32 +00:00

63 lines
1.4 KiB
C++

/*
* Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
* Copyright 2008 Mika Lindqvist, monni1995_at_gmail.com
* All rights reserved. Distributed under the terms of the MIT License.
*/
#ifndef _BLUETOOTH_H
#define _BLUETOOTH_H
#include <ByteOrder.h>
/* Bluetooth version */
#define BLUETOOTH_1_1B 0
#define BLUETOOTH_1_1 1
#define BLUETOOTH_1_2 2
#define BLUETOOTH_2_0 3
#define BLUETOOTH_VERSION BLUETOOTH_2_0
/* Bluetooth common types */
/* BD Address */
typedef struct {
uint8 b[6];
} __attribute__((packed)) bdaddr_t;
namespace BPrivate {
extern const bdaddr_t kBdNullAddress;
extern const bdaddr_t kBdLocalAddress;
extern const bdaddr_t kBdBroadcastAddress;
}
#define BDADDR_NULL (&BPrivate::kBdNullAddress)
#define BDADDR_LOCAL (&BPrivate::kBdLocalAddress)
#define BDADDR_BROADCAST (&BPrivate::kBdBroadcastAddress)
#define BDADDR_ANY BDADDR_BROADCAST
/* Link key */
typedef struct {
uint8 l[16];
} __attribute__((packed)) linkkey_t;
/* 128 integer type needed for SDP */
struct int128 {
int8 b[16];
};
typedef struct int128 int128;
typedef struct int128 uint128;
/* Protocol definitions - add to as required... */
#define BLUETOOTH_PROTO_HCI 134 /* HCI protocol number */
#define BLUETOOTH_PROTO_L2CAP 135 /* L2CAP protocol number */
#define BLUETOOTH_PROTO_RFCOMM 136 /* RFCOMM protocol number */
#define BLUETOOTH_PROTO_MAX 256
#endif // _BLUETOOTH_H