[hal] Replace const char* with std::string_view in Driver Station sim functions (#4532)

This commit is contained in:
Ryan Blue
2022-12-09 16:10:23 -05:00
committed by GitHub
parent 5a52b51443
commit bde383f763
11 changed files with 60 additions and 44 deletions

View File

@@ -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