Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a5faa1d8 authored by Hui Peng's avatar Hui Peng Committed by Automerger Merge Worker
Browse files

Merge "[Invisalign2] adjust the logging statement in smp_main" into main am: 3514cfb2

parents a2ed5372 3514cfb2
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -305,9 +305,9 @@ void smp_br_state_machine_event(tSMP_CB* p_cb, tSMP_BR_EVENT event,
  tSMP_BR_SM_TBL state_table;
  uint8_t action, entry;

  LOG_VERBOSE("addr:%s", ADDRESS_TO_LOGGABLE_CSTR(p_cb->pairing_bda));
  LOG_DEBUG("addr:%s", ADDRESS_TO_LOGGABLE_CSTR(p_cb->pairing_bda));
  if (curr_state >= SMP_BR_STATE_MAX) {
    LOG_VERBOSE("Invalid br_state: %d", curr_state);
    LOG_ERROR("Invalid br_state: %d", curr_state);
    return;
  }

@@ -318,8 +318,8 @@ void smp_br_state_machine_event(tSMP_CB* p_cb, tSMP_BR_EVENT event,

  tSMP_BR_ENTRY_TBL entry_table = smp_br_entry_table[p_cb->role];

  LOG_VERBOSE("SMP Role:%s State:[%s(%d)], Event:[%s(%d)]",
              (p_cb->role == HCI_ROLE_PERIPHERAL) ? "Peripheral" : "Central",
  LOG_DEBUG("Role:%s State:[%s(%d)], Event:[%s(%d)]",
            hci_role_text(p_cb->role).c_str(),
            smp_get_br_state_name(p_cb->br_state), p_cb->br_state,
            smp_get_br_event_name(event), event);

+2 −1
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
#include "stack/include/bt_hdr.h"
#include "stack/include/bt_octets.h"
#include "stack/include/smp_api_types.h"
#include "types/hci_role.h"
#include "types/raw_address.h"

typedef enum : uint16_t {
@@ -290,7 +291,7 @@ class tSMP_CB {
  tSMP_BR_STATE br_state; /* if SMP over BR/ERD has priority over SMP */
  uint8_t failure;
  tSMP_STATUS status;
  uint8_t role;
  tHCI_ROLE role;
  uint16_t flags;
  tSMP_EVT cb_evt;
  tSMP_SEC_LEVEL sec_level;
+14 −15
Original line number Diff line number Diff line
@@ -952,9 +952,8 @@ tSMP_CB smp_cb;
 ******************************************************************************/
void smp_set_state(tSMP_STATE state) {
  if (state < SMP_STATE_MAX) {
    LOG_VERBOSE("State change: %s(%d)==>%s(%d)",
                smp_get_state_name(smp_cb.state), smp_cb.state,
                smp_get_state_name(state), state);
    LOG_DEBUG("State change: %s(%d)==>%s(%d)", smp_get_state_name(smp_cb.state),
              smp_cb.state, smp_get_state_name(state), state);
    if (smp_cb.state != state) {
      BTM_LogHistory(
          kBtmLogTag, smp_cb.pairing_ble_bd_addr, "Security state changed",
@@ -963,7 +962,7 @@ void smp_set_state(tSMP_STATE state) {
    }
    smp_cb.state = state;
  } else {
    LOG_VERBOSE("invalid state=%d", state);
    LOG_ERROR("invalid state=%d", state);
  }
}

@@ -995,22 +994,22 @@ bool smp_sm_event(tSMP_CB* p_cb, tSMP_EVENT event, tSMP_INT_DATA* p_data) {
  tSMP_SM_TBL state_table;
  uint8_t action, entry, i;

  LOG_DEBUG("addr:%s", ADDRESS_TO_LOGGABLE_CSTR(p_cb->pairing_bda));
  if (p_cb->role >= 2) {
    LOG_VERBOSE("Invalid role:%d", p_cb->role);
    LOG_ERROR("Invalid role:%d", p_cb->role);
    return false;
  }

  tSMP_ENTRY_TBL entry_table = smp_entry_table[p_cb->role];

  if (curr_state >= SMP_STATE_MAX) {
    LOG_VERBOSE("Invalid state:%d", curr_state);
    LOG_ERROR("Invalid state:%d", curr_state);
    return false;
  }

  LOG_VERBOSE("SMP Role:%s State:[%s(%d)], Event:[%s(%d)]",
              (p_cb->role == 0x01) ? "Peripheral" : "Central",
              smp_get_state_name(p_cb->state), p_cb->state,
              smp_get_event_name(event), event);
  LOG_DEBUG("Role:%s, State:[%s(%d)], Event:[%s(%d)]",
            hci_role_text(p_cb->role).c_str(), smp_get_state_name(p_cb->state),
            p_cb->state, smp_get_event_name(event), event);

  /* look up the state table for the current state */
  /* lookup entry /w event & curr_state */
@@ -1021,12 +1020,12 @@ bool smp_sm_event(tSMP_CB* p_cb, tSMP_EVENT event, tSMP_INT_DATA* p_data) {
    if (entry & SMP_ALL_TBL_MASK) {
      entry &= ~SMP_ALL_TBL_MASK;
      state_table = smp_all_table;
    } else
    } else {
      state_table = smp_state_table[curr_state][p_cb->role];
    }
  } else {
    LOG_VERBOSE("Ignore event[%s(%d)] in state[%s(%d)]",
                smp_get_event_name(event), event,
                smp_get_state_name(curr_state), curr_state);
    LOG_WARN("Ignore event[%s(%d)] in state[%s(%d)]", smp_get_event_name(event),
             event, smp_get_state_name(curr_state), curr_state);
    return false;
  }

@@ -1046,7 +1045,7 @@ bool smp_sm_event(tSMP_CB* p_cb, tSMP_EVENT event, tSMP_INT_DATA* p_data) {
      break;
    }
  }
  LOG_VERBOSE("result state=%s", smp_get_state_name(p_cb->state));
  LOG_DEBUG("result state=%s", smp_get_state_name(p_cb->state));
  return true;
}