• The API Ref page currently states:

    power - Transmit power. Accepted values are -40, -30, -20, -16, -12, -8, -4, 0, and 4 dBm. Others will give an error code.

    But I tried to set my puck's TxPower to -30 and got this:

    >NRF.setTxPower(-30);
    Uncaught Error: Got BLE error 0x7 (INVALID_PARAM)
     at line 1 col 19
    NRF.setTxPower(-30);
    

    Digging into the code there is a comment indicating-30 is nRF51 only. Might be good to use the same (or similar) line on the API reference page:

    Accepted values are -40(nRF52 only), -30(nRF51 only), -20, -16, -12, -8, -4, 0, and 4 dBm. Others will give an error code.

    Also, I'm not even sure what is the difference between nRF52 and nRF51? Is nRF52 just newer firmware/hardware?

  • Hi - thanks. I actually already made the change (which is why you see it in the comments at the top of the function - they're actually used for the API ref so everything stays in sync). It's just that the documentation on the site is designed to go with a certain release (in this case 1v99), so changes I make to the docs after that point don't get reflected until the next release.

    And yes, if you look on Nordic's site, nRF51 is an earlier line of chips (1/4 the RAM and clock speed). Normally they wouldn't be supported except I have a build for the BBC micro:bit, which uses it.

  • Ah, makes sense!

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

setTxPower() suggested documentation change nRF51 vs nRF52

Posted by Avatar for jijidad @jijidad

Actions