Loading system/stack/gatt/gatt_db.cc +5 −5 Original line number Diff line number Diff line Loading @@ -148,12 +148,12 @@ static tGATT_STATUS gatts_check_attr_readability(const tGATT_ATTR& attr, * * Description Utility function to read an attribute value. * * Parameter p_attr: pointer to the attribute to read. * Parameter attr16: pointer to the attribute to read. * offset: read offset. * p_value: output parameter to carry out the attribute value. * p_len: output parameter to carry out the attribute length. * p_data: output parameter to carry out the attribute value. * read_long: this is a read blob request. * mtu: MTU * p_len: output parameter to carry out the attribute length. * sec_flag: current link security status. * key_size: encryption key size. * Loading Loading @@ -182,7 +182,7 @@ static tGATT_STATUS read_attr_value(tGATT_ATTR& attr16, uint16_t offset, uint16_t uuid16 = attr16.uuid.As16Bit(); if (uuid16 == GATT_UUID_PRI_SERVICE || uuid16 == GATT_UUID_SEC_SERVICE) { *p_len = attr16.p_value->uuid.GetShortestRepresentationSize(); *p_len = gatt_build_uuid_to_stream_len(attr16.p_value->uuid); if (mtu < *p_len) return GATT_NO_RESOURCES; gatt_build_uuid_to_stream(&p, attr16.p_value->uuid); Loading system/stack/gatt/gatt_int.h +1 −0 Original line number Diff line number Diff line Loading @@ -436,6 +436,7 @@ extern uint32_t gatt_add_sdp_record(const bluetooth::Uuid& uuid, uint16_t start_hdl, uint16_t end_hdl); extern bool gatt_parse_uuid_from_cmd(bluetooth::Uuid* p_uuid, uint16_t len, uint8_t** p_data); extern uint8_t gatt_build_uuid_to_stream_len(const bluetooth::Uuid& uuid); extern uint8_t gatt_build_uuid_to_stream(uint8_t** p_dst, const bluetooth::Uuid& uuid); extern void gatt_sr_get_sec_info(const RawAddress& rem_bda, Loading system/stack/gatt/gatt_sr.cc +1 −1 Original line number Diff line number Diff line Loading @@ -467,7 +467,7 @@ static tGATT_STATUS gatt_build_primary_service_rsp( if (!p_uuid) continue; if (op_code == GATT_REQ_READ_BY_GRP_TYPE) handle_len = 4 + p_uuid->GetShortestRepresentationSize(); handle_len = 4 + gatt_build_uuid_to_stream_len(*p_uuid); /* get the length byte in the repsonse */ if (p_msg->offset == 0) { Loading system/stack/gatt/gatt_utils.cc +8 −0 Original line number Diff line number Diff line Loading @@ -454,6 +454,14 @@ tGATT_TCB* gatt_allocate_tcb_by_bdaddr(const RawAddress& bda, return NULL; } /** gatt_build_uuid_to_stream will convert 32bit UUIDs to 128bit. This function * will return lenght required to build uuid, either |UUID:kNumBytes16| or * |UUID::kNumBytes128| */ uint8_t gatt_build_uuid_to_stream_len(const Uuid& uuid) { size_t len = uuid.GetShortestRepresentationSize(); return len == Uuid::kNumBytes32 ? Uuid::kNumBytes128 : len; } /** Add UUID into stream. Returns UUID length. */ uint8_t gatt_build_uuid_to_stream(uint8_t** p_dst, const Uuid& uuid) { uint8_t* p = *p_dst; Loading Loading
system/stack/gatt/gatt_db.cc +5 −5 Original line number Diff line number Diff line Loading @@ -148,12 +148,12 @@ static tGATT_STATUS gatts_check_attr_readability(const tGATT_ATTR& attr, * * Description Utility function to read an attribute value. * * Parameter p_attr: pointer to the attribute to read. * Parameter attr16: pointer to the attribute to read. * offset: read offset. * p_value: output parameter to carry out the attribute value. * p_len: output parameter to carry out the attribute length. * p_data: output parameter to carry out the attribute value. * read_long: this is a read blob request. * mtu: MTU * p_len: output parameter to carry out the attribute length. * sec_flag: current link security status. * key_size: encryption key size. * Loading Loading @@ -182,7 +182,7 @@ static tGATT_STATUS read_attr_value(tGATT_ATTR& attr16, uint16_t offset, uint16_t uuid16 = attr16.uuid.As16Bit(); if (uuid16 == GATT_UUID_PRI_SERVICE || uuid16 == GATT_UUID_SEC_SERVICE) { *p_len = attr16.p_value->uuid.GetShortestRepresentationSize(); *p_len = gatt_build_uuid_to_stream_len(attr16.p_value->uuid); if (mtu < *p_len) return GATT_NO_RESOURCES; gatt_build_uuid_to_stream(&p, attr16.p_value->uuid); Loading
system/stack/gatt/gatt_int.h +1 −0 Original line number Diff line number Diff line Loading @@ -436,6 +436,7 @@ extern uint32_t gatt_add_sdp_record(const bluetooth::Uuid& uuid, uint16_t start_hdl, uint16_t end_hdl); extern bool gatt_parse_uuid_from_cmd(bluetooth::Uuid* p_uuid, uint16_t len, uint8_t** p_data); extern uint8_t gatt_build_uuid_to_stream_len(const bluetooth::Uuid& uuid); extern uint8_t gatt_build_uuid_to_stream(uint8_t** p_dst, const bluetooth::Uuid& uuid); extern void gatt_sr_get_sec_info(const RawAddress& rem_bda, Loading
system/stack/gatt/gatt_sr.cc +1 −1 Original line number Diff line number Diff line Loading @@ -467,7 +467,7 @@ static tGATT_STATUS gatt_build_primary_service_rsp( if (!p_uuid) continue; if (op_code == GATT_REQ_READ_BY_GRP_TYPE) handle_len = 4 + p_uuid->GetShortestRepresentationSize(); handle_len = 4 + gatt_build_uuid_to_stream_len(*p_uuid); /* get the length byte in the repsonse */ if (p_msg->offset == 0) { Loading
system/stack/gatt/gatt_utils.cc +8 −0 Original line number Diff line number Diff line Loading @@ -454,6 +454,14 @@ tGATT_TCB* gatt_allocate_tcb_by_bdaddr(const RawAddress& bda, return NULL; } /** gatt_build_uuid_to_stream will convert 32bit UUIDs to 128bit. This function * will return lenght required to build uuid, either |UUID:kNumBytes16| or * |UUID::kNumBytes128| */ uint8_t gatt_build_uuid_to_stream_len(const Uuid& uuid) { size_t len = uuid.GetShortestRepresentationSize(); return len == Uuid::kNumBytes32 ? Uuid::kNumBytes128 : len; } /** Add UUID into stream. Returns UUID length. */ uint8_t gatt_build_uuid_to_stream(uint8_t** p_dst, const Uuid& uuid) { uint8_t* p = *p_dst; Loading