#include "device/gamepad/hid_haptic_gamepad.h"
#include <vector>
#include "base/ranges/algorithm.h"
#include "device/gamepad/hid_writer.h"
namespace device {
namespace {
const size_t kBitsPerByte = …;
void MagnitudeToBytes(double magnitude,
size_t report_size_bits,
uint32_t logical_min,
uint32_t logical_max,
std::vector<uint8_t>* bytes) { … }
}
HidHapticGamepad::HapticReportData kHapticReportData[] = …;
HidHapticGamepad::HidHapticGamepad(const HapticReportData& data,
std::unique_ptr<HidWriter> writer)
: … { … }
HidHapticGamepad::~HidHapticGamepad() = default;
std::unique_ptr<HidHapticGamepad> HidHapticGamepad::Create(
uint16_t vendor_id,
uint16_t product_id,
std::unique_ptr<HidWriter> writer) { … }
bool HidHapticGamepad::IsHidHaptic(uint16_t vendor_id, uint16_t product_id) { … }
const HidHapticGamepad::HapticReportData* HidHapticGamepad::GetHapticReportData(
uint16_t vendor_id,
uint16_t product_id) { … }
void HidHapticGamepad::DoShutdown() { … }
void HidHapticGamepad::SetVibration(mojom::GamepadEffectParametersPtr params) { … }
base::WeakPtr<AbstractHapticGamepad> HidHapticGamepad::GetWeakPtr() { … }
}