#include <errno.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/poll.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/hci_lib.h>
#include <bluetooth/l2cap.h>
#include <sys/ioctl.h>
#include "BluetoothLinux.h"
#define | BLUETOOTH_DEFAULT_DEVICE -1 |
Constants needed to perform inquiries on the Linux platform default device id of the Bluetooth adapter to use: -1 means the first available one. | |
#define | BLUETOOTH_SCANDELAY 5000 |
milliseconds between inquiries / scans | |
#define | BLUETOOTH_INQUIRYLENGTH 5 |
the length of the Bluetooth inquiry in 1.28 second intervals | |
#define | BLUETOOTH_FLUSH_CACHE true |
if the Bluetooth cache should be flushed between inquiries | |
#define | BLUETOOTH_USE_L2_CONNECTIONS false |
if an L2 connection should be started to each found peer - this allows to measure the ping time and link quality | |
#define | BLUETOOTH_L2_PINGDELAY 500 |
milliseconds between L2 pings (if used) | |
#define | BLUETOOTH_MAX_PING_TIME 60 |
milliseconds L2PING time | |
#define | BLUETOOTH_MIN_LINK_QUALITY 210 |
minimum L2 link quality (range 0 -255) | |
Functions | |
EXPORT_FEATURE (BluetoothLinuxFeatureProvider) |
Some parts of this code have been taken from hcitool.c of the bluez-utils disribution and were modified accordingly. The original license is:
BlueZ - Bluetooth protocol stack for Linux Copyright (C) 2000-2001 Qualcomm Incorporated
Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation;
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS SOFTWARE IS DISCLAIMED.
© 2003-2004 by Rene Mayrhofer, Harald Radi
Harald Radi <harald.radi@nme.at>