001package com.ctre.phoenix;
002
003import edu.wpi.first.hal.HALValue;
004
005public class WPI_CallbackHelper {
006    public static double getRawValue(HALValue value) {
007        switch(value.getType()) {
008        case HALValue.kDouble:
009            return value.getDouble();
010        case HALValue.kBoolean:
011            return value.getBoolean() ? 1 : 0;
012        case HALValue.kInt:
013            return value.getLong();
014        case HALValue.kLong:
015            return value.getLong();
016        case HALValue.kEnum:
017            return value.getLong();
018        default:
019            return 0;
020        }
021    }
022}