Bug 825851 - Patch 1: Handle AT command: AT+VGM, r=echou

This commit is contained in:
Gina Yeh 2013-01-07 16:58:59 +08:00
parent 893bbc6417
commit f171760c2a
2 changed files with 18 additions and 0 deletions

View File

@ -616,6 +616,23 @@ BluetoothHfpManager::ReceiveSocketData(UnixSocketRawData* aMessage)
* SLC establishment is done when AT+CMER has been received.
* Do nothing but respond with "OK".
*/
} else if (msg.Find("AT+VGM=") != -1) {
ParseAtCommand(msg, 7, atCommandValues);
if (atCommandValues.IsEmpty()) {
NS_WARNING("Couldn't get the value of command [AT+VGM]");
goto respond_with_ok;
}
nsresult rv;
int vgm = atCommandValues[0].ToInteger(&rv);
if (NS_FAILED(rv)) {
NS_WARNING("Failed to extract microphone volume from bluetooth headset!");
goto respond_with_ok;
}
NS_ASSERTION(vgm >= 0 && vgm <= 15, "Received invalid VGM value");
mCurrentVgm = vgm;
} else if (msg.Find("AT+CHLD=?") != -1) {
SendLine("+CHLD: (1,2)");
} else if (msg.Find("AT+CHLD=") != -1) {

View File

@ -56,6 +56,7 @@ private:
virtual void OnDisconnect() MOZ_OVERRIDE;
int mCurrentVgs;
int mCurrentVgm;
int mCurrentCallIndex;
bool mCLIP;
bool mReceiveVgsFlag;