1414#include <zephyr/types.h>
1515#include <zephyr/sys/byteorder.h>
1616#include <zephyr/sys/reboot.h>
17+ #include <zephyr/bluetooth/bluetooth.h>
1718#include <zephyr/bluetooth/cs.h>
1819#include <zephyr/bluetooth/gatt.h>
1920#include <zephyr/bluetooth/conn.h>
@@ -199,8 +200,8 @@ static void extract_pcts(cs_de_report_t *p_report, uint8_t channel_index,
199200 for (uint8_t tone_index = 0 ; tone_index < p_report -> n_ap ; tone_index ++ ) {
200201 int antenna_path = bt_le_cs_get_antenna_path (p_report -> n_ap ,
201202 antenna_permutation_index , tone_index );
202- if (antenna_path < 0 ) {
203- LOG_WRN ("Invalid antenna path." );
203+ if (antenna_path < 0 || antenna_path > MAX_AP ) {
204+ LOG_WRN ("Invalid antenna path: %d" , antenna_path );
204205 return ;
205206 }
206207
@@ -390,6 +391,8 @@ static void ranging_data_cb(struct bt_conn *conn, uint16_t ranging_counter, int
390391
391392static void subevent_result_cb (struct bt_conn * conn , struct bt_conn_le_cs_subevent_result * result )
392393{
394+ ARG_UNUSED (conn );
395+
393396 if (dropped_ranging_counter == result -> header .procedure_counter ) {
394397 return ;
395398 }
@@ -440,6 +443,7 @@ static void subevent_result_cb(struct bt_conn *conn, struct bt_conn_le_cs_subeve
440443
441444static void ranging_data_ready_cb (struct bt_conn * conn , uint16_t ranging_counter )
442445{
446+ ARG_UNUSED (conn );
443447 LOG_DBG ("Ranging data ready %i" , ranging_counter );
444448
445449 if (ranging_counter == most_recent_local_ranging_counter ) {
@@ -457,12 +461,15 @@ static void ranging_data_ready_cb(struct bt_conn *conn, uint16_t ranging_counter
457461
458462static void ranging_data_overwritten_cb (struct bt_conn * conn , uint16_t ranging_counter )
459463{
464+ ARG_UNUSED (conn );
460465 LOG_INF ("Ranging data overwritten %i" , ranging_counter );
461466}
462467
463468static void mtu_exchange_cb (struct bt_conn * conn , uint8_t err ,
464469 struct bt_gatt_exchange_params * params )
465470{
471+ ARG_UNUSED (params );
472+
466473 if (err ) {
467474 LOG_ERR ("MTU exchange failed (err %d)" , err );
468475 return ;
@@ -474,6 +481,8 @@ static void mtu_exchange_cb(struct bt_conn *conn, uint8_t err,
474481
475482static void discovery_completed_cb (struct bt_gatt_dm * dm , void * context )
476483{
484+ ARG_UNUSED (context );
485+
477486 int err ;
478487
479488 LOG_INF ("The discovery procedure succeeded" );
@@ -497,12 +506,18 @@ static void discovery_completed_cb(struct bt_gatt_dm *dm, void *context)
497506
498507static void discovery_service_not_found_cb (struct bt_conn * conn , void * context )
499508{
509+ ARG_UNUSED (conn );
510+ ARG_UNUSED (context );
511+
500512 LOG_INF ("The service could not be found during the discovery, disconnecting" );
501513 bt_conn_disconnect (connection , BT_HCI_ERR_REMOTE_USER_TERM_CONN );
502514}
503515
504516static void discovery_error_found_cb (struct bt_conn * conn , int err , void * context )
505517{
518+ ARG_UNUSED (conn );
519+ ARG_UNUSED (context );
520+
506521 LOG_INF ("The discovery procedure failed (err %d)" , err );
507522 bt_conn_disconnect (connection , BT_HCI_ERR_REMOTE_USER_TERM_CONN );
508523}
@@ -532,6 +547,8 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, enum bt_
532547static bool le_param_req (struct bt_conn * conn , struct bt_le_conn_param * param )
533548{
534549 /* Ignore peer parameter preferences. */
550+ ARG_UNUSED (conn );
551+ ARG_UNUSED (param );
535552 return false;
536553}
537554
@@ -689,6 +706,8 @@ static void procedure_enable_cb(struct bt_conn *conn,
689706
690707void ras_features_read_cb (struct bt_conn * conn , uint32_t feature_bits , int err )
691708{
709+ ARG_UNUSED (conn );
710+
692711 if (err ) {
693712 LOG_WRN ("Error while reading RAS feature bits (err %d)" , err );
694713 } else {
@@ -702,6 +721,7 @@ void ras_features_read_cb(struct bt_conn *conn, uint32_t feature_bits, int err)
702721static void scan_filter_match (struct bt_scan_device_info * device_info ,
703722 struct bt_scan_filter_match * filter_match , bool connectable )
704723{
724+ ARG_UNUSED (filter_match );
705725 char addr [BT_ADDR_LE_STR_LEN ];
706726
707727 bt_addr_le_to_str (device_info -> recv_info -> addr , addr , sizeof (addr ));
@@ -711,6 +731,7 @@ static void scan_filter_match(struct bt_scan_device_info *device_info,
711731
712732static void scan_connecting_error (struct bt_scan_device_info * device_info )
713733{
734+ ARG_UNUSED (device_info );
714735 int err ;
715736
716737 LOG_INF ("Connecting failed, restarting scanning" );
@@ -724,6 +745,8 @@ static void scan_connecting_error(struct bt_scan_device_info *device_info)
724745
725746static void scan_connecting (struct bt_scan_device_info * device_info , struct bt_conn * conn )
726747{
748+ ARG_UNUSED (device_info );
749+ ARG_UNUSED (conn );
727750 LOG_INF ("Connecting" );
728751}
729752
0 commit comments