mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01:42 +00:00
[hal] Replace const char* with std::string_view in Driver Station sim functions (#4532)
This commit is contained in:
@@ -254,8 +254,8 @@ class FMSSimModel : public glass::FMSModel {
|
||||
void SetAutonomous(bool val) override {
|
||||
HALSIM_SetDriverStationAutonomous(val);
|
||||
}
|
||||
void SetGameSpecificMessage(const char* val) override {
|
||||
HALSIM_SetGameSpecificMessage(val);
|
||||
void SetGameSpecificMessage(std::string_view val) override {
|
||||
HALSIM_SetGameSpecificMessage(val.data(), val.size());
|
||||
}
|
||||
|
||||
void Update() override;
|
||||
|
||||
@@ -166,8 +166,8 @@ void HALSimWSProviderDriverStation::OnNetValueChanged(const wpi::json& json) {
|
||||
HALSIM_SetDriverStationMatchTime(it.value());
|
||||
}
|
||||
if ((it = json.find(">game_data")) != json.end()) {
|
||||
HALSIM_SetGameSpecificMessage(
|
||||
it.value().get_ref<const std::string&>().c_str());
|
||||
std::string message = it.value().get_ref<const std::string&>();
|
||||
HALSIM_SetGameSpecificMessage(message.c_str(), message.length());
|
||||
}
|
||||
|
||||
// Only notify usercode if we get the new data message
|
||||
|
||||
Reference in New Issue
Block a user