2018-07-22 17:00:06 -05:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
|
|
|
|
|
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
|
|
|
|
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
|
|
|
|
/* the project. */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
2018-07-26 01:30:29 -07:00
|
|
|
|
|
|
|
|
#include <cstring>
|
|
|
|
|
|
|
|
|
|
#include <hal/DriverStation.h>
|
2018-07-22 17:00:06 -05:00
|
|
|
|
2018-07-22 23:03:55 -07:00
|
|
|
namespace halsim {
|
|
|
|
|
|
2018-07-22 17:00:06 -05:00
|
|
|
typedef struct {
|
2018-07-26 01:30:29 -07:00
|
|
|
HAL_JoystickAxes axes;
|
|
|
|
|
HAL_JoystickButtons buttons;
|
|
|
|
|
HAL_JoystickPOVs povs;
|
|
|
|
|
HAL_JoystickDescriptor descriptor;
|
|
|
|
|
|
|
|
|
|
void ResetUdp() {
|
|
|
|
|
std::memset(&axes, 0, sizeof(axes));
|
|
|
|
|
std::memset(&buttons, 0, sizeof(buttons));
|
|
|
|
|
std::memset(&povs, 0, sizeof(povs));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ResetTcp() { std::memset(&descriptor, 0, sizeof(descriptor)); }
|
2018-07-22 17:00:06 -05:00
|
|
|
} DSCommJoystickPacket;
|
2018-07-22 23:03:55 -07:00
|
|
|
|
|
|
|
|
} // namespace halsim
|