Skip to content

Commit

Permalink
[ESP32]: Fix ble scanning for esp32
Browse files Browse the repository at this point in the history
  • Loading branch information
jadhavrohit924 committed Jun 27, 2024
1 parent 58536ba commit 0486dbe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/platform/ESP32/ChipDeviceScanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#pragma once

#include <ble/Ble.h>
#include <lib/core/CHIPError.h>
#include <system/SystemLayer.h>

Expand All @@ -31,7 +32,6 @@
#include "esp_gattc_api.h"
#include "esp_log.h"
#include "freertos/FreeRTOS.h"
#include <ble/Ble.h>
#include <lib/core/CHIPError.h>
#include <system/SystemLayer.h>
#endif
Expand Down
3 changes: 2 additions & 1 deletion src/platform/ESP32/nimble/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,8 @@ bool BLEManagerImpl::SendWriteRequest(BLE_CONNECTION_OBJECT conId, const ChipBle
return false;
}

rc = ble_gattc_write_flat(conId, chr->chr.val_handle, pBuf->Start(), pBuf->DataLength(), OnWriteComplete, this);
assert(pBuf->DataLength() <= UINT16_MAX);
rc = ble_gattc_write_flat(conId, chr->chr.val_handle, pBuf->Start(), static_cast<uint16_t>(pBuf->DataLength()), OnWriteComplete, this);
if (rc != 0)
{
ChipLogError(Ble, "ble_gattc_write_flat failed: %d", rc);
Expand Down

0 comments on commit 0486dbe

Please sign in to comment.