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

📄 ag_msg.h

📁 bluetooth audio gateway
💻 H
字号:
#ifndef _AG_MSG_H
#define _AG_MSG_H


#include "ag_types.h"


/*
    This file is not stand-alone: it is shared between the BlueLab
    audio_gateway and its Win32 EAGDriver. They provide the
    surrounding typedefs.
*/


/* 
    Returned when a start request is received by the EAG this represents the 
    version of the EAG that has been shipped 
*/
#define EAG_VERSION 2


/* AG messages */
#define AG_MSG_BASE 0x00

enum
{
    AG_START_REQ = AG_MSG_BASE,
    AG_START_CFM,
    AG_INQUIRY_REQ, 
    AG_INQUIRY_RESULT_IND,
    AG_REMOTE_NAME_IND,
    AG_INQUIRY_COMPLETE_CFM,
    AG_SM_ADD_DEVICE_REQ,

    AG_PAIR_REQ,
    AG_PIN_CODE_REQUEST_IND,
    AG_PIN_CODE_RES,
    AG_PAIR_CFM,

    AG_LINK_KEY_REQUEST_IND,
    AG_LINK_KEY_RES,
    AG_CONNECT_AS_MASTER_REQ,
    AG_CONNECT_AS_SLAVE_REQ,
    AG_CONNECT_REQUEST_IND,
    AG_RFCOMM_CONNECTION_STATUS_IND,
    AG_CREATE_SCO_REQ,
    AG_SCO_CONNECTION_STATUS_IND,
    AG_RFCOMM_DISCONNECT_REQ,
    AG_SCO_DISCONNECT_REQ,

    AG_RING_REQ,
    AG_VOLUME_CHANGE_REQ,
    AG_VOLUME_CHANGE_IND,
    AG_MIC_CHANGE_REQ,
    AG_MIC_CHANGE_IND,
    AG_BUTTON_PRESS_IND,
    AG_DATA_IND,
    AG_DATA_REQ,
    AG_CANCEL_REQ,
    AG_ERROR_IND,

    AG_DIAL_FROM_HF_REQUEST_IND,
    AG_CALL_ACCEPT_STATUS_IND,

    AG_SEND_CALL_STATUS_REQ,
	AG_SEND_CALL_SETUP_REQ,
	AG_SEND_SERVICE_STATUS_REQ,

	AG_VOICE_RECOG_ENABLE_IND,
	AG_VOICE_RECOG_ENABLE_REQ
};


/* TODO insert comments here describing what the fields of each message are for */

typedef struct
{
	uint16 supportedProfiles;
    uint16 hfSupportedFeatures;	
} AG_START_REQ_T;


typedef struct
{
    uint16 version;
} AG_START_CFM_T;


typedef struct
{
    uint8 num_responses;
    timeout_t timeout;
    uint32 CoD_filter;
    uint16 remote_name_request_enabled;
} AG_INQUIRY_REQ_T;


typedef struct
{
    bd_addr_t dev_address;
    uint32 class_of_device;
    clk_offset_t clock_offset;
    page_scn_rep_mode_t page_scan_rep_mode;
    page_scn_mode_t page_scan_mode;
    page_scn_per_mode_t page_scan_period_mode;
    uint16 continuation_pkt_pending;
    uint16 length;
    uint8 device_name[1];
} AG_INQUIRY_RESULT_IND_T;


typedef struct
{
    uint16 continuation_pkt_pending;
    uint16 length;
    uint8 device_name[1];
} AG_REMOTE_NAME_IND_T;


typedef struct
{
    ag_inquiry_status_t status;
} AG_INQUIRY_COMPLETE_CFM_T;


typedef struct
{
    bd_addr_t dev_address;
    uint8 link_key[AG_SIZE_LINK_KEY];
    uint8 trust_flag;
} AG_SM_ADD_DEVICE_REQ_T;


typedef struct
{
    bd_addr_t dev_address;    
    uint8 use_authentication;    
    timeout_t timeout;
} AG_PAIR_REQ_T;


typedef struct
{
    bd_addr_t dev_address;
} AG_PIN_CODE_REQUEST_IND_T;


typedef struct
{
    bd_addr_t dev_address;
    uint8 PIN_length;
    uint8 PIN[MAX_PIN_LENGTH];
} AG_PIN_CODE_RES_T;


typedef struct
{
    ag_pair_status_t status;
    bd_addr_t dev_address;
    uint8 link_key[AG_SIZE_LINK_KEY];
} AG_PAIR_CFM_T;


typedef struct
{
    ag_handle_t handle;
} AG_LINK_KEY_REQUEST_IND_T;


typedef struct
{
    ag_handle_t handle;
    uint8 accept;
    uint8 link_key[AG_SIZE_LINK_KEY];
} AG_LINK_KEY_RES_T;

typedef struct
{
    bd_addr_t dev_address;
    timeout_t timeout;
    ag_auth_config_t use;
    ag_park_config_t park;
    ag_sniff_config_t sniff;
    uint16 target;    
} AG_CONNECT_AS_MASTER_REQ_T;

typedef struct
{
    bd_addr_t dev_address;
    timeout_t timeout;
    ag_auth_config_t use;
    ag_park_config_t park;
    ag_sniff_config_t sniff;
    uint16 page_scan_interval;
    uint16 page_scan_window;	
} AG_CONNECT_AS_SLAVE_REQ_T;

typedef struct
{
    ag_handle_t handle;
    bd_addr_t dev_address;
} AG_CONNECT_REQUEST_IND_T;


typedef struct
{
    ag_handle_t handle;
    ag_connection_status_t status;
	ag_profile_role_t profile_role;
} AG_RFCOMM_CONNECTION_STATUS_IND_T;


typedef struct
{
    ag_handle_t handle;
    pkt_type_t type;
} AG_CREATE_SCO_REQ_T;


typedef struct
{
    ag_handle_t handle;
    ag_connection_status_t status;
    ag_sco_connection_handle_t sco_handle;
} AG_SCO_CONNECTION_STATUS_IND_T;


typedef struct
{
    ag_handle_t handle;
} AG_RFCOMM_DISCONNECT_REQ_T;


typedef struct
{
    ag_handle_t handle;
} AG_SCO_DISCONNECT_REQ_T;


/*lint -esym(768, handle) */
typedef struct
{
    ag_handle_t handle;
    timeout_t repetition_rate;
    uint8 number_rings;
} AG_RING_REQ_T;

typedef struct
{
    ag_handle_t handle;
    int8 increment;
    uint8 gain;
} AG_VOLUME_CHANGE_REQ_T;


typedef struct
{
    ag_handle_t handle;
    uint8 gain;
} AG_VOLUME_CHANGE_IND_T;


typedef struct
{
    ag_handle_t handle;
    uint8 gain;
} AG_MIC_CHANGE_REQ_T;


typedef struct
{
    ag_handle_t handle;
    uint8 gain;
} AG_MIC_CHANGE_IND_T;


typedef struct
{
    ag_handle_t handle;
} AG_BUTTON_PRESS_IND_T;


typedef struct
{
    ag_handle_t handle;
    uint16 length;
    uint8 data[1];
} AG_DATA_IND_T;


typedef struct
{
    ag_handle_t handle;
    uint16 length;
    uint8 data[1];
} AG_DATA_REQ_T;


/*lint -esym(756, CANCEL_REQ_T) */
typedef struct
{
    ag_handle_t handle;
} AG_CANCEL_REQ_T;


typedef struct
{
    ag_handle_t handle;
    ag_error_code_t reason;
} AG_ERROR_IND_T;


typedef struct
{
    ag_handle_t handle;
    dial_mode_t dial_this;
    uint16 length;
    uint8 dial_data[1];
} AG_DIAL_FROM_HF_REQUEST_IND_T;


typedef struct
{
    ag_handle_t handle;
    uint16 accept_or_reject;
} AG_CALL_ACCEPT_STATUS_IND_T;


typedef struct
{
    ag_handle_t handle;
    uint16 call_ind_status;
} AG_SEND_CALL_STATUS_REQ_T;

typedef struct
{
	ag_handle_t handle;
	ag_call_setup_vals_t call_setup;
} AG_SEND_CALL_SETUP_REQ_T;


typedef struct
{
	ag_handle_t handle;
	uint16 service_ind_status;
} AG_SEND_SERVICE_STATUS_REQ_T;


typedef struct
{
	ag_handle_t handle;
	uint16 enable;
} AG_VOICE_RECOG_ENABLE_IND_T;


typedef struct
{
	ag_handle_t handle;
	uint16 enable;
} AG_VOICE_RECOG_ENABLE_REQ_T;



typedef struct
{
    uint16									length;
    uint16									type;
    
    union {
        AG_START_CFM_T						start_cfm;
        AG_INQUIRY_RESULT_IND_T				inquiry_result_ind;
        AG_REMOTE_NAME_IND_T				remote_name_ind;
        AG_INQUIRY_COMPLETE_CFM_T			inquiry_complete_cfm;
        AG_PIN_CODE_REQUEST_IND_T			pin_code_req_ind;
        AG_PAIR_CFM_T						pair_cfm;
        AG_LINK_KEY_REQUEST_IND_T			link_key_request_ind;
        AG_CONNECT_REQUEST_IND_T			connect_request_ind;
        AG_RFCOMM_CONNECTION_STATUS_IND_T	rfcomm_connection_status_ind;
        AG_SCO_CONNECTION_STATUS_IND_T		sco_connection_status_ind;
        AG_VOLUME_CHANGE_IND_T				volume_change_ind;
        AG_MIC_CHANGE_IND_T					mic_change_ind;
        AG_BUTTON_PRESS_IND_T				button_press_ind;
        AG_DATA_IND_T						data_ind;
        AG_ERROR_IND_T						error_ind;
        AG_CALL_ACCEPT_STATUS_IND_T			call_accept_status_ind;
        AG_DIAL_FROM_HF_REQUEST_IND_T		dial_from_hf_request_ind;
		AG_VOICE_RECOG_ENABLE_IND_T			voice_recog_enable_ind;
    } ag_msg;
} AG_TO_PHONE_MSG_T;


#endif

⌨️ 快捷键说明

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