Skip to content

Commit

Permalink
platform/Zephyr: Correct return value handling of bt_id_create() (#19161
Browse files Browse the repository at this point in the history
)

The identifier returned by bt_id_create() will be GT/EQ to 0 on successful

Signed-off-by: chao.an <anchao@xiaomi.com>
  • Loading branch information
anchao authored and pull[bot] committed Jul 1, 2022
1 parent 11ecdac commit ed86aed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/platform/Zephyr/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ CHIP_ERROR InitRandomStaticAddress()

error = bt_id_create(&addr, nullptr);

if (error)
if (error < 0)
{
ChipLogError(DeviceLayer, "Failed to create BLE identity: %d", error);
return System::MapErrorZephyr(error);
Expand Down

0 comments on commit ed86aed

Please sign in to comment.