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

📄 a2dp_sd_private.h

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

FILE NAME
    a2dp_sd_private.h
    
DESCRIPTION
    
*/

#ifndef A2DP_SD_PRIVATE_H
#define A2DP_SD_PRIVATE_H

#include "a2dp_sd_button.h"

#include <a2dp.h>
#include <avrcp.h>
#include <message.h>
#include <app/message/system_message.h>


/* Define the PS keys used by the application */
#define PS_AV_SINK_ADDR     (0)


/* Define the class of device fields */
#define AV_MAJOR_DEVICE_CLASS   (0x000400)
#define AV_MINOR_HIFI           (0x000028)
#define AV_COD_CAPTURE          (0x080000)


/* Define the PSMs used by the app. */
#define AVCTP_PSM   (0x0017)
#define AVDTP_PSM   (0x0019)


/* Define the button ids for the HID actions */
#define HID_PLAYPAUSE       0x01
#define HID_TRACK_FORWARD   0x02
#define HID_TRACK_BACKWARD  0x04
#define HID_STOP            0x08


/* Timeout for being in discover mode */
#define DISCOVER_TIMEOUT    (60000)


/* If connection not created after this has expired then abort the connect attempt. */
#define CONNECT_TIMEOUT		(30000)


/* Define some messages internal to the application. */
#define APP_MSG_BASE    (0x0)

enum
{
    APP_INIT_CFM = APP_MSG_BASE,
    APP_DISCOVER_REQ,
    APP_INITIATE_REQ,
    APP_START_STREAMING_REQ,
	APP_SUSPEND_STREAMING_REQ,
    APP_CLOSE_REQ,
    APP_KICK_PROFILE_REQ,
    APP_DISCOVER_TIMEOUT_IND,
    APP_LED_TIMEOUT_IND,
	APP_CONNECT_TIMEOUT_IND
};


typedef struct
{
    bdaddr addr;
} APP_INITIATE_REQ_T;


typedef enum
{
    a2dp_state_initialising,
    a2dp_state_discovering,
    a2dp_state_accepting,
    a2dp_state_initiating,
    a2dp_state_connected,
    a2dp_state_streaming,
    a2dp_state_disconnecting
} a2dp_state;


typedef enum
{
    avrcp_state_accepting,
    avrcp_state_connected,
    avrcp_state_disconnecting,
    avrcp_state_initialising
} avrcp_state;



typedef struct
{
    TaskData        task;
    TaskData        audio_control;
    TaskData        audio_streaming;
	Task 			codec_task;
    PioState        pio_state;
    a2dp_state      a2dpState;
    avrcp_state     avrcpState;
    bdaddr          av_sink_addr;
    bool            discover_pending;
    Sink            media_sink;
    Sink            rcp_sink;
    hci_scan_enable scan_enabled;
    uint16          connect_timer_expired;
    A2DP            *a2dp;
    AVRCP           *avrcp;
} a2dpSourceDongleTaskData;


/****************************************************************************
NAME    
    getTheAppTask
    
DESCRIPTION
    Returns the app's main task.

RETURNS
    Task
*/
Task getTheAppTask(void);


/****************************************************************************
NAME    
    resetConnectTimeoutFlag
    
DESCRIPTION
    Resets the flag indicating the connect timeout has expired.
*/
void resetConnectTimeoutFlag(void);


/****************************************************************************
NAME    
    avSourceDongleUpdateA2dpState
    
DESCRIPTION
    Updates the local A2DP state.

RETURNS
    Task
*/
void avSourceDongleUpdateA2dpState(a2dp_state new_state);

/****************************************************************************
NAME    
    avSourceDongleRetrieveA2dpState
    
DESCRIPTION
    Retrieve local A2DP state.

RETURNS
    Task
*/
a2dp_state avSourceDongleRetrieveA2dpState(void);


/****************************************************************************
NAME    
    avSourceDongleUpdateAvrcpState
    
DESCRIPTION
    Updates the local AV RCP state.

RETURNS
    Task
*/
void avSourceDongleUpdateAvrcpState(avrcp_state new_state);


#endif /* A2DP_SD_PRIVATE_H */

⌨️ 快捷键说明

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