📄 sco.c
字号:
#include "demohs.h"
#include "hal.h"
#include <framework.h>
#include <audio.h>
#ifdef DEV_BOARD_HS
#include <pio.h>
#endif
/*
scoStatusInd
Called by the headset framework to indicate that a SCO (voice)
connection has been either created or destroyed by the Audio
Gateway.
*/
void scoStatusInd(const HS_SCO_STATUS_IND_T * ind)
{
/* Stop any ring tone that might be playing */
(void) AudioStop(hsState.AudioRingHandle);
/* On setting up or tearing down a sco unmute the microphone */
if (hsState.isMuted)
muteRequest();
if (ind->status == CmConnectComplete)
{
#ifdef DEV_BOARD_HS
/* enable the codec */
PioSet(PIO_CODEC, CODEC_ON);
#endif
/* set the sco connected flag */
hsState.scoConnected = 1;
/*
Volume cmds are *only* allowed when there is a SCO so send
initial volume here and not on RFCOMM connection establishment
*/
sendInitialVolume();
/* sendInitialMicGain(); */
}
else
{
#ifdef DEV_BOARD_HS
/* disable the codec */
PioSet(PIO_CODEC, CODEC_OFF);
#endif
/* reset the sco connected flag */
hsState.scoConnected = 0;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -