-
Notifications
You must be signed in to change notification settings - Fork 9
Some fixes for Zephyr testing #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dsseng
wants to merge
5
commits into
google:main
Choose a base branch
from
dsseng:zephyr-fixes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ea841f7
Generate compile_commands.json from Bazel
dsseng 9ecec71
Remove unsupported commands from the feature mask
dsseng 1bd59f0
fixup! Generate compile_commands.json from Bazel
dsseng 20ba9b4
Add an ideal PHY model and make it the default
dsseng f4c97c2
fixup! Add an ideal PHY model and make it the default
dsseng File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,11 @@ class Phy { | |
| LOW_ENERGY, | ||
| BR_EDR, | ||
| }; | ||
|
|
||
| enum class Model { | ||
| PSEUDORANDOM, | ||
| IDEAL, | ||
| }; | ||
| }; | ||
|
|
||
| } // namespace rootcanal | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -143,7 +143,7 @@ static std::array<uint8_t, 64> SupportedCommands() { | |
| // OpCodeIndex::REMOTE_NAME_REQUEST_CANCEL, | ||
| OpCodeIndex::READ_REMOTE_SUPPORTED_FEATURES, OpCodeIndex::READ_REMOTE_EXTENDED_FEATURES, | ||
| OpCodeIndex::READ_REMOTE_VERSION_INFORMATION, OpCodeIndex::READ_CLOCK_OFFSET, | ||
| OpCodeIndex::READ_LMP_HANDLE, OpCodeIndex::SETUP_SYNCHRONOUS_CONNECTION, | ||
| // OpCodeIndex::READ_LMP_HANDLE, OpCodeIndex::SETUP_SYNCHRONOUS_CONNECTION, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Careful, SETUP_SYNCHRONOUS_CONNECTION is implemented. |
||
| OpCodeIndex::ACCEPT_SYNCHRONOUS_CONNECTION, OpCodeIndex::REJECT_SYNCHRONOUS_CONNECTION, | ||
| OpCodeIndex::IO_CAPABILITY_REQUEST_REPLY, OpCodeIndex::USER_CONFIRMATION_REQUEST_REPLY, | ||
| OpCodeIndex::USER_CONFIRMATION_REQUEST_NEGATIVE_REPLY, | ||
|
|
@@ -171,7 +171,7 @@ static std::array<uint8_t, 64> SupportedCommands() { | |
|
|
||
| // CONTROLLER_AND_BASEBAND | ||
| OpCodeIndex::SET_EVENT_MASK, OpCodeIndex::RESET, OpCodeIndex::SET_EVENT_FILTER, | ||
| OpCodeIndex::FLUSH, | ||
| // OpCodeIndex::FLUSH, | ||
| // OpCodeIndex::READ_PIN_TYPE, | ||
| // OpCodeIndex::WRITE_PIN_TYPE, | ||
| // OpCodeIndex::READ_STORED_LINK_KEY, | ||
|
|
@@ -185,34 +185,41 @@ static std::array<uint8_t, 64> SupportedCommands() { | |
| OpCodeIndex::WRITE_INQUIRY_SCAN_ACTIVITY, OpCodeIndex::READ_AUTHENTICATION_ENABLE, | ||
| OpCodeIndex::WRITE_AUTHENTICATION_ENABLE, OpCodeIndex::READ_CLASS_OF_DEVICE, | ||
| OpCodeIndex::WRITE_CLASS_OF_DEVICE, OpCodeIndex::READ_VOICE_SETTING, | ||
| OpCodeIndex::WRITE_VOICE_SETTING, OpCodeIndex::READ_AUTOMATIC_FLUSH_TIMEOUT, | ||
| OpCodeIndex::WRITE_AUTOMATIC_FLUSH_TIMEOUT, | ||
| OpCodeIndex::WRITE_VOICE_SETTING, | ||
| // OpCodeIndex::READ_AUTOMATIC_FLUSH_TIMEOUT, | ||
| // OpCodeIndex::WRITE_AUTOMATIC_FLUSH_TIMEOUT, | ||
| // OpCodeIndex::READ_NUM_BROADCAST_RETRANSMITS, | ||
| // OpCodeIndex::WRITE_NUM_BROADCAST_RETRANSMITS, | ||
| OpCodeIndex::READ_HOLD_MODE_ACTIVITY, OpCodeIndex::WRITE_HOLD_MODE_ACTIVITY, | ||
| // OpCodeIndex::READ_HOLD_MODE_ACTIVITY, OpCodeIndex::WRITE_HOLD_MODE_ACTIVITY, | ||
| OpCodeIndex::READ_TRANSMIT_POWER_LEVEL, OpCodeIndex::READ_SYNCHRONOUS_FLOW_CONTROL_ENABLE, | ||
| OpCodeIndex::WRITE_SYNCHRONOUS_FLOW_CONTROL_ENABLE, | ||
| OpCodeIndex::SET_CONTROLLER_TO_HOST_FLOW_CONTROL, OpCodeIndex::HOST_BUFFER_SIZE, | ||
| OpCodeIndex::HOST_NUMBER_OF_COMPLETED_PACKETS, OpCodeIndex::READ_LINK_SUPERVISION_TIMEOUT, | ||
| // OpCodeIndex::SET_CONTROLLER_TO_HOST_FLOW_CONTROL, | ||
| OpCodeIndex::HOST_BUFFER_SIZE, | ||
| // OpCodeIndex::HOST_NUMBER_OF_COMPLETED_PACKETS, OpCodeIndex::READ_LINK_SUPERVISION_TIMEOUT, | ||
| OpCodeIndex::WRITE_LINK_SUPERVISION_TIMEOUT, OpCodeIndex::READ_NUMBER_OF_SUPPORTED_IAC, | ||
| OpCodeIndex::READ_CURRENT_IAC_LAP, OpCodeIndex::WRITE_CURRENT_IAC_LAP, | ||
| OpCodeIndex::SET_AFH_HOST_CHANNEL_CLASSIFICATION, OpCodeIndex::READ_INQUIRY_SCAN_TYPE, | ||
| // OpCodeIndex::SET_AFH_HOST_CHANNEL_CLASSIFICATION, | ||
| OpCodeIndex::READ_INQUIRY_SCAN_TYPE, | ||
| OpCodeIndex::WRITE_INQUIRY_SCAN_TYPE, OpCodeIndex::READ_INQUIRY_MODE, | ||
| OpCodeIndex::WRITE_INQUIRY_MODE, OpCodeIndex::READ_PAGE_SCAN_TYPE, | ||
| OpCodeIndex::WRITE_PAGE_SCAN_TYPE, OpCodeIndex::READ_AFH_CHANNEL_ASSESSMENT_MODE, | ||
| OpCodeIndex::WRITE_AFH_CHANNEL_ASSESSMENT_MODE, | ||
| OpCodeIndex::READ_EXTENDED_INQUIRY_RESPONSE, OpCodeIndex::WRITE_EXTENDED_INQUIRY_RESPONSE, | ||
| OpCodeIndex::REFRESH_ENCRYPTION_KEY, OpCodeIndex::READ_SIMPLE_PAIRING_MODE, | ||
| OpCodeIndex::WRITE_PAGE_SCAN_TYPE, | ||
| // OpCodeIndex::READ_AFH_CHANNEL_ASSESSMENT_MODE, | ||
| // OpCodeIndex::WRITE_AFH_CHANNEL_ASSESSMENT_MODE, | ||
| // OpCodeIndex::READ_EXTENDED_INQUIRY_RESPONSE, | ||
| OpCodeIndex::WRITE_EXTENDED_INQUIRY_RESPONSE, | ||
| OpCodeIndex::REFRESH_ENCRYPTION_KEY, | ||
| // OpCodeIndex::READ_SIMPLE_PAIRING_MODE, | ||
| OpCodeIndex::WRITE_SIMPLE_PAIRING_MODE, OpCodeIndex::READ_LOCAL_OOB_DATA, | ||
| OpCodeIndex::READ_INQUIRY_RESPONSE_TRANSMIT_POWER_LEVEL, | ||
| OpCodeIndex::WRITE_INQUIRY_TRANSMIT_POWER_LEVEL, | ||
| // OpCodeIndex::WRITE_INQUIRY_TRANSMIT_POWER_LEVEL, | ||
| // OpCodeIndex::READ_DEFAULT_ERRONEOUS_DATA_REPORTING, | ||
| // OpCodeIndex::WRITE_DEFAULT_ERRONEOUS_DATA_REPORTING, | ||
| OpCodeIndex::ENHANCED_FLUSH, OpCodeIndex::SEND_KEYPRESS_NOTIFICATION, | ||
| OpCodeIndex::SET_EVENT_MASK_PAGE_2, | ||
| // OpCodeIndex::READ_FLOW_CONTROL_MODE, | ||
| // OpCodeIndex::WRITE_FLOW_CONTROL_MODE, | ||
| OpCodeIndex::READ_ENHANCED_TRANSMIT_POWER_LEVEL, OpCodeIndex::READ_LE_HOST_SUPPORT, | ||
| OpCodeIndex::READ_ENHANCED_TRANSMIT_POWER_LEVEL, | ||
| // OpCodeIndex::READ_LE_HOST_SUPPORT, | ||
| OpCodeIndex::WRITE_LE_HOST_SUPPORT, | ||
| // OpCodeIndex::SET_MWS_CHANNEL_PARAMETERS, | ||
| // OpCodeIndex::SET_EXTERNAL_FRAME_CONFIGURATION, | ||
|
|
@@ -225,18 +232,18 @@ static std::array<uint8_t, 64> SupportedCommands() { | |
| // OpCodeIndex::SET_CONNECTIONLESS_PERIPHERAL_BROADCAST_DATA, | ||
| // OpCodeIndex::READ_SYNCHRONIZATION_TRAIN_PARAMETERS, | ||
| // OpCodeIndex::WRITE_SYNCHRONIZATION_TRAIN_PARAMETERS, | ||
| OpCodeIndex::READ_SECURE_CONNECTIONS_HOST_SUPPORT, | ||
| // OpCodeIndex::READ_SECURE_CONNECTIONS_HOST_SUPPORT, | ||
| OpCodeIndex::WRITE_SECURE_CONNECTIONS_HOST_SUPPORT, | ||
| OpCodeIndex::READ_AUTHENTICATED_PAYLOAD_TIMEOUT, | ||
| OpCodeIndex::WRITE_AUTHENTICATED_PAYLOAD_TIMEOUT, | ||
| // OpCodeIndex::READ_AUTHENTICATED_PAYLOAD_TIMEOUT, | ||
| // OpCodeIndex::WRITE_AUTHENTICATED_PAYLOAD_TIMEOUT, | ||
| OpCodeIndex::READ_LOCAL_OOB_EXTENDED_DATA, | ||
| // OpCodeIndex::READ_EXTENDED_PAGE_TIMEOUT, | ||
| // OpCodeIndex::WRITE_EXTENDED_PAGE_TIMEOUT, | ||
| // OpCodeIndex::READ_EXTENDED_INQUIRY_LENGTH, | ||
| // OpCodeIndex::WRITE_EXTENDED_INQUIRY_LENGTH, | ||
| // OpCodeIndex::SET_ECOSYSTEM_BASE_INTERVAL, | ||
| // OpCodeIndex::CONFIGURE_DATA_PATH, | ||
| // OpCodeIndex::SET_MIN_ENCRYPTION_KEY_SIZE, | ||
| OpCodeIndex::SET_MIN_ENCRYPTION_KEY_SIZE, | ||
|
|
||
| // INFORMATIONAL_PARAMETERS | ||
| OpCodeIndex::READ_LOCAL_VERSION_INFORMATION, OpCodeIndex::READ_LOCAL_SUPPORTED_FEATURES, | ||
|
|
@@ -252,17 +259,18 @@ static std::array<uint8_t, 64> SupportedCommands() { | |
| // STATUS_PARAMETERS | ||
| OpCodeIndex::READ_FAILED_CONTACT_COUNTER, OpCodeIndex::RESET_FAILED_CONTACT_COUNTER, | ||
| // OpCodeIndex::READ_LINK_QUALITY, | ||
| OpCodeIndex::READ_RSSI, OpCodeIndex::READ_AFH_CHANNEL_MAP, | ||
| OpCodeIndex::READ_RSSI, | ||
| // OpCodeIndex::READ_AFH_CHANNEL_MAP, | ||
| // OpCodeIndex::READ_CLOCK, | ||
| OpCodeIndex::READ_ENCRYPTION_KEY_SIZE, | ||
| // OpCodeIndex::GET_MWS_TRANSPORT_LAYER_CONFIGURATION, | ||
| // OpCodeIndex::SET_TRIGGERED_CLOCK_CAPTURE, | ||
|
|
||
| // TESTING | ||
| OpCodeIndex::READ_LOOPBACK_MODE, OpCodeIndex::WRITE_LOOPBACK_MODE, | ||
| OpCodeIndex::ENABLE_IMPLEMENTATION_UNDER_TEST_MODE, | ||
| OpCodeIndex::WRITE_SIMPLE_PAIRING_DEBUG_MODE, | ||
| OpCodeIndex::WRITE_SECURE_CONNECTIONS_TEST_MODE, | ||
| // OpCodeIndex::ENABLE_IMPLEMENTATION_UNDER_TEST_MODE, | ||
| // OpCodeIndex::WRITE_SIMPLE_PAIRING_DEBUG_MODE, | ||
| // OpCodeIndex::WRITE_SECURE_CONNECTIONS_TEST_MODE, | ||
|
|
||
| // LE_CONTROLLER | ||
| OpCodeIndex::LE_SET_EVENT_MASK, OpCodeIndex::LE_READ_BUFFER_SIZE_V1, | ||
|
|
@@ -276,13 +284,14 @@ static std::array<uint8_t, 64> SupportedCommands() { | |
| OpCodeIndex::LE_CLEAR_FILTER_ACCEPT_LIST, | ||
| OpCodeIndex::LE_ADD_DEVICE_TO_FILTER_ACCEPT_LIST, | ||
| OpCodeIndex::LE_REMOVE_DEVICE_FROM_FILTER_ACCEPT_LIST, OpCodeIndex::LE_CONNECTION_UPDATE, | ||
| OpCodeIndex::LE_SET_HOST_CHANNEL_CLASSIFICATION, OpCodeIndex::LE_READ_CHANNEL_MAP, | ||
| // OpCodeIndex::LE_SET_HOST_CHANNEL_CLASSIFICATION, OpCodeIndex::LE_READ_CHANNEL_MAP, | ||
| OpCodeIndex::LE_READ_REMOTE_FEATURES_PAGE_0, OpCodeIndex::LE_ENCRYPT, | ||
| OpCodeIndex::LE_RAND, OpCodeIndex::LE_START_ENCRYPTION, | ||
| OpCodeIndex::LE_LONG_TERM_KEY_REQUEST_REPLY, | ||
| OpCodeIndex::LE_LONG_TERM_KEY_REQUEST_NEGATIVE_REPLY, | ||
| OpCodeIndex::LE_READ_SUPPORTED_STATES, OpCodeIndex::LE_RECEIVER_TEST_V1, | ||
| OpCodeIndex::LE_TRANSMITTER_TEST_V1, OpCodeIndex::LE_TEST_END, | ||
| OpCodeIndex::LE_READ_SUPPORTED_STATES, | ||
| // OpCodeIndex::LE_RECEIVER_TEST_V1, | ||
| // OpCodeIndex::LE_TRANSMITTER_TEST_V1, OpCodeIndex::LE_TEST_END, | ||
| OpCodeIndex::LE_REMOTE_CONNECTION_PARAMETER_REQUEST_REPLY, | ||
| OpCodeIndex::LE_REMOTE_CONNECTION_PARAMETER_REQUEST_NEGATIVE_REPLY, | ||
| OpCodeIndex::LE_SET_DATA_LENGTH, | ||
|
|
@@ -321,8 +330,9 @@ static std::array<uint8_t, 64> SupportedCommands() { | |
| OpCodeIndex::LE_CLEAR_PERIODIC_ADVERTISER_LIST, | ||
| OpCodeIndex::LE_READ_PERIODIC_ADVERTISER_LIST_SIZE, | ||
| // OpCodeIndex::LE_READ_TRANSMIT_POWER, | ||
| OpCodeIndex::LE_READ_RF_PATH_COMPENSATION_POWER, | ||
| OpCodeIndex::LE_WRITE_RF_PATH_COMPENSATION_POWER, OpCodeIndex::LE_SET_PRIVACY_MODE, | ||
| // OpCodeIndex::LE_READ_RF_PATH_COMPENSATION_POWER, | ||
| // OpCodeIndex::LE_WRITE_RF_PATH_COMPENSATION_POWER, | ||
| OpCodeIndex::LE_SET_PRIVACY_MODE, | ||
| // OpCodeIndex::LE_RECEIVER_TEST_V3, | ||
| // OpCodeIndex::LE_TRANSMITTER_TEST_V3, | ||
| // OpCodeIndex::LE_SET_CONNECTIONLESS_CTE_TRANSMIT_PARAMETERS, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,8 +81,24 @@ void TestModel::StopTimer() { | |
| timer_tick_task_ = kInvalidTaskId; | ||
| } | ||
|
|
||
| std::unique_ptr<PhyLayer> TestModel::CreatePhyLayer(PhyLayer::Identifier id, Phy::Type type) { | ||
| return std::make_unique<PhyLayer>(id, type); | ||
| class IdealPhyLayer : public PhyLayer { | ||
| public: | ||
| IdealPhyLayer(PhyLayer::Identifier id, Phy::Type type) : PhyLayer(id, type) {} | ||
|
|
||
| int8_t ComputeRssi(PhyDevice::Identifier sender_id, PhyDevice::Identifier receiver_id, int8_t tx_power) { | ||
| return -30; | ||
| } | ||
| }; | ||
|
|
||
| std::unique_ptr<PhyLayer> TestModel::CreatePhyLayer(PhyLayer::Identifier id, Phy::Type type, Phy::Model model) { | ||
| if (model == Phy::Model::IDEAL) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you use a switch case preferably ? |
||
| return std::make_unique<IdealPhyLayer>(id, type); | ||
| } else if (model == Phy::Model::PSEUDORANDOM) { | ||
| return std::make_unique<PhyLayer>(id, type); | ||
| } else { | ||
| ERROR("Unknown PHY model: {}, using pseudorandom", static_cast<std::underlying_type_t<Phy::Model>>(model)); | ||
| return std::make_unique<PhyLayer>(id, type); | ||
| } | ||
| } | ||
|
|
||
| std::shared_ptr<PhyDevice> TestModel::CreatePhyDevice(std::string type, | ||
|
|
@@ -133,9 +149,9 @@ void TestModel::RemoveDevice(PhyDevice::Identifier device_id) { | |
| } | ||
|
|
||
| // Add a phy to the test model. | ||
| PhyLayer::Identifier TestModel::AddPhy(Phy::Type type) { | ||
| PhyLayer::Identifier TestModel::AddPhy(Phy::Type type, Phy::Model model) { | ||
| static PhyLayer::Identifier next_id = 0; | ||
| std::shared_ptr<PhyLayer> phy_layer = CreatePhyLayer(next_id++, type); | ||
| std::shared_ptr<PhyLayer> phy_layer = CreatePhyLayer(next_id++, type, model); | ||
| phy_layers_[phy_layer->id] = phy_layer; | ||
| return phy_layer->id; | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PathLossModel?