CyBle_SetTxPowerLevel(0) ?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
DeCo_1926091
Level 4
Level 4
First like received

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

0 Likes
1 Solution

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

View solution in original post

4 Replies
GyanC_36
Employee
Employee
250 replies posted 100 replies posted 50 replies posted

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

0 Likes

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

0 Likes

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

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

Dennis

0 Likes