OSDN Git Service

L2cap shim: fix L2CA_SendFixedChnlData
authorHansong Zhang <hsz@google.com>
Tue, 29 Dec 2020 23:11:54 +0000 (15:11 -0800)
committerHansong Zhang <hsz@google.com>
Tue, 5 Jan 2021 20:39:13 +0000 (12:39 -0800)
The return value should be L2CAP_DW_*

Test: CtsVerifier
Tag: #gd-refactor
Bug: 141555841
Change-Id: I729cc4a1d85ec47af278d5f81a52991fdd174113

main/shim/l2c_api.cc

index e98e609..d49c526 100644 (file)
@@ -799,14 +799,14 @@ uint16_t L2CA_SendFixedChnlData(uint16_t cid, const RawAddress& rem_bda,
                                 BT_HDR* p_buf) {
   if (cid != kAttCid && cid != kSmpCid) {
     LOG(ERROR) << "Invalid cid " << cid;
-    return false;
+    return L2CAP_DW_FAILED;
   }
   auto* helper = &le_fixed_channel_helper_.find(cid)->second;
   auto remote = ToAddressWithType(rem_bda, Btm::GetAddressType(rem_bda));
   auto len = p_buf->len;
   auto* data = p_buf->data + p_buf->offset;
   bool sent = helper->send(remote, MakeUniquePacket(data, len));
-  return sent ? len : 0;
+  return sent ? L2CAP_DW_SUCCESS : L2CAP_DW_FAILED;
 }
 
 bool L2CA_RemoveFixedChnl(uint16_t cid, const RawAddress& rem_bda) {