1.RSSI 查询
1.1基于RSSI的应用sink应用程序支持RSSI查询扫描模式有两种
- 应用程序能够查询临近的可发现蓝牙设备,当查询完毕(查到最大个数或者查询时间到),会将查询到的设备按照信号强度进行排列
- 接近配对:只尝试1次或者全部尝试连接
- 接近自动连接:This feature is designed to improve reconnection times when there are a lot of entries in the Audio Sink application’s PDL.
2.speaker中的button流程
app_handler –> handleHFPMessage –> HFP_INIT_CFM –> InitEarlyUserFeatures –> buttonManagerInit –> ButtonsInit –> ButtonsMessageHandler –> MESSAGE_PIO_CHANGED –> ButtonsCheckDetection
由前面分析HFP的过程可以知道,当HFP_INIT_CFM 这个初始化确认消息过来之后,会进行InitEarlyUserFeatures 这个函数,这里便对按键进行了初始化我们往下看
- 1.InitEarlyUserFeatures函数
void InitEarlyUserFeatures ( void )
{
ChargerConfigure(CHARGER_SUPPRESS_LED0, TRUE);
/* Initialise the Button Manager */
buttonManagerInit() ; /*这里对按键初始化1.*/
/* Once system Managers are initialised, load up the configuration */
configManagerInit(TRUE); /*这里对按键的配置进行读取4.*/
/* Init wired before USB or wired audio gets routed before init */
wiredAudioInit();
/* USB init can be done once power lib initialised */
usbInit();
/* initialise the display */
displayInit();
/* initialise DUT */
dutInit();
/*configure the audio Pre amp if enabled */
initPreAmp( AUDIO_CHANNEL_A) ;
initPreAmp( AUDIO_CHANNEL_B) ;
/* Enter the limbo state as we may be ON due to a charger being plugged in */
stateManagerEnterLimboState();
}
- 2.buttonManagerInit按键初始化函数
void buttonManagerInit ( void )
{
/*put the buttons task and the button patterens in a single memory block*/
int lSize = sizeof(ButtonsTaskData) ;
/*allocate the memory*/
theSink.theButtonsTask = mallocPanic( lSize );/*开辟了按键任务的空间*/