Adds HAL calls for match data from DS (#691)

This commit is contained in:
Thad House
2017-11-01 21:58:44 -07:00
committed by Peter Johnson
parent 237b2df82f
commit 6af4940c22
3 changed files with 98 additions and 0 deletions

View File

@@ -14,6 +14,7 @@
#include <condition_variable>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <mutex>
#include <string>
@@ -153,6 +154,23 @@ double HAL_GetMatchTime(int32_t* status) {
return SimDriverStationData.GetMatchTime();
}
int HAL_GetMatchInfo(HAL_MatchInfo* info) {
info->eventName = static_cast<char*>(std::malloc(1));
info->eventName[0] = '\0';
info->matchNumber = 0;
info->replayNumber = 0;
info->gameSpecificMessage = static_cast<char*>(std::malloc(1));
info->gameSpecificMessage[0] = '\0';
return 0;
}
void HAL_FreeMatchInfo(HAL_MatchInfo* info) {
std::free(info->eventName);
std::free(info->gameSpecificMessage);
info->eventName = nullptr;
info->gameSpecificMessage = nullptr;
}
void HAL_ObserveUserProgramStarting(void) { HALSIM_SetProgramStarted(); }
void HAL_ObserveUserProgramDisabled(void) {