How to get audio after setting up HFP connection between phone and windows

127 views Asked by At

I have made a HFP connection between my android and windows using AT commands but not able to use my pc as a headset for a call i can make,pick and hung up calls from my pc but cant hear audio in my pc this code makes HFP connection between my pc and windows

await PushCommand("AT+BRSF=" + HF_Supported_Features);

            if ((AG_Supported_Features >> 9 & 0x1) == 1) // Check if the device support Codec Negotiation
            {
                Console.WriteLine("This device support Codec Negotiation");
                SLCState = Negotiate_Codecs;
                Console.WriteLine("here");
                Console.WriteLine(HF_Available_Codec);
                await PushCommand("AT+BAC=" + HF_Available_Codec);
            }
            else
            {
                Console.WriteLine("This device does not support Codec Negotiation");
            }
            SLCState = Retrieve_AG_Indicators;
            await PushCommand("AT+CIND=?");
            SLCState = Retrieve_AG_Indicators_Status;
            await PushCommand("AT+CIND?");
            SLCState = Enable_AG_Indicators_Status_Update;
            await PushCommand("AT+CMER=3,0,0,1");
            if ((AG_Supported_Features & 0x1) == 1)
            {
                Console.WriteLine("This device support three-way calling");
                SLCState = Retrieve_Call_Hold_Capability;
                await PushCommand("AT+CHLD=?");
            }
            else
            {
                Console.WriteLine("This device does not support three-way calling");
            }
            if ((AG_Supported_Features >> 10 & 0x1) == 1)
            {
                Console.WriteLine("This device support HF indicators");
                SLCState = List_HF_Indicators;
                await PushCommand("AT+BIND=" + HF_Supported_Indicators);
                SLCState = Retrieve_Supported_HF_Indicators;
                await PushCommand("AT+BIND=?");
                SLCState = Retrieve_Enable_HF_Indicators_Status;
                await PushCommand("AT+BIND?");
                await PushCommand("AT+BCC");
            }
            else
            {
                Console.WriteLine("This device does not support HF indicators");
            }
            
           
            SLCState = Established;


            var adapter = await BluetoothAdapter.GetDefaultAsync();
            var radio = await adapter.GetRadioAsync();
0

There are 0 answers