?? headset_scan.c
字號:
/****************************************************************************
Copyright (C) Cambridge Silicon Radio Ltd. 2005-2007
FILE NAME
headset_scan.c
DESCRIPTION
NOTES
*/
/****************************************************************************
Header files
*/
#include "headset_debug.h"
#include "headset_scan.h"
#include <connection.h>
#ifdef DEBUG_SCAN
#define SCAN_DEBUG(x) DEBUG(x)
#else
#define SCAN_DEBUG(x)
#endif
#define HCI_PAGESCAN_INTERVAL_DEFAULT (0x800)
#define HCI_PAGESCAN_WINDOW_DEFAULT (0x12)
#define HCI_INQUIRYSCAN_INTERVAL_DEFAULT (0x800)
#define HCI_INQUIRYSCAN_WINDOW_DEFAULT (0x12)
/*****************************************************************************/
void headsetEnableConnectable(hsTaskData *app)
{
hci_scan_enable scan = hci_scan_enable_off;
/* Set the page scan params */
/* TODO - Read radio from PSKeys */
/*ConnectionWritePagescanActivity(app->radio.page_scan_interval, app->radio.page_scan_window);*/
/*ConnectionWritePagescanActivity(HCI_PAGESCAN_INTERVAL_DEFAULT, HCI_PAGESCAN_WINDOW_DEFAULT);*/
/* Make sure that if we're inquiry scanning we don't disable it */
if (app->inquiry_scan_enabled)
scan = hci_scan_enable_inq_and_page;
else
scan = hci_scan_enable_page;
/* Enable scan mode */
ConnectionWriteScanEnable(scan);
SCAN_DEBUG(("Scan : %x\n",scan));
/* Set the flag to indicate we're page scanning */
app->page_scan_enabled = TRUE;
}
/*****************************************************************************/
void headsetDisableConnectable(hsTaskData *app)
{
hci_scan_enable scan;
/* Make sure that if we're inquiry scanning we don't disable it */
if (app->inquiry_scan_enabled)
scan = hci_scan_enable_inq;
else
scan = hci_scan_enable_off;
/* Enable scan mode */
ConnectionWriteScanEnable(scan);
SCAN_DEBUG(("Scan : %x\n",scan));
/* Set the flag to indicate we're page scanning */
app->page_scan_enabled = FALSE;
}
/*****************************************************************************/
void headsetEnableDiscoverable(hsTaskData *app)
{
hci_scan_enable scan = hci_scan_enable_off;
/* Set the inquiry scan params */
/* TODO - Read radio from PSKeys */
/*ConnectionWriteInquiryscanActivity(app->radio.inquiry_scan_interval, app->radio.inquiry_scan_window);*/
/*ConnectionWriteInquiryscanActivity(HCI_INQUIRYSCAN_INTERVAL_DEFAULT, HCI_INQUIRYSCAN_WINDOW_DEFAULT);*/
/* Make sure that if we're page scanning we don't disable it */
if (app->page_scan_enabled)
scan = hci_scan_enable_inq_and_page;
else
scan = hci_scan_enable_inq;
/* Enable scan mode */
ConnectionWriteScanEnable(scan);
SCAN_DEBUG(("Scan : %x\n",scan));
/* Set the flag to indicate we're page scanning */
app->inquiry_scan_enabled = TRUE;
}
/*****************************************************************************/
void headsetDisableDiscoverable(hsTaskData *app)
{
hci_scan_enable scan;
/* Make sure that if we're page scanning we don't disable it */
if (app->page_scan_enabled)
scan = hci_scan_enable_page;
else
scan = hci_scan_enable_off;
/* Enable scan mode */
ConnectionWriteScanEnable(scan);
SCAN_DEBUG(("Scan : %x\n",scan));
/* Set the flag to indicate we're page scanning */
app->inquiry_scan_enabled = FALSE;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -