Skip to content

Commit

Permalink
esp32: fix compiling when enabling ble commissioner (project-chip#35085)
Browse files Browse the repository at this point in the history
* esp32: fix compiling when enabling ble commissioner

* Restyled by clang-format

---------

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
2 people authored and PeterC1965 committed Aug 28, 2024
1 parent 728fcb1 commit 0662dae
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/platform/ESP32/nimble/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ CHIP_ERROR BLEManagerImpl::SendWriteRequest(BLE_CONNECTION_OBJECT conId, const C
if (pBuf->DataLength() > UINT16_MAX)
{
ChipLogError(Ble, "Buffer data Length is too long");
return false;
return CHIP_ERROR_INVALID_ARGUMENT;
}
rc = ble_gattc_write_flat(conId, chr->chr.val_handle, pBuf->Start(), static_cast<uint16_t>(pBuf->DataLength()), OnWriteComplete,
this);
Expand Down Expand Up @@ -1746,12 +1746,12 @@ void BLEManagerImpl::DriveBLEState(intptr_t arg)
#ifdef CONFIG_ENABLE_ESP32_BLE_CONTROLLER
CHIP_ERROR BLEManagerImpl::HandleRXNotify(struct ble_gap_event * ble_event)
{
size_t dataLen = OS_MBUF_PKTLEN(ble_event->notify_rx.om);
uint16_t dataLen = OS_MBUF_PKTLEN(ble_event->notify_rx.om);
System::PacketBufferHandle buf = System::PacketBufferHandle::New(dataLen, 0);
VerifyOrReturnError(!buf.IsNull(), CHIP_ERROR_NO_MEMORY);
VerifyOrExit(buf->AvailableDataLength() >= data_len, err = CHIP_ERROR_BUFFER_TOO_SMALL);
ble_hs_mbuf_to_flat(ble_event->notify_rx.om, buf->Start(), data_len, NULL);
buf->SetDataLength(data_len);
VerifyOrReturnError(buf->AvailableDataLength() >= dataLen, CHIP_ERROR_BUFFER_TOO_SMALL);
ble_hs_mbuf_to_flat(ble_event->notify_rx.om, buf->Start(), dataLen, NULL);
buf->SetDataLength(dataLen);

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

Expand Down

0 comments on commit 0662dae

Please sign in to comment.