001/* 002 * Copyright (C) Cross The Road Electronics. All rights reserved. 003 * License information can be found in CTRE_LICENSE.txt 004 * For support and suggestions contact support@ctr-electronics.com or file 005 * an issue tracker at https://github.com/CrossTheRoadElec/Phoenix-Releases 006 */ 007package com.ctre.phoenixpro.wpiutils; 008 009import edu.wpi.first.hal.HALValue; 010 011/** 012 * @deprecated Classes in the phoenixpro package will be removed in 2024. 013 * Users should instead use classes from the phoenix6 package. 014 */ 015@Deprecated(forRemoval = true) 016public class CallbackHelper { 017 public static double getRawValue(HALValue value) { 018 switch(value.getType()) { 019 case HALValue.kDouble: 020 return value.getDouble(); 021 case HALValue.kBoolean: 022 return value.getBoolean() ? 1 : 0; 023 case HALValue.kInt: 024 return value.getLong(); 025 case HALValue.kLong: 026 return value.getLong(); 027 case HALValue.kEnum: 028 return value.getLong(); 029 default: 030 return 0; 031 } 032 } 033}