Skip to content

Commit fe34e81

Browse files
esp32: fix compiling when enabling ble commissioner (project-chip#35085)
* esp32: fix compiling when enabling ble commissioner * Restyled by clang-format --------- Co-authored-by: Restyled.io <commits@restyled.io>
1 parent c17fd97 commit fe34e81

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/platform/ESP32/nimble/BLEManagerImpl.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ CHIP_ERROR BLEManagerImpl::SendWriteRequest(BLE_CONNECTION_OBJECT conId, const C
659659
if (pBuf->DataLength() > UINT16_MAX)
660660
{
661661
ChipLogError(Ble, "Buffer data Length is too long");
662-
return false;
662+
return CHIP_ERROR_INVALID_ARGUMENT;
663663
}
664664
rc = ble_gattc_write_flat(conId, chr->chr.val_handle, pBuf->Start(), static_cast<uint16_t>(pBuf->DataLength()), OnWriteComplete,
665665
this);
@@ -1746,12 +1746,12 @@ void BLEManagerImpl::DriveBLEState(intptr_t arg)
17461746
#ifdef CONFIG_ENABLE_ESP32_BLE_CONTROLLER
17471747
CHIP_ERROR BLEManagerImpl::HandleRXNotify(struct ble_gap_event * ble_event)
17481748
{
1749-
size_t dataLen = OS_MBUF_PKTLEN(ble_event->notify_rx.om);
1749+
uint16_t dataLen = OS_MBUF_PKTLEN(ble_event->notify_rx.om);
17501750
System::PacketBufferHandle buf = System::PacketBufferHandle::New(dataLen, 0);
17511751
VerifyOrReturnError(!buf.IsNull(), CHIP_ERROR_NO_MEMORY);
1752-
VerifyOrExit(buf->AvailableDataLength() >= data_len, err = CHIP_ERROR_BUFFER_TOO_SMALL);
1753-
ble_hs_mbuf_to_flat(ble_event->notify_rx.om, buf->Start(), data_len, NULL);
1754-
buf->SetDataLength(data_len);
1752+
VerifyOrReturnError(buf->AvailableDataLength() >= dataLen, CHIP_ERROR_BUFFER_TOO_SMALL);
1753+
ble_hs_mbuf_to_flat(ble_event->notify_rx.om, buf->Start(), dataLen, NULL);
1754+
buf->SetDataLength(dataLen);
17551755

17561756
ChipLogDetail(DeviceLayer, "Indication received, conn = %d", ble_event->notify_rx.conn_handle);
17571757

0 commit comments

Comments
 (0)