⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 a2dp_sd_scan.c

📁 CSR蓝牙MP3播放USB DONGLE源码
💻 C
字号:
/****************************************************************************
Copyright (C) Cambridge Silicon Radio Ltd. 2004-2006
Part of BlueLab 3.5.2-release

FILE NAME
    a2dp_sd_scan.c

DESCRIPTION 

NOTES
    
*/


/****************************************************************************
    Header files
*/
#include "a2dp_sd_private.h"
#include "a2dp_sd_scan.h"

#include <connection.h>


/****************************************************************************
NAME    
    a2dpSdEnableConnectable
    
DESCRIPTION
    Make the device connectable.

RETURNS
    void
*/
void a2dpSdEnableConnectable(a2dpSourceDongleTaskData *theApp)
{
    /* Set the page scan params */
    ConnectionWritePagescanActivity(0x800, 0x12);

    /* Make sure that if we're inquiry scanning we don't disable it */
    if ((theApp->scan_enabled == hci_scan_enable_inq_and_page) ||
        (theApp->scan_enabled == hci_scan_enable_inq))
        theApp->scan_enabled = hci_scan_enable_inq_and_page;
    else
        theApp->scan_enabled = hci_scan_enable_page;

    /* Enable scan mode */
    ConnectionWriteScanEnable(theApp->scan_enabled);
}


/****************************************************************************
NAME    
    a2dpSdDisableConnectable
    
DESCRIPTION
    Take device out of connectable mode.

RETURNS
    void
*/
void a2dpSdDisableConnectable(a2dpSourceDongleTaskData *theApp)
{
    /* Make sure that if we're inquiry scanning we don't disable it */
    if ((theApp->scan_enabled == hci_scan_enable_inq_and_page) ||
        (theApp->scan_enabled == hci_scan_enable_inq))
        theApp->scan_enabled = hci_scan_enable_inq;
    else
        theApp->scan_enabled = hci_scan_enable_off;

    /* Enable scan mode */
    ConnectionWriteScanEnable(theApp->scan_enabled);
}


/****************************************************************************
NAME    
    a2dpSdEnableDiscoverable
    
DESCRIPTION
    Make the device discoverable. 

RETURNS
    void
*/
void a2dpSdEnableDiscoverable(a2dpSourceDongleTaskData *theApp)
{
    /* Set the inquiry scan params */
    ConnectionWriteInquiryscanActivity(0x800, 0x12);

    /* Make sure that if we're page scanning we don't disable it */
    if ((theApp->scan_enabled == hci_scan_enable_inq_and_page) ||
        (theApp->scan_enabled == hci_scan_enable_page))
        theApp->scan_enabled = hci_scan_enable_inq_and_page;
    else
        theApp->scan_enabled = hci_scan_enable_inq;

    /* Enable scan mode */
    ConnectionWriteScanEnable(theApp->scan_enabled );
}


/****************************************************************************
NAME    
    a2dpSdDisableDiscoverable
    
DESCRIPTION
    Make the device non-discoverable. 

RETURNS
    void
*/
void a2dpSdDisableDiscoverable(a2dpSourceDongleTaskData *theApp)
{
    /* Make sure that if we're page scanning we don't disable it */
    if ((theApp->scan_enabled == hci_scan_enable_inq_and_page) ||
        (theApp->scan_enabled == hci_scan_enable_page))
        theApp->scan_enabled = hci_scan_enable_page;
    else
        theApp->scan_enabled = hci_scan_enable_off;

    /* Enable scan mode */
    ConnectionWriteScanEnable(theApp->scan_enabled );
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -