sjanc commented on code in PR #1984:
URL: https://github.com/apache/mynewt-nimble/pull/1984#discussion_r1968455238


##########
nimble/controller/src/ble_ll_conn_hci.c:
##########
@@ -1932,6 +1933,39 @@ ble_ll_conn_hci_wr_auth_pyld_tmo(const uint8_t *cmdbuf, 
uint8_t len,
 }
 #endif
 
+#if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL) || MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
+int
+ble_ll_conn_hci_cb_read_tx_pwr(const uint8_t *cmdbuf, uint8_t len,
+                               uint8_t *rspbuf, uint8_t *rsplen)
+{
+    const struct ble_hci_cb_read_tx_pwr_cp *cmd = (const void *)cmdbuf;
+    struct ble_hci_cb_read_tx_pwr_rp *rsp = (void *)rspbuf;
+    struct ble_ll_conn_sm *connsm;
+    uint16_t handle;
+
+    if (len != sizeof(*cmd)) {
+        return BLE_ERR_INV_HCI_CMD_PARMS;
+    }
+
+    if (cmd->type != 0x01) {
+        return BLE_ERR_INV_HCI_CMD_PARMS;
+    }
+
+    handle = le16toh(cmd->conn_handle);
+    connsm = ble_ll_conn_find_by_handle(handle);
+    if (!connsm) {
+        return BLE_ERR_UNK_CONN_ID;
+    }
+
+    rsp->conn_handle = cmd->conn_handle;
+    rsp->tx_level = g_ble_ll_tx_power;

Review Comment:
   According to spec valid range is -30 to 20 dBm...
   
   Isn't this BR/EDR command anyway?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to