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

Commit 5fbe10a3 authored by Hansong Zhang's avatar Hansong Zhang
Browse files

SDP_BROWSE_PLUS is never true

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I0a0a579320cb2e58d49e21826ce84e3198e1a5c9
parent 063ca99c
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -135,13 +135,8 @@ static void sdp_snd_service_search_req(tCONN_CB* p_ccb, uint8_t cont_len,
  p += 2;

/* Build the UID sequence. */
#if (SDP_BROWSE_PLUS == TRUE)
  p = sdpu_build_uuid_seq(p, 1,
                          &p_ccb->p_db->uuid_filters[p_ccb->cur_uuid_idx]);
#else
  p = sdpu_build_uuid_seq(p, p_ccb->p_db->num_uuid_filters,
                          p_ccb->p_db->uuid_filters);
#endif

  /* Set max service record count */
  UINT16_TO_BE_STREAM(p, sdp_cb.max_recs_per_search);
@@ -589,13 +584,8 @@ static void process_service_search_attr_rsp(tCONN_CB* p_ccb, uint8_t* p_reply,
    p += 2;

/* Build the UID sequence. */
#if (SDP_BROWSE_PLUS == TRUE)
    p = sdpu_build_uuid_seq(p, 1,
                            &p_ccb->p_db->uuid_filters[p_ccb->cur_uuid_idx]);
#else
    p = sdpu_build_uuid_seq(p, p_ccb->p_db->num_uuid_filters,
                            p_ccb->p_db->uuid_filters);
#endif

    /* Max attribute byte count */
    UINT16_TO_BE_STREAM(p, sdp_cb.max_attr_list_size);
+0 −39
Original line number Diff line number Diff line
@@ -457,45 +457,6 @@ tCONN_CB* sdp_conn_originate(const RawAddress& p_bd_addr) {
 *
 ******************************************************************************/
void sdp_disconnect(tCONN_CB* p_ccb, uint16_t reason) {
#if (SDP_BROWSE_PLUS == TRUE)

  /* If we are browsing for multiple UUIDs ... */
  if ((p_ccb->con_state == SDP_STATE_CONNECTED) &&
      (p_ccb->con_flags & SDP_FLAGS_IS_ORIG) &&
      ((reason == SDP_SUCCESS) || (reason == SDP_NO_RECS_MATCH))) {
    /* If the browse found something, do no more searching */
    if ((p_ccb->cur_uuid_idx == 0) && (p_ccb->p_db->p_first_rec))
      p_ccb->cur_uuid_idx = p_ccb->p_db->num_uuid_filters;

    while (++p_ccb->cur_uuid_idx < p_ccb->p_db->num_uuid_filters) {
      /* Check we have not already found the UUID (maybe through browse) */
      if ((p_ccb->p_db->uuid_filters[p_ccb->cur_uuid_idx].len == 2) &&
          (SDP_FindServiceInDb(
              p_ccb->p_db,
              p_ccb->p_db->uuid_filters[p_ccb->cur_uuid_idx].uu.uuid16, NULL)))
        continue;

      if ((p_ccb->p_db->uuid_filters[p_ccb->cur_uuid_idx].len > 2) &&
          (SDP_FindServiceUUIDInDb(
              p_ccb->p_db, &p_ccb->p_db->uuid_filters[p_ccb->cur_uuid_idx],
              NULL)))
        continue;

      p_ccb->cur_handle = 0;

      SDP_TRACE_EVENT("SDP - looking for for more,  CID: 0x%x",
                      p_ccb->connection_id);

      sdp_disc_connected(p_ccb);
      return;
    }
  }

  if ((reason == SDP_NO_RECS_MATCH) && (p_ccb->p_db->p_first_rec))
    reason = SDP_SUCCESS;

#endif

  SDP_TRACE_EVENT("SDP - disconnect  CID: 0x%x", p_ccb->connection_id);

  /* Check if we have a connection ID */
+0 −3
Original line number Diff line number Diff line
@@ -150,9 +150,6 @@ typedef struct {
  uint16_t cur_handle;                   /* Current handle being processed */
  uint16_t transaction_id;
  uint16_t disconnect_reason; /* Disconnect reason            */
#if (SDP_BROWSE_PLUS == TRUE)
  uint16_t cur_uuid_idx;
#endif

#define SDP_DISC_WAIT_CONN 0
#define SDP_DISC_WAIT_HANDLES 1