8 Replies Latest reply on Dec 10, 2015 6:36 PM by userc_40659

    Cannot Get/Set dongle's Public/Random BD address



      I am trying to get Local Random/Public Bluetooth Device Address of my dongle, to call Cmd_Get_Bluetooth_Device_Address_API by sending a byteArray,


      // 02_Public: Cmd_Get_Bluetooth_Device_Address_Api (Trigger Complete)
      cmdPacket_GetBleDevicePublicAddress[0] = 0x0C
      cmdPacket_GetBleDevicePublicAddress[1] = 0x00
      cmdPacket_GetBleDevicePublicAddress[2] = 0x01; // sizeof(uint8)
      cmdPacket_GetBleDevicePublicAddress[3] = 0x00;
      cmdPacket_GetBleDevicePublicAddress[4] = 0x00;// Public Address Type


      However, whenever I try this after the Cmd_Init_Ble_Stack_Api() was successfully done, I can only get a signal of CYBLE_ERROR_INVALID_PARAMETER


      Could anyone tell me what did I miss to initial its address?


      How could I get the Random and Public Address?


      Thank you!

        • 1. Re: Cannot Get/Set dongle's Public/Random BD address

          Since there is no problem to get those address in CySmt, I tried to set the same Random/Public Address with what I got in CySmt by myself, with a cmd packet to trigger Cmd_Set_Bluetooth_Device_Address_Api, however, still can only get CYBLE_ERROR_INVALID_PARAMETER.


          all of those command packets were sent after the Cmd_Init_Ble_Stack_Api() was successfully done.


          Could anyone tell me what did I miss?


          Thank you!

          • 2. Re: Cannot Get/Set dongle's Public/Random BD address

            Just to simplify my question,


            What else do I need to get the Public/Random Bluetooth Device Address from the dongle, after Initializing the Ble Stack?


            Please help me get a solution, Thank you guys so much!



            • 3. Re: Cannot Get/Set dongle's Public/Random BD address





              Address of the device should be of 6 bytes . Also we should mention the type of address.




              Simply we cannot give 5 bytes and send a command to set the address. 




              Your input argument(5bytes) is not correct that's why it is returning CYBLE_ERROR_INVALID_PARAMETER







              • 4. Re: Cannot Get/Set dongle's Public/Random BD address

                First, thank you for you reply!


                Second, you were wrong! Please take a careful look at my code, which is to get the address instead of set.


                Third, I am not sure who take your post as the right answer; if possible, please change it.


                Fourth, I changed one tiny command in the dongle and it works very well now, which proves my codes in Qt have no problem.


                To be honest, I am disappointed about it, that nobody would like to take this problem seriously.

                • 5. Re: Cannot Get/Set dongle's Public/Random BD address

                  Fifth, this problem still exists:


                  After I modified a tiny change in the dongle(by accident, no sure its principle), the dongle could be controlled by GAP cmd in my Qt codes; however, failed to be initialized in CySmart.


                  Just my guess, maybe Cypress set a little trick to prevent an access to the dongle outside CySmart, which could also explain why no one would like to answer this question.


                  Please tell me if I was wrong, because I do want my dongle to be able to work with CySmart and in Qt at the same time.

                  • 6. Re: Cannot Get/Set dongle's Public/Random BD address

                    Found out the cause:


                    cmd to initial should be exact 0xFC07, while 0x0007 will cause something wrong;


                    It would be better if an employee could tell why.




                    This post should be selected as the right answer.

                    • 7. Re: Cannot Get/Set dongle's Public/Random BD address

                      Mr, Sen,




                      Thanks for updating the thread.  The post itself doesn't give full info about the issue and the way you are implementing


                      My comment was based on the error CYBLE_ERROR_INVALID_PARAMTER and it occurs only if you give wrong argument while calling the API.


                      From your 1st post my understanding is that you are trying to send 5 bytes array as argument and to get the address of it.


                      Are you using your own APIs over the BLE APIs provided by cypress?Info about your implementation is missing clearly in the forum thread.







                      • 8. Re: Cannot Get/Set dongle's Public/Random BD address

                        Hi VAVC,


                        Thank you for considering this post!


                        I mentioned in my first post that the ble stack was successfully initialized, and my codes in the post are to get the address instead of set; so the post from you which was given the right answer is definitely not answering my question. 


                        Sorry I forgot to mention my codes to talk to the dongle are in Qt instead of CySmart, but I believe you know it, since my question would never happen in CySmart.


                        After so many days that know one can answer my question, and since it is about PRoC dongle, I post another detailed question here,http://www.cypress.com/forum/proc-ble/failed-getset-proc-dongles-publicrandom-bd-address-after-successful-ble-stack-initial


                        as what I expected, nobody considers it either.


                        I already post the right answer to my question after I figured it out by myself, which is about the cmd to trigger BLE initial should only be exact 0xFC07. Although Two Bytes cmdOpCode [**** **00] [0000 0111]  could also trigger the initial function, something wrong after that. If possible, could you please tell me why?


                        And if possible, could you please change the right answer sign to this thread?


                        Thank you very much!