@@ -659,7 +659,7 @@ CHIP_ERROR BLEManagerImpl::SendWriteRequest(BLE_CONNECTION_OBJECT conId, const C
659
659
if (pBuf->DataLength () > UINT16_MAX)
660
660
{
661
661
ChipLogError (Ble, " Buffer data Length is too long" );
662
- return false ;
662
+ return CHIP_ERROR_INVALID_ARGUMENT ;
663
663
}
664
664
rc = ble_gattc_write_flat (conId, chr->chr .val_handle , pBuf->Start (), static_cast <uint16_t >(pBuf->DataLength ()), OnWriteComplete,
665
665
this );
@@ -1746,12 +1746,12 @@ void BLEManagerImpl::DriveBLEState(intptr_t arg)
1746
1746
#ifdef CONFIG_ENABLE_ESP32_BLE_CONTROLLER
1747
1747
CHIP_ERROR BLEManagerImpl::HandleRXNotify (struct ble_gap_event * ble_event)
1748
1748
{
1749
- size_t dataLen = OS_MBUF_PKTLEN (ble_event->notify_rx .om );
1749
+ uint16_t dataLen = OS_MBUF_PKTLEN (ble_event->notify_rx .om );
1750
1750
System::PacketBufferHandle buf = System::PacketBufferHandle::New (dataLen, 0 );
1751
1751
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 );
1755
1755
1756
1756
ChipLogDetail (DeviceLayer, " Indication received, conn = %d" , ble_event->notify_rx .conn_handle );
1757
1757
0 commit comments