BLE how to call Cordio HCI driver function set_tx_power()

Hi, I’m using the Artemis and am wondering how to call the HCI driver’s set_tx_power(). I think I’m seeing the function I wan to call documented here: https://github.com/ARMmbed/mbed-os/blob … Driver.cpp But the HCI driver is opaque to me. I’m using the ArduinoBLE library, so maybe I need to customize that a little to be able to call this? Let me know if anyone has tried to do this or has a good guess on how to do this.

Thanks!

This is always a vendor-specific command. Your link shows how it is implemented on an STM32WB. The implementation for HCI in Apollo3 is different. You can not change it with ArduinoBLE library as that only uses (part of) the standard defined BLE instruction.

For Apollo3 by default, it is set at 0db in the HCI-driver. But there is a call in the Apollo3 BLE-HCI driver you can use to select -10db, 0db or +3db. Below is an example of how you can use that from a sketch.

#include "wsf_types.h"
#include "wsf_msg.h"
#include "hci_drv_apollo3.h"

void setup() {

  /* Set the TX power,  allowed options:
   * TX_POWER_LEVEL_MINUS_10P0_dBm  sets at -10 DB
   * TX_POWER_LEVEL_0P0_dBm         sets at   0 DB  (default)
   * TX_POWER_LEVEL_PLUS_3P0_dBm    Sets at   3 DB
   */
  HciVsA3_SetRfPowerLevelEx(TX_POWER_LEVEL_MINUS_10P0_dBm); 

}

void loop() {
  // put your main code here, to run repeatedly:

}

Outstanding help! Thank you.