mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
halsim_ds_socket: Update tag parsing, and add rumble support (#1214)
Outputs are now sent. Ensure only the proper number of outputs are actually sent though. Also adds match time, and proper enable tags.
This commit is contained in:
committed by
Peter Johnson
parent
d54c2665dc
commit
63c1f80d60
@@ -6,15 +6,26 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
#include <vector>
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#include <hal/DriverStation.h>
|
||||
|
||||
namespace halsim {
|
||||
|
||||
typedef struct {
|
||||
std::vector<int16_t> axes;
|
||||
uint8_t button_count;
|
||||
uint32_t buttons;
|
||||
std::vector<int16_t> povs;
|
||||
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)); }
|
||||
} DSCommJoystickPacket;
|
||||
|
||||
} // namespace halsim
|
||||
|
||||
Reference in New Issue
Block a user