georgerobotics / cyw43-driver

Other
79 stars 42 forks source link

43439 Bluetooth setting txpower #78

Closed matsobdev closed 7 months ago

matsobdev commented 1 year ago

Would it be possible to make firmware control over Bluetooth txpower. Is it possible with current Infineon SDK?

matsobdev commented 7 months ago

I guess good news, bad news. There is a way to control at least BLE TX power (for connection and advertisements), but default TX power is max already (for adv at least). Still useful. There is working HCI Vendor commend Set_Transmit_Power (OCF 0x026): 0x26, 0xFC, 0x03, 0xFE, 0x00, 0x09, that is max value of 9 dBm I guess. This value gives 0x00 event error code for that command (or however it is called :D), but there is no CMD line since HCI command is send using cybt_hci_write_buf(buf, size). Last line with corresponding EVT:

capture_08032024_012411 For values 0x10 and higher, error code is 0x30. RSSI at scanner side changes accordingly and matches default value (no messing with Set_Transmit_Power) at 0x09 TX power. For BLE connection command will be: 0x26, 0xFC, 0x03, 0x04, 0x00, 0x09.