4 Replies Latest reply on Mar 27, 2019 10:59 AM by decoburn_1926091

    CyBle_SetTxPowerLevel(0) ?

    decoburn_1926091

      I've found CyBle_SetTxPowerLevel(0) in a program called Proximity Bonding, peripheral.  It's purpose is to reduce the advertising transmitter power to such a low level that in order to bond a central device must be placed within a cm or two of it.  This seems to work sometimes and not so much at other times.

       

      I've been unable to find any documentation that talks about the parameter "0".  All I've found are indications (enum) that the value can be from 0x01 through 0x07.

       

      Is the use of "0" legit and, if so, what does it really mean?

       

      Thanks for your help,

      Dennis

        • 1. Re: CyBle_SetTxPowerLevel(0) ?
          GyanC_36

          Hi Dennis,

           

                You need to pass the struct of type CYBLE_BLESS_PWR_IN_DB_T as a parameter to this API which has two elements  1) Power Level and 2) Channel type for which you want to update the power.

           

          Could you please point out the project from where did you get this implementation?

           

          -Gyan

          • 2. Re: CyBle_SetTxPowerLevel(0) ?
            decoburn_1926091

            Hi Gyan,

             

            The project is BLE Proximity Bonding (peripheral)  (it also contains a central project).

            I found it from a PSoC4 BLE forum post by grsr dated 30 Jun 2016 which contains the link "Attachment Download BLEProximityBonding.zip.

             

            Line 127 of BLEAppication.c  is  SetTxPowerLevel(0);  which calls:

             

            void setTxPowerLevel(CYBLE_BLESS_PWR_LVL_T powerlevel)

            {

            pwrlvl.blePwrLevelInDbm=powerlevel;

            pwrlvl.bleSsChId=CYBLE_LL_ADV_CH_TYPE;

            CyBle_SetTxPowerLevel(&pwrlvl);       

            pwrlvl.bleSsChId=CYBLE_LL_CONN_CH_TYPE;

            CyBle_SetTxPowerLevel(&pwrlvl);  

            }

             

            Will this work? Maybe I just don't understand.

             

            Thanks,

            Dennis

            • 3. Re: CyBle_SetTxPowerLevel(0) ?
              GyanC_36

              Hi Dennis,

               

                   You need to pass a valid value for Power Level. '0' is not a valid value. Enum CYBLE_BLESS_PWR_LVL_T  does not have  a valid  '0' value. This is a bug in this example. Thanks for pointing this out.

               

              -Gyan

               

               

              1 of 1 people found this helpful
              • 4. Re: CyBle_SetTxPowerLevel(0) ?
                decoburn_1926091

                Thanks Gyan,   I'll stop beating my head against THAT wall and try another approach.

                 

                Dennis