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

Commit f56395dd authored by Hemant Gupta's avatar Hemant Gupta
Browse files

GATT: Fix usage of 16 and 32 bit UUID's in Discover services by UUID

Fix improper usage of 16 and 32 bit UUID's in Disocever services by UUID
Fixes PTS test cases GATT/CL/GAD/BV-08-C and GATT/CL/GAR/BV-03-C.

Test: PTS test cases GATT/CL/GAD/BV-08-C and GATT/CL/GAR/BV-03-C passes

Bug: 80095184
Change-Id: Ia0a26bd20ee68c5c7db0bc00036634f6719f25e9
parent 3b00cc75
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -107,10 +107,14 @@ void gatt_act_discovery(tGATT_CLCB* p_clcb) {

    size_t size = p_clcb->uuid.GetShortestRepresentationSize();
    cl_req.find_type_value.value_len = size;
    if (size == Uuid::kNumBytes32) {
    if (size == Uuid::kNumBytes16) {
      uint8_t* p = cl_req.find_type_value.value;
      UINT16_TO_STREAM(p, p_clcb->uuid.As16Bit());
    } else if (size == Uuid::kNumBytes32) {
      /* if service type is 32 bits UUID, convert it now */
      memcpy(cl_req.find_type_value.value, p_clcb->uuid.To128BitLE().data(),
            Uuid::kNumBytes128);
      cl_req.find_type_value.value_len = Uuid::kNumBytes128;
    } else
      memcpy(cl_req.find_type_value.value, p_clcb->uuid.To128BitLE().data(),
             size);