Skip to content

Commit

Permalink
add ble state 'initiating'
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielsantosphilips committed Oct 3, 2024
1 parent 4f2a49e commit 4798181
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions services/ble/Gap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ namespace infra
stream << "Scanning";
else if (state == services::GapState::advertising)
stream << "Advertising";
else if (state == services::GapState::initiating)
stream << "Initiating";
else
stream << "Connected";

Expand Down
3 changes: 2 additions & 1 deletion services/ble/Gap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ namespace services
standby,
scanning,
advertising,
connected
connected,
initiating
};

enum class GapAdvertisingEventType : uint8_t
Expand Down
1 change: 1 addition & 0 deletions services/ble/Gap.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ message State
scanning = 1;
connected = 2;
advertising = 3;
initiating = 4;
}
Event value = 1;
}
Expand Down
5 changes: 3 additions & 2 deletions services/ble/test/TestGapCentral.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,10 @@ namespace services
services::GapState stateScanning = services::GapState::scanning;
services::GapState stateAdvertising = services::GapState::advertising;
services::GapState stateConnected = services::GapState::connected;
services::GapState stateInitiating = services::GapState::initiating;

stream << stateStandby << " " << stateScanning << " " << stateAdvertising << " " << stateConnected;
stream << stateStandby << " " << stateScanning << " " << stateAdvertising << " " << stateConnected << " " << stateInitiating;

EXPECT_EQ("Standby Scanning Advertising Connected", stream.Storage());
EXPECT_EQ("Standby Scanning Advertising Connected Initiating", stream.Storage());
}
}

0 comments on commit 4798181

Please sign in to comment.