6 Replies Latest reply on Aug 30, 2018 3:57 AM by NAYU_1212731

    BT-headset control from "ClientControl"


      I'm using the following WICED environment of PC and CYBT-343026-EVAL board.

      demo.hci_audio_gateway_CYBT_343026_EVAL download UART=COM9


      A search of Bluetooth Headset and a connection are done from a AG screen of "ClientControl" of the PC connected.


      Next I want to do the following control.
      Would I be able to control from "ClientControl" of PC?

      When it's possible, please teach me the way.
      And if not, please teach me a source cord change point.

      1) Modification method of AFH.
      2) Ringing to Bluetooth Headset. (transmission method of AT Command.)
      3) Modification method of PIN Code.
      4) Modification method of Visibility.
      5) Volume modification method to Bluetooth Headset.

        • 1. Re: BT-headset control from "ClientControl"

          I'm working with him,


          Summary of his question is follows.



          Currently, he is using sample application of "demo.hci_audio_gateway".

          They need to know following points.


          Q1: They would like to issue following trigger from Host CPU and need to know how to control this module from CPU.


          -Start Ringing from Host

          =>Is it control by AT command? such as atd ****;

              If so, which I/F of this module should be used to receive AT command ?

              (HCI UART_? or this sample application does not include AT command program?)

             He would not like to use PUART due to the restriction of Host CPU.


          -Change volume setting of HF from AG(module)

          => Is it also controlled by AT command?

              Is that same avobe ?


          Q2: Regarding to AFH, should the customer change AFT setting manually, such as mask frequency ?

                 Or , is it controlled automatically inside IC?


          Q3: Could you tell me how to change Paring PIN code .

                 I think it should be set WICED API but I can not find it.


          Q4: The customer would like to set visibility setting not to show scan their equipment.

                 Is this setting controlled by API?

                 If so, could you show me which API to change it?


          Thank you.



          • 2. Re: BT-headset control from "ClientControl"



            First of all, "ClientControl" is a good start point to verify WICED features but does not cover all of WICED APIs. To see all WICED feature, you should also refer below documents in WICED SDK.



            It shows "pre-defined" commands/events between WICED IC and host MCU over WICED HCI.

            We "pre-define" those commands but user can add their own commands/events because these are implemented on sample app layer that can be modified by the user. (User can also  modify existing commands but it is not recommended due to compatibility)



            It describes all public APIs of WICED.


            Q1:: I am checking and will answer later.


            Q2:: AFH channel is controlled by lower FW of inside chip. Host needs not care about the AFH channel.


            Q3:: Please note PIN code is only used by legacy paring but not by SSP (Simple Secure Pairing). I believe most devices should not use legacy pairing (i.e. PIN code) recently but WICED has its API for compatibility.

            If the legacy pairing is started, WICED library notifies user app w/ BTM_PIN_REQUEST_EVT. Then, the app should tell PIN code to the WICED library. Below shouws implementation of demo/audio/hci_audio_gateway.


                    case BTM_PIN_REQUEST_EVT:
                        WICED_BT_TRACE("remote address= %B\n", p_event_data->pin_request.bd_addr);
                        wiced_bt_dev_pin_code_reply(*p_event_data->pin_request.bd_addr,result/*WICED_BT_SUCCESS*/,4, &pincode[0]);


            In this case, pincode is fixed to "0000". User can modify this PIN code if he wants.


            Q4:: Visibility can be definitely configurable. I would show the instruction on below three layers.

            ClientControl :: Check/Uncheck "Discoverable" chec box at upper pane of the window.

            WICED HCI command :: Please refer "4.1.8 Set Visibility" of WICED-HCI-Control-Protocol.pdf

            WICED API :: Please refer below API.

            wiced_result_t  wiced_bt_dev_set_discoverability (uint8_t inq_mode, uint16_t duration,

                                                                uint16_t interval);

            • 3. Re: BT-headset control from "ClientControl"

              Q1:: Yes, these are done by commands over Service Level Connection (SLC), defined by HFP spec as below.

                Start Ringing :: RING

                Volume control::  +VGS: n  (set HF speaker gain)

                                            +VGM: m  (Set HF Mic gain)


              On WICED API, those commands can be sent by using RFCOMM library API. As void _send_result_to_hf () in demo/audio/hci_audio_gateway/hci_control_ag_commands.c sends a response for command sent by HF. It should be good example that AG itself sends its initiating commands, like RING or +VGS.


              Unfortunately, we don't define WICED HCI command to send those AG commands. User can add such commands if their host MCU wants to control them.

              • 4. Re: BT-headset control from "ClientControl"







                内部Library(RFCOMM)のAPIでAT Commandをコールする事は可能だが、HCI UART経由で呼べるI/Fが現在のサンプルアプリには搭載されていないので、ユーザーの方でユニークなHCIコマンドを定義して貰えれば実装可能で、HCI UARTのみで実現可能という事ですよね。



                AFHに関してはLow Level FWで自動制御しているのでユーザーが特に制御する必要はないという事で理解しました。





                1.         case BTM_PIN_REQUEST_EVT: 
                2.             WICED_BT_TRACE("remote address= %B\n", p_event_data->pin_request.bd_addr); 
                3.             wiced_bt_dev_pin_code_reply(*p_event_data->pin_request.bd_addr,result/*WICED_BT_SUCCESS*/,4, &pincode[0]); 
                4.         break





                WICED HCI command :: Please refer "4.1.8 Set Visibility" of WICED-HCI-Control-Protocol.pdf


                WICED API :: Please refer below API.

                wiced_result_t  wiced_bt_dev_set_discoverability (uint8_t inq_mode, uint16_t duration,

                                                                    uint16_t interval);







                • 5. Re: BT-headset control from "ClientControl"


                  • 6. Re: BT-headset control from "ClientControl"