Squashed 'third_party/allwpilib/' changes from 00e090877..66b57f032
66b57f032 [wpimath] Copy child constraint in region constraints (#2831)
cfac22b4c [wpilib] Reset odometry in path following examples (#2859)
2ef67f20a [wpilib] Add way to silence joystick connection warnings (#2845)
7a73946ce [build] Update OpenCV to remove WITH_GTK (#2856)
6d22b5a3c [wpigui] Render during resize events (#2857)
50050a0e5 [wpilibc] Update C++ DiffDriveSim example to match Java (#2839)
de1742279 [wpilib] Add IsJoystickConnected method (#2847)
6b5e83ce1 [wpilibj] DrivetrainSim: Initialize m_u to default value (#2854)
17d75d8a3 [wpilibj] SimDeviceSim: Make register device callbacks static (#2835)
616405f7a [wpilib] Fix DiffDriveSim pose reset and example (#2837)
5c2dc043c [wpilib] Update examples to export NewCommands (#2841)
24a3c12f3 [wpilib] Fix names and descriptions of examples (#2846)
3e544282f [hal] Use FPGA time in HAL_SendError (#2849)
3c85a4064 [sim] Use units for voltage and current in RoboRioSim (#2853)
ac3c336b9 [wpimath] Use units for LinearSystemId Kv and Ka (#2852)
f24f28244 [build] Disable Gazebo builds when -PmakeSim is not set (#2810)
0dfee4745 [wpiutil] netconsoleTee: Add option to specify port (#2840)
eb80f7a78 [wpilibc] SendableRegistry: Add range and null checks (#2830)
68fed2a1a [build] Update NativeUtils to 2021.0.4 (#2828)
10d118a8d Fix C++ gradle in OtherVersions.md (#2826)
e021c3319 [wpilib] Set AnalogPotentiometer dashboard type (#2825)
7b7548196 [wpilib] AnalogPotentiometer: provide scaled value to Dashboard (#2824)
e019c735e [build] Update compiler to 2021 (#2823)
c253f2c7e Update Readme to match current practice (NFC) (#2820)
0ce9133b5 [wpimath] Address issues with LinearSystemLoop reset() and matrix initialization (#2819)
6ac9683a3 [build] Fix Gradle flags for CI documentation job (#2817)
1d7739d8d [build] Build with -PreleaseMode on tag push (#2816)
1de2a6d85 [build] Fix release versioning (#2815)
0a723a50d [build] Use fetch-depth: 0 to get all history (#2812)
34b91318f [build] Add Developer ID signing workflow (#2779)
b11a7114a [build] Bump thirdparty-opencv to 3.4.7-4 (#2811)
2ca5e1c8d Update requirements in README to include full VS install and JDK (#2808)
7ae8c7b24 [sim] Use DutyCycleEncoder FPGA index for sim device number (#2803)
1e17e4086 [build] Add a javaFormat Gradle task (#2805)
1069019fd [wpilib] Add DutyCycleEncoderSim (#2798)
4422904a2 [build] Add WITH_GUI cmake option
5d085b78b [build] Fix cmake shared library build
0927c73b1 [build] Update NativeUtils to latest version (#2797)
5fe8f9017 [build] Refactor CMake flags (#2788)
5cdffeaba [sim] StepTiming(): incrementally step Notifiers in sequence (#2794)
6e7c7374f [build] Globally Exclude PMD.TooManyMethods (#2793)
fb7b41793 [wpilib] Add ADXRS450_GyroSim (#2800)
abbf9f01a [wpilib] Fix typos in simulation classes (#2799)
17698af5e [wpimath] Add distance/angle constructor to Translation2d (#2791)
b66fcdb3f [sim] Fix Field2D GUI crash when collapsed (#2786)
7fc48b75d [command] Add PIDSubsystem PIDController as child (#2784)
07ac5370d [wpimath] Fix m_nextR instantiation in LinearSystemLoop ctor (#2783)
7c8f1cf7a [wpilib] Support scheduling functions more often than robot loop (#2766)
57a97e3fb [wpilib] Remove WatchdogTest print statements (#2781)
061432147 [wpilib] Clean up physics simulation class APIs (#2763)
8f3e5794b [wpilib] Add TimedRobot unit tests (#2771)
a112b5e23 [wpilib] Fix ProfiledPIDController continuous input (#2652)
67859aea4 [build] Split documentation into its own job (#2775)
37643ab0b [wpimath] Use std::lower_bound in Trajectory::Sample() calculation (#2774)
b0ee11f7c [build] Update vcpkg actions to latest (#2776)
7647e29b2 Add docs for building robot projects with other WPILib versions (#2756)
a3e672f86 [wpimath] C++: Assign zero in MakeWhiteNoiseVector if std-dev is zero (#2773)
9058fe803 [wpilib] Update docs link to stable (NFC) (#2772)
32f429a81 [wpimath] Move DiscretizeR() in EKF and UKF from Predict() to Correct() (#2753)
bf2665654 [wpimath] Fix quintic spline generation from control vectors (#2762)
96e26247d [wpiutil] Add custom priority queue implementation (#2770)
8e538aa82 [wpilibc] Make IsSimulation() checks constexpr (#2769)
fa809b2c4 [wpilibc] Clean up include files (#2708)
9a63cd36c [wpilibc] Const-qualify Watchdog comparison operator (#2767)
21d949daa [wpilibc] Add LinearSystemLoop C++ ctor to match Java (#2755)
330b90e04 [wpilib] Enable ArmSubsystem in ArmBot example (#2752)
693daafe2 [wpilib] Rename LinearSystemSim's ResetState() to SetState() (#2750)
c3b3fb8b7 [sim] Change StepTiming to wait for notifiers (#2603)
62731bea2 [wpilib] Add set functions to differential drive simulation (#2746)
c55fb583b [wpilibj] Watchdog: Implement equals and hashCode (#2743)
9725aff83 [wpilib] Clean up DifferentialDrivetrainSim API (#2747)
1320691eb [wpilib] Shorten differential drive simulation stability test (#2745)
451f67c63 [hal] SimDevice class: remove HAL_SimDeviceHandle constructor (#2744)
43b1b128b Improve README-CMAKE.md (#2737)
fc991cb59 [wpilib] Clean up simulation physics API (#2739)
17d3d2f75 [wpilibc] Add ScopedTracer class (#2724)
73950b985 [wpilibc] RobotBase::IsReal, IsSimulation: Add doxygen comments (#2735)
61ee331f1 [build] Double gradle build max heap size to 2G (#2689)
651319589 [wpilibc] Fix a use-after-free in DifferentialDrivetrainSim (#2741)
5479948bd Update filepaths in thirdparty notices (#2713)
1ec145ec8 [imgui] Add IMGUI_IMPL_OPENGL_LOADER_GL3W to cmake compile defs (#2728)
8ab47cb07 [wpilib] Add C++ diff-drive sim tests and fix Java test name (#2729)
b7b3dcf3e Reorganize build documentation (#2712)
f7da0b452 Improve list of build requirements in README (#2709)
f9a338018 [build] Add macOS CMake CI (#2711)
b61f08d3f [wpilib] Add physics simulation support with state-space (#2615)
050322592 [build] CMake: Fix Metal linking on macOS (#2725)
d4d0b5501 [wpilib] Use more inclusive terminology (NFC) (#2723)
6c5726c96 Add CODE_OF_CONDUCT (#2716)
56972447b [wpigui] Only build static for both gradle and cmake (#2703)
67e1796ef [wpimath] Fix Eigen rule-of-three violations (#2707)
1ae8da3b3 [wpigui] Move portable-file-dialogs.h to wpigui and upgrade it (#2704)
3ed97f45f [cscore] Properly init variable in usbviewer (#2702)
ae2809cad [wpimath] Update KalmanFilter C++ class docs based on Java (NFC) (#2699)
b0a296477 [wpimath] Use newer link to controls book in comments (NFC) (#2700)
629a4574d [wpimath] Include Eigen headers in cppHeadersZip (#2696)
4be809499 [wpimath] Use more specific Eigen includes in headers (#2693)
b10063da9 [sim] Set Encoder reset to false when count set (#2692)
5e54e1314 [sim] Ignore incoming websocket DS/Joystick when real DS connected
8f87c5631 [sim] Automatically turn off GUI DS when real DS connected
1b18560e9 [sim] ds_socket: Remove iostream
f86a5f9b0 [sim] WebSockets: don't override HAL_Main
f1b1bdb12 [hal] Add HAL_Shutdown and simulation shutdown callbacks
0365557b2 [sim] Make extension registry thread-safe
883d96283 [wpiutil] SimpleBufferPool: Deallocate on destruction
35790a899 [wpimath] Remove rho overload from LinearQuadraticRegulator constructors (#2687)
8edc17dac [wpimath] Add Vector overload for times and div (#2686)
502f5c8b5 [wpimath] Make LinearPlantInversionFeedforward's A and B matrices final (#2688)
bc28fb187 [wpimath] Remove print from LinearSystemIDTest (#2684)
de0277713 [sim] Add API for extensions to discover each other (#2681)
1593eb4d4 [sim] Add plotting to simulation GUI
70ba92f91 [sim] GUI: Show DS info even when GUI DS disabled
47cc71ea0 [hal] Add HALSIM_GetJoystickCounts
9453d6727 [sim] Output more error details on extension load failure (#2680)
f758af826 [wpilib] Use misspell to find more spelling errors (NFC) (#2679)
6a1e5385e [sim] WS: Don't call virtual function from destructor
63487dca7 [sim] Fix WS blank device messages (e.g. DriverStation)
7d6f09f5c [sim] SimDataValue: Fix cancellation
148eed3cd [sim] Make sure NotifyListener members are initialized
05701317b [build] Make loading sim extensions from MyRobot easier (#2671)
7548fdae5 [hal] Fix InitialzeInterrupts naming (#2673)
3e41d92c1 [wpilib] Use misspell to fix spelling errors (NFC) (#2674)
ad6c8b882 [hal] Fix PDP Energy Calculation (#2672)
947ff655c [wpimath] Refactor KalmanFilter to be steady-state only (#2657)
183b7c85a [wpigui] Handle Direct3D framebuffer resize
4cf6947af [cscore] Add wpigui-based USB camera viewer
b83709b26 [wpigui] Add GetDistSquared and MaxFit functions
c699d5517 [wpigui] Build dev executable in cmake build
781afaa85 [wpigui] Refactor texture handling
007b03a2c [hal] Fix wpiformat errors (#2670)
ed1869334 [hal] Add no throw/error version of CAN Write methods (#2063)
7c99224bb Create maintainers.md (#1937)
c2c409090 [build] Fix CMake imgui and wpigui on macOS (#2669)
416288061 [build] Fix Gradle build on macOS 11.0 Big Sur (#2656)
83376bc23 [build] Add sourcelink support for windows pdbs (#2592)
c0de98f9f [sim] Fix GUI scaling of window sizes (#2668)
70db0db22 [build] Don't unconditionally regenerate wpimath numbers (#2665)
526f26685 [wpilib] Add methods to check game and enabled state together (#2661)
5d1220e62 [sim] Use wpigui for simulator GUI
b80fde438 [wpigui] Add wpigui wrappers for GLFW+imgui
148f43b4a [wpilibc] Use LLVM containers in ShuffleboardInstance (#2658)
0d88213de [sim] Add missing new line to extension loader message (#2663)
36b8d74fa [build] Revert "[build] Apply temporary JDK arch fix (#2643)" (#2655)
5021f2815 [wpilibc] Fix InterruptableSensorBase comment (#2659)
ee6a81457 [wpilib] Enable continuous input on theta controller in swerve examples (#2651)
807de9a0a [build] Fix Eigen include path for CMake install (#2649)
9398b6b55 [sim] Add AnalogEncoderSim (#2647)
932bfcf37 [sim] Add WebSocket extension (client/server) (#2589)
e127bac7f [sim] Properly initialize AnalogTrigger (#2646)
bccf13bf6 [build] Run unit tests in CMake build (#2644)
950bbd6dc [wpilibj] Fix joystick button edge synchronisation (#2433)
e680ba85f [build] Apply temporary JDK arch fix (#2643)
b23ede7d5 [wpimath] Remove unnecessary copying in constraints (#2645)
73047d8b3 [wpiutil] Fix WPIUtilJNI.now() implementation (#2640)
ef5e0c2e7 [wpimath] Remove duplicate WPIMathJNI class (#2639)
dc9e560f9 [sim] Add callback for NotifyNewData
ae5b07ba0 [hal] Add stubs for sim joysticks and match info on Rio
3384c23a5 [build] Specify --tags on fetch and add version sanity check (#2638)
c2259d42a [wpilib] Add Toggle() function to solenoid classes (#2635)
370e9d089 [build] Remove Azure Pipelines CI
cab8b18c6 [build] Add GitHub Actions CI Workflow
3b283ab9a [wpimath] Add core State-space classes (#2614)
e5b84e2f8 [wpimath] Use project includes for units, Drake, Eigen (#2634)
f86417d79 [wpimath] Move MathShared.h to wpimath/ directory
8dc3d2383 [wpimath] Move DrakeJNI to edu.wpi.first.math.WPIMathJNI
42993b15c [wpimath] Move math functionality into new wpimath library (#2629)
ad817d4f2 [sim] Map wpi::Now() to simulated FPGA time (#2631)
77954bb3d [wpiutil] Add JNI wrapper for wpi::Now() (#2632)
52f7a62e1 [wpiutil] Allow aarch64 platform on any OS (#2625)
1b8ceb36f [sim] Add callbacks for joysticks and match info (#2628)
ceea1f9d4 [sim] Add Mechanism2D to Simulation GUI (#2607)
2f81f2b78 [wpilib] Fix timestamp slew in SlewRateLimiter (#2627)
aba035eb3 [command] Modify swerve and mecanum commands to use new controller
5ca270208 [wpilib] Add HolonomicDriveController class and tests
af588adce [wpiutil] Add angle normalization method
399684a58 [wpilibc] Make SendableChooser movable (#2621)
5cf4c16f5 [wpilibj] Suppress serialVersionUID warnings (#2618)
0fe2319df [wpilibj] Use try with resources for Java tests (#2612)
e759dad01 [wpiutil] Add Drake and Drake JNI (#2613)
0c18abed3 [build] Double gradle build max heap size to 1G (#2616)
89dad2fd8 [build] Use artifactory doxygen mirror (#2600)
a6a71f8c7 [hal] Fix RoboRIO notifier never starting (#2611)
1fee190fd [wpiutil] Add MIME type utility (#2608)
23ba3ca19 [wpilib] Change Watchdog to use HAL notifier (#2602)
33d836329 [sim] Fix HAL notifier race condition (#2606)
49dcf7cf5 [command] Speed up MecanumControllerCommand and SwerveControllerCommand tests (#2604)
9778445a7 [sim] Change stepTiming to take seconds (#2599)
c2cc90b27 [sim] Move WPILib C++ sim implementations out of line (#2598)
b9feb8122 [sim] Add joystick simulation support (#2595)
b06ddcdd8 [wpilib] Improve and sync AnalogPotentiometer docs (NFC) (#2580)
16ef372b5 [hal] Merge WaitForCachedData into WaitForDSData (#2587)
f0a34ea64 [wpilib] Remove Analog Gyro specific docs from Gyro interface (#2596)
33f7dec5c [wpilibj] Fix Gyro.getRotation2d() units bug (#2594)
300580359 [build] Update to latest native utils (#2591)
eeaaf5d25 [build] Add Azure build using cmake on Windows (#2588)
15819cc98 [command] Add SimulationPeriodic to templates (#2582)
fe6bfb1ba [cscore] Provide USB Camera VID and PID in Windows (#2585)
5c8d7b242 [build] Remove install prefix from CMakeLists.txt for Windows (#2584)
ff0801d78 [build] Revert change to DeriveLineEnding made in #1961 (#2581)
ac4b0a311 [wpilib] AnalogPotentiometer: Use average voltage (#2583)
227084e92 [hal] Implement stub mockdata on RoboRIO (#2575)
a175f6e86 [command] Add simulationPeriodic method to Subsystem (#2577)
4043c461d [wpiutil] HttpServerConnection: Make more functions virtual (#2576)
b3b2aa635 [wpilib] Fix SplineHelper cubic spline bug (#2572)
5bd2dca46 [sim] Move HAL_LoadExtensions to end of HAL_Initialize (#2571)
21740fd2c [build] Add PDBs to jnicvstatic archives (#2573)
c11ef442f [wpiutil] Add HttpWebSocketServerConnection (#2505)
b5a38001d [cscore] Add support for changing the USB camera path (#2547)
5b6f68cf7 [wpilib] Add parentheses to MSVC #pragma message (#2569)
3050e935a [sim] Add WPILib-class-taking constructors (#2538)
80a1fa9ec [sim] Add support for disabling SimDevices (#2568)
1851ba143 [sim] Remove index from RoboRIO simulation interface (#2567)
c4b8a2505 [sim] Add Java wrapper for getProgramStarted (#2566)
a1d2d40ad [wpilib] Add RamseteController examples (#2553)
a3881bb45 [wpilibc] Add implicit conversion from degree_t to Rotation2d (#2564)
6e4ee8da2 [cscore] Limit jnicvstatic exports to only C and JNI symbols (#2565)
2a0f79b90 [wpilib] Add X and Y component getters to Pose2d and Transform2d (#2563)
5ccc98bc1 [wpiutil] Add angular acceleration units (#2562)
b1353e4d6 [cscore] Fix jnicvstatic classifier (#2561)
9f4de9155 [cscore] Add new jnicvstatic artifact type (#2560)
d30d1088d [wpiutil] Split units.h into separate headers for each unit (#2551)
c6e634664 [sim] Support StepTiming() even when timing is not paused (#2558)
e08c8a1fc [wpiutil] Add circular buffer class with static size (#2542)
e50dbe0c4 [wpilib] Add Gyro::GetRotation2d() (#2555)
d9c7bbd04 [wpiutil] Restore existing dll directory when setting dll directory (#2559)
dac0e5b13 [sim] Set Windows timer precision to 1ms (#2557)
ce3bc9194 [sim] Move Sim classes from HAL to wpilibc/j (#2549)
22c0e2813 [build] Upgrade CI to clang-format 10.0 (#1961)
9796987d5 [wpiutil] Add new combined native class loader (#2554)
4d275e476 [cscore] Fix USB camera test failure (#2556)
492d6c282 [sim] Update thirdparty-imgui (#2552)
765f00935 [wpiutil] Add HttpQueryMap and HttpPath/HttpPathRef (#2544)
629e8b41f [sim] Provide method to set the runtime type (#2539)
71c187a1e [hal] Add GetIndex() to handles classes (#2548)
00e991e2a [wpiutil] Add dual-IPv4/IPv6 uv::AddrToName() (#2545)
8a80f97c0 [hal] Move JNI helpers and sim namespace to hal namespace (#2543)
3cbec411c [build] Add package declaration check to checkstyle (#2446)
3bcb89fb8 Set rpath on all unix platforms to $ORIGIN (#2299)
62b8a36ce [sim] Wrap timing functions in C++ SimHooks (#2540)
27566abb0 [command] PIDSubsystem: Add GetSetpoint (#2534)
dfb130270 [wpilib] Use inclusive language where practical (#2533)
1ba616f84 [build] Fix 32-bit Windows builds (#2537)
11fb0a4cb [cscore] EnumerateUsbCameras(): Only list capture devices (#2532)
1557a4c3b [sim] Make SimDeviceInfo/SimValueInfo data members public (#2531)
ab28a7d65 [build] Run Gradle Wrapper validation on PRs (#2527)
d58a5e124 [sim] Name DSCommJoystickPacket structure (#2525)
762347f00 [wpilibj] Throw separate exception for constraint misbehavior (#2510)
4b76adf15 [wpilibc] Remove incorrect timer rollover (#2523)
6be1b9524 [wpilibj] Trajectory: Add zero-arg constructor (#2513)
38ad79061 CONTRIBUTING.md: Change Travis to Azure (#2520)
86acb27e2 [wpilibc] Fix doxygen comments (#2519)
1b395fa21 [wpilib] Implement Trajectory.equals() (#2517)
92380485c [command] Make cancel safe to call from initialize (#2440)
27f9a21a2 [wpilib] Moved Watchdog output to reportWarning() (#2413)
cf7088a46 [wpilibj] RamseteController: Fix units typo in javadocs (#2515)
67554ef3b [build] Add .inl files to styleguide (NFC) (#2506)
cf20b068c [sim] Map HAL_GetSystemActive to HALSIM_GetDriverStationEnabled (#2501)
0b9316d94 [build] Revert workaround for azure windows library loading issue (#2481) (#2499)
3011ebe54 [wpilibc] Fix uninitialized variable in Trajectory class (#2495)
4b77b0773 [wpilibj] SensorUtil: change exception type (#2490)
e5935a473 [wpilibc] Fix const-qualification in kinematics and constraints (#2478)
a3a8472b8 [wpilib] Trajectory: Add MaxVelocity and Region constraints (#2466)
212182d99 [wpilibj] Remove getSimObject (#2479)
c82b8546b [build] Work around azure windows library loading issue (#2481)
fac4e3fcf [wpilibc] Add real-time priority constructor to Notifier (#2303)
5b0122fed [sim] Add NetworkTables view to Simulation GUI (#2327)
b46b5df16 [wpilibc] Output Tracer to DriverStation by default (#2469)
cb5102933 [wpilib] Add Color.fromHSV() static helper (#2461)
e504b3ecb [command] Add NetworkButton (#2373)
0ad0ec098 [wpilibj] Move button tests to button package (#2472)
d1d32ada0 [build] Fix artifact publishing (#2471)
8058daa98 [sim] Add encoder rate and distance to Simulation GUI (#2470)
f4c5c0f5b [command] Add withName inline decorator to Java (#2420)
2ecb8dab7 Add issue templates (#2189)
576d427f0 [wpilib] SpeedControllerGroup: Add vector-taking constructor (#2194)
21aafea09 [hal] Use std::thread for Notifier thread on Rio (#2152)
3ed290856 [sim] Add HALSIM accessors for encoder rate and distance (#2467)
2b188b54d [ntcore] Always show StartLocal instances as connected (#2462)
306720e63 [build] Split build logic into separate files (#2457)
a308dd447 [wpilib] Fix SplineHelper quintic spline generation bug (#2429)
8f33d21bc [wpilib] Add init methods to Preferences (#2443)
b9ee3ae03 [wpilibc] Refactor Tracer functionality out of Watchdog class (#2456)
c14b87b22 [wpilibj] Refactor Tracer functionality out of Watchdog class (#2452)
8a279aaf2 [build] Check SHA-256 of downloaded Gradle distribution (#2169)
3a5e541b2 [wpilibc] Add doxygen deprecated tag to deprecated methods (#2336)
43574128b Add a CODEOWNERS file (#2431)
e4a990384 [build] Fix generateJavadoc dependencies (#2458)
0d30108dc [wpiutil] Endian.h: minor cleanup and improvements (#2454)
b7a79c70c C++: Add Watchdog to CommandScheduler (#2437)
6e6f28d1a Add watchdog and epoch reporting to CommandScheduler (#2319)
d14978e54 New commands: add docs to end() (#2450)
1c28b729a Move curvature_t to units namespace (#2444)
303194b08 Add missing CAN definition for IO Breakout (#2394)
2ee3bfaa2 Make SlewRateLimiter unit declarations public (#2445)
029a94dd3 Remove old simulation bits (ds_nt, lowfi, print) (#2432)
f6df9217b Remove static import usage in SelectCommand example (#2442)
184fae4ba DutyCycleEncoder: Set ownsDutyCycle for channel constructor (#2436)
35b236651 Timer.start(): Match C++ behavior in Java (#2434)
c92677055 DutyCycleEncoder: Close created DigitalInput (#2435)
272eaf184 DutyCycleEncoder: Fix simulation support (#2387)
56fbb1fc3 Make Ultrasonic.setAuto() static (#2419)
33f6bf947 DriverStation (Java): Make getStickButton functions public (#2424)
07326edb6 Sim GUI: Add user rename support to SimDevice list (#2426)
144610151 Bump NativeUtils to enable bigobj (#2430)
4228d3609 Fix Watchdog epoch prints being off by three orders of magnitude (#2414)
510936a2a Improve Button API documentation in GenericHID (#2421)
5854e284e Convert license file to Markdown (#2190)
a732606e5 Geometry classes: remove explicit serializers/deserializers (#2312)
84e300739 Fix ProfiledPIDController profile direction for continuous input (#2279)
8edf9282c Timer: synchronize on lock object (#2352)
5a1acaaef Update copyright dates for #2121 (#2415)
4fd7c210d Shuffleboard: Fixed mix up of title and type parameters (#2121)
a26a7d217 Remove references to percent tolerance (#2380)
7b7f44d93 Use netcomm function to get target class rather then hardcoded (#2391)
6cf89aa0f Fix interrupt cancellation (#2406)
3be83784c Add Transform2d::Inverse() (#2407)
b6c163acd Const-qualify frc2::Timer::HasElapsed() (#2397)
05a26b727 Fix missing Field2d package (#2386)
35eb90c13 Fix "'dimensionless' ambiguous symbol" error (#2382)
761f79385 Add SimulationInit and SimulationPeriodic functions (#2377)
554bda333 HAL: Expose NetComm SendConsoleLine (#2337)
2a968df77 Add method for releasing a waiting interrupt (#2347)
30ccd13b6 Add methods for getting color of an LED (#2366)
60c09ea51 Fix notifier race happening with very fast notifiers (#2370)
65eab9352 Fix DifferentialDriveVoltageConstraint for tight turns w/ zero velocity (#2341)
a226ad850 Set a default option for Sendable Chooser in examples (#2361)
31f4fd70c Sim GUI: Fix crash when field/robot image load is canceled (#2362)
7275ab983 Add headerpad_max_install_names to Mac builds (#2333)
5b3facc63 TrapezoidProfile: Make units public (#2342)
0f313fb9a cmake: Improved portability of OpenCV Java binding search (#2348)
05b7593e6 C++ circular_buffer: support types not implicitly convertible from int (#2350)
1b85066d2 Fix C++ ParallelRaceGroup multiple calls behavior (#2339)
e93b64f58 Add note that only a single instance of ADXRS450 is supported (#2349)
f0a18f31e Timer: add hasElapsed, advanceIfElapsed (#2322)
29c82527a Fix typo in ADXL sim double creation (#2332)
c165dc5e5 Simulation GUI: Add 2D field view (#2261)
42da07396 Add missing references to f in PIDSubsystem javadoc (#2318)
20e6c0405 Fix cmake install of hal generated files (#2320)
ff5d3e5b3 RamseteController: Add setEnabled method (#2313)
6cc68ab50 Update MavenArtifacts.md (#2289)
068465146 Fix null check order in SendableRegistry (#2314)
3bcf8057d Add more detail to RuntimeLoader failure message (#2309)
8039a6c52 Add missing include to ShuffleboardEventImportance (#2310)
558c020cc Fix duplicated state when using quintic splines (#2307)
7797da78f Add missing methods to Timed and TimedSkeleton templates (#2306)
0ab81d768 Add feed-forward and slew rate limiting to advanced drive examples (#2301)
1cee5ccb9 Feed RobotDrive watchdog in RamseteCommand example (#2298)
3ce01b5ac Fix DriveSubsystem.getHeading Java documentation (#2282)
e6aa8f3ff Update toolchain link in readme (#2304)
9d7b08797 Simulation GUI: Add support for custom names (#2292)
bb184ed48 Simulation GUI: Refactor ini saving (#2291)
b9b31069c Fix C++ POVButton (#2294)
d0cf4e888 Change sim Filesystem.getDeployDirectory() to src/main/deploy (#2293)
02fb85076 Add new speed controllers to shuffleboard docs (#2288)
ac8177e10 Fix GearsBot log methods not being called periodically (#2280)
2eb5c5447 TrapezoidProfile: Fix aliasing of m_initial to result in calculate() (#2284)
0e206e69c Remove Set Camera Server Shared message (#2285)
b1357cace Fix LiveWindow SetEnabled C++ std::bad_function_call (#2281)
37202b6f2 Add missing SensorUtil::kAnalogOutputs (#2276)
2ac0d5296 Remove AnalogTrigger::SetDutyCycle (#2275)
dbe1e6f46 Fix missing SetDutyCycleSimDevice on Rio (#2274)
a61fcbd68 Make Button class concrete (#2244)
fe597eeba Fix SPI DIO count for sim (#2272)
e213a47ef Official Gradle Wrapper Validation GitHub Action (#2273)
dcb96cb50 TrajectoryGenerator: Allow replacement of error reporting function (C++) (#2267)
60d48fec5 Fix Java static colors having zero values (#2269)
ee8475d21 Run wpiformat (#2270)
f47e31813 C++ units: Interoperate with Windows headers min/max (#2268)
cb66bcca3 Add callback handlers for LiveWindow (#2053)
73302f616 Fix color name typos (#2265)
cba21a768 Fix C++ JoystickButton and POVButton (#2259)
822e75ec4 Simulator GUI: Handle save file having window size=0 (#2260)
108ddfa1b Fix Pi Camera auto exposure property name (#2258)
d4c8ee591 Add Axis enum in XboxController (#2253)
ab9647ff5 CommandScheduler: Don't store NetworkTableEntry
6666d3be4 SendableBuilder: Allow multiple updateTable functions
795086b4c Fix Demangle when used standalone (#2256)
56765cf49 C++ CommandBase: Don't add to LiveWindow (#2255)
bf7012fa2 Fix new CommandScheduler.cancelAll() (#2251)
10e8fdb72 Make C++ IterativeRobotBase and RobotBase constructor and destructor public (#2242)
790dc552c Add quirks support for Pi camera (#2241)
0ec8ed6c0 Make C++ controller using declarations public (#2240)
832693617 Add missing definition for PIDController::SetPID() (#2239)
772ef8f96 Update Maven location to artifactory (#2235)
95b6cd2dd TrajectoryGenerator: Allow replacement of error reporting function (#2234)
ce1ac17df Remove experimental from new command example descriptions (#2226)
b2f7a6b65 Add clarification to LED about length and # of drivers (#2231)
bedbef799 Revert "Remove -no-module-directories flag from javadoc build (#2201)" (#2229)
bc159a92a Default sim voltage to 12v, make user rails active (#2224)
f50d710a5 Make color ctor public (#2222)
bc8f68bec Add sim HAL_WaitForCachedControlData (#2221)
32c62449b Add ArrayRef overloads to new command classes (#2216)
6190fcb23 Run wpiformat (#2218)
012d93b2b Use an explicit stack instead of recursion when parameterizing splines (#2197)
222669dc2 Fix trapezoidal profile PID controller setpoint bug (#2210)
abe25b795 TrajectoryUtil.toPathweaverJson: Create parent directories (#2214)
354185189 Update ProjectYear to 2020 (#2212)
f14fe434a Add (Old) qualifier to old subsystem (#2211)
e874ba931 Add Color classes for use with AddressableLED (#2127)
96348e835 Fix C++ SendableRegistry::AddChild() (#2207)
d91796f8d fix clang-format version number (#2206)
9abce8eb0 Fix subsystem LiveWindow usage (#2202)
8b4508ad5 Use default path for networktables.ini in simulation (#2205)
5b7dd186d Add templates for new commands for vscode plugin (#2016)
6ea13ea8f ntcore: Add support for local-only operation (#2204)
44bcf7fb4 Java examples: use non-static imports for constants (#2191)
c7a1dfc0b Add SlewRateLimiter class (#2192)
a12bb447e Fail cmake build if python3 generate_numbers.py fails (#2203)
c4bd54ef4 Add JNI binding to suppress driver station error/warning messages (#2200)
f9a11cce5 Remove -no-module-directories flag from javadoc build (#2201)
6008671c3 Report WPILib version as part of usage reporting (#2199)
7b952d599 Add usage reporting for many new things (#2184)
93cdf6869 Add Constants.cpp for MecanumControllerCommand example (#2196)
0c6f24562 Fix bug in ULEB128 decoding (#2195)
bdc1cab01 Add support for configuring SPI Auto Stall Config (#2193)
3259cffc6 Add transform methods to Trajectory (#2187)
67b59f2b3 Minor improvements/fixes to new command framework (#2186)
1ce24a7a2 Add 2020 speed controllers (#2188)
635882a9f Add getter for initial pose in Trajectory (#2180)
71a22861e Use ManagedStatic for CameraServer (#2174)
9cb69c5b4 Add a way to pass in a preconstructed value to ManagedStatic (#2175)
5e08bb28f Add docs and lifecycle tasks for faster dev builds (#2182)
ea4d1a39e Update characterization values to match real robot (#2183)
31b588d96 Fix ArmFeedforward Javadocs (#2176)
0b80d566a Use ChipObject HMB function for LED (#2173)
f8294e689 Sim GUI: Add a bit of spacing to the analog inputs (#2170)
b78f115fc Work around VS2019 16.4.0 bugs (#2171)
b468c5125 Change AddressableLED example to use consistent PWM port (#2168)
023c08829 Add toString() to relevant kinematics classes (#2160)
8a11d13a3 Fix C++ DutyCycleEncoder int constructor (#2166)
daa81c64a Minor javadoc fix in SwerveDriveKinematicsConstraint (#2167)
e20d96ea4 Use __has_include for WPILib.h (#2164)
a76d006a0 Update native-utils to 2020.7.2 (#2161)
24c031d69 Increase SPI auto byte count to allow 32 bytes to be sent (#2163)
6b4eecf5f Add hidden functions to get the SPI system and SPI DMA (#2162)
ccdd0fbdb Add TrapezoidProfile external PID examples (#2131)
5c6b8a0f4 Replace std::is_pod_v with std::is_standard_layout_v (#2159)
67d2fed68 Add DutyCycleEncoder channel constructor (#2158)
d8f11eb14 Hardcode channels for LSB weight (#2153)
b2ae75acd Add way to disable "no extensions found" message (#2134)
4f951789f Build testbench tests online inorder to improve speed (#2144)
005c4c5be Try catch around task dependencies to fix loading in editor (#2156)
34f6b3f4c Fix C++ RamseteCommand param doxygen (#2157)
f7a93713f Fix up templated TrapezoidProfile classes (#2151)
8c2ff94d7 Rename MathUtils to MathUtil for consistency with other util classes (#2155)
d003ec2dc Update to 2020v9 image (#2154)
8e7cc3fe7 Add user-friendly SimDeviceSim wrappers (#2150)
6c8f6cf47 Fix bug in cubic and quintic hermetic spline generation (#2139)
e37ecd33a Sim GUI: Add support for LED displays (#2138)
57c5523d6 Fix documentation in RamseteCommand (#2149)
7b9c6ebc2 Fix wpiutilJNIShared linkage typo in wpilibj (#2143)
9a515c80f Template C++ LinearFilter to work with unit types (#2142)
5b73c17f2 Remove encoder velocities methods in DifferentialDriveOdometry (#2147)
b8c102426 Fix PS3Eye VID and PID (#2146)
2622c6c29 Add default values for b and zeta in RamseteController (#2145)
f66ae5999 Add HSV helpers to AddressableLED (#2135)
5e97c81d8 Add MedianFilter class for moving-window median (#2136)
f79b7a058 Remove unnecessary constructor arg for LinearFilter's circular buffers (#2140)
e49494830 Replace Jenkins with Azure agent (#1914)
b67d049ac Check status of PDP CAN reads (#2126)
70102a60b SendableRegistry.foreachLiveWindow: Prevent concurrent modification (#2129)
6dcd2b0e2 Improve various subsystem APIs (#2130)
ce3973435 HAL_CAN_ReceiveMessage: return MessageNotFound if no callbacks registered (#2133)
3fcfc8ea7 Fix double disable segfaulting interrupts (#2132)
6ceafe3cd Fix class reference for logger (#2123)
b058dcf64 Catch exceptions generated by OpenCV in cscore JNI (#2118)
0b9307fdf Remove unused parts of .styleguide files (#2119)
39be812b2 Fix C++ ArmFeedforward (#2120)
21e957ee4 Add DifferentialDrive voltage constraint (#2075)
e0bc97f66 Add ProfiledPIDSubsystem example (#2076)
3df44c874 Remove Rotation2d.h wpi/math include (#2117)
a58dbec8a Add holonomic follower examples (#2052)
9a8067465 Fix incomplete .styleguide (#2113)
ffa4b907c Fix C++ floating point literal formatting (#2114)
3d1ca856b Fix missing typename and return type (#2115)
5f85457a9 Add usage reporting for AddressableLED (#2108)
4ebae1712 Enforce leading/trailing zeros in Java numeric constants (#2105)
fa85fbfc1 Template C++ TrapezoidProfile and ProfiledPIDController on units (#2109)
f62e23f1a Add Doxygen for new HAL interfaces (#2110)
5443fdabc Directly construct PWM port from HAL, avoid wpilib PWM object (#2106)
c0e36df9d Standardize on PWMVictorSPX in examples (#2104)
8c4d9f541 Add TrapezoidProfileSubsystem (#2077)
45201d15f Add encoder distance overload to DifferentialDriveOdometry (#2096)
845aba33f Make feedforward classes constexpr (#2103)
500c43fb8 Add examples for DMA, DutyCycle, DutyCycleEncoder and AddressableLED (#2100)
589162811 Use DifferentialDriveWheelSpeeds in RamseteCommand ctor (#2091)
b37b68daa Add JRE deployment to MyRobot Deploy (#2099)
0e83c65d2 Fix small logic error in ParallelDeadlineGroup (#2095)
6f6c6da9f Updates to addressable LED (#2098)
1894219ef Fix devmain package in commands (#2097)
77a9949bb Add AddressableLED simulation GUI support
a4c9e4ec2 Add AddressableLED simulation support
8ed205907 Add AddressableLED (#2092)
59507b12d Bump to 2020 v7 image (#2086)
5d39bf806 Make halsimgui::DrawLEDs() values parameter const (#2088)
841ef91c0 Use gyro angle instead of robot angle for odometry (#2081)
1b66ead49 Use standard constant for pi instead of 3.14 (#2084)
db2c3dddd Use DMA Global Number for DMA Index (#2085)
82b2170fe Add DMA support to HAL and WPILibC (#2080)
8280b7e3a Add DutyCycleEncoder and AnalogEncoder (#2040)
551096006 Use kNumSystems for DutyCycle count in Ports (#2083)
df1065218 Remove release configs of deploy in MyRobot (#2082)
bf5388393 Add deploy options to myRobot (#2079)
b7bc1ea74 Update to 2020v6 image (#2078)
708009cd2 Update to gradle 6.0 (#2074)
3cce61b89 Add SmartDashboard::GetEntry function in C++ (#2064)
565e1f3e7 Fix spelling in MecanumDriveOdometry docs (#2072)
1853f7b6b Add timing window to simulation GUI
c5a049712 Add simulation pause/resume/step support
f5446c740 Add Notifier HALSIM access
3e049e02f Add name to HAL Notifier
2da64d15f Make usage reporting enums type match (#2069)
f04d95e50 Make FRCUsageReporting.h C-compatible (#2070)
d748c67a5 Generate docs for command libraries and fix doclint enable (#2071)
55a7f2b4a Add template for old command-based style (#2031)
486fa9c69 Add XboxController examples for arcade and tank drive (#2058)
e3dd1c5d7 Fix small bug in SplineHelper (#2061)
7dc7c71b5 Add feedforward components (#2045)
5f33d6af1 Fix ProfiledPIDSubsystem parameter name (#2017)
94843adb8 Standardize documentation of Speed Controllers bounds (#2043)
9bcff37b9 Add HAL specific version of wpi_setError (#2055)
326aecc9a Add error message for CAN Write Overrun (#2062)
00228678d Add requirements param to more Command APIs (#2059)
ff39a96ce Make DigitalOutput a DigitalSource (#2054)
5ccad2e8a Fix frc2::Timer returning incorrect timestamp values (#2057)
629e95776 Add VendorDeps JSON files for command libraries (#2048)
6858a57f7 Make notifier command tests a lot more lenient (#2056)
0ebe32823 Fix MyRobotStatic accidentally linking to shared command libs (#2046)
384d00f9e Fix various duty cycle bugs (#2047)
1f6850adf Add CAN Manufacturer for Studica (#2050)
7508aada9 Add ability to end startCompetition() main loop (#2032)
f5b4be16d Old C++ Command: Make GetName et al public (#2042)
e6f5c93ab Clean up new C++ commands (#2027)
39f46ceab Don't allow rising and falling values to be read from AnalogTrigger (#2039)
d93aa2b6b Add missing lock in FRCDriverStation (#2034)
114ddaf81 Fix duplicate encoders in examples (#2033)
f22d0961e Sim GUI: Add duty cycle support
3262c2bad Sim GUI: Use new multi-channel PDP getter function
96d40192a Revert accidental change to MyRobot.cpp (#2029)
ed30d5d40 Add JSON support for Trajectories (#2025)
2b6811edd Fix null pointer dereference in C++ CommandScheduler (#2023)
1d695a166 Add FPGA Duty Cycle support (#1987)
509819d83 Split the two command implementations into separate libraries (#2012)
2ad15cae1 Add multi PDP getter and sim PCM/PDP multi arg functions (#2014)
931b8ceef Add new usage reporting types from 2020v5 (#2026)
0b3821eba Change files with CRLF line endings to LF (#2022)
6f159d142 Add way to atomically check for new data, and wait otherwise (#2015)
a769f1f22 Fix bug in RamseteCommand (using degrees instead of radians) (#2020)
c5186d815 Clean up PIDCommand (#2010)
9ebd23d61 Add setVoltage method to SpeedController (#1997)
f6e311ef8 Fix SplineHelper bug (#2018)
f33bd9f05 Fix NPE in RamseteCommand (#2019)
1c1e0c9a6 Add HAL_SetAllSolenoids to sim (#2004)
ea9bb651a Remove accidental OpenCV link from wpilibc shared library (#2013)
cc0742518 Change command decorators to return implementation (#2007)
16b34cce2 Remove IterativeRobot templates (#2011)
669127e49 Update intellisense to work with Beta 2020 code (#2008)
9dc30797e Fix usage reporting indices (#2009)
f6b844ea3 Move HAL Interrupt struct to anonymous namespace (#2003)
a72f80991 Add extern C to DigitalGlitchFilterJNI (#2002)
916596cb0 Fix invalid examples json, add validator (#2001)
5509a8e96 Use constexpr for all example constants
0be6b6475 Use constexpr for DifferentialDriveKinematics
936627bd9 wpilibc: Remove direct CameraServer dependency (#1989)
8e333c0aa Use FPGA Time instead of wall clock time for odometry (#1996)
d4430b765 Gearsbot example: Use standard argument order (#1995)
75438ab2c Add RamseteCommand (#1951)
989df1b46 Bump Native Utils and OpenCV dependencies (#1993)
dbc33b61e Fix Timer usage in TrapezoidProfileCommand (#1992)
79f8c5644 Add TrapezoidProfileCommand (#1962)
9440edf2b Refactor TrajectoryGenerator (#1972)
73a30182c Add frc2::Timer (#1968)
36ea865ed Add toString for geometry and trajectory classes (#1991)
cbe05e7e8 Update ProfiledPIDController API (#1967)
d04eb3546 Deprecate old PID classes (#1964)
02264db69 Add JNI dependencies to myRobotCpp (#1980)
2a76c996e Use VID/PID detection for PS3Eye (#1977)
a3820bbdf Remove HAL_BaseInitialize (#1981)
a83fb4793 Update to 2020v5 image (#1983)
4b0ed910e Make SwerveDriveKinematics.toChassisSpeeds() public (#1976)
103c1b121 Remove DS caching from the HAL level (#1971)
6635ea75e Fix NPE in SendableRegistry.foreachLiveWindow() (#1974)
cfe23c5cd Fix grammar error in comment for configureButtonBindings (#1969)
4bde2654e Fix mac azure build (#1973)
4f034e6c1 generateTrajectory: default reversed param to false (#1953)
acf960f72 Sim GUI: Add option to disable outputs on DS disable
2d3dac99f Sim GUI: Handle low resolutions and scale default window positions
07c86e0cd Sim GUI: Support High DPI monitors
46ad95512 SimDeviceData: Add missing null check
5bce489b9 Add ProggyDotted font to imgui (both cmake and gradle)
55af553ac Simulation GUI: Map gamepad the same way as DS
c59f9cea5 CameraServer: Add VID/PID support for Linux USB devices (#1960)
3fc89c84d Make splinePointsFromSplines public (#1963)
2c5093797 Fix implicitly deleted move constructors (#1954)
f3ad927f4 Update Java SmartDashboard and LiveWindow to match C++
05c25deb7 Fix move handling of C++ Sendable in SmartDashboard and LiveWindow
d726591ce Fix Gazebo sim plugin build (#1959)
2ff694fa4 Unbreak gradle build when other compilers installed (#1958)
53816155b Improve command decorator names (#1945)
a38f183a9 Fix GenResources.cmake so it's usable in a submodule (#1956)
b3398dca3 Set gradlebase correctly for all examples (#1950)
2c311013d Add Aarch64Bionic platform detection (#1922)
c10f2003c Add generateTrajectory overload (#1944)
63cfa64fb Add getters for pose in odometry classes (#1943)
2402c2bad Fix C++ command group recursive constructor bug (#1941)
f4eedf597 Fix ConcurrentModificationException in CommandScheduler (#1938)
bb0b207d2 Fix array out of bounds exception caused by parallel race group (#1935)
7bd69e591 Fix typo in temperature (#1940)
ec9738245 Bump to 2020 v4 image (#1931)
46303a822 Add messaging to extension loading in the HAL (#1926)
d169d6be9 Set extract_static for Doxygen config so that static members show up (#1930)
4e183eb10 Bump to 2020 v3 image (#1929)
84c185803 LiveWindow: catch errors in callback/builder functions (#1921)
0e3b0f3da Remove deprecated free() calls (#1925)
7f839b87c Remove timeouts from azure builds (#1924)
45b766a5d Fix main thread ID being potentially incorrect for simulation (#1923)
56d782b16 Add secondary camera name for PS3Eye (#1920)
2b4894038 Add simulation GUI plugin
f97d16073 Add imgui build to cmake
55a844a3e HAL sim: Add encoder channel B access
10deba854 Remove sendables from SendableRegistry when close() is called (#1917)
a9f0e4668 Implement sim devices for ADXL345, ADXL362, ADXRS450, Ultrasonic
aa9064586 Add ability to associate other devices with a SimDevice
81c2c8a7d Add simulation generic device/value support
e8d6f8a2c Move mockdata/HAL_Value.h to hal/Value.h
1b266717a Add simulation module support to cmake build (#1906)
fb8f3bd06 Add testbench yaml file (#1915)
846d8def0 Update to 2020 v2 image (#1913)
d6ac6e512 Fix PortForwarder package declaration (#1912)
227157086 Fix PS3Eye exposure setting (#1911)
885744d7e Add myRobot C++ version to cmake build (#1907)
366091fa8 Document that ConditionalCommand requires all subsystems (#1909)
c58b072c8 Fix Drive usage reporting order (#1908)
762c88adb Update compiler versions in readme (#1905)
af8ce568d Add Ramsete unicycle controller (#1790)
b2c2934d0 Fix javadoc warnings about invalid usage of ">" (#1904)
cce26ec78 Replace CRLF line endings with LF (#1902)
cb54602d4 Add support for writing RTR CAN Frames to the CAN API (#1900)
9f740e590 Use OS for serial port instead of NI VISA (#1875)
b23baf611 Add ability to run robot main loop in a separate thread (#1895)
457f94ba2 Add trajectory generation using hermite splines (#1843)
fd612052f Update native utils to use new frchome directory (#1884)
8858ec55c Remove periodic can read call (#1868)
41efb8015 Update CANAPITypes.h (#1860)
c93be1b2d Remove LabVIEW HAL support (#1901)
680f8919e Remove eigen, units and libuv from doxygen generation (#1898)
c5812524f Bump GradleJNI plugin version (#1899)
971303da8 Add PortForwarder class (#1890)
50db77bf2 Fix wpiutil cmake eigen install source directory (#1891)
85d42c199 C++ PIDCommand: Add GetMeasurement() and UseOutput() (#1892)
2dfbb855d wpilibj: Fix SwerveDriveKinematics ctor parameter name (#1889)
471f375a3 Simplify Sendable interface (#1864)
1d8c4d016 Replace ::value and ::type with _v and _t suffixes (#1885)
a5650b943 Add Units Utility class for Java (#1829)
904479ad4 Deprecate GearTooth class for removal (#1878)
86b666bba Add equality comparator to geometry classes (#1882)
62f07c182 Make one-arg Rotation2d constructor implicit (#1883)
f405582f8 Add kinematics suite (#1787)
561cbbd14 Deprecate Filter class for removal (#1876)
84e2973aa Remove unused include from Filesystem.h (#1877)
f49859ebf Remove NI VISA headers, as they are now included in NI Libraries (#1879)
bc59db5e6 Rename DEBUG macro to DEBUG0 (#1871)
dd928b4cb Remove JNI logging (#1872)
3e0f7d099 Use units for new NotifierCommand (#1869)
5ffe15d5f Remove ability to build all combined artifacts (#1867)
516cbef2c Remove RoboRIO ifdef from simulation headers (#1859)
9b6ffc201 Replace SetOutputRange() with SetIntegratorRange()
ff8b8f0a8 Remove percent tolerance from PID controller
0ca8d667d Clean up AutoCloseable and other Java warnings (#1866)
7112add67 Watchdog: use units::second_t instead of double (#1863)
761bc3ef8 Change C++ WaitCommand to use units (#1865)
1fb301123 Add MathUtils.clamp() for Java (#1861)
eb3e0c9c9 Fix cmake Eigen include directory (#1862)
2250b7fbe Rename GearsBotNew example to GearsBot
c9f9feff1 Replace deprecated API usage in C++ examples
d6b9c7e14 CONTRIBUTING.md: Point to frc-docs instead of screensteps (#1858)
d10a1a797 Fix eigen build in vcpkg (#1856)
2bdb44325 Add frc2 includes to list of "other lib" regexes (#1855)
4b2b21d24 Replace outdated Java collections (#508)
8993ce5bf Move Eigen headers out of main include folder (#1854)
0f532a117 Add PWMSparkMax (#1751)
f7ad363d8 Add jni cross compile options for aarch64 (#1853)
9afea3340 Add support for aarch64 jetson bionic builds (#1844)
d787b5d60 Add more items to .gitignore (#1850)
5dd0d1b7d Use units in SPI
07ac711b3 Fix units deprecated warning in IterativeRobot
decfd858b Correctly report -1 for POV on disconnected joystick (#1852)
076ed7770 Add new C++ Command framework (#1785)
a0be07c37 Refactor HAL handle move construction/assignment (#1845)
558c38308 Add new Java Command framework (#1682)
1379735af Delete RobotState and SensorUtil constructors (#1847)
e3d86fee4 Move circular buffer class from wpilib to wpiutil (#1840)
4cd8a5667 TimedRobot.cpp: Fix deprecation warning (#1846)
b2861f894 Use 2020 artifacts and artifactory server (#1838)
98cc32703 Update to use artifactory to publish artifacts (#1833)
fa0640300 Move drive integration tests into wpilibj/src/test (#1836)
e716c36b8 Fix Nat.java generation to be incremental (#1831)
9fd2b5e3f Fix MSVC builds on cmake windows in vcpkg (#1835)
7e95010a2 Add compile-time EJML matrix wrapper to wpiutil (#1804)
3ebc5a6d3 Add ProfiledPIDController
fc98a79db Clean up PIDController interface in preparation for ProfiledPIDController
fdc098267 Fix compilation error in elevator trapezoid profile example (#1826)
a3dd84e85 Make XBoxController Button enum public (#1823)
a216b9e9e Add TrapezoidProfile example (#1814)
8f386f6bb wpilibc: Add unit-safety to C++ geometry classes (#1811)
c07ac2353 wpilibc: Add overloads for units (#1815)
f1d71da8a Move GetStackTrace and Demangle to wpiutil, add Windows support (#1819)
ef037457e Make LinearFilter copyable and moveable (#1789)
76930250c Remove objective-cpp support (#1816)
1c246418f Move TrapezoidProfileTest to trajectory folder (#1812)
95a54a0f2 Add java arcade drive example (#1810)
a4530243e HAL sim: Fix incorrectly setting dio port to initialized on cleanup (#1813)
09d00a622 Update Java examples to use new PIDController (#1809)
ba9b51742 Add missing Java examples (#841)
6411bd79c InterruptableSensorBase: Fix callback function deletion (#1807)
810e58ea8 I2C: Add tip about writeBulk() to transaction() (#1806)
607d6c148 Fix wpilibj integration tests jar name (#1808)
c9873e81b Remove PIDControllerRunner and mutex from new PIDController (#1795)
98d0706de Fix cscore build with OpenCV 4 (#1803)
fbe67c90c Make Sendable setters synchronous (#1799)
c67a488a0 Format SendableBuilderImpl javadocs (#1802)
8e93ce892 Fix PIDControllerRunner member destruction order (#1801)
c98ca7310 Add EJML dependency to wpiutil (#1769)
3b12276bc SendableBase: remove unnecessary synchronization (#1797)
e6d348f38 Fix missing default name in Java PIDController (#1792)
df12fc2a8 Java cleanups (#1776)
39561751f Update GradleVSCode version (#1786)
37d316aa0 Add C++20 std::math constants shim (#1788)
dd4310959 Deprecate frc/WPILib.h (#1779)
823174f30 Update native utils to 2020.0.4 (#1783)
37c695266 Squelch -Wdeprecated-copy for Eigen with GCC >= 9
04c9b000f Revert "Fix build of Eigen 3.3.7 with GCC 9"
ca3e71e21 wpiutil: Fix Process::Spawn() (#1778)
d946d5a2b Fix Eigen compilation errors and add tests (#1777)
8b1b9ac75 Fix build of Eigen 3.3.7 with GCC 9
2f680ba99 Add Eigen linear algebra library
a885db7d4 Make MotorEncoderTest use LinearFilter (#1775)
ee2410169 Add geometry classes (#1766)
48fe54271 Add HALSIM_SetSendError implementation (#1773)
dff58c87f Fix unused warning in release build (#1771)
dde61aad3 Remove TimerEventHandler typedef from Notifier class (#1767)
0f6ef80ab Add RobotState#IsEStopped and DriverStation#IsEStopped (#952)
e48886187 Move unit tests from integration test suite (#1170)
dffa1a5cb Make null checks more descriptive (#1688)
fe59d854d Notifier: add null check (#1684)
10731f3d6 Update uv Udp wrapper for latest features
89f7b72b6 Update libuv to 1.30.1 release
85f2f8740 wpiutil: Add unique_function (#1761)
73ec94078 Remove SampleRobot (#1658)
62be0392b Replace std::lock_guard and std::lock with std::scoped_lock (#1758)
24d31df55 Make sure move constructor is generated for TrapezoidProfile (#1757)
841ef5d73 Remove template types from lock RAII wrapper usages (#1756)
e582518ba Fix some move constructors (#1754)
8757bc471 Remove pre-C++17 shims (#1752)
ea9512977 Add replacement PIDController class (#1300)
9b798d228 Add TrapezoidProfile class (#1673)
804926fb5 Unconditionally skip athena builds for sim (#1748)
118e9d29d Add C++14 units library (#1749)
c705953d7 Add usage reporting to LinearFilter (#1750)
852d1b9ca Don't cross-build gazebo for raspbian (#1747)
eedb3a1ad Fix GCC 9 warnings (#1730)
60dce66a4 Remove wpi::ArrayRef std::initializer_list constructor (#1745)
9e19b29c3 Use base azure image for primary wpilib build (#1744)
299425071 Update jni library, fix cross builds of the jni symbol check (#1742)
a6b0e9b85 Only disable execution of cross compile google tests (#1741)
3c2093119 Use docker container to run wpiformat (#1740)
5fe2eebce Revert "Don't build halsim_gazebo on raspbian (#1737)" (#1743)
4b1b92bb7 Replace wpi::optional with C++17 std::optional (#1732)
0fbb0d989 Update to 2020 compilers (#1733)
2dc94e605 Disable google tests on cross compilers (#1738)
d9cb57a42 Don't build halsim_gazebo on raspbian (#1737)
f7cfdd7ce Replace crlf line endings with lf (#1731)
b6d5d90d9 Add JaCoCo Support (#1734)
c7ab2baa6 Add way to disable the jni check tasks from a property (#1736)
0c45c5b7e Fix skip athena and skip raspbian flags (#1735)
3dfb01d45 Update to new Native Utils (#1696)
30e936837 Clean up LinearDigitalFilter class (#782)
311e2de4c Remove deprecated Joystick constants (#1715)
c08fd6682 Update CAN manufacturer list (#1706)
258bba0c2 ErrorBase and WPIError improvements (#1727)
372ca4f45 cmake: Enable googletest unit tests (#1720)
223d47af0 HALSIM: support mocking of HAL_SendError() (#1728)
55cb683db Change compiler flags to C++17 (#1723)
ee8a33c56 wpiutil: SafeThread: Add thread id, support getting shared_ptr (#1722)
61426d08d wpiutil: Signal: make operator() const (#1721)
b630b63ef Remove functions in LiveWindow deprecated since 2018 (#1716)
1d0c05d4f Styleguide fixes for #1718 (#1719)
f07569df1 Fix newer GCC/clang compiler warnings (#1718)
0120f3124 C++ SPI: Fix SetClockRate to take int (#1717)
c2829ed98 Configure gradle to ignore unresolved headers (#1711)
221e66f46 Allow disabling static init of JNI libraries (#1672)
738852e11 cmake: Add cross toolchain files for Rio and Pi (#1710)
27b697b08 Remove frc directory include shims (#1714)
9e45373a7 Remove functions and classes deprecated for 2018 season (#1059)
eeb1025ac SPI: Report port as instance for usage reporting (#1704)
bc6f1e246 Windows compiler options improvements (#1709)
bb48ae391 cmake: Move example programs into folders (#1654)
221011494 Update for C++17 and fix MSVC warnings (#1694)
fb1239a2a Add raw sources and sinks to cscore (#1670)
7de947734 Add lambda overloads for interrupts (#1636)
90957aeea Move libuv to its own subfolder in build (#1661)
47aae502a Styleguide fixes (#1702)
0bff98b5e Correct DifferentialDrive::ArcadeDrive param docs (#1698)
b52e40b80 Allow widgets to be added by passing value suppliers (#1690)
4a00cd77b Add usage reporting for the Shuffleboard API (#1685)
e25e515f2 Publish artifacts on azure (#1678)
322ef9b96 Force Java 11, fix javadoc generation (#1695)
d42ef5df0 Fix Watchdog print formatting (#1693)
f432f65be Update copyright year in license to 2019 (#1524)
1726b77ac wpiutil: uv: Remove copy from SimpleBufferPool (#1680)
620bec9ca wpiutil: uv: Add LoopClosing status to Handle (#1647)
7cd6e2e7f UsbCamera: Solve race in windows initialization (#1638)
7732836bd Completely disable watchdog tests on mac (#1679)
698edfda9 Remove framework load, disable mac timeout test (#1676)
1c454b000 Add Shuffleboard calls to IterativeRobotBase in C++ (#1607)
f42905b32 Include missing headers in HAL.h (#1660)
bdc822fad Only generate passthrough URLs for RoboRIO (#1624)
d3affb16b Make failure of HAL_GetFPGATime() more descriptive (#1633)
2de3bf7f5 Update LLVM from stable upstream (#1653)
3cf4f38f5 Fix build on macos10.14.4 (#1648)
4e0c10f48 Fix CAN Clean using wrong ID (#1668)
3b0631324 Fix Gray to BGR conversion in CameraServer (#1665)
6cd1c73ef Fix GUID comparison creating weird symbol (#1659)
063bbab6f MavenArtifacts.md: update links to HTTPS (#1674)
aab4c494d Fix type in build.gradle (#1604)
bf46af260 Disable extraneous data warnings in libjpeg (#1630)
655763a9a Limit length of message sent to DS SendError call (#1618)
a095ec2d8 Fix linker errors with free functions in Threads.h (#1625)
12ab035aa Fix receive side of LabVIEW USB streams (#1621)
99e4f7dd2 Fix SPI CS1 not working correctly (#1614)
60c2f5905 C++ CameraServer: initialize default Usb camera device number (#1601)
d55ca191b CameraServer: Add switched camera support (#1600)
e8b24717c C++ Shuffleboard fixes (#1595)
182758c05 Fix Ultrasonic sensor runner thread (#1598)
74f7ba04b Java PIDBase: Make setPIDSourceType and getPIDSourceType public (#1599)
997d4fdf4 Update HAL GetStackTrace to properly report user errors (#1594)
76d9e2663 uv: Add reuse to pipe (#1577)
a230c814c Add support for WPILib vscode extension for allwpilib C++ intellisense (#1590)
12cb77cd7 Fix DS Comm button tests (#1591)
8a9822a96 Allow multiple instances of the same PDP (#1582)
a9371a758 Fix missing exposure property on windows USB cameras (#1571)
6992f5421 cscore: Avoid crash if invalid (null) source set in MjpegServer (#1585)
43696956d Fix Watchdog incorrectly resetting expiration flag upon disable (#1580)
ae3fd5ada Fix docs search having unspecified module directory (#1568)
404666b29 Fix Halsim DS Button Format (#1583)
1eb4c99d1 Update README for 2019 changes (#1569)
910b9f3af Add support for camera descriptions on windows (#1572)
09d90b02f Remove prints and unecessary items from windows GetNetworkInterfaces (#1573)
0e1f9c2ed ntcore: Read ini escaped quotes correctly (#1579)
f156a0011 wpiutil uv: Pass IPC value of listening pipe to accepted pipe (#1576)
4a6087ed5 Disable watchdog test on mac (#1578)
88a09dd13 cscore: Handle USB camera integer menus (#1561)
7d1959636 Changed terminology from "Overload" to "Override" (#1563)
bd05dfa1c Fix ds_socket matchinfo (#1555)
05d6660a6 cscore: Add config json to VideoSink (#1543)
1349dd4bd Make MjpegServer functions public (#1545)
fdf298b17 CameraServer: Return MjpegServer from StartAutomaticCapture(VideoSource) (#1544)
453a9047e Fix cmake hal sim build (#1539)
e97e7a761 Add DriverStationSim.notifyNewData (#1537)
308bdbe29 cscore: Windows UsbCamera: Use custom windows message for initial connection (#1534)
f889b45d5 cscore: MjpegServer: Fix FPS limiting (#1536)
444b899a9 Java: Fix Timer.get() handling of accumulated time (#1531)
f121ccff0 Avoid Watchdog thread clobbering m_isExpired flag after callback (#1527)
bc2c932f9 Fix MotorSafety deadlock (#1526)
6bdd7ce50 Update docs for disabled init to match all the other modes (#1523)
c12d7729e Update examples to use VictorSPX's rather then Sparks (#1521)
363511604 cscore: set charset of displayed pages (#1520)
6105873cb Provide alternate device paths info for USB cameras (#1519)
80f87ff8a Allow video sources to be added to Shuffleboard (#1453)
a2368a619 Watchdog: add timeout message suppression feature
ae3cb6c83 Watchdog.java: add comment fixes from reverted #1442
f0f196e5b Revert "MotorSafety: Use Watchdog instead of DS class polling (#1442)"
7c35355d2 Revert "Suppress Watchdog's generic timeout message in MotorSafety (#1486)"
75cc09a9e Revert "Suppress timeout message in C++ MotorSafety class (#1512)"
0e2e18063 PowerDistributionPanelTest.cpp: Include thread
01d132206 Add constants for built-in Shuffleboard widgets and layouts (#1468)
ceed1d74d ntcore: Strip whitespace from IP addresses (#1516)
e1bf62399 cscore: handle HTTP stream hangs (#1513)
d46ce13ff Fix CAN API timing out incorrectly (#1497)
300eeb330 Suppress timeout message in C++ MotorSafety class (#1512)
d81700125 Only write version information on real robot (#1510)
8ac4b113a Fix build on macOS 10.14.2 (#1509)
f3864e9ab Move deprecated message in C++ from class level to constructor (#1505)
799c3ea8a Disable gyro sim test on mac (#1506)
8d95c38e3 Watchdog: Fix potential IllegalFormatException (#1508)
a7f4e29b7 Update versioning and vscode plugin (#1498)
b88369f5e Move deprecation warning for SampleRobot to constructor (#1503)
ce6f1d058 Change deperecation year for serial port direct constructor (#1504)
f163216a4 Add support for raspbian extraction (#1494)
c449ef106 Unconditionally await in awaitUntil (#1499)
6593f4346 Default to DS attached to true in sim (#1500)
ce1367a11 Make JNI library not found message clearer (#1495)
0d7d88026 Renable full Java 8 Compatibility (#1493)
ca2acec88 Update to NI Libraries 2019v12 (#1492)
3721463eb Don't use symbolic path searching for USB detection (#1491)
6e8f8be37 Make C++ examples able to run GradleRIO unit tests (#1490)
d84240d8e Bump opencv version to 3.4.4-4 (#1489)
1823cb2b6 Fix periodic can packets not being received properly (#1488)
41596608c Suppress Watchdog's generic timeout message in MotorSafety (#1486)
0c3b488e1 Make ntcore instances not smart pointers (#1485)
7d7af287f Add empty classes to command/classes creation (#1479)
411962299 Fix characters in license file (#1480)
d528a7796 wpiutil: Fix resources build (#1476)
dab7e1b7a Add multiCameraServer to cmake build (#1477)
ab4934546 Add missing param javadoc comment and fix argument order inconsistency (#1475)
608d82423 wpiutil: Use scoped connections to ensure cleanup (#1474)
e0e15eafe wpiutil: Add shared resources for http servers
0fb24538a wpiutil: HttpServerConnection: add SendStaticResponse
d65547ea7 Bump OpenCV version (#1471)
bfe15245a Add multiCameraServer executable (#1422)
ff58c5156 Change SmartDashboard type of PIDBase.cpp to match PIDBase.java (#1470)
6d4326a56 Rate-limit Watchdog timeout prints to 1Hz (#1459)
97ba195b8 Fix LiveWindow attempting to start listeners on uninitialized sendables (#1463)
3d546428a Add missing SubTableListener methods to C++ NetworkTable (#1465)
b64dfacff DriverStation: fix error checking for GetXXXAxis and GetXXXPov (#1469)
dcbf02a1e Update auto SPI for timestamp changes (#1457)
7e1ec2883 NI image 2019v9 (#1467)
ef16317f8 Update NativeUtils and Doxygen (#1462)
26e8e587f MotorSafety: Use Watchdog instead of DS class polling (#1442)
0d0492bfc HAL: Add additional error messages to HAL_GetErrorMessage (#965)
3b33abfc7 Make Watchdog use single thread dispatch (#1347)
99033481e Add netconsoleTee
b4901985b Add netconsoleServer
97edb6c68 wpiutil: uv::Buffer: Add Dup() function
73de3364b AxisCamera constructor: add StringRef overload (#1458)
5551981b3 Upgrade to Gradle 5.0 (#1444)
90572a3cc Add wpilibc and wpilibj skeleton templates (#1441)
c40518805 Fix directory iterators not working correctly (#1454)
bea0565ac Update to OpenCV 3.4.4 (#1452)
0b0345436 wpiutil: Replace LLVM Optional with C++17-compatible optional
489701cac wpiutil: Rename Optional.h to LLVMOptional.h
a769d56ec Create C++ ShuffleBoard example (#1438)
6f0c185a0 Add methods to change the selected tab in the Shuffleboard app (#1448)
a60f312d1 Add eager null checks in drive base classes (#1447)
acb786a79 Remove MotorSafetyHelper, create MotorSafety base class instead (#562)
df347e3d8 wpiutil: uv::Process: Revamp args/options approach (#1434)
e4aa45f34 wpiutil: WebSocket: Fix Sec-Websocket-Accept computation
75cc3cda2 wpiutil: SHA1: Add method to get raw bytes instead of hex
45f4472d4 Add mechanism to control Shuffleboard recordings and add event markers (#1414)
69cb53b51 Add support for USB Webcams on Windows (#1390)
70a66fc94 Make Gradle show stdout for wpilibj tests (#1431)
9207d788a Convert ReadInterrupt* to return int64_t time (#1417)
ef3a31aa2 Add an example of using the HAL directly (#1374)
63775362f Remove SynchronousPID class (#1429)
55493b0c1 Fix polymorphic exception types being caught by value (#1426)
1696557c4 Fix deprecation warning in wpilibj shuffleboard example (#1427)
ecd376be4 Export C functions from JNI statically linked library (#1425)
f54c0f70f Update opencv to 3.4.3-19 (#1424)
9bc998f4b cscore: Add JSON for source settings (#1423)
43d188a42 RobotBase: Call cscore Shutdown() from destructor
563d5334c Update OpenCV to 3.4.3-17
193b0a222 cscore: Add Shutdown() function
76f5d153f wpiutil: Add Stop() to EventLoopRunner
19caeca99 cscore: Use more standard naming for Instance public variables
0abae1765 cscore: Refactor sink and source creation
81d10bc65 cscore: Build examples on Windows (#1421)
b51b86525 Stop webserver on test run (#1420)
ace37c517 CameraServer: enable usb cameras on non-Linux platforms (#1411)
ac751d322 Fix unused variable warnings in ntcore (#1416)
7c9a3c4d7 Update NI Library to 2019.7.1 and OpenCV to 3.4.3-16 (#1418)
8be693f55 Fix list layout in shuffleboard example (#1413)
622ae29df CameraServer: Change opencv sources to publish "cv:" type (#1412)
e7c98feca libuv: Use WPI (FPGA) clock on roboRio (#1409)
28087424e Add deploy directory detection (#1400)
b6830638d NetworkListener: use Pimpl idiom (#1405)
fb557f49e Add missing driver station documentation (#1388)
746f950a0 Remove ifdefs from linux NetworkListener (#1404)
9a38a3e18 Don't use static for raw_ostream outs/errs (#1401)
2e3e3a47b Use a kill -9 after attemting a safe kill (#1397)
e27d6d7bb cscore: Change impl to only one singleton (#1398)
1dec0393a Fix static deletion race condition in DS thread (#1396)
d03b02032 wpiutil: Add WorkerThread (#1302)
71e29b1d9 Remove unused import from rumble example (#1395)
f0b0965f9 Remove large HAL headers from wpilibc headers (#1386)
f774e47c8 Add an example showing how to use a hid rumbler (#1394)
761933a16 Refactor Java Ultrasonic to use a List container (#1389)
99e0f08a6 Move applicable integration tests to native build as unit tests (#1364)
e89d5eb69 Fix stringop truncation warning from GCC 8.2 (#1393)
2501e1188 Enable HTML5 javadocs (#1267)
9174f23f3 Remove some usages of windows.h (#1370)
9f6544fa8 Allow binding commands to POV (#1378)
9a1af132b Unify GetHostname() and use libuv implementation (#1391)
a8aacd365 Update build setup for raspbian and debug binaries (#1384)
8ff81f5a2 cscore: Separate platform-specific sources (#1387)
349e273ec AnalogGyro: add "calibrating for n seconds" message (#1380)
0a2ab4f0d Revert change in behavior in HeldButtonScheduler (#1381)
7c1a7332e uv::Async, uv::AsyncFunction: allow calling from within loop
172e438cd wpiutil: uv::Async: Keep weak reference to loop
1a7a0db1f wpiutil: Change uv::AsyncFunction to use promise/future.
11e5faf46 Use Array Constructor rather then new array to toArray (#1368)
c7118f8ad wpiutil: Signal: Don't use std::forward when calling (#1371)
7933d2cbe wpiutil: uv: Don't close uninitialized handles (#1372)
ce8c71b1f Fix link for license (#1367)
da9a57552 Rename squaredInputs to squareInputs in DifferentialDrive (#1361)
7068551a3 Bump OpenCV and GTest to 2019 dependencies (#1366)
bd9484a2f Make MyRobot compilation test use TimedRobot (#1363)
b9fa3a439 Update to 2019 RoboRIO and 2019 v4 image (#1352)
88b93c220 Update NativeUtils to not copy NI libraries to jenkins RoboRIO (#1359)
0a937bb5b wpiutil: SafeThread: Ensure thread is released in destructor (#1358)
613d5eda0 wpiutil: SafeThread: join on thread exit (#1357)
18c8cce6a SafeThread: Avoid use-after-free risk in thread shutdown (#1355)
36000ddb3 wpiutil: uv::Loop: Store the thread ID of the loop
de6d6c9a5 wpiutil: EventLoopRunner: Allow getting the loop shared_ptr.
6d99c0ac6 wpiutil: EventLoopRunner: Remove extraneous wpi namespace qualifier
164e9a2c7 wpiutil: uv::Work: Don't connect work and afterWork if they're null
f3fb95af7 wpiutil: uv::Tcp: Simplify reuse function
40a9fc44f wpiutil: uv::Poll: add reuse functionality
f0ac04864 Remove pmd and checkstyle publishing from azure (#1353)
81498e6af Deprecate IterativeRobot in favor of TimedRobot (#1341)
f1056efa0 Updates version plugin to 2.2 (#1349)
54fbec27d Fix typo (#1348)
fd8215345 Fix shuffleboard C++ tests, and run them on desktop (#1351)
7b471d8c6 Fix windows image on azure pipelines (#1350)
175c6c1f0 Add fluent builders for more flexibly adding data to Shuffleboard (#1022)
ac7dfa504 Switch to using containers for Linux builds on Azure (#1335)
a73285486 Clean up edge detection logic in ButtonScheduler subclasses (#1340)
617185602 Document Watchdog epochs better (#1345)
d5d744a39 Fix publishing of templates on jenkins (#1343)
8b1274d74 Replace typedefs in C++ with using declarations (#1339)
26c33a9a5 Remove priority_condition_variable (#1337)
5fad2b105 Remove travis and appveyor configuration files (#1338)
32ec07ee0 Throw correct exception in HAL_getJoystickAxes/POVs JNI (#1336)
15c5a820b Publish tests to azure ci (#1334)
e15fabd2e Add cmake azure build (#1332)
1aa844672 Add move constructors and assignment operators to wpilibc (#1314)
b1965f74a Add styleguide check to azure pipelines build (#1331)
0c58a0a70 Repackage CameraServer classes (#1321)
467c9fd68 Add kInvalid value to HAL_I2CPort and HAL_SPIPort (#1329)
b505bbefd Rename variable in SPI class not compliant with style guide (#1330)
5c6b78ea2 Set up CI with Azure Pipelines (#1306)
f89274fb1 Fix hal header zip task dependencies (#1327)
1137582a7 Revert "Move deprecated ntcore classes to wpilibj jar (#1322)" (#1326)
e26e3b6aa Fix HAL Headers Zip (#1325)
456d3e16a Update NI Libraries to layout without C++ (#1324)
e21007304 Move HAL classes to their own base package (#1317)
0068b6aea Remove wpilibj tests from wpilibjIntegrationTests (#1323)
12c92a822 Move deprecated ntcore classes to wpilibj jar (#1322)
d2a5aaafd Use external dependencies for NI and NetComm libraries (#1304)
bedef476f Replace IterativeRobot in examples with TimedRobot (#1310)
59386635e Add CAN API constructor that takes explicit manufacturer and device type (#1311)
a846ed062 Add virtual destructor to CameraServerShared (#1313)
8b5dc53cc Add Lambda support to InstantCommand (#1262)
59700882f PIDController: Mention unit for 'period' (#1305)
025af2452 Make NetworkTableEntry.callRpc and createRpc public (#1303)
c0ff6198b Change hal sim to use spinlocks (#1291)
67b1c8531 Notifier: properly reset HAL alarm in non-periodic case (#1296)
0b113ad9c Fix some PIDCommand constructors not forwarding subsystems (#1299)
c8482cd6d wpiutil: Add WebSocket implementation (#1186)
d6d532182 wpiutil UidVector: Implement clear() and forward iterator (#1293)
8d91343bf wpiutil spinlock.h: Include STL mutex for convenience (#1292)
488ba7937 Add more checkstyle checks to simulator code (#1289)
de212a9dd Add names to simulator components (#1268)
8d8f120cc EventLoopRunner: Use AsyncFunction
57490e000 Add uv::AsyncFunction to do a roundtrip function call to a uv::Async
1de1900db Change uv::Async to accept data parameters
4a3e43d4a Add HttpMultipartScanner (#1197)
9e37ee13d Add wpi::HttpServerConnection and an example of its use (#1281)
7b95c5341 ntcore: Change params in Java RpcAnswer from String to byte[] (#1280)
5283726cc ntcore: Describe RPC version 0 in spec (#1279)
0b8f4b5e6 Add libdl to wpiutil cmake build (#1288)
a5f7342fc Run cmake build in travis (#1287)
6df742544 cmake: Compile cscore and wpiutil examples (#1286)
d7b68f3f9 Unbreak cmake build (#1285)
e28295fc7 Add dependency injection of Subsystem to Command (#1275)
6df500e72 Add missing library dependencies in simulation dev executables (#1284)
83cfb8b19 UrlParser: fix Has() functions (#1283)
82b25d0ec spinlock_bench.cpp: Fix wpiformat warning (#1282)
b44f27ddf SendableChooser: Rename addDefault and addObject for clarity (#1239)
fa78f30e3 ntcore: Make protocol revision more visible in docs (#1278)
46ae19d08 wpiutil: Add a mutex-compatible spinlock implementation (#1272)
77124a229 Twine: disable part of isValid() that causes spurious warnings (#1271)
1462a5bd4 Fix spacing and const correctness in sim (#1269)
44099d9a2 Update errorprone config for Java 10 (#1265)
c2ceebfb9 Add gyro and accelerometer simulator wrappers (#1183)
0a0d9245e cscore: Add connection strategy to sources (#1252)
7bd3f9f0b Change ButtonScheduler scope start method to public (#1254)
4801ae249 Replace ellipsis characters munged by wpiformat with three periods (#1256)
0e9172f9a Fix many errorprone warnings (#1247)
6db5f8043 docs: Set use_mathjax to true (#1251)
898076f69 docs/build.gradle: Use unix EOL (#1250)
195e10181 cscore: Use Twine instead of StringRef in API (#1244)
97a8f8f47 HAL: Add Doxygen module documentation (#1246)
9408fd517 Add Doxygen comments for namespaces (#1245)
00c2cd7da Improve JNI loading efficiency (#1224)
cbb62fb98 Fix errorprone so it is version locked and reports warnings (#1242)
a11fcb605 Add UseConcurrentHashMap exception to PMD and clean NOPMDs (#1243)
139b1720b Fix JavaDoc generation (#1241)
011f0ff53 UsbCamera: Make setConnectVerbose public and add test (#1240)
75a67202e Add documentation building to repo (#1238)
186e1dc54 ntcore: Documentation cleanups (#1237)
f2393feee cscore: Documentation cleanups (#1236)
66e35128c Use Pimpl idiom for CameraServer
6933fefe5 Use Pimpl idiom for Scheduler
fedf82812 Command: Use SmallPtrSet for requirements instead of std::set
eb64ea9fc MotorSafetyHelper: Use SmallPtrSet instead of std::set
826ed7fe3 SmallPtrSet: Fix makeIterator
a2d314b0d ConditionalCommand.cpp: Remove iostream include
6b37ca9f9 UsbCamera: Allow silencing of Connecting message (#1231)
0614913f1 Add a way to indicate a Sendable is an actuator (#1226)
5fafaf627 Add confirmation to SendableChooser (#1217)
397a296e2 Add a .controllable key as a standard part of Sendable (#1225)
1d9ed8f45 Fix SensorUtil issues (#1194)
bbb622aaa Revert "Use ASAN when on Clang (#1187)" (#1234)
8cbe7a625 cscore: Move CvSourceImpl placeholders into SourceImpl (#1230)
932308b49 MjpegServer: Add ability to set compression, etc in code (#1229)
939827825 cscore: Add properties support to VideoSink (#1228)
c9a75a119 cscore: Support multiple levels of JPEG compression (#1223)
04ee8dbe7 UsbCamera: In JPEG mode, get size from image instead of mode (#1222)
7fd7192b1 Disable UvGetAddrInfo Concurrent test on Windows (#1227)
63c1f80d6 halsim_ds_socket: Update tag parsing, and add rumble support (#1214)
d54c2665d Update UsageReporting enums and their uses for 2019 (#1218)
8aac46542 Add a SimpleBufferPool for uv::Buffer (#1215)
c78e1499d Remove appveyor artifacts, and only build 64 bit (#1212)
a34df5589 Switch DS Sim Sockets to use UV loops (#1211)
eb2c6e19f Add sim hooks to set match data (#1191)
c25d48fd0 HttpParser: Add Reset() function (#1210)
794403dce Add shim headers for headers moved to cameraserver and frc folders
d89b7dd41 Move CameraServer and WPILib headers into their own folder
31ced30c1 HttpParser: Change Execute() to return StringRef (#1209)
74a306d47 Add halsim_ds_socket to allow a simulated robot to talk to the real DS (#1180)
5bf582113 Cleanup docs in uv::Stream and uv::Tcp (#1207)
eed28a585 Add sockaddr_in overloads for uv::Tcp and uv::Udp (#1206)
435e026c0 uv::Loop: Add user-defined data (#1205)
739267d36 Add Reuse function to uv::Tcp (#1208)
85118a023 Minor fixes required to enable the simulated robots to run (#1181)
ae72c0b29 Clean up style issues in wpilibj_frcnetcomm.py (#1199)
b72885b4f Remove wildcard dep version from gazebo msg (#1203)
70b0d7cb0 UDPClient: Add receive functionality (#1204)
053ca47d4 Update gradle dependencies (#1202)
74efe5aaf Get halsim_gazebo building again (#1201)
fe5d7dd6b Move DS caching from user level to the HAL (#1143)
0b5df467e Update Native Utils to fix static allocations (#1196)
80134164a Move Java main function from library to user code (#1148)
76b26c2df HAL_InitializePWMPort: Check for MXP port (#1195)
f8635e8ab Update to gradle 4.9 (#1193)
4029b5d84 Update gazebo plugins to Gazebo 9 (#1189)
4c527b9b0 Add vscode intellisense settings (#1173)
caa03d23a Make JxArrayRef less error-prone for jxArray (#1190)
297863b17 Add HttpParser and UrlParser C++ wrappers for http_parser.
1992b67ee Import nodejs/http-parser.
e2314f352 wpiutil: Add C++ libuv wrappers (#1166)
340b26bad Use ASAN when on Clang (#1187)
7f000fecc Force a DS mutex release on shutdown on desktop (#1188)
76c901ce7 Add simple motor simulation classes (#1117)
57fc61407 Compile C headers in C mode, and fix cscore C (#1179)
89d15f061 Fix main function initialization (#1176)
f5b1028b5 Fix race conditions in command tests by increasing the delay time (#1178)
ad3e2d7d3 Make HAL headers C-compatible (#1177)
3818a8b3b Update to gradle 4.8.1 (#1174)
59e8b6026 Add HAL Documentation (#1132)
de5d7d3c1 Only use priority_mutex on RoboRIO by default. (#1172)
ebd41fe0b Bring back the gazebo plugins (#1063)
70960b025 Signal: rename Signal to Signal_mt and Signal_st to Signal.
c8afe9bc2 Signal: Optimize to use plain std::function.
1ecaaafa6 Discuss and include licenses for third party software. (#1101)
33a01b314 Add maven documentation (#1140)
1d8456e2b Move FRCNetComm.java into generated directory (#1168)
b5bacc09a libuv: Silence cast-function-type warning on GCC 8. (#1169)
876c65047 wpiutil: Add a signal-slot implementation. (#1163)
3eae079db Add PDP usage reporting (#1167)
122fdf48b libuv: Hook up to build.
d94f49b3b libuv: Silence clang compiler warning in uv-common.c
39670fc9c libuv: Add pragmas for win32 libraries.
6f0d50b9c libuv: Avoid conditional-true compiler warning.
873b2ed13 libuv: Add missing casts.
321c144d2 libuv: Remove extern "C" from uv.h.
13e1af259 libuv: Remove MSVC 2008 stdint from uv.h and uv-win.h.
9d7792ead libuv: Remove aix, os390, and sunos from uv-unix.h.
6d93d3c25 libuv: Rename source files from .c to .cpp.
156822dbc Import libuv 1.21.0.
208f82d6f Revert "Add libuv dependency (#1109)"
a818c7fd4 Add loop timing to IterativeRobot and TimedRobot (#781)
50b13d2f3 Convert UnitTestUtility to a JUnit 5 MockHardwareExtension (#1153)
b7807bf9d Clean up Command container iteration code (#73)
ea7d11b1d Twine: Make isNull() public. (#1162)
212f378d0 Replace globalError in ErrorBase with a global set of all errors (#615)
2faba39b5 Change wpilibc artifact name to match standard (#1158)
064989f2e Fix projects having different version numbers (#1113)
6b1b4796c Remove Link Script (#1159)
1ebb83e0f Remove explicit close() from Gyro interface (#1152)
9108a9359 Switch non-integration tests to JUnit 5 (#1120)
c7e97f45f Add RobotPeriodic functions to default templates. (#1149)
5af85dd1b Explicitly states the gyro direction contract for the Gyro interface (#1151)
b20158015 Update java robot class docs (#1150)
b1bb63f9a Add ADX Simulator tests (#1142)
056e68f2a Use new CAN API for PDP (#1081)
f6e4df6a1 Remove OS Serial Port (#1141)
0cde67143 Upgrade to gradle 4.8 (#1136)
1f9645afe Fix CAN API reads (#1139)
86285b427 Removes MSVC 2013 Shims (#1130)
e548a5f70 Update and enable PMD 6.3.0 (#1107)
8eafe7f32 Solve some safety issues with RPCs (#1127)
6aebba545 Import MapVector from LLVM. (#1128)
664a3c246 ntcore: Fix C API polling array returns. (#1126)
321dfaf0a Remove non-existent directory from .styleguide (#1124)
8373e0361 Made Controller interface public (#1123)
8c680a26f Moved C++ comments from source files to headers (#1111)
d9971a705 Throw UncleanStatusException rather then RuntimeException (#1114)
85fe722f4 Fixes JNI files not getting cleaned on rebuild (#1121)
c04f463b7 Makes FRCNetComm interfaces static final classes. (#1118)
307da3ad2 Simplify allocation of JNI global classes and exceptions (#1110)
39f80730d Disable broken ntcore tests using JUnit 5 (#1116)
35cfe0d92 Add comment to FRCNetComm.java noting that it is autogenerated (#1115)
8d218dbca Add support for unit testing from GradleRIO for C++ projects (#1094)
938f83514 Update things deprecated in gradle 4.8; remove unused function (#1093)
1dc55c03d Add Windows PDBs to release zips, and skip strip on mac (#1092)
859b457c3 Add libuv dependency (#1109)
8958c4eab Fixed wpilibj_frcnetcomm.py and added invocation to Travis (#1106)
7c9517ce5 Fix gain encapsulation in LinearDigitalFilter (#1105)
5bf9720cc Use externally built Google Test (#1108)
d1587ed2c LICENSE.txt: Update copyright date to 2018. (#1100)
5fcb67aaf Fix Checkstyle (#1095)
2e5fece59 Add utility class tests (#871)
863cfde39 Adds tests to ensure all examples have matching item in json file (#1079)
c4728d291 Makes CAN API initializer setup HAL (#1084)
fb45a5b31 Allows passing in the main robot class from the command line (#1091)
86c1f8ae5 Fixes initialization when not using the provided main (#1085)
381c25c57 Fixes interrupts not getting closed properly. (#1088)
62d5301b1 Changes notifier to be closable. (#1090)
40cc743cc Enable checkstyle on cscore, ntcore, wpiutil (#1032)
ecfe95383 Made SensorBase a utility class and renamed it to SensorUtil (#813)
ba93f79d8 Fix mac builds (#1087)
dcc276484 Default to requiring frc namespace for wpilibc. (#972)
cbaff5285 Implements AutoCloseable for types, replacing free() (#1048)
a2ecb1027 Update LLVM to latest upstream. (#1080)
680aabbe7 Add new CAN API (#1036)
55b0fe008 Fixes JNI symbol check on VS 2015 (#1078)
8b8c3d546 Updates NativeUtils dependency (#1077)
38a7786f2 Remove spotless (#1074)
df182f382 PIDController now supports composition (#976)
5cc757357 Updates JNI to support embedded jni libraries for easier setup (#1075)
17401e10f Add setting to invert the right side of the drive (#1045)
73439d821 DriverStation: Fix getStickButtonPressed/Released (#856)
72a79aac5 Fixed the names of the arguments to some C++ drive classes (#1070)
c89678971 Replaced the START_ROBOT_CLASS() macro with a template function (#1050)
64b03704f Rename Joystick default channel constants (#904)
630fc55bd Implemented synchronous PID controller (#993)
f90e429bf Add removeAll to preferences (#987)
2e0709f05 Add spotless to check line endings (#1055)
11d46713d Fixes pessimistic std::move (#1069)
ef442d775 Refactored DriverStation.java unplugged message handling to match C++ (#808)
3e6c3c3e9 Replaces Timer in PIDController.java with Notifier (#878)
8d57b73b4 Fixed naming convention of static variable in TimedRobot.java (#876)
d8c8643b5 Format HTML and XML files (#944)
adb609835 Removed extra newlines after open curly braces (#935)
938d5379e Adds command examples to built examples (#1062)
7cd15aa04 Re-enable JsonIteratorObjectTest.KeyValue.
f8ed48af9 Update json from upstream version 3.1.2.
c274d1790 StringRef: Add comparison operators against const char*.
6699f8636 Make most StringRef functions noexcept.
c2b1ed3ed ArrayRef: Add value_type typedef like std containers.
2c27ad073 raw_istream enhancements.
31bb55c31 Add std::vector and unsigned variants of raw_ostream.
dd4230d74 StringMap: Add decrement operations to iterator.
cff475c1f Moves C++ templates and examples to match gradle setup (#1065)
d564e19ef Only prints the debug binary message once per build (#1066)
1d6eb629a Adds Objective C++ Build capabilities to cscore mac (#1029)
406e18663 Switches NotifyListenerVector to SmallVector (#1004)
ab70220ec Makes SPI edge changes more obvious (#1056)
560123ab7 Fixes command folder name in templates.json (#1061)
4e1964156 Removes 32 bit configs for linux and mac. (#1060)
5ff3d837b Fix compilation with GCC 8 (#1051)
74d7107ac Add AppVeyor Build Support (#1013)
e21a246a4 Make the HAL self initialize when ever any initialization function is called (#1012)
59a8e9da5 Fixes gradle wpilibj classpath for editors (#1047)
795c60da0 Adds a testCpp task to all projects (#1014)
f3db32911 Enables MyRobot project (#1028)
f07799c67 Disables unstable and failing unit tests (#1057)
eec4f53a6 Forces CRLF files to LF (#1054)
01d8d0c79 Moved C++ header includes out of extern "C" and added missing C header includes (#1053)
6729a7d6b Run wpiformat on merged repo (#1021)
0babbf317 Adds CMake Readme (#1042)
337e89cf6 Adds JNI Simulator interface and updated Sim API (#1002)
104637134 Fixes some JNI issues with method calling and class storage (#1043)
665a6e356 Allow users to feed the watchdog contained in drive objects (#1044)
b7ea481bf Notifier: reset updatedAlarm before waiting (#946)
7a34f5d17 Check for nullptr return from malloc, calloc, and realloc. (#1023)
e8d5759d9 Actually have the cscore examples build, and makes them build only on linux (#1030)
eeae84c71 Adds cscore examples to builds (#1027)
dab6f40b4 Moves examples.xml to json, and adds template json (#1026)
5c2c5ccd0 Remove atomic static shim. (#1020)
8cbfe35bd ntcore: Remove MSVC 2013 shim. (#1018)
954f8c40f Adds CMake Builds (#1015)
6a49173ce Update cscore examples for llvm to wpi rename. (#1016)
1043aef7f ntcore: Make header actually a C header (#1007)
f7bcf5305 HAL: wait for all objects to release handle before freeing (#1011)
6a159c5bd Miscellaneous cleanups (#1008)
a098814ea Removes the make_unique shim for c++11 (#1010)
a28832e52 Add backwards compatibility shims for old wpiutil headers.
f84018af5 Move entirety of llvm namespace to wpi namespace.
93859eb84 TimedRobot now uses the Notifier HAL API (#942)
e7cf6bf7c Fixed wpilibj GenericHID.getType() (#969)
a8fd88840 Revert "Uses ComputeDigitalMask function across HAL DIO (#837)" (#1005)
c84bd744c Uses ComputeDigitalMask function across HAL DIO (#837)
11b99a016 Removes old version files from git ignore (#1003)
dfa46cbdd Fix typos, keep formatting consistent. (#974)
91151e33b Add out to gitignore (#988)
2ed9ae165 Removed unused ROBOT_TASK_PRIORITY constant from RobotBase.java (#991)
fdfea3516 Fix JavaDoc tag (#995)
47783842e Fix JavaDoc tag in Differential Drive (#996)
7f88cf768 New 2018 and later build setup (#1001)
cb2c9eb6d Remove gmock and builds from utility libraries (#999)
4a1e52075 Merge cscore into allwpilib.
b3aa659f9 Merge ntcore into allwpilib.
4870d83ad Merge wpiutil into allwpilib.
7210a8fd2 Prepare ntcore for merge into allwpilib.
0f947613a Prepare wpiutil for merge into allwpilib.
ea73c10cd Prepare cscore for merge into allwpilib.
6d3d52f92 Fix GetJpegSize() and JpegNeedsDHT() to handle SOF as first tag. (#127)
dbd1f1781 Ran wpiformat (#126)
96e9a6989 Improved Command-based examples (#906)
14228d82f Adds Direct port name Serial API (#956)
040731447 Add FPS and byte count telemetry measurement for sources. (#125)
5175829ba PWM: Use getRaw and setRaw for Sendable "Value" property. (#963)
9d7293734 SendableChooser: Do not automatically add to LiveWindow. (#964)
1e5ec362f CameraServer: catch VideoExceptions in video listener. (#949)
7bb3e4efc Made documentation for RobotDriveBase::SetDeadband() clearer (#953)
67de595c8 ADXRS450_Gyro: Add null check around reset (#948)
82152e90f Adds defaults to PWM config (#961)
1e7d43989 HAL Notifier: Don't disable the notifier manager when the last handle is cleaned up (#960)
71d06a1a2 HttpRequest: Don't reorder parameters. (#73)
698feff2f MjpegServer: Support limiting FPS. (#123)
3ef9ffaf3 HttpCamera: Force reconnect when SetUrls() is called. (#122)
3025a182c Fix two bugs in client synchronization. (#270)
febc41c85 Fix Travis CI wpiformat install (#72)
627ca6db7 Fix Travis CI wpiformat install (#121)
c80b0de2c Fix Travis CI wpiformat install (#269)
979984fa6 Fix Travis CI wpiformat install (#947)
57e9fb33d Fixes C++ SendableChooser using invalid temp variable (#945)
f5a292dad Adds TriState JNI entry point (#938)
4e9e7ec8f ParseHttpHeaders: Make case-insensitive per HTTP spec.
77d6c1174 Invert right side motors in MecanumDrive sendable (#933)
c69b8f00d ReadJpeg: Don't read past the end of the image. (#119)
0542b50f7 Work around fallthrough warnings on GCC 7+.
1077ef9fb Adds compile task (#118)
67f9c9a5b Fixed TimedRobot.java hanging if an exception was thrown (#926)
f720cbb12 Switches CtreCanNode to use locking and std::chrono for time (#909)
64a7e57fe Added output normalization to DifferentialDrive::CurvatureDrive() (#924)
5ca00dddb Added TimedRobot::GetPeriod() (#915)
120ceb342 Fix channel reassignments for C++ Joystick twist and throttle axes (#903)
5cbafc138 Updates to image 17 (#913)
39d1650d5 Fixes double to int to double cast in encoderJNI (#918)
02336fc47 Makes FMS data never be a null string. (#900)
c00848c06 Fixes indexed classed handle resource (#899)
738a1c015 PIDController: setContinuous should only check input range if continuous is true (#896)
48ae6c954 Publishes match specific data and other FMS info to NT (#874)
07f70cf78 Fixes control data packet delay (#875)
e4e1eab41 Fix cancel of inner commands in ConditionalCommands (#858)
0e8ff4663 SpeedControllerGroup: Call set() from pidWrite()
54a0a7654 Link to replacements for RobotDrive in JavaDocs (#879)
59f938b58 Invert when getting motor speed in SpeedControllerGroup (#886)
551388845 Fix PIDController with Continous and no Input Range set. (#883)
02b661504 RobotController: Make getBatteryVoltage() static. (#869)
1f4822f33 Replaced Talon motor controller in DifferentialDrive class docs with Spark (#868)
bb38ef564 DifferentialDrive: Invert right motor in LiveWindow. (#867)
ca36d1dce Adding callbacks for notifying when the distance per pulse changes (#861)
ee33296e1 SmartDashboard override .name entry in putData(String, Sendable) (#866)
4376c94dc Updated copyright year
19f7a5f10 Set up wpiformat
4514ff807 Removed extra newlines from beginning of Java classes (#264)
b66d72f5c Updated copyright year
c6f6b352f Set up wpiformat
0ef980336 Update copyright year to 2018 (#864)
eedb8910c Removed extra newlines from beginning of Java classes (#859)
882399c65 Update copyright year to 2018 (#116)
8346caed9 Move subsystem command metadata to metadata key format (#863)
55b6764d5 Fix bugs in simulation libraries (#853)
2c4faee66 Fixes -Og compile and strip binaries (#838)
228728106 Fixes linux and mac builds to -Og, and strips binaries (#261)
cd4b7b6cc Switches to -Og instead of -O2, and strip binaries on linux and mac (#63)
da5458a2d Updates to newest build setup, fixing -Og and strip binaries (#115)
8d1dee16b Add DriverStation NetworkTables HAL Extension (#829)
76b182600 Add Low Fidelity NetworkTables simulation extension (#823)
c647a801a Add Encoder Index as a child (#857)
02131639b Add Digilent DMC 60 Speed Controller (#855)
566e28369 Make setDefaultCommand public (#854)
40eb6dfc9 Fix SmartDashboard PutData to hook setters. (#851)
a3e5378d1 SPI: Check for null (#850)
691741cfc Fixes non public static methods in RobotController. (#852)
166d9e01b Add PWMVictorSPX (#842)
7eab4371f Adds TriState DIO functionality to the HAL (#835)
de134a5c6 Add deprecated shims for LiveWindowSendable and NamedSendable. (#834)
7f074563d Add support for automatic SPI transfer engine. (#836)
d3dd58636 Revert "Fixes SPI bad chip select (#818)" (#822)
9c8510559 Update to image 2018v16 (#833)
86ac70a12 Fix wpilibcIntegrationTests RobotController warnings. (#832)
3c3a448d4 Deprecate SampleRobot (#472)
8744511f1 Fixes some methods in RobotController not being static. (#831)
7729dd972 Fixes JNI symbol check (#830)
8b7aa6109 Adds RobotController class (#828)
88a6b4ac3 PIDController::InitSendable(): Use double, not bool for double values. (#827)
217b1a225 VisionRunner: Add stop() function to stop a runForever() loop. (#826)
d2e7a90f4 Removes statics from hal sim (#825)
8bd48d6c3 Switches HAL to manual instead of static initialization (#824)
1fa0adb09 Removes MSVC and GCC old version workarounds (#821)
f615e68a4 Require GCC 5 for wpilib build (#820)
aa4f0ef4f Start using the new FRC compiler define (#797)
b42285fdd Fixes SPI bad chip select (#818)
8106fbdbe Removes custom CONFIG_ATHENA compiler directive (#796)
942ba5176 Reclassified NetworkTables headers as "other library" (#775)
33a08d5b3 Add halsim unit tests (#783)
4e3af0756 Removes workarounds for issues in image 10 (#816)
5078f6c92 Update to image 2018v13 (#815)
899892c11 Change Utility to use Twine.
54326311a Use Twine in error checks.
fe53dd2f2 Use Twine for error message inputs.
ab137abab Use llvm::Twine across C++ Command structure.
001dedf3b SmartDashboard: Use magic static for static initialization. (#812)
f9bece2ff Update LiveWindow to provide continuous telemetry. (#771)
3befc7015 Make MotorEncoderTest use LinearDigitalFilter's reference overload (#811)
de63e1c8a Fixed race condition between PIDController enable/disable and PIDWrite() call
a76b1aa80 Reduced scope of PIDController's critical sections
350b741ad Cleaned up SampleRobot template and added warning about disabling motor safety (#766)
64bfdc1a6 Bail out of the integration tests if enable fails (#792)
65cc85f68 Add reference constructors/factory methods to LinearDigitalFilter (#810)
6a00dc797 Re-Add PacGoat java example (#802)
e9e407a87 Replace C identifier lists with (void) (#809)
59c4984ed Deprecated internal filter of PID controller (#746)
b428d1e4b Remove CANSpeedController interface. (#806)
099436459 Fixes cross module base class statics (#779)
0b8d3f026 Update SampleRobot template to match comments (#768)
52eba45c5 Add missing documentation for squaredInputs for RobotDrive (#805)
9090a82ef Fixes halsim sources and headers zips (#804)
4e0ed7986 Fix no return warning in jni_util.h (#62)
2a69a4c7d Revert #780 (don't kill FRC_NetCommDaemon). (#795)
9d2393f97 Waits 10 seconds between running the C++ and Java test (#798)
dae619b00 Add error reporting to AbstractComsSetup test initialization. (#800)
9c06d2878 Update to latest native plugin (#799)
e3a2abdf9 HAL_SetDigitalPWMRate(): Use same logic as LabView. (#794)
7867e906e NidecBrushless: Have disable() call PWM.setDisabled(). (#763)
65a044f63 Fix HAL_CleanNotifier race. (#793)
cbd08a1e1 Add tests for equivilance of RobotDrive and DifferentialDrive/MecanumDrive (#732)
e308dd28f Fix javadoc link in Solenoid.java (#789)
fa0b4428e Runs DS enabled loop in process (#785)
6767afd40 Adds a UDPClient (#60)
26a36779a Performed cleanup of Timer's free functions (#776)
dfc0656e5 Fix wpilibj FilterOutputTest null pointer exception (#778)
0f3f5218a Kill FRC_NetCommDaemon as well as robot programs. (#780)
34c44b7ae Improved Drive docs and fix implementation bugs (#774)
7a250a1b9 Implement PCM One Shot feature. Fixes artf4731 (#539)
a338ee8be Add PIDController Wrapping (#601)
c9d440f33 Fix Java Compressor test. Make limits same as C++. (#772)
aa2de65ba Use Twine instead of StringRef where appropriate. (#259)
a00b2449d Removed unused includes and replaced Ultrasonic's std::set with std::vector (#767)
5c659fdcd Deprecated PIDController::SetTolerance() (#764)
d36d72bd4 Fixes MotorSafetyHelper locking and race conditions (#762)
614093c0c Fix documentation for getMatchTime in Timer class to match DriverStation (#761)
877c7f51c raw_istream: Don't forward declare Twine et al. (#59)
912b74151 Use llvm::Twine instead of llvm::StringRef in several places. (#58)
f73db4a49 Twine::isSingleStringRef(): Support CharKind. (#57)
12c4418bd Added callbacks for CAN (#757)
0431cf97f Cleanup PIDController (#597)
ba879f466 Cleaned up variable names for std::lock_guard and their associated mutexes (#759)
96de0b5b1 Variable name fixes (#758)
85157a56c CircularBuffer now uses an idiomatic interface in C++ and Java (#421)
029246ed2 Replaced extra constructors in LinearDigitalFilter with llvm::ArrayRef<> (#755)
6377ab774 Allow deprecated warnings for tests (#756)
05e581f40 Fixed crash in wpilibj SampleRobot (#753)
c73dd807e ErrorBase: Remove last use of sstream and iostream. (#750)
7a0dd9baa Add return-to-zero test for LinearDigitalFilter moving average (#751)
11f37683c Added constructor to PIDController that takes references instead of pointers (#745)
5af0c9c10 Replaced const variables with constexpr (#731)
259461aee Added PIDController::GetAvgError() back in (#749)
d214b3678 Change HAL notifier to polling. (#627)
4a07f0380 PIDController class now uses LinearDigitalFilter for filtering velocity instead of internal queue (#38)
cf828ca85 Upgraded clang-format to 5.0 (#103)
7847c6923 Update for wpi::Now() change to microseconds. (#113)
7f46b50b2 Unify WPI_Now and HAL_GetFPGATime. (#743)
0e4a1c5da NetworkTable: Add key utility functions. (#256)
551504e77 Update documentation for Now() for 1 us steps. (#258)
85e83f1bb WPI_Now(): return microseconds, and make backend replaceable. (#56)
7eac3fcbd Java NetworkTableEntry.setValue() and kin: Handle common Java types. (#257)
303c259b8 Simulate ADX* family of accelerometers and gyros (#688)
cd1dbb1e3 Adds a const buffer listener (#742)
a20474bfc Update sensors to not use direct byte buffers.
479d0beb5 SerialPort: Use byte[] instead of ByteBuffer in JNI.
b93aa176d AnalogInput: Remove byte buffer usage.
9021b37fd I2C: Provide byte[] JNI interfaces.
6307d4100 SPI: Provide byte[] JNI interfaces.
e9b0b9d8f MjpegServer: Use sink name in title. (#112)
cad1b9413 Add exposure quirk for LifeCam Cinema. (#111)
3324bcc5c Use magic statics instead of ATOMIC_STATIC. (#109)
20c8d29ae Fix wpi::mutex usage in SetVideoMode().
110726c5b Adds support to test library for JNI testing (#54)
df7c1389d Remove ni-libraries libi2c and libspi.
6accc31ee HAL: implement I2C and SPI directly instead of using i2clib and spilib.
f56ec10bc Only return lower 32 bits of FPGA time (#741)
e5e6d6a19 Ran formatter based on styleguide#95 (#737)
c663d7cd1 Reflowed comments and removed commented out code (#735)
1e8d18b32 Upgrade Travis CI Python version to 3.5 (#740)
c2d95db3a Fix PreferencesTest. (#739)
7db60f8e7 CvSource: Implement SetVideoMode(). (#104)
b3f1e7431 Ran formatter based on styleguide#95 (#108)
dd7563376 Force load OpenCV and cscore libraries on program initialization (#716)
14fcf3f2f Simplified PIDController integration logic (#645)
020ee227d Move ctre headers to hal/src so they aren't user-visible. (#728)
4d559f385 Use wpi::mutex instead of std::mutex. (#730)
e301adb22 Use wpi::mutex instead of std::mutex. (#105)
3438a1734 Use wpi::mutex instead of std::mutex. (#254)
e4deda5cc Fix SafeThread bad merge. (#53)
80618a2e6 Use wpi mutex and condition_variable. (#52)
e45b6e0f6 Fix typo in priority_condition_variable. (#51)
86d4899a5 Make NetworkTable constructor private/package-private. (#253)
9d8a508cd Add priority_mutex and priority_condition_variable. (#50)
c9ead29f4 SafeThread: Simplify m_lock assignment. (#49)
35d68d2a3 Adds ability to simulate joysticks and event info (#727)
7007725d9 SerialHelper: Check error_code to prevent infinite loop. (#725)
0c83cad70 Upgraded clang-format to 5.0 (#431)
0001047b8 Add NidecBrushless to WPILib.h (#724)
f77fd1eca Set SO_EXCLUSIVEADDRUSE for server sockets on Windows. (#44)
5a5e75392 LLVM path: Don't follow symlinks. (#48)
c88525136 Fixes HALSim_Print build to be the standardized pattern (#721)
42096fac3 Ran formatter (#722)
6be9e69d1 Switch Command Templates to TimedRobot (#719)
7bbd13d91 Adds match specific calls to Java and C++ (#720)
3e4e5261f Remove no warnings on winsock and scl issues (#47)
cf4afb6fe Adds get header task (#46)
55fa1e5e7 Adds header task (#101)
2225c4fee Fixes warnings for casts in sim interrupt functions (#718)
c10165541 Adds warning prints by updating native plugin (#100)
51165ba0a Updates native plugin to add warning prints (#251)
f03b31f43 Adds warning printouts to gradle by updating native plugin (#45)
7efab4c43 Replaced ternary operators with if statements (#346)
c8e44256e Uses NI provided function for SetOccurDataRef rather then importing the symbol ourselves. (#714)
f3cd883c5 Add Nidec Brushless motor. (#705)
f34c736fb Adds warning prints to native library builds (#710)
127648996 Removed uses of deprecated functions (#709)
8b2e656bd Fixed Java velocity PID not calculating result when P = 0 (#717)
6e9d1f55c Updates image to 2018 v10 image (#713)
f4dce9e60 Fixes receive size in Java I2C (#715)
b9aabc71b Fixes publishing basenames for examples to make combiner script work. (#712)
0d5477236 Add IDEA plugin to root project (#707)
faf134a67 C++ examples no longer use deprecated APIs (#703)
c24e75540 Fixes java example publishing and xml file (#706)
bee9f1cb1 Adds header task to print out all headers (#704)
45d48d6b5 Cleaned up C++ examples (#672)
6401aa1fd SerialHelper: Use llvm path functions instead of popen. (#702)
8e797a1a1 Import filesystem directory iterators from llvm. (#43)
6af4940c2 Adds HAL calls for match data from DS (#691)
237b2df82 Add .type metadata to preferences table (#701)
a70687aae Improve error reporting for the new TCP netconsole. (#700)
fbfe85568 Fix preferences test (#699)
595b1df38 Fixed minimum number of joystick axes (#696)
fd32350dc Assign received sequence number on receiving an unknown entry (#250)
b9c8ebeff Ran formatter (#99)
efc7770e9 Fixes NPE in DriverStation initialization (#694)
21585f70a Added functions for detecting button press and release events (#626)
c33fca34e Added TimedRobot template (#673)
de95f08a1 Adding call to notify program started (#692)
90f99dc57 Adds PWM to LoopTiming and CycleStart HAL calls (#693)
f34332643 Uses new FPGA calls to get 64 bit FPGA time and 64 bit PWM cycle start time. (#687)
4ab095e9c Fix formatting in CameraServer.cpp (#689)
541753c81 Updates to 2018 v9 image (#686)
f02bb058b Set the llvm standard output stream to be unbuffered. (#678)
12e96c6f1 Add usage reporting to CameraServer (#682)
b65447b6f Fix spelling typos (#595)
9945a5b3c Ran formatter (#681)
ce4c9edd1 Fixes halsim_print to not try and build when the 'onlyAthena' flag has been set (#685)
a6e6ae41b Add function that can register all the HAL callbacks at once (#646)
f4e2e41aa Remove leading '*' from license and rename to LICENSE.txt (#596)
1e528669f Adds publishing for examples and templates so they can be grabbed from eclipse (#674)
a1ea44840 Adds JNI call to get CANStatus (#677)
9dc1de1d0 Specified angle units for Vector2d rotate() function. (#679)
0521d8504 Moved comment after include line so include order is determined properly (#680)
3c842d823 SPI and I2C simulator (#662)
ec12b0ffe Add wpiformat to Travis CI (#98)
7fd594748 Fix include guards (#97)
be77f9cb2 Pull request for the Extensions interface only (#655)
2fc60680f Remove RedundantModifiers (#578)
0291a95f6 Add cpp examples (#659)
66002d6ca [WIP] Move examples to allwpilib (Java) (#569)
a7e9ac106 Fix capitalization of class names in PIDToleranceTest.cpp (#588)
434d60592 Adds HAL_Initialize to ErrorBase constructor, and makes HAL_Initialize properly reentrant (#668)
ee2074725 Adds WPILib JNI shared debug file publish. (#671)
f4779379c Added brace comments (#670)
877a9eae1 Add SpeedControllerGroup (#362)
b68e1c557 Added brace comments (#96)
ded1beb94 Removes specific raspbian, armv7 and armv8 cross builds (#249)
a6c7789b5 Removes specific raspbian, armv7 and armv8 cross builds (#41)
24752a975 Removes OpenCV dependency from wpilibJNI (#667)
e1dc09951 Updates to the 2018v5 image (#665)
f0cc62324 Change metadata format to dotfile, make certain entries metadata (#666)
ba3a85d0c Changes TalonSRX to PWMTalonSRX in wpilibj and wpilibc. (#656)
79919a5f1 Moves wpilibc link script into shared folder (#660)
94ea5bfb0 Move published wpilibj JNI shared artifact into shared/ subfolder (#658)
24680bbd5 Change link script artifact id (#657)
73f8412b4 Correctly handle negative waitForXQueue timeouts in Java.
529d7f5fe Initialize logger min level from logger_impl.
a6c1e18ae NetworkTable.containsKey(): Always return false on empty key.
8a37b81f4 LoadEntries: Don't emit NOTIFY_FLAGS. (#247)
f81b6fbcd Fix handling of deleted values in several places. (#241)
7fab0e0ef Depend on wpiutil 3.+, ntcore 4.+, cscore 1.+ rather than just +. (#651)
223e61df2 Depend on wpiutil 3.+ rather than just +. (#95)
303df626a Depend on wpiutil 3.+ rather than just +. (#235)
9e8ad778d Update wpilib-version-plugin to 2.0. (#39)
1f18cc541 Add SaveEntries() and LoadEntries(). (#233)
e68a71022 Move immediate connection notification logic into Dispatcher.
e4a8bff70 Move immediate entry notification logic into Storage.
10982e027 Don't actually remove deleted entries from m_entries. (#239)
dd66b2384 Remove priority mutex (#644)
19addb04c Split RobotDrive class into a class for each drive type (#552)
abb66d3e4 Replace FRC_NetworkCommunication CAN in wpilibj with HAL CAN (#650)
db4981f16 Java now asks the HAL if it is a simulation or not (#647)
8edc02b06 Update README for new build system. (#232)
4b2aaee9e Made package local methods in NetworkTableInstance public (#234)
9fdb33b6a Switches native linux arm build to be `nativearm` arch (#38)
6e1be897d Ran formatter (#643)
423d8f686 Add missing usage reporting. (#639)
eb38204d1 Update the README to note the need for gcc 5+ and Visual Studio (#640)
1711291cd Fix Travis build (#641)
3faecdb35 Add SHA1 algorithm implementation. (#32)
57ba58917 PreferencesTest: Use new NetworkTables API. (#636)
2249a8bac Adds a HAL wrapper around the CAN API's (#623)
c572e6a30 Adds the rest of the data needed for a publish on jenkins (#628)
e444b6015 Updated remaining .styleguide files to new config file format (#635)
db96f41ad Log.cpp: Use raw_ostream and llvm path functions. (#93)
38dbed8e0 .styleguide now uses generalized config file format (#621)
10fbf17d4 .styleguide now uses generalized config file format (#94)
34c18ef00 Remove getTable from wpilibj Sendable interface.
0d4fde17e Remove GetTable from wpilibc Sendable interface.
040a8c6bc Update wpilibc to use new NetworkTables package and interfaces.
4e80570c4 Update wpilibj to use new NetworkTables package and interfaces.
91529cc43 Update NetworkTables for new API.
ef8580969 Fix bug in raw_fd_istream::read_impl(). (#30)
95bce5d65 Add more storage incoming unit tests.
cedbafeb2 Add INetworkConnection interface for unit testing.
7c1d2f4bc Improve client connection synchronization behavior.
8099d6dbd Refactor Storage ProcessIncoming().
8e01b68cf Switch Storage save/load to use raw_ostream/raw_istream.
d707a07f8 Refactor Storage load and save functionality.
5ab20bb27 Implement independent instances.
8125a179f Only include .cpp files in testsuite build.
041563f8e Change UidVector to be LRU with a reuse threshold. (#29)
ef3267833 Fix IterativeRobot/TimedRobot RobotInit(). (#633)
a5ef50c9e Add documentation for PeriodMultiplier (#632)
6eee45789 Renable javadoc fail on error (#631)
fb6d7b347 Fixes javadocs (#630)
2d78fdabb Fix recieve typo in JNI names. (#629)
94c31ceeb Gets wpilib compiling with skipAthena and onlyAthena flags (#625)
c3f7c85f8 Adds wpi GetHostname function (#25)
12b2efa48 Log.cpp: Use raw_ostream and llvm path functions. (#223)
67d4da51e Restore travis support. (#608)
6e4f66cc8 Classify other libraries' headers properly and fix committed formatting issues (#620)
5d403a7b4 Makes an empty stringref have a valid Data pointer (#28)
3c88f94b4 HttpUtil has moved to wpiutil; use it. (#92)
06636a0e1 Set up wpiformat (#86)
a4e781a23 Fixed spacing and comment annotations around namespace and extern declarations (#587)
f151892db Contents of copyright line now has more standard ordering (#585)
c45fb73f3 Convert for loops to foreach loops (#592)
848280d1f Improve C++ Compressor documentation based on Java's docs. (#607)
8416b4e42 Add default parameter to StringRef to allow null termination on lengthed strings. (#27)
1a0ed61f7 Force the java dev library to be built during `build` (#24)
68501759f tcpsockets: Don't pull in platform-specific headers in headers. (#26)
f7016b359 HALUtil: Update to new GetJavaStackTrace function.
be58a279a Cross-platform JNI sometimes has jlong != int64.
909e6c485 Error.cpp: Use llvm path function instead of OS basename.
5c0b08f4f Turn off -Wunused-const-variable on Mac.
05d1cfa27 Add "override" qualifier to several headers.
ae675ae4e DriverStation: Work around missing pthread_local on Mac.
d3b636d07 fpga_clock: Don't use constexpr for time_points.
8b460f594 sim DriverStation: Fix missing includes.
bdfa32876 Fixed Gradle test task name (#617)
4a3472ebb Removed unused include in PIDCommand.cpp (#616)
9c804c135 Fixes builds with skipAthena and onlyAthena, and mac builds (#613)
2a9c454ba Cleaned up and updated .styleguide for new build system file locations and ran wpiformat (#612)
1a9a6c367 Fixes HalSimStaticDeps config and publishing (#610)
e1195e8b9 Update to 2018_v4 image and new build system. (#598)
dd85b1e51 Update googletest and googlemock to 1.8.0. (#90)
2d3cf1bdb Updates plugin to 1.2.12 (#91)
baa8021c7 Force dev java to be built during `build` task (#227)
133540f57 Switches to the new build system (#87)
43c103c0a Update googletest and googlemock to 1.8.0. (#23)
162ac787b Update googletest and googlemock to 1.8.0. (#226)
fa7d5bc02 Add UidVector (used in both ntcore and cscore Notifier). (#22)
9d4508812 Fix destruction order issue in SourceImpl. (#89)
7ef56de3f Fix mac builds. (#88)
0d76b3f30 Added gradlew.bat to .gitattributes (#225)
50ed55e8e Force OpenCV to 3.1.0 (#602)
92c4c49b0 Removes the custom platform include flag (#224)
855df5d67 raw_mem_istream: Add StringRef constructor.
c8d9cc7e5 Add filename constructor to raw_fd_istream.
1c1fbf14c Import LLVM openFileForRead and openFileForWrite.
9e4dc235d Connect to server in parallel rather than doing round-robin. (#205)
4bd8cf6f5 Native tests depend on native sources, so include in exportedHeaders. (#222)
d9c754c30 Add a java version of the dev app. (#218)
ea028a382 Add a cpp dev run task. (#219)
7d9e6b7e2 Move ReadLine into raw_istream class as getline. (#20)
17b5cace5 Base64: Add raw_ostream and SmallString interfaces. (#19)
2fa41b23b Add a java version of the dev app. (#16)
9f5f6111d Add a cpp dev run task. (#17)
078216412 Gradle 4.1 (#220)
5439fe7b1 Gradle 4.1 (#18)
55111ac35 Fix CORS issue with all requests (#85)
f0cc5d9ca Adds an all artifact to the published libraries (#15)
ccfeab5ac Adds an all artifact to the published libraries (#217)
d682295cc Miscellaneous cleanups for HAL, wpilibc, and wpilibj JNI (#589)
5e19c1881 Use diamond operator
617ff52f1 Use generics
7e011bda6 Add HTTP utilities. (#7)
8418c3912 Add Path and Twine components from LLVM. (#10)
5d3af62c0 Remove use of std::chrono_literals (C++14 feature). (#574)
4b8ef57a9 Remove networktables2.type Java custom container types. (#214)
d910b0b2a Remove deprecated throwing get functions. (#213)
80c8de7d6 Add dependency to jni task to fix 32 bit builds (#216)
7f776deae Fix ntcoreExe build model. (#215)
8209ba8a0 Move NetworkTable into nt namespace, with a shim. (#211)
25c8e873d TCPConnector: Add method to connect to server in parallel. (#6)
e24db75f0 Build updates to newest version of plugins and gradle, along with config file (#13)
5df746366 Remove wpiutil and update to the new build system (#210)
eb7331f2a Actually makes the right classifier
03bd0820c Adds a java classifier whenever jenkins is building (#12)
63768166e Updates to plugin 1.2 (#9)
bd899a7a7 Fixes mac RuntimeDetector (#11)
ddd5aeba1 Checkstyle 8.1 (#584)
301442ee4 Add json support to wpiutil.
de9dd1180 Include src/main/native/cpp when building test.
436ed4d1e Implement comparison operators for llvm::StringMap.
88aa273e5 license.txt: Add LLVM license.
d11d8409a license.txt: Remove leading asterisks
9385d1b6d GetJavaStackTrace: Provide llvm::StringRef excludeFuncPrefix. (#3)
b90653f3e Logger: Add def_func and min_level constructors. (#2)
1243cf04e Adds new build system to repo (#1)
3cfcbe9a9 Remove Scheduler.java from the sim path. (#564)
4f5b5b137 Adds gmock files
6bc793505 Suppress MultipleTopLevelClasses warning (#581)
3b44160cf Rearrange some method calls so methods fail faster (#583)
d9586c8d3 Fixes JNI aliasing issues involving ControlWord and AllianceStation (#575)
74df3fac4 Require non null (#580)
06321b8e8 Fix encoder sourceA null check (#579)
f3efb948f Switches CANJNI to use byte[] rather then ByteBuffer, and throws exceptions for invalid platforms (#571)
432c03bf6 Updated Gradle to 4.0.1 (#573)
bfd224278 Fix Java MyRobot linting (#572)
822ea6abc Made SpeedController class organization consistent between languages (#568)
97437ee58 Miscellaneous formatting and style fixes for integration tests (#570)
aa7fe0db2 Fixes unused buffer warning on platforms other then athena (#566)
237685d4a Fixes static initialization of HAL handles (#565)
abbe63027 Gets WPILib building on windows and C++11 vs C++1y (#561)
89d3b08e7 Added TimedRobot (#520)
f826216a2 Gets JNI compiling on all platforms (#563)
aa0a874ad Add periodic method to subsystems (#528)
2da26c057 Make HAL_Initialize timeout configurable, makes result a bool, and makes Java an exception rather than assert. (#557)
d34c84490 Fixed function ordering in robot base classes (#553)
68b63632c Removed functions that have been deprecated for at least one year (#551)
d2de94778 Remove memory leak in ConditionalCommand (#537)
4fd4a50d4 Update Preferences to not use deprecated APIs (#555)
9d9382071 Replaced STL streams with LLVM's raw_ostream (#344)
c57a7f0a4 Switches all notifiers created with the external API to be threaded (#546)
1d15fcd07 Prints error when HAL_GetFPGATime call fails in fpga_clock. (#558)
e824b1129 Adds way to reset and version all HAL handles (#545)
0cd03c66e Remove deprecated Task class (#550)
462b231da Adds function to HAL to free malloc'd joystick name (#543)
e4a918850 Fixed return value of SendableChooser<T>::GetSelected() for non-pointer T's (#512)
d472af351 Removes CAN.h from the HAL (#556)
98a587a34 Removed unused includes and added missing stdint.h includes (#549)
5fd996876 Fixed a typo (#547)
f43675e2b Add functionality for getting the current network mode (#202)
417cf33f9 Expose ITable paths (#200)
b433d98c0 Replace std::stringstream with llvm::raw_svector_ostream (#345)
7006672b0 Fixes hal shim from alias to using item (#538)
efec0c5cc Moves the HAL priority_ custom types to the hal namespace (#532)
16e71eac4 Fixes assertions to not crash StringRef (#534)
067b1f3ee Adds a way to get the native handle from SafeThread (#198)
3d2f41d08 Adds a way to get the native handle from SafeThread (#198)
68b62abb5 Adds chrono wrapper around fpga time (#527)
b2f347969 Switches SPI and I2C to use enums in the HAL for ports (#531)
67d62ba16 Travis now passes the current year to wpiformat (#438)
e1fc60b8d SolenoidBase functions are now static (#530)
f32e696fe Fix exception when getting a relay in kReverse Direction. Fixes #458 (#525)
fc81298fa Switches DS to use Occur callback rather than internal netcomm semaphore (#510)
5987cfeaa Fix SPIs to not set CS DIO pins into DIO mode (#504)
cd0ece451 Removes the semaphore class (#529)
dc9f85ebb Fix comment refering to old _val enum values (#524)
35a2055cd Improve documentation for WaitCommand and TimedCommand. (#494)
a1066776a Make SmartDashboard methods static (#523)
4dae74734 Refactor RobotDrive squaring (#390)
d348a5b94 Fixes WaitForInterrupt to return values matching enum (#503)
f0c413f40 Relay stores nt value in enum (#460)
846eee2f6 HashMap -> LinkedHashMap (#492)
0b9ff68da StartLiveWindowMode ITables use lambdas (#461)
7187e005d Add Checkstyle WhitespaceAfter check (#466)
a5cd24e7e Reduce scope of for loop variables to for loop initializer (#517)
dbe821bae Change the wrapper to use the all distribution with the sources (#498)
04486c647 CameraServer: Always update addresses when updating stream values. (#496)
2ee8ba936 SafePWM: Rename Feed to feed (#463)
b07782cd8 Removes StatusIsFatal checks from PDP (#493)
305450b6e Remove 'value' from PIDSourceType (#464)
fdd0b853e Fixes Base.h to work properly with MSVC 2015 and above (#513)
49de28d3d Add overloads for property types except enum (#73)
c34cf1176 MjpegServer: style fixes for root page (#72)
42facbb07 Make Java "struct" constructors public for testing/simulating (#195)
9f97cd61b Correct platform path for 32-bit Linux (#179)
1d025204e Fixed Spelling Mistakes in SmartDashboard.java (#506)
59133a7d9 Use Javadoc formatting for Java comments. (#66)
b484cbba7 Adds SinkFrameTimeoutCpp to def file (#61)
61e34621c Add GetNextFrame timeout to CvSink and MjpegServer.
5e9575de6 Add missing CS_SetDefaultLogger in cscore-jni.def.
12f759860 Corrects assumptions about return values from i2c-lib (#484)
c02d34dbf Allow resetting the logger back to default (#55)
8f97637b7 Fix handling of HTTP cameras that do not provide a Content-Length. (#59)
878d3a6f4 Publish video modes to webserver. (#58)
ef25bbde7 Fix SetExposureAuto. (#57)
1bdbb5ddc Remove usages of isEnable() (#483)
b573fb655 Fix param order in RobotDrive docs (#481)
b50a7bdbe Fixes memory leak for SPI reads (#474)
5a5f10dfc Fixes I2C read change size of pointer (#479)
8c3efa592 Increment reference count when creating VideoSource object (#53)
e6656326a Adds field IP to round robin list (#187)
e375b4a9f CameraServer: auto-increment startAutomaticCapture(). (#468)
ff141ab1f Fixes exception on camera creation without plugged in camera (#470)
cf8cab850 Fixes missing VideoProperty constructor. (#49)
b8537be21 CameraServer: Remove NT-driven settings. (#467)
db5dfa174 Adds sliders for all settable properties to the default webpage (#48)
13457d1bf Update setUpdateRate() documentation to match implementation.
8f1b034b2 Fix typo in JavaDoc (#462)
71d0a07e0 Fixes solenoid allocation error message (#455)
d32234249 Remove comments about Blue DS (#450)
8f8c4d3d9 HttpUtil: Allow "http" scheme to be mixed case.
d47bd1ecb Fixes embedded library name used for extraction in Java (#45)
e9fcb5381 Fixes Java artifact clasifiers when using custom suffix (#44)
3e2631f49 Fixes Java artifact clasifiers when using custom suffix (#183)
bc7ab1769 CameraServer updates (#446)
3c3236c5d Fix video mode notifications.
7a049c29b Added a conditional command that chooses 1 of 2 commands (#435)
23462ec7d Adds way to force publishing version from command line (#43)
ac56b0a33 Adds way to force publishing version from command line (#182)
1fc375b31 Updates the gradle wrapper to version 3.3 (#445)
eee7f3991 Allow VisionRunner to stop (#442)
b55c604c0 Updates Gradle to 3.3, and removes the Visual Studio 2015 workaround (#41)
a72f8f3bc Add new ARM Toolchain, add toolchainpath to README (#42)
2e3503517 Add OS level serial port (#426)
27c0405fc Reruns gradle wrapper to fully generate 3.3 files (#181)
b9e80ecfd Updates to gradle 3.3, and removes Visual Studio 2015 workaround (#180)
a3adb38be Adds support for specifying output suffix of arm packages. (#34)
593ba37c4 Java VideoEvent: Make propertyHandle public.
4ed78a84e Java VideoMode: Provide PixelFormat-taking constructor.
e893662c0 Adds new functions to def file (#40)
15e58acc7 Java SendableChooser no longer sets a default on addObject (#441)
5df78c520 Adds support for building separate armhf artifacts (#177)
f13f88688 Fixes arm example builds on windows (#39)
5dd8e4dc7 Adds defs for the C windows functions, and shims the 5 missing ones (#38)
5aa5e3e09 SendableChooser generic value (#433)
883fd5b06 For property events, provide property name rather than source name.
7ddbf2010 Create VideoCamera base class and move camera settings functions to it.
23135d7a5 Allow Sink.SetSource() to be given an empty source.
b91ab0b44 Gets builds working on Windows (VS 2015) (#37)
9a2ec13ba Fixes SetIntArrayRegion template for windows builds (#178)
78995f5cc Fixes SetIntArrayRegion template for windows builds (#178)
f225c4773 Fixes gradle publish with no flags. (#35)
25ae7b2c2 Upgraded Doxygen gradle plugin to 0.3 (#440)
4b6dc9583 Corrected order of access specifiers in MockCommand class (#436)
64eab1f7b Fixes missing Extern "C" from HAL Threads (#437)
bac4b3d5c Fixed gradle publish with no flags. (#176)
182f57216 Adds project and classpath ignores (#425)
65b091a39 Call SmartDashboard::init() in RobotBase constructor. (#428)
ed1a94531 Update license headers to 2017 (#434)
e3f99a4a2 JStringRef: ensure string is null terminated so c_str() works correctly.
df7d3261c JStringRef: ensure string is null terminated so c_str() works correctly.
95ad4783f Revert "Fixes TCPAcceptor able to use an empty string (#172)"
b5b089922 Revert "Fixes TCPAcceptor able to use an empty string (#172)"
9a0a1baa6 Fixes TCPAcceptor able to use an empty string (#172)
6ad9f45d9 Fixes TCPAcceptor able to use an empty string (#172)
4e12ffb0a Update the wpilib version plugin (#423)
7ec223d44 Update WPILib Version Plugin (#33)
ed9e83722 Updates the wpilib version plugin (#171)
b9a08e826 Fixed entry comment (#169)
58931e1d3 Be even more permissive on valid JPEG formats.
976ca8005 Use InetNtop on Win32 rather than WSAAddressToString. (#170)
95e529566 Use InetNtop on Win32 rather than WSAAddressToString. (#170)
4800c201e Add Axis camera creation functions and Http camera NT publishing. (#420)
dc9a9e5d9 Fixes typo in SensorBase error message (#422)
4b16999fb Fix tests that are only built on cmake. (#168)
318d23ba1 Add AxisCamera wrapper class.
9c4c7c08b Java HttpCamera: Make accessor functions public.
9016a9e8b Start implementing HttpCamera.
4c8c41fdc CvSink: Support grayscale images.
205d3b1d0 Some cameras don't provide the JFIF header, so don't require it.
1575fff07 MjpegServer: Limit the number of simultaneous clients to 10.
8c7338f2b TCPAcceptor: Include port number in error messages. (#166)
459cc65b3 TCPAcceptor: Include port number in error messages. (#166)
6844f05c3 Adds SetAllSolenoids function to CTRE PCM code (#419)
8f67f2c24 Remove unused code and add pmd check (#395)
cc246bb9a Switches JNI to use new jni_util methods (#404)
3d2827567 UsbCamera: Simplify the message passing implementation.
bf9f0a9e6 Add vision pipeline API to make it easier to run OpenCV pipelines (#388)
6f41b3cde UsbCamera: Implement LifeCam HD-3000 exposure quirk.
9ffc09a11 Fix settings example if there's no "--" in arg list.
ced2608af Move ExtCtrlIoctl to UsbCameraProperty::DeviceQuery.
adbca532c Break up UsbCameraImpl::DeviceProcessCommands().
5e38d8f28 Refactor UsbCameraProperty.
d6ef2c04a Start refactoring source property implementations.
ce6978387 UsbCamera: Scale some properties to make them constently percentages.
c3160bad4 Update SendableChooser to use HashMap (#394)
94b8ac42c Adds CPP version of vision pipeline (#399)
a03e3d7eb Fixes HAL to build without all headers included in HAL.h (#418)
a42ec08d1 Fix RoboRIO Cross-Toolchain GCC Status (#405)
fddb6cd9d Fixes SPI Accumulator averages (#415)
10b13da3d Refactor USB vendor/product to product string to UsbUtil.h.
88afefe46 Avoid crash in SourceImpl constructor.
841f01601 Fixes SerialHelper when used with OS serial ports. (#411)
8e4afc95c Switches C++ strings to StringRef (#336)
80abf6bf2 Support per-stream resolution settings.
94359709a Add new ARM Toolchain, add toolchainpath to README (#165)
8cec94869 Fix typos (#409)
31ae7c942 Fixed signatures of deleted assignment operators (#408)
d0900626d Removed format.py shim (#393)
0ee4cadca CameraServer: Workaround LabVIEW dashboard OpenCV compatibility. (#406)
8501b7c9e CvSourceImpl::CreateProperty(): Use lock_guard instead of unique_lock.
0ce0855a6 Java: check for null and use new jni_util features.
e1dabbc2d cscore_cpp.cpp: Fix include order.
c08a489e2 Improve error message for VIDIOC_STREAMON "no space left on device".
28a2ba4bf Add external logger interface.
2b8b8e740 Improve logging consistency by using source/sink name throughout.
bdaf60b2d Replace tabs with spaces in gradle files.
7c2f994a6 Refactor source IsConnected() and connected notification.
24b5a9c38 Adds UsageReporting include when using the LabVIEW shim (#401)
bb9f5b749 jni_util: Add JException wrapper class.
c091d74de jni_util: Add JException wrapper class.
626220e9f Fix javadoc typo (#403)
19be09c36 Add null checks on all JNI object parameters.
57d053a8f jni_util: Make JStringRef and JArrayRef null-safe.
8c2a148ed jni_util: Make JStringRef and JArrayRef null-safe.
0e43765c5 jni_util: Add GetJavaStackTrace.
6fbaf57b9 jni_util: Add GetJavaStackTrace.
12aee3e02 Make JLocal and JArrayRef movable but non-copyable.
2df00647d Make JLocal and JArrayRef movable but non-copyable.
498a8e2b7 Fix JArrayRef DirectBuffer destructor.
99395273c Fix JArrayRef DirectBuffer destructor.
4568156bd Make JClass more useful and use it in ntcore JNI.
ce7611562 Make JClass more useful and use it in ntcore JNI.
323d68d46 Fixes multiple initialization of HAL_BaseInitialize (#400)
db2091dd9 Adds safe serial port write methods (#396)
8216d85e5 Adds check for PWM overallocation (#392)
a705eb1c6 Add PMD and solve issues (#389)
77f664a6b Fixes simulator HAL builds (#391)
c30057e92 Remove unused imports (#387)
81fd0eefa usbcvstream example: Print error from GrabFrame.
b5fd15e05 CvSink::GrabFrame(): Add delays like MjpegServer to avoid consuming CPU.
ecfc68417 MjpegServer: Increase bad frame wait from 10 to 20 ms.
4600ea135 Frame: Make Data struct public.
3b82ba894 Refactor JPEG functions to JpegUtil.
c32fc57ce Refactor HTTP utilities.
9a8f66e3e SourceImpl: Add no-copy PutFrame.
ef3971321 Revert "Don't output \r\n before boundary. This throws off some clients."
da68fea08 Fixes shared wpiutil switch on athena (#24)
06108b947 Update CameraServer support. (#386)
1f93a4ab4 Change acronym class names to use MixedCase (UsbCamera, MjpegServer). (#22)
7a587390b Fixes OpenCV on windows when we get to it. (#23)
16181523c Put language in version string (#377)
7e0706cf8 Updated Usage Reporting for 2017 v8 Image (#385)
bff67887f Adds capabilities to support certain HAL functionality from LabVIEW (#382)
351ff5eb4 Adds new Threads API for priority setting while using std::thread (#379)
378a145cf Fixes Missed Symbol from Def file (#162)
3625f11e0 Adds C methods that take a cv::Mat* (#21)
051df1404 Updates ni patch task to automatically switch all files to LF (#381)
ee0318f69 Updates NI Libraries to image 8 (#380)
1332ba3ad Adds JNI symbol check to ensure we don't miss any definitions (#19)
558b2ffa4 NetworkStream: Add setBlocking() and getNativeHandle(). (#161)
1315a3967 NetworkStream: Add setBlocking() and getNativeHandle(). (#161)
a6fb1efcb Switches internal joystick errors to take StringRef (#378)
31fecc28a Check for NaN motor speed. Fixes artf5467. (#376)
00b76d42e Fixed unused variable warning from gcc. (#159)
e7c4150c0 Fixed unused variable warning from gcc. (#159)
bc06c843c Adds JNI symbol check to ensure we don't miss any definitions (#160)
30b1efc35 Adds check to ensure all JNI symbols have been defined properly (#373)
7d721eb56 Fixes memory leak in SerialHelper VISA (#366)
b8e9439d3 Message: Fix typo in error message. (#158)
d48aac5be Gradle Update (#372)
14b56db99 Gradle 3.2.1 (#369)
bfe429de5 Switches handles back to std::array (#367)
57ef5cfd0 Splits out SerialHelper to allow using OS or VISA resources (#365)
4bbb7c0bc Fixed javadoc generation to actually download cscore and ntcore and include the source in its output. (#368)
4de70bff5 Adds missing JNI method definitions (#371)
687f0c7dc Use const parameters in std::sort lambda. (#364)
f3d66e92e Searches for USB serial devices to get the correct VISA object (#363)
046d385a7 Actually fix lack of - (#157)
5caf75237 Fixed version generation when no - is present (#156)
9a91ae54d Fixes incorrectly changed Java enums (#360)
69422dc06 Replaced floats with doubles (#355)
7bcd243ec Reorder the HAL handle types (#357)
8f70bea89 Fixes Athena Runtime build not including ntcore (#356)
948c4275a Fixes the wpilibj jar not getting updated during every build (#359)
03a115991 Java CameraServer: Fix type cast exception. (#358)
a19b1b934 Adds data accessor functions to JNI (#18)
1c8fb298b Ran formatter (#354)
b25a7cb37 Command::IsFinished() must be overriden by subclasses again (#353)
140c365e4 Added XboxController class (#140)
8c93ceb72 Add cscore-based CameraServer. (#352)
0b1e876dc Bump wpiutil version to 1.0.2.
ac50d7cf8 Removes NiVision from allwpilib (#305)
ae8c8ec23 Don't output \r\n before boundary. This throws off some clients.
ecb873ff4 Fixes myRobotJava zipping before Java gets built (#351)
ec8c0eb3c Fix FPS setting and crash in reapplying settings.
3d898dd8f MJPEGServer: Fix URI %xx-decoding.
df18e178e MJPEGServer: Provide a bare-bones HTML root page.
71a6e0898 MJPEGServer: Make a couple of tweaks for Axis camera compatibility.
a05636d9a Add data accessors for USBCamera and MJPEGServer.
5eecbfd9b Implement immediate notify on network interfaces event.
78baa04ec Adds OpenCV to myRobotJava (#350)
65514b302 USBCamera: Update description on reconnect.
881d55f85 VideoListener: Add move assignment operator.
b78f580d4 Adds default methods for Commands (#238) (#238)
cc20d9d0f Add no-parameter constructors for specific sources/sinks.
b115c7522 Adds SPI DIO to WPILib (#256)
6bc092f3a Updates SPI device pin (#348)
f99a266ce Adds CsCore dependency to myRobotCpp (#349)
35aa54441 VideoEvent: Make sourceHandle and sinkHandle public.
bad4ca466 Add event for network interfaces change.
5fecc57e8 Add methods to get the hostname and network interfaces.
e1f4e3d2d Fix mapping into Java enums.
5ace9e418 Renumber event kind values.
9945459a4 Notify sink enable and disable events.
22c11fad3 Notify source property events.
c6b527d45 Notify source connect, disconnect, and video mode changes.
8e9911d33 Notify on sink source change.
b24572594 Notify on source and sink create and destroy.
154ae5dcb Notifier: Take Impl rather than handle in notification functions.
bae203708 Handle: Add methods to get Data struct from Impl pointer.
c0bc8d702 Change examples to start at port 8081 rather than 8080.
736b5ff42 Java: throw VideoException on error.
29cd2b11b enum_usb example: output the property type.
dcf773c3e Add USBCamera setting functions similar to the old WPILib nivision ones.
791cabbc2 Rename Type to Kind.
3c7d8063f VideoProperty: rename type() to getType().
3381340eb Add method to get source/sink type.
6446b9ef1 Add sink source changed event.
6c19eb59b VideoSource, VideoSink: Provide equality operation.
797d049f3 Use java.util.function.Consumer for event listener.
0bcafedeb MJPEGServerImpl: Refactor NeedsDHT.
7e0e8286e SourceImpl: Refactor frame allocation into AllocFrame.
5ae116237 Move MJPEG DHT insertion from SourceImpl to MJPEGServerImpl.
c80c4ae55 MJPEGServer: Use worker thread model.
254b88bdb Start adding support for non-MJPEG frame types.
2657d8917 Adds a c_str method to StringRef (#155)
38ec59f03 Adds a c_str method to StringRef (#155)
1f724d58e Made the test scripts executable to fix -dirty on the version numbers. (#347)
259cf1ff3 Mark NetworkTablesJNI callback interfaces as FunctionalInterface. (#154)
de4a246bb Adds OpenCV Loading to wpilib program startup (#338)
b12658afc Make SafeThreadOwner moveable. (#153)
c23880f82 Make SafeThreadOwner moveable. (#153)
41dd9e4f0 Loads OpenCV JNI Library in Java (#15)
412b80da3 Fixes joystick button handling HAL JNI layer (buttons are in an (#341)
47319960a Fixes a missed change to unique_ptr in the HAL (#337)
b22d21823 Removes CANJaguar specific constants from JNI files (#339)
3d1f69075 Adds a size parameter to JStringRef (#152)
dc94a3fac Adds a size parameter to JStringRef (#152)
6eb82bc31 Exclude genlinks.bat from HAL zip (#333)
a06dd25d5 Adds cscore and opencv to wpilib (#332)
468cac543 Fixes JNI
d4b48216e Renames uberzip to athena-uberzip, and doesn't include static library in it
e1bb05bc5 Updates to the 2017 v7 image (#329)
f83ff41e4 Rename from cameraserver to cscore.
891ce0631 Adds opencv headers to uberzip (#11)
0658ba6f7 Adds javadocs and sources to published windows builds (#10)
29d8d1d74 Implement listener interfaces.
8d2efb283 Improve listener interface.
e07a40a16 Adds an UberZip that preincludes the opencv libraries
38a3eda6a Switches CameraServer on Arm to use non-included native library
6d1ab7606 Enables temporary publishing on windows
8694a020a Removed entries from .styleguide that are included in .gitignore (#331)
1efb2e4d3 Deprecates Task and Semaphore, and changes other deprecations to use wpiutil version (#330)
77edf1e10 Add FRC Driver Station connection support.
28c8678ea SafeThread: Use atomic for m_active.
34acd9d47 SafeThread: Use atomic for m_active.
861726cef Adds gradle task to fix NI libraries whenever new ones are added. (#325)
81212d80c Fixes ultrasonic declaration (#328)
2235a809c Fixes a missed change from the ni-libraries location change (#326)
3fe0f49ac Moves NI headers to their own folder in the repo (#324)
03d8f9193 Moves using namespace from ChipObject.h into hal namespace (#323)
05ca76ea9 Runs clang-format on ntcore (#150)
d1065f0bd Moves deprecation definition to wpiutil (#149)
cf0ec7b9a Moves deprecation definition to wpiutil (#149)
5e54969f6 Adds Task back into WPILibC (#320)
46085824a Add DHT data to MJPEG source images if not present.
18ef5eb1b C++ and Java tests for the new build system (#309)
b5e3d92e9 Remove errant "using namespace" in global namespace (#318)
ba8761e39 "using" directives are no longer used in global namespaces (#219)
78f0b1562 Removes Task.h from wpilib.h header (#317)
5c28b3002 Removes NetworkTables from Java executable jar (#303)
59267da72 Namespace all wpilibc functions/classes into "frc" namespace. (#311)
36ad45c07 Delete .gitreview (#316)
ecb2add79 Removes additional references to CANTalon from the library. (#312)
9bbdaf300 Removes the task class from wpilib (#314)
bc492bb40 Removes the REAL definition from wpilib.h (#315)
7067179b2 Ignores the vscode directory. (#6)
81221c487 Moves JNI internal utility methods to frc namespace (#310)
4828a6986 Update versioning plugin.
3fcc808e9 Use zlib built into OpenCV.
15cdd661a Simplify OpenCV dependencies.
137b3d81f Fixes JNI file not being copied to output directory for integration tests (#308)
6741f47ef Update version plugin (#307)
60d9f3de6 Update version plugin (#148)
f87baaa4f Moves dependencies to their own gradle file, and adds capabilities to link to ntcore and wpilib (#4)
fecd8a448 Fix wpiutil version (#147)
fe4ef75cf Updated wpiutil version
87c7a9db5 Add USB and OpenCV processed dual stream example.
fa2ce4008 Add OpenCV library links to example executables.
4eac3fe9a Disable x86 platform for now until we get OpenCV working with it.
d7efd6251 build.gradle: Fix OpenCV library order.
e10b399f5 CvSource: Implement NotifyError.
39a819538 CvSourceImpl: Add stub for CreateProperty(callback).
e75e9092a Fixes athena runtime zip not being built at the correct times (#306)
247cef5ec Removes CANJaguar from wpilib (#300)
43331419f MJPEGServer: Output boundary at start of image instead of end.
c66a55d81 Implement CvSink.
9a44a3814 Fix source and sink refcounting.
5f69cb2a5 SinkImpl: Refactor GetDescription, add GetError, SetEnabled.
a5f63c3ae SourceImpl::GetNextFrame(): Avoid spurious wakeups.
005396218 SourceImpl: add PutError().
c462d0b24 CvSourceImpl.h: Remove unnecessary include.
29f999e2b Adds new handle structure and type for vendors (#297)
778edaeb2 Reverse the JNI load order to look for system library first. (#145)
273a395a2 Client: when reconnecting, default to NT3. (#143)
5e3755493 Linking and maven publish location rewrite (#298)
aa49ebd47 Links wpiutil on roboRIO dynamically (#141)
c45384b91 Removes the native library from the RoboRIO Jar (#139)
70343c0b3 Fixes missing function for Timer::GetMatchTime() (#299)
88fdbc6d3 Readds wpiutilZip dependency to the build. (#144)
7ca6c5ef3 Remove RemoveSourceProperty.
60e199b0b Fixes format.py on windows (#293)
1071686d8 Replaces C++ IsNewControlData semaphore with atomic bool, and Java code with AtomicBool (#187)
511d55154 Implement most CvSource functionality.
fdebdd520 Added format.py to Travis config (#236)
7ea13f7e0 Refactor properties from USBCameraImpl to SourceImpl.
5ca5583fc Removed unnecessary set of parentheses and ran formatter (#290)
75463a249 Implements threaded notifiers and interrupts in the HAL (#281)
7280d241f Fixes DIO not erroring with too high of DIO number (#288)
963391cf3 Cleanup SolenoidBase, Solenoid, and DoubleSolenoid (#271)
4f4c52d6d Switches JNI to use SafeThread from WPIUtil (#282)
499da6d08 Updated the wpilib version plugin to 1.2. Fixes issues with submodules. (#289)
6754703ad Updated the wpilib version plugin to 1.2.
89b8e5435 Updated the wpilib version plugin to 1.2. Fixes issues with submodules. (#138)
b0ab351f7 Don't check for existence in distributing .debug files. (#137)
39e4d11f8 Remove .pullapprove.yml (#287)
9b6f4ecd0 Don't check for existence in distributing .debug files.
df4a2c07f Checks for system initialization in functions that can be called before creating handle based objects (#285)
c46c49037 Adds wpiUtil to HAL and JNI (#280)
9142cbb82 CvSource: Update interface functions.
1f6b38632 Implement frame timestamps and use wpi::Now() for generation.
f2751db5c Adds NI Libraries symbolic link (#286)
aad1266a9 Distribute shared library .debug files.
06a40680a Change debug strip to be part of link task (as doLast).
cc2cbf810 Exclude opencv MANIFEST.MF files to prevent repeat unzips.
cf9aa9032 Don't overwrite platform-dependent opencv zip files.
d51f6c45e JNI: initialize status to 0.
017ec83ce Add support for OpenCV to Java wrappers.
6641612de Update to use wpi version plugin.
218718a06 Add OpenCV dependency and update OpenCV interfaces.
353041535 Distribute shared library .debug files. (#136)
e4234f519 raw_istream: Add std::istream style in_avail(). (#135)
d81840d6c raw_istream: Add std::istream style in_avail(). (#135)
1d336996b Dispatcher: Minimize amount of time m_flush_mutex is held. (#132)
86c43df8d Fix connection notification races. (#130)
5c1b7ecd1 Change debug strip to be part of link task (as doLast). (#134)
011ac1fa2 Java: Allow any Number type (not just Double) to be passed to putValue(). (#129)
2bff276ad Fixes a missed formatting issue (#283)
e5e1a1a4d Moved version generation to the WPILib versioning plugin. (#277)
b8e5258cf Creates the build dir if it doesn't exist, and deletes the version files during clean' (#131)
56179088b Updated the gradle build to get the version from the WPILibVersioning plugin (#123)
780e9580b Ignores KeepAlive messages during initial handshakes (#128)
0613f1d18 Cleanup encoder class (#272)
8b94e0933 Update README (#261)
23ef57561 Cleanup PowerDistributionPanel (#275)
33b95816e Cleanup SensorBase class (#273)
4c1e4fd80 Updates image to v6 (#278)
b775b01e0 Optimizes NetworkTables string concatenation (#125)
0a8e0e974 MJPEGServer: Pass resolution and FPS requests to source.
89805a44c Fix NetworkTable::setFlag typo (#124)
9caa0af4d USBCamera, HTTPCamera: Name functions consistent with classes.
70531762b usbstream: Wait for enter rather than infinite loop/sleep.
30f4ecd17 Rename HTTPSink to MJPEGServer.
d56c3f9ad USBCamera: Default to MJPEG and lowest resolution.
73a97c177 USBCamera: Finish implementing mode support.
3784b665d Updated version for beta 1 (#270)
567ea1d58 Remove CAN TalonSRX from WPILib (moving to external library) (#268)
55346e28d DoubleSolenoid free reverse port handle instead of channel (#274)
8ec2b1d96 README: Fix artifact names.
c858e0391 README: Remove reference to cmake.
63c9af457 Add license.
473a87a76 USBCameraImpl.cpp: Clean up formatting a bit.
4c6f6536b tests.gradle: Link to wpiutil.
cb4d8a655 Add examples.
417545d52 Finish most of USBCameraImpl.
7f88bd15d SinkImpl: Keep enabled count rather than just boolean.
49b8c4ba7 Fixes the gradle dependencies for building (#269)
f1c2b6656 Reverts the 2017 Image for Beta 1 (#264)
27bf94fd0 Remove kDefaultPeriod from IterativeRobot (#232)
4896a77c8 Fixes guarantees for waitForData (#252)
d1d3f049f Solve scp file not found (#263)
7b3f6eeae Add raw_fd_istream. (#121)
f6df7cad9 Add raw_fd_istream. (#121)
15cb50516 TCPStream: Avoid SIGPIPE signals.
cc1b94afd TCPStream: Avoid SIGPIPE signals.
c313dde03 Updated the rpath to point to the correct location for the Java integration tests. (#262)
8d1c51b7e Update image 2017 v5 (#254)
a59e00e90 Adds a test to make sure WaitForData is properly waiting (#258)
7070162b9 Fixed lint errors (#259)
9859c14ca Fixes status parameter in wrong location for initialization range functions (#260)
a7eca7d4b Adds ConnectionInfo to Rpc callback (#116)
64ebe7f5e Updates SmartDashboard with new NetworkTables3 functions (#162)
8b2345a70 Removes an unnecessary function from HAL Power (#237)
e65f9908d Makes IterativeRobot not double check for new control data (#253)
fd52912d7 Fixed return value propagation of format.py (#251)
9e7993905 Remove slack integration (#257)
9047c98e6 Fixes possible indefinite timeout on multiple RPC calls (#120)
a65620722 Forces exceptions to throw on HAL handle creation functions (#209)
53d078966 Storage: Escape equal sign in strings. (#119)
ee24a6f4f Disable support for non-MJPEG formats.
70616c48e Add support for enumerating and changing USB camera video mode.
81e63ea3a Fix simulation build with latest ntcore/wpiutil. (#250)
d4bbd5cc6 Make raw_socket_istream constructor explicit.
1affae956 Make raw_socket_istream constructor explicit.
7463e0208 Logger: Use raw_ostream and SmallString.
d3ed26f7c Logger: Use raw_ostream and SmallString.
f711ced4c Add raw_socket_ostream.
1ec89fc4f Add raw_socket_ostream.
a92b7298f Add 1-character read to raw_istream.
de07b01a7 Add 1-character read to raw_istream.
4c6c096c5 Change API of raw_istream to be more similar to raw_ostream.
c2ae897b0 Change API of raw_istream to be more similar to raw_ostream.
b2e129197 Refactor JNI helpers into wpiutil (support/jni_util.h). (#105)
94c2b6579 Refactor JNI helpers into wpiutil (support/jni_util.h). (#105)
760d6a26d Make SafeThread header-only. (#117)
3a419768c Make SafeThread header-only. (#117)
d8ee44349 Update to latest LLVM code (#88)
ee4244850 Update to latest LLVM code (#88)
d90cf843e Move common utility classes to wpiutil library. (#79)
f6b700ea9 Move common utility classes to wpiutil library. (#79)
5dfae8d6b Fixed include order (#245)
107a4cc1e Add wpiutil dependency. (#190)
35d51d68f Made a comment use more professional language (#249)
049fec470 Fixed compilation with GCC 6 (#248)
659dbef75 Ran format.py after writing unit tests for and fixing bugs in it (#239)
a5fe605aa HTTPSink: Add basic property setting support.
7818c3bda USBCamera: Normalize property names.
d5e5755ff Collapse boolean/double/enum properties into just integer.
8fbc23b1f HTTPSinkImpl fixes.
ac9b6f7b1 Implemented CircularBuffer resizing (#224)
425ed464e Removed leading underscores from variable names (#246)
2c15bb247 Remove delay from periodic methods. (#243)
28e178b1a Update Compressor documentation (#244)
d05f0820b HTTPSinkImpl: Report property step and default.
dad44cc92 Add status parameter to property functions.
2c80587d1 Start implementing USBCamera.
80eb05643 Fix property handles (and allocate more bits to the property index).
80e546b79 Adds a way to externally test C structures (#115)
6eba04ed8 Use copy-and-swap idiom for reference-counted classes.
c606671d2 Consistently name property max/min functions and add step/default.
9bb37d5df Remove support for multiple channels.
5d2a08443 Fix Typos. Fixes artf4853 (#242)
e952236e1 Reverts the last 2 Rpc changes (#114)
9a3100b22 Fully asigns the ConnectionInfo struct (#113)
7e9754acf Passes the ConnectionInfo of the Rpc client on server callback (#112)
087eeec76 C standard library functions and types are now prefixed with std:: (#227)
dbe03afb9 Fixes error in driver station control word cache (#222)
2ecb939b3 Add a method to detect the HAL runtime version (#228)
1416fb8f6 Update Periodic JavaDoc (#231)
aeb6c4889 Added license template file (#225)
c2fc6711d Switches enums to use a fixed size for their base (#230)
f271185cb Adds a RobotPeriodic method to IterativeRobot (#226)
b78592d62 Log.h: Remove unnecessary includes.
052f746c6 Use StringRef and ArrayRef return values when buf passed.
c4ceec145 Enable unit tests.
775386d8b HTTPSinkImpl: Implement GetDescription.
451c08ef7 Add wpiutil library dependency to builds.
52c8743b3 Finish rename of EnumerateSinks to EnumerateSinkHandles.
5c59b9aeb Make HTTPCamera constructor public.
3e00dabd1 Import gmock.
4fc7daedc Fixes incorrect deadband value being passed over PWM (#223)
c5c069743 Switches AppVeyor to use same build for 32 and 64 bit java tests (#107)
ba241cd7f Source: Keep track of how many sinks are connected and enabled.
ddb97bfaf Fix SendStream error handling.
e415ca66b Initial HTTPSink implementation. Untested.
85be299da Start implementation.
9dd5bea7a Create a common CS_Handle. Add initial status values.
e71abedef Add logging implementation.
3888d7726 Adds connection listeners that can be called statically (#111)
6bfc00867 Replaced snake case variable names with mixed case (#221)
2c94d0ba2 Cleaned up integer type usage in the HAL (#192)
0cd05d1a4 Cleaned up integer type usage in wpilibc (#92)
ff93050b3 Remove static_assert for sizeof(uint32_t) <= sizeof(void*) (#220)
05626cfaf Fixed cpplint.py warnings (#215)
59ec54887 Switches notifier to use a typedef for the callback, and prepends HAL_ to InterruptHandlerFunction (#216)
028efff50 Ran format.py (#217)
fc48944b4 Fixes Rpc Cancel. Check was only in timeout case instead of global (#110)
2499771cf Added extensions to .styleguide (#214)
c989ae808 Updated gradle to 3.0 (#208)
2150f5879 Adds AppVeyor support for VS 2013 and 2015 (#106)
85156d15c Fixes the final issue with VS 2013 builds (#109)
6943d14f9 Java: Use wpiutil jni-util.h helpers.
ade4e87d6 Fixes support for MSVC 2013 (#104)
8007a7b15 Correctly handle UTF8 Java translation for StringArray. (#103)
e8643600f Implement all current JNI native functions.
cb7f1f6e3 Initial .def file real content.
af7132be8 Initial CameraServerJNI.cpp commit.
ec080118f Clean up odd special case of GetSourceProperty().
6bcc0e2d8 Correctly prefix CS_EnumerateSourceProperties.
2fd81a7e3 Add copyright notices to Java files.
2f99f81aa Java: Add VideoProperty implementation.
97f1f1c9c CameraServerJNI: Fix case of a few functions.
0fbb2e8a1 Add methods to get property name and enumerate properties.
0158fd35f Continue implementing C wrappers.
80b15b7fe Add a bit of description about how handles work in the C API.
2acca6eeb cameraserver_cpp.h: Move stdint.h above the C++ includes.
151c89fb5 Rename FrameGrab to GrabFrame.
4f22ac410 Move all non-trivial inline functions to cameraserver_oo.inl.
7c1da2dfc Split classes in cameraserver_cpp.h out to cameraserver_oo.h.
b5d32ec84 VideoSource, VideoSink: Move the status flag too.
aec16a934 Revamp API again and start implementing C and Java wrapper shells.
93b486b6b Replaced C-style casts found by GCC in HAL, wpilibc, and JNI (#211)
075155b43 More gradle 3.0 additions (#102)
c25c62e0a Update gradle to 3.0.
2ec6132fc Switches compiler from -O0 to -Og (#197)
8aba2b285 Adds .vscode to styleguide ignore files (#210)
32c95fa0d Moved style guide documents and scripts to wpilibsuite/styleguide (#207)
e653a228f Updates gradle to 3.0. Now that the check bug is fixed, removes the empty check tasks. (#101)
b2831347b Revamp API.
7845caa10 Fixes GetRpcResult not removing calluid from call list on non blocking call (#100)
66d214c8a Finishes blocking call canceling (#99)
277cf2a08 Removes new line from mdns name (#98)
7bf44e951 Fixes server side polled rpcs (#96)
c0ce4270f Adds a way to cancel a blocking rpc call (#94)
d6e8de21e Fixes rpc timeouts and blocking call list error (#95)
1635cba82 Reduced minimum update rate from 100 ms to 10 ms. (#89)
a78647062 Only allows 1 blocking call per Rpc Call Id (#93)
4164e670d Adds Visual Studio Code files to gitignore (#92)
062470ef6 Add llvm::SmallSet. (#90)
0b80bd2b0 Adds timeout capabilities to blocking Rpc Calls (#86)
40365faed Adds a static mutex to notifiers to stop destructor race condition (#204)
e1515299c Initial commit.
776cb915b Revert "PIDController queue now stores inputs instead of errors (#138)" (#205)
5e9fe2f5c Adds an ignore for Visual Studio Code files (#203)
7501ae65a PIDController queue now stores inputs instead of errors (#138)
63469c00c run-tests-on-robot.sh: Save coredump on crash. (#201)
3df257cdb Set duplicate strategy for all jars and zips to prevent duplicates from occurring (#191)
45b8e9ab4 Renamed "pin" to "channel" and variables with underscores now use mixed case (#194)
227fdc1a6 Updated C++ style guide (#196)
d347cebf6 Cleaned up odd formatting from static_cast by using "u" integer literal (#200)
3819cd076 Updated cpplint.py and fixed its regexes for C-style casts (#193)
e8f1fdda4 format.py now emits warnings for modified generated files (#195)
fd4719cb8 Fixed Doxygen comments for LinearDigitalFilter (#198)
bc99d341f Changes remote_name to remote_ip (#87)
6ef4745d8 Added Joystick::GetAxisType() (#98)
0f9f7309e Sets the duplicate strategy to exclude in all zip tasks (#85)
e6244289f Create dummy wpiutil library. (#84)
30fbfe46e Create dummy wpiutil library. (#84)
a73166a66 Make many more utility classes/headers public. (#76)
62a980d3c Fixes Relay Constant Test (#189)
866046edd Some general cleanups in the HAL (#188)
8ac7e44f1 Updates gradle to 2.14.1 (#186)
d66f65e37 Updates gradle to 2.14.1 (#83)
a831978cc Uses the fixed SensorBase functionality in the WPILib (#185)
8da577b56 Moves FRCDriverStation to athena folder (#184)
512ecf649 Makes SensorBase checks use HAL check methods (#182)
0901ae080 Switches the HAL structs to use unique_ptr (#183)
1ca291f20 Fixes a missed HAL_Bool change from int32 (#181)
75eabfee1 Moves DriverStation HAL code to its own header and definition (#179)
f7c3f13a7 Improve CircularBuffer documentation (#180)
57efd13f7 Replaced PIDController::Initialize() with delegating constructors (#178)
7ddc15362 Fixes analog gyro casting to float then returning double (#177)
f9ebd3bde Fixed PIDController::GetError() for continuous inputs (#169)
2c911b0f7 Adds a maximum time based cache to HALControlWord data (#158)
1bf2d58db Reordered DriverStation functions in wpilibc and wpilibj to match wpilibc header (#166)
c93b5bedf Miscellaneous cleanups for wpilibc PID controller (#175)
dffaa0abb Moves HAL cpp headers from root to HAL directory (#174)
20c6525b1 Cleaned up wpilibj enums (#167)
fe7165a8f Removed double-add of shared classpath. Fixes #157. (#164)
d2aa168f6 Implements Better Error Messages from the HAL (#172)
05c00430b Fixes CPP lint errors added to HAL. (#173)
530508716 Fixes a missed float to double change in the HAL. (#176)
b979fc2a6 Adds SetDefault Java definitions to Def file (#82)
58092c519 Adds SetDefault methods to NetworkTables (#54)
6615a34e9 Added contributing and license files (#63)
50a261283 Notifier: maintain freelist to reuse uids. (#81)
6251697f6 Added Lint task and parallelized format.py (#161)
ea1a1e6bc Makes the CANJaguar error status messages more useful (#165)
edf5ecd4a Changes HAL Headers to be C compliant. (#171)
1b1ee7f9f Renamed spiGetSemaphore() to spiGetMutex() (#170)
3fade171f Fixed inconsistencies in documentation (#168)
c99e89dfc Fixed the remaining cpplint.py warnings (#160)
b51e85ae2 Switches HAL to fixed length signed integers, and adds our own HAL_Bool Type (#155)
4a98e6881 Moves the DS new data wait calls down to the HAL. (#156)
0cb288ffb Fixes warnings thrown by cpplint.py (#154)
e44a6e227 Refactored wpilibj HAL JNI to simplify generating it from HAL headers (#109)
aafca4ed7 Reduced duplication between formatting scripts with Task base class (#80)
ea6876e81 Some general HAL cleanups (#153)
aa9c2b2c9 Made Log.h use std::chrono (#136)
43a2eccdc Finishes Prefix Renames (#152)
b637b9ee4 Prepends all HAL functions with HAL_ (#146)
5ad28d58e Switches PWMs to do scaling at the HAL level. (#143)
be2647d44 Switches Java to use HAL Constants (#145)
4a3e3a632 Changes DigitalSource API for HAL ease of use (#144)
7597e3c27 Switches handle resources to dynamic arrays (#142)
0a983eeeb Moves Gyros to the HAL (#131)
b036bf2e3 Add method to get the port number of a Joystick (#137)
73602e6cb Added missing include for robot startup macro (#135)
72455280a Removes unneeded resource includes from WPILibC files (#134)
ea95bb85a Adds Constants from new constants class to encoders (#133)
fb865d3ee Adds a special exception and status message for a handle error (#127)
36ac37db8 Moves Encoders to Handles and Moves WPILib Encoders to HAL (#124)
b45e0917a Adds port constants to the HAL (#130)
0e127679c Removes some unused variables from DigitalInternal (#128)
2f36d508c Gradle 2.14 (#118)
cf29d4560 Moves HAL PCM objects to header and HAL namespace (#129)
8c4ad6242 Switches Solenoids to Handles (#126)
62c217cd0 Switches compressor to handles (#125)
0f105a26f Switches Counters to Handles (#123)
eb4350033 Update Travis OS X build to use newest image. (#75)
47694ef81 Switches DigitalPWM to Handles (#121)
f77a976fb Switches resource errors to AllocationExceptions in JNI (#122)
3593ecb17 Switches PWM and DIO to Handles (#120)
384ad57d2 Updates Gradle to 2.14 (#78)
9b2af0d09 Switches relays to handles (#119)
e8e052712 Switches AnalogInputs and AnalogTriggers to Handles (#117)
77a1af44c Removes freePort from the HAL (#116)
5e2a76147 Moves handle definitions to main handle header (#115)
e1d4845cc Move Analog Outputs to Handles (#112)
95d40ed01 Fixed issue with digital outputs used as pwm on mxp (#14)
aa22d4c33 Clarified that PID controller runs in discrete time (#107)
046e043c4 Moves Interrupts over to Handles instead of pointers (#99)
74fc10999 Fixes preferences formatting (#108)
cee9b2609 Added std:: prefix to more C standard library uses (#106)
daa0260a4 Deduplicated UsageReporting definitions (#104)
d66c61a36 Cleaned up robot startup and cleanup/shutdown code (#77)
ecc210f99 Rename Notifier::m_handlerMutex to Notifier::m_notifyMutex (#105)
3cacc2aba Switches indexed handles to shared_ptr (#101)
085c47b67 Unbreak wpilibc WritePreferencesToFile test. (#103)
4b516de18 Don't delete persistent entries in DeleteAllEntries. (#71)
c7d9ecbab Fix mac build by not defining false and true. (#73)
039515082 Fixes formatting in error.cpp (#102)
c3908660b Switches all HAL Handle errors to be zero (#100)
b2795af2b Added note that multilib GCC is required when building the native version on 64 bit Linux (#66)
6c6c087e3 Fixes .gitignore ignoring needed files (#68)
3c77faaf6 Fix UTF8 conversion in Java. (#70)
fc515f457 Changes HAL Port from a pointer to a handle (#93)
5a82f73d9 Replaced .h C headers with c-prefixed version and added std:: prefix to C standard library usage (#90)
776a991d6 Moves Notifier over to handles (#97)
8527f2c2a Fixes HandleResource classes (#95)
c85b72b95 Fixes a few bugs in the initial handle implementation (#94)
f0d9e19b5 ErrorBase: change to ostringstream. (#66)
c7c011813 Made include ordering/organization more explicit in style guide (#86)
d76f0d402 Adds support for Handles to the HAL (#91)
de7678f2f remove author requirement for now (#84)
2f7eff709 Removed @author from comments (#88)
7a402b417 Replaced "RoboRIO" with "roboRIO" in comments (#87)
10b4814e6 VisionAPI.cpp: Remove non-UTF8 characters. (#85)
613309c0a Replaced wpilibj class Init() methods with delegating constructors (#79)
c622c03ef Places while loop around DS wait condition. (#83)
ed7d2d6aa Splits the HAL Analog Implementation Files (#82)
51ff9e9f6 Classes which use I2C or SPI now do so via composition rather than inheritance (#72)
9f2f301fa Deduplicated FRC network communication headers (#71)
fa8bb3fa9 Remove obsolete timer functions and replace with std::chrono (#64)
4af0bbdde Add Travis Badge to ReadMe (#81)
4aca3c202 Removed extraneous curly braces around std::lock_guards in PIDController class (#78)
753ab85ef Removed commented out includes and imports (#76)
da6b8c7ae Split HAL Digital Implementation files (#59)
305ab08f1 Renamed DriverStation::IsSysBrownedOut() to DriverStation::IsBrownedOut() to match the Java version. This changes the external API. (#67)
e9718fc7b Replaced NULL with nullptr in C++ source files (#70)
8566878af Fixed C++ simulation build with Boost 1.60 (#49)
62812faf6 Clean up include guards and EOF newlines (#65)
d82635bbe Reordered headers according to the style guide (#58)
a598e2d09 format.py: add missing 'sys' import (#69)
b5b2f0c7d Fixed typo in LinearDigitalFilter documentation (#62)
e6f6d2478 Removed empty default constructors and destructors from Gazebo plugins (#63)
21b2aabf1 Removed unused DS_LOG() macro (#61)
74f9da9da artf2612: Added Python script for updating license in source files (#57)
e63830ed2 format.py: Fix running from styleguide directory on Windows. (#55)
eb51de65e format.py: Error out if no files found to format. (#56)
565a125da Reformat for recent commits (#54)
3af8e7e9f ControllerPower.cpp: Use quoted include instead of bracket for HAL. (#53)
e3eae023d Cleanup of gazebo plugins (#46)
6d9b3b0aa Splits HAL Digital and Analog Headers into multiple headers (#52)
9e99df1cf Removed sync group from SpeedController interface (#51)
e842ff7ad Explicitly stop the PIDController Notifier in the destructor (#48)
21b1e39b2 HAL Notifier: Use freelist to avoid use-after-free race. (#50)
8fc55c80a Renames all our .hpp HAL files to .h (#44)
248ca0c4a Added verbose flag to format.py (#47)
0d655d7ce Ran formatter again (#45)
e71f454b9 Renamed folders for consistency, using sim/athena/shared schema (#27)
54092378e Changes HAL to return -1 to 1 for joysticks (#35)
a4f0c4fbe Implements locking in C++ DriverStation, and adds double buffering to DS Thread (#25)
0965d60a7 Fixed a bug where using the two parameter constructor for CANTalon could cause invert-direction to not be initialized. (#26)
f2d601d83 Use interrupt() in our interrupt exceptions (#24)
e14e45da7 Add format script which invokes clang-format on the C++ source code (#41)
68690643d Fix travis configuration to include compiling sim (#28)
00b290210 Converts non hardware dependent tests to unit tests (#10)
975568c77 Adds Error Prone as compile time check to java projects (#13)
a834fff7b Applies Google Styleguide to Java parts of the library (#23)
64ab6e51f Create .pullapprove.yml (#42)
05a208981 Fixed PCM tests by raising tolerance slightly (#15)
6272244a7 Adds error-prone to check java code
a53251805 Adds all relevent tools to gitignore
320db8df1 Add .clang-format.
b827f484b Add Slack Notification from Travis (#11)
000a98f19 Fix apt-get update -q causing build to fail (#20)
bb64dd354 Updated README, and added in CONTRIBUTING. This adds tables of contents, as well as fixing a few other issues.
d1fb8cc20 Merge pull request #60 from wpilibsuite/build/appveyor
7d33059c2 Add appveyor badge to readme
d0c40b5ce Fixes indentation in .travis.yml
6794ff9ce Add Travis Build Configuration
ed0f197d1 Adds appveyor build config
25ad7a623 Merge pull request #59 from wpilibsuite/build/osxTravisBuild
5fb31baea Adds OSX Build to travis
ffb384ebf Add Travis Badge to ReadMe
95098c549 Add required apt packages to travis
386266842 Add Travis config file
083362bd8 Removed {@inheritDoc} from C++ sources and readded .inc files to Doxygen extension mapping
0f228e7b7 Implements a common PWMSpeedController base class
686f5d9fe Fix incorrect comments in the HAL I2C functions and incorrect return values for some I2C class member functions.
ad8763fc8 Removed unused pcre.h header. If regexes are needed in the future, use C++11's regex header.
1011b56b4 Fixes notifier restart error when last notifier is deleted
5904314a7 Improve ADXRS450 error detection.
e85254734 Makes Java Timer timing more accurate
fa8b68419 Make Java AnalogGyro.getAngle() thread-safe.
ec13d00b1 Fixed gradle build issue where files were not getting added to the wpilib java jar correctly.
36447d86d Merge "Clear error buffer total when clearing the buffer contents"
5ac68f74d Support client round robin to multiple server addresses.
b8ad1de33 Make members of ConnectionInfo and EntryInfo public.
1e14403b3 Update POV documentation with examples of POV angles
bee507eda Clear error buffer total when clearing the buffer contents
16343bbe7 Updated release to version 5.
623a5fcf8 Fix C++ CameraServer request handling.
6bd1654b8 Updated release number for the new release
952ebb11a This adds StopMotor() to the SpeedController interface for C++ and Java. For Java, this is as simple as just adding it, as all motors already have an implementation from MotorSafety that is correctly resolved. For C++, I had to override StopMotor in the classes that descend from SafePWM and explicitly call the SafePWM version. RobotDrive now calls StopMotor on each of its SpeedControllers, instead of calling Disable or setting the motor to 0.0 as it was doing previously.
91c5db06d Merge "More updates to the Gyro test fixing potential null pointer exception"
df33a7822 Added Config routine to allow enabling/disabling of limit switch and soft limits. This improves upon the ConfigLimitMode routine, which does not allow certain combinations of enable/disabled limit features. Also keeps parity with LV and Java.
a33076ab9 Merge "Add an additional member variable for "stopped" which indicates the CAN motor controller has been explicitly stopped, but not disabled by the user (main use case is MotorSafety tripping). When Set() is called the next time the controller will be re-enabled automatically."
f80312b86 Merge pull request #52 from robotdotnet/master
836dc7a88 Fixes Connection Listeners
d567bd0bc Add an additional member variable for "stopped" which indicates the CAN motor controller has been explicitly stopped, but not disabled by the user (main use case is MotorSafety tripping). When Set() is called the next time the controller will be re-enabled automatically.
f436b33d7 More updates to the Gyro test fixing potential null pointer exception
728329388 Merge pull request #51 from robotdotnet/RemoteChanges
3c3b2c75c Rate-limit duplicate error messages to avoid flooding console.
710bd586d Adds extended Remote Connection Listener
f17d27aac Merge "artf4818: Fix CAN Talon JNI references with underscores."
94629bcb7 Merge "Updated PDP port of Talon and disabled PDP tests for Victor and Jaguar since the Victor and Jaguar don't draw enough current for the PDP to read above 0. PDP tests for both java and cpp only test the Talon now."
4a6f55b61 Fixed the gyro deviation over time test
fdfedd12f artf4818: Fix CAN Talon JNI references with underscores.
ae1171d1b Merge "Fixed the motor tests by reducing speed to within the limits of the encoders we use. Also fixed java pid tolerances since getAvgError() was broken. It is now fixed and works properly. Added tests for both java and cpp that test if pid tolerances are working using fake input output pairs."
6b356020f Updated PDP port of Talon and disabled PDP tests for Victor and Jaguar since the Victor and Jaguar don't draw enough current for the PDP to read above 0. PDP tests for both java and cpp only test the Talon now.
7041cbc5e Fixed the motor tests by reducing speed to within the limits of the encoders we use. Also fixed java pid tolerances since getAvgError() was broken. It is now fixed and works properly. Added tests for both java and cpp that test if pid tolerances are working using fake input output pairs.
f24c8b1b8 Fixed robot drive for C++ Simulation
d62256156 Merge "Update version number for Release 3 Print distinctive message on robot program startup Change-Id: Ic91b81bd298ee6730503933cf0e733702e4b4405"
61dbd4366 Update version number for Release 3 Print distinctive message on robot program startup Change-Id: Ic91b81bd298ee6730503933cf0e733702e4b4405
f913b5de8 Merge "Removed publishing of java sim jar"
bd3e068f3 PDP Classes should support any PDP address
cb4cc6322 Merge "Added -pthread"
838d8abf6 Added -pthread
94bd629b8 Merge pull request #48 from ThadHouse/master
c6ff69079 Merge "Remove maven local as a possible search location"
5d3ac3ea7 Another improvement to HAL-joy getting to ensure it works in future RIO image updates.
f9e87f0cc Removed publishing of java sim jar
73d6e98bf Loads ntcore from path if extracted load fails
880156832 DriverStation::GetJoystickName(): Make work for stick>0.
75a91e24e Remove maven local as a possible search location
6adf4c48c Merge "Fix HALGetJoystickDescriptor()."
026c427a2 Merge "Fixed Simulation C++ API"
63878d8ab Fixed Simulation C++ API
83f902f2f Fix HALGetJoystickDescriptor().
c90a8c586 getTable(): Don't prepend slash if key already starts with it.
f79ed1ab4 Artf4800: Fixes HALGetJoystick*** Segfault
bf89762e8 Merge "fix sim_ds launch script"
bd1e09162 Merge "Added build dir specification for sim javadoc to not overwrite athena javadoc"
2662a7ab0 Initialized the m_sensors variable to fix artf4798.
713d54fd2 Added build dir specification for sim javadoc to not overwrite athena javadoc
75a07fc3e fix sim_ds launch script
6b740e87b Fix C++ PIDController SetToleranceBuffer and OnTarget locking.
ac27f4b64 Merge "Fix onTarget() so that it returns false until there are any values retrieved"
99b6000a6 Fix onTarget() so that it returns false until there are any values retrieved
628811ed0 Correctly set smart dashboard type for AnalogGyro and ADXRS450_Gyro.
c57e749a9 Merge "Fixed sim_ds script library path"
3350926d2 Merge "PIDController feed forward term can now be calculated by the end user"
4dec393c2 Fixed sim_ds script library path
0e9f07d1c Merge "Fixing install script... again"
5765b1397 Use absolute path for NT persistent storage.
2d4304880 Fixing install script... again
e3ce991f1 PIDController feed forward term can now be calculated by the end user
3cd125397 artf2612: Update license in source files.
008fb2e38 Merge "Removed gz_msgs from wpilibcSim"
887f220fe Ultrasonic: replace linked list with std::set.
dd1977815 Removed gz_msgs from wpilibcSim
7a2be548a Merge "Replaced linked list in Notifier with std::list"
5f9300966 Merge "Renamed Gyro to AnalogGyro to match athena API"
d77f5c801 Replaced linked list in Notifier with std::list
6faa51ff4 Renamed Gyro to AnalogGyro to match athena API
9092b74f4 TCPAcceptor: Check for socket creation failure.
b3d28c7e3 Merge pull request #46 from 333fred/master
ed9238546 Merge pull request #44 from ThadHouse/master
1247976a3 Fixes Android Build issues
880bc7db9 Adds a compilerPrefix argument for using a compiler with a different toolchain. Resolves github #45.
ce2245110 Merge "Adds CANTalon to LiveWindow"
dfba97a54 Merge "Fixing the frcsim installer script"
20f23e0e3 TCPConnector: Don't leak socket descriptors.
99b2b6514 Adds CANTalon to LiveWindow
5976baec0 Merge "Fixes CAN devices in C++ library not showing in the livewindow"
932ec8e30 Merge "HAL: Use extern "C" in implementation files."
1c6fe85a7 Fixes CAN devices in C++ library not showing in the livewindow
d9efcbc7a C++ NetworkTable: Add array and raw getters and setters.
e15ca5a41 Added linear digital filters
5e2a07d58 Fix client connection to 2.0 server.
70bc630f1 Fixing the frcsim installer script
6c89f34e4 Merge "Default bufLength for PIDController in Java should be 1"
d542fe429 Merge "Adds WaitResult to Java waitForInterrupt"
351e8599a HAL: Use extern "C" in implementation files.
620836e1c Update .gitignore.
31a39b4e5 Default bufLength for PIDController in Java should be 1
e2ec34090 Keep track of FPGA time rollovers with 64-bit time.
063925e73 Merge "Change C++ Notifier to allow std::function callback."
de4708cbd Merge "Rewrite C++ Notifier to use HAL multi-notifier support."
8bbc1d43b Merge "Rewrite Java Notifier and update Interrupt JNI."
c01146eb0 Merge "Readded styleguide accidentally removed in the reorg"
3e71573c5 Merge "Artf4179: Allow alternate I2C addresses for ADXL345_I2C"
5bc6e1378 Readded styleguide accidentally removed in the reorg
af2f54720 Java: Don't detach thread when releasing globals.
5cee85f92 Fixed some typos in the comments of MotorEncoderFixture.java, a method name in CANMotorEncoderFixture.java, and the README files
951c81f5b Adds WaitResult to Java waitForInterrupt
75d1891a5 Artf4177: Use read byte count for ReadString
376fc6be6 Artf4179: Allow alternate I2C addresses for ADXL345_I2C
91a451f87 Change C++ Notifier to allow std::function callback.
b0de0b738 Rewrite C++ Notifier to use HAL multi-notifier support.
5dc5ed83b Rewrite Java Notifier and update Interrupt JNI.
fe01096e7 Merge "finishing up FRCSim installer"
236ef199a Merge pull request #41 from 333fred/master
acc7fbbf0 finishing up FRCSim installer
1ea5b21dc Added skipArm flag to disable the arm build entirely
e6054f543 ntcore_c.h: Whitespace fixes.
416a238be Merge "Artf4776 Fixes First DIO PWM usage errors"
2aaaed34f Unbreak build on VS2012.
3d2b54a1c Merge "Artf4774 Fixes HAL getHALErrorMessage missing error"
ae99eb676 Merge "Prevent double free in DigitalGlitchFilter"
e2fb1c6d4 Merge "Set correct error message"
4881795a9 Prevent double free in DigitalGlitchFilter
fef8f933d Add SafeThread to fix thread JNI shutdown races.
17b363f3b working on install process for FRCSim 2016
85c3e6a4f Merge "This commit adds documentation generation, including grabbing ntcore sources, for both Java and C++. This will need changes made in the wpilib promotion tasks to copy the generatd documentation to the correct places."
2c04cf135 Improved READMEs
dbba4a103 Artf4776 Fixes First DIO PWM usage errors
083c90d37 Added libnipalu to make vision programs link properly
729545809 This commit adds documentation generation, including grabbing ntcore sources, for both Java and C++. This will need changes made in the wpilib promotion tasks to copy the generatd documentation to the correct places.
d8de5e4f1 Added ntcore sources zip to the main build
842aba97b Set correct error message
554543c5d Merge "Fixes the sources zip to actually include all sources."
d3f440003 Artf4774 Fixes HAL getHALErrorMessage missing error
20749ed6e Condition java sim build on -PmakeSim flag
44821c3e3 Change how Dispatcher is shut down.
8cc066ecc Fixes the sources zip to actually include all sources.
2540f102b Include sys/select.h on Unix platforms.
684da8d89 Merge "Add SPARK and SD540 motor controllers"
8b3f4aa68 Remove unused member variable.
0537f9d0d Fix mac.gradle.
4b0980fb8 Fixed jar task dependencies. The stripped version of the binary is now added to the jar, not the full debug version of the binary
65e4eeeb7 Fix Windows linkage.
298dc5491 Fix Windows build.
fb486e381 Merge "Added a withoutTests gradle flag for CMAKE feature parity"
32001427d Java: call JNI AttachCurrentThread less frequently.
13496c75b Fixed double free of DriverStation.
2a43813d1 Added a withoutTests gradle flag for CMAKE feature parity
b4c058389 ContainsKey: Compare to nullptr.
88b985be5 Allow building of tests to be disabled in cmake.
d69803804 Repaired simulation build on linux
7528b6b8b Fix NetworkTable::ContainsKey.
0d062fba3 Add Cmake wrappers and unzip desktop ntcore builds
fa903dd9c Add SPARK and SD540 motor controllers
931693345 Merge changes I55ce71c6,I803680c1
31e1041ba Merge "Remove broken and unused HALLibrary.java."
1b03f818a Rewrite CANTalon JNI layer.
cd5765559 Last feature addition for CANTalon java/C++ user-facing API.
4b0407338 Remove broken and unused HALLibrary.java.
0a06fdb52 Clean up FRCNetworkCommunicationsLibrary JNI.
c2ecffe70 Update to latest UsageReporting.h.
ec69c6a86 Fix Solenoid Resource object creation. Fixes artf4758.
bc0c89561 Take 2 on usage reporting.
9e1833058 Report usage for ADXL362 and ADRXS450.
e25d9fc96 Use correct condition variable in DispatchThreadMain().
82d89d3b7 Updated to NI image v18
7ba89306c Merge "Make C++ Analog Potentiometer test work."
c70e710ca Remove raw pointer deprecation warnings.
b1a3ded2f Added desktop classifier publishing for c++ as well
bafe4e56a Notifier: Change back to constructor from ATOMIC_VAR_INIT.
bd2a28f59 Add ADXRS450_Gyro.
6851dee3f Merge "Gyro: Add support for fixed calibration (artf4124)."
de219055f HAL: Add software-based accumulator for SPI devices.
530ce310a Merge "HAL: Add support for multiple Notifiers."
bc6da8eff Add noexcept shim for MSVC.
5d26b1355 NetworkTable: Add override declarations for all functions.
0d7106450 Make TableKeyNotDefinedException::what() const noexcept.
60647a2f8 Turn off Nagle algorithm to decrease latency.
8b0f19a0f Updated Notifier to match changes in gerrit 1171
76ee093e9 Add exception-generating C++ functions, but mark as deprecated.
d0c01ac30 Updates wpilib to use different repos for the different build versions, instead of using classifiers
9e6635ec1 Fixed log compilation on Mac
db91e20ec Updated ntcore build to build both arm and native versions
3cd20d3ff Java: Fix getValue().
6a8fcbc40 Make C++ Analog Potentiometer test work.
5c8214654 comment out halDesktop
f5fe5cfcf JNIWrapper: Fall back to system library if not found in .jar.
10e51f026 Merge "HAL: Increase safety during program termination."
b71cea69c Merge "DigitalInput: Don't crash on Get() of invalid channel."
01b64b5bd Merge "Add support for ADXL362 SPI accelerometer."
e9f98b28c Merge "Reduce overhead of setErrorX() calls."
cd4703065 artf4160 This fixes the java version of the addressOnly() function.
4f535fb77 Merge "Re-enable C++ Pressure Switch Test."
d34ba8866 Re-enable C++ Pressure Switch Test.
b3b03c43c artf4700: Added DigitalGlitchFilter
375a19563 Gyro: Add support for fixed calibration (artf4124).
6d00b77ef Merge "artf4175: Fixes FakeEncoderFixture encoder type error"
93b65aad3 DigitalInput: Don't crash on Get() of invalid channel.
c3c35c604 fix javadoc warnings/errors
03c43a46d HAL: Add support for multiple Notifiers.
07be45af8 HAL: Increase safety during program termination.
c2642f39e Avoid null pointer deref on disconnect.
7182b9a6b Upgrade TCPConnector messages from DEBUG to ERROR / INFO.
ac9e42af3 TCPConnector: Select only IPv4 addresses.
790862db4 Provide default stderr logger for INFO/WARN/ERR levels.
2f8562c23 artf4175: Fixes FakeEncoderFixture encoder type error
bb9988365 Fixed const correctness in casts and unused parameters.
a66eaa434 Reduce overhead of setErrorX() calls.
61760c839 Removed unnecessary ::std::string calls.
055ee0982 Fixed current and potential bugs caught by Coverity
b0fec4089 Merge "Added README, deleted old obsolete building instructions"
906fe65e3 Optimize Solenoid Gets. Fixes artf4730.
84ca2ab0f Merge "Prevent PID tests from hanging."
d998e53f9 Merge "Moved gyro calibration into a separate function so teams can recalibrate at any time after construction"
2f2184e8c Makes HALSetDataSem take a MULTIWAIT_ID rather then a NATIVE_MULTIWAIT_ID
de39877ef artf4153 Adds HAL structure memory management
e3191b0bf Prevent PID tests from hanging.
e162e4d1c Merge "Fix HALGetJoystickAxisType() definition to match header."
5080e5b77 Added README, deleted old obsolete building instructions
f10f8558e Added README for building
9b4dd268b Moved gyro calibration into a separate function so teams can recalibrate at any time after construction
aa95a8c29 Merge "artf4162: Fixes multiple solenoid creations in java"
c935ae2d9 Merge "Adds new CanTalon HAL Functions to C library"
8ad1c07a2 Merge "Remove temporary batch file."
966e4be36 artf4162: Fixes multiple solenoid creations in java
66b28e95a Adds new CanTalon HAL Functions to C library
f36e36424 Fix HALGetJoystickAxisType() definition to match header.
752f5fb4e Merge "Update PCM test to check Solenoid get methods also"
68bb07416 Merge "Arguments to Task are now forwarded to std::thread more correctly"
03ce0a1b9 Remove temporary batch file.
ab90e7aa2 Update PCM test to check Solenoid get methods also
ad64c0b02 Merge "spiSetBitsPerWord doesn't exist; remove from headers."
fec7f3a5e Merge "Make PDP parameters consistent with other HAL functions."
c59e08ee9 Add support for ADXL362 SPI accelerometer.
d59016be3 Arguments to Task are now forwarded to std::thread more correctly
2cd7bc83c Update .gitignore for new tree structure.
964b24361 Make PDP parameters consistent with other HAL functions.
51a35daed spiSetBitsPerWord doesn't exist; remove from headers.
84e793503 std::shared_ptr doesn't need to be initialized with nullptr. The C++ standard already guarantees it will behave as if it is.
26c27756a Updated the definitions file to add overloaded functions, added no-unused-private-field for Mac builds. Gradle also now works with the classifier-based dependency system, rather than having separate repos for every level.
6d854afb0 WPILib Reorganization
c76e60324 Add Java support for raw values.
d98ceb60c Merge pull request #36 from ThadHouse/master
2e050b054 Makes SetTeam use Mdns
c20d34c2b Rename Gyro to AnalogGyro and make Gyro an interface.
e2a455666 Add ByteBuffer interfaces to I2C and SPI.
44ba8823d Merge pull request #34 from JLLeitschuh/feat/functionalTableListener
4c42712b2 Makes ITableListener a lambda function
6a0485a72 Fixed mac lib path
af3facd1c Merge "Notify the Driver Station that code is ready after robotInit is called"
d690974ad Improved error handling in HAL Digital and Solenoid systems.
76756048c Notify the Driver Station that code is ready after robotInit is called
91891081b Merge "Update docs to reflect that PDP can now be at any address."
ff4abd63f Merge "JNI: Don't call HALInitialize() within an assert()."
511c4a4d3 Update docs to reflect that PDP can now be at any address.
967400f18 Merge pull request #32 from ThadHouse/master
a142cc48d Adds StopNotifier and StopRpcServer functions
3469f6733 GetRpcResult: Check m_terminating after wait() returns.
2b6c6f280 Merge pull request #31 from ThadHouse/master
aefeee39a Fixes SetEntryRaw to actually set raw.
27101979f Add extern "C" to ntcore_c implementation.
033520d42 Merge pull request #29 from ThadHouse/master
16e68c348 Fixes parameter type differences for c interface.
94b6073f3 Merge pull request #28 from ThadHouse/master
8fc2eee2b Makes Value::MakeStringArray properly set size
28f55802b Reverted RobotBase debugging changes from Peter.
06372cb14 JNI: Don't call HALInitialize() within an assert().
7023013c4 Simplify JNI interfaces.
927400a43 Added classifiers for networktables to to the pom
2f228380f Updated the ntcore reference and updated the build.gradle file to build with the most recent ntcore commit.
44bd52c44 Update the image version to 15
21124e017 Merge "Revert "Added work around for the missing path on the frc_console_tee command in frcRunRobot""
09962a7c8 Revert "Added work around for the missing path on the frc_console_tee command in frcRunRobot"
969af7b61 Added publishing of an ntcore sources zip
da6611833 Add JNI headers to the exported headers when compiled with JNI
beeefa235 kFramework_Simple was renamed to match the corresponding robot framework's name
26f1bd6a1 Merge "Fixed documentation generation for .inc files"
a34f3f238 Merge "HALUsageReporting::kFramework_Simple was renamed to match the corresponding robot framework's name"
231178c26 HALUsageReporting::kFramework_Simple was renamed to match the corresponding robot framework's name
424efca1b NetworkConnection: bump debug levels a bit.
4d7ea37d5 Fix update message type data.
32a1beb77 WireDecoder: Add commented-out read stream dumping.
d850b2fd7 Gradle build: rebuild on changes to header files in src.
bb52c2441 Merge "Update the library version string for the driver station (artf4708)"
9f5fe63aa Reuse dead connection slots.
03ee425e5 Add additional debug messages.
042e3a323 Update the library version string for the driver station (artf4708)
9200b7c78 Add extern "C" to JNI definitions to catch mismatches.
520d946f6 Fixed documentation generation for .inc files
b793810e4 Fixes for mac builds
9df5f5e27 When running on jenkins, the base name of produced archives becomes the project name. This fixes that to be the correct name.
7fbd0e34d Merge pull request #27 from 333fred/master
77cf3adf6 This commit updates the gradle files to be cleaner. It also builds for the current platform by default, and only builds tests when building for the current platform. Mac builds and VS2015 builds are fixed.
ad3424a69 Fix RobotDrive constructor (4 SpeedControllers).
97a7716a2 Added work around for the missing path on the frc_console_tee command in frcRunRobot
fc0a94af2 Update image version to v14
4da09db20 Revert "Updated the scripts to run as admin and manually start the robot programs. This will be reverted with a new image from NI"
a0cc45a8f Format and style changes. Rebuilt last SRX-related commit with latest checkout.
a3b6535fe Merge "Updated the scripts to run as admin and manually start the robot programs. This will be reverted with a new image from NI"
29299079f Merge "Updated roborio version numbers"
06dea34ff Merge "DO NOT ACCEPT THIS COMMIT UNTIL IMAGE CONTAINS netconsole-host: Don't overwrite system netconsole on deploy"
4972480b2 Updated the scripts to run as admin and manually start the robot programs. This will be reverted with a new image from NI
e73d873df Updated roborio version numbers
4eadd99d2 Merge "Removed simluation eclipse plugin"
1316deaf5 Added LiveWindow support for PID control for CAN speed controllers.
dd0e3e4ab Implement join with timeout (and detach).
d77b3d788 Dispatcher: Remove unused member variable.
64c8f1b48 Reupdated the ntcore version
39c40a9b8 Merge "Revert "Don't overwrite system netconsole on deploy (PENDING NEW IMAGE)""
fbbb8dab7 update the version 12 image number
e44936213 Merge "Revert "Don't overwrite system netconsole on deploy (PENDING NEW IMAGE)""
b4761f8f9 Revert "Don't overwrite system netconsole on deploy (PENDING NEW IMAGE)"
298bc8037 DO NOT ACCEPT THIS COMMIT UNTIL IMAGE CONTAINS netconsole-host: Don't overwrite system netconsole on deploy
bff8eb366 Revert "Don't overwrite system netconsole on deploy (PENDING NEW IMAGE)"
763d81653 Merge "Don't overwrite system netconsole on deploy (PENDING NEW IMAGE)"
4036ddf55 Merge "Fixed miscellaneous typos"
dff6e89b4 Notify local listeners on preferences load.
32af49dbb Fixed miscellaneous typos
c01d057d7 Counter: Explicitly call mode constructor.
490c88a9b Don't overwrite system netconsole on deploy (PENDING NEW IMAGE)
6fc3f1d3d Update netconsole-host binaries (TODO: make part of build)
1309533a4 Updated eclipse plugins to check for the 2016v10 image instead of 2015v23.
57b00d3b3 Fix StorageTest unit test on MSVC 2015.
29e54a989 Adding path back in for OS X toolchains because of Apple lockdown
c384fc97d Fixing up rpath libstdc++ for all versions
9c1ab6987 Merge "Automatically set persistent on new Preferences keys."
d9e9712b0 Merge "Update ntcore to latest version."
e281437c4 Merge "Replaced instances of std::unique_lock with std::lock_guard where possible"
f8c0fb105 Merge "Fix typo in Preferences Test name"
87fc49c66 Automatically set persistent on new Preferences keys.
f93bf82fa Update ntcore to latest version.
c0ecde302 Replaced instances of std::unique_lock with std::lock_guard where possible
c2f5bcc04 Fix typo in Preferences Test name
38e0cd696 Provide compatibility shim for std::make_unique().
898952a2d Merge pull request #26 from Beachbot330/master
202cb8bb1 fix javadoc warnings/errors
f64b05549 Provide DEPRECATED macro as portable version of [[deprecated]].
a480cc65e Removed simluation eclipse plugin
ef3fa53fc Fixed solenoid allocation bug exposed by adding status pointer initialization
049be6870 Always initialize status to 0 when calling HAL from JNI.
c0c91c414 Modified the test scripts to run as admin rather than lvuser until we have the passwd issue resolved
9f859234f Update for latest image, not sure about ctre folder so leaving
89ae8f214 Initialize status in HALInitialize.
4592c90e3 Add protocol specification documentation.
734e9a446 Fix NT_GetEntryInfo implementation signature to match header.
90959defd Provide more extensive listener features.
51064f5e7 Fix client initial flags setting.
3e8afc14b Java NetworkTable: perform string comparion correctly.
3c4b96024 Reverted task dependency changes that do not work
75d9228f3 Fixed networktables build
424bf51a7 Implement local notification.
00f797a32 NetworkTables updates for beta
75358e6c4 This adds a maven publish routine for ntcore to replace the networktables java routine.
e2879b7bf Fix JNI embed location on Windows.
525f88ae1 artf4115: Added MotorSafety to Relays
c21c47f54 artf4000 A fix contributed by James Ward to fix the restriction on the read/write sizes in I2C.
3635299fd Updated Gradle Version
a7feaddd6 Fixed some warnings printed during wpilibC++Sim build
771b5807f Merge "Updated C++ documentation"
c248ce794 Merge "PIDSubsystem.cpp: Use make_shared instead of make_unique."
6db58a2cc PIDSubsystem.cpp: Use make_shared instead of make_unique.
b80d2f665 Merge "Updated gradle version."
4c83259ac C++ NetworkTable: Provide AddSubTableListener().
9c50e9f96 Updated gradle version.
a3effbfb9 Java NetworkTable: Don't use ipAddress when starting server.
90ce262bb C++ NetworkTable: Provide SetPort() method.
23448c827 NetworkTable interface: Provide method to set persistent filename.
d904dfce7 Include the ARM JDK JNI headers.
d9fa086ec Include the ARM JDK JNI headers.
f89c5e150 Use new NetworkTables across WPILib (C++ and Java).
3b91fac19 ntcore.def: Add JNI getEntries function.
f65e69710 Revert changes preventing old user code from compiling.
e42f9b060 Add EntryInfo class (missed in previous commit).
c5d456f3a Add ITable/NetworkTable GetKeys and GetSubTables accessors.
6cbc21942 Add ITable/NetworkTable accessors for new features.
4b06e74a1 Java: Return boolean from put functions.
42f973ebe Java: Don't raise illegal state exceptions unless really necessary.
84e7d5906 Java: Use Global instead of WeakGlobal for callbacks.
51eb96903 Java: Improve robustness against JVM crashes on exit.
6d8e79693 Disable logging on static instance destruction.
f7e603c7d Add DEBUG4 message for messages received during client handshake.
30ad381b6 Notify on entries created/modified during handshake.
5181c4e5b Java: Don't free locals after detaching thread.
a2ec638db Java: Use empty string as default IP rather than null.
ef1e81f93 Merge "Create a WPILib Style guide."
953a2ce80 Implement keep-alives.
e1efb7364 Don't allow update intervals slower than 1 second.
123ba9c67 Use SmallVector instead of malloc buffers for WireEncoder.
d3e63e007 Change cmake to output same jar name (ntcore) as gradle.
21e21d3b8 Fixed the Windows build. Also added ensuring that vs2012 is installed if vs2015 is detecting, and printing an error that actually makes sense if it is not. Finally, added a .gitreview file, so that git-review will be able to autodetect the host and project for ntcore automatically.
702b6de73 Java: Fix crash on JVM exit.
6233b3477 Java: Fix fallback on external library.
07942bf42 Notifier: fix Stop() so it actually notifies the thread.
66f9f73cb Add gradle wrapper.
2dd9eafa4 Enable "make test" on cmake.
b1783cc1d Integrate googletest and googlemock.
c5c615b7d Add sublime text files to .gitignore.
897420a5f Reindent build.gradle.
5d1ab0e82 Merge "Unbreak cmake build."
af01ff300 Updated C++ documentation
550b04cff Merge pull request #21 from ThadHouse/master
46e0ac125 Added documentation to the C interface
22d984a6b Comments the interop functions in the C interface.
8d6f96adb Add NT_FreeCharArray.
1f431754a Simplify C entry point function names.
40093df91 Remove NT_AllocateNTString from ntcore.def.
f3bfee149 Change NT_GetEntry*FromValue to return copies.
9b9b41f40 Reformat to match coding style. No functional changes.
a451fd3f0 Make string/raw getters/setters use char*+len instead of NT_String.
756520724 StartClient(): Make a local copy of server_name.
e516200e0 Java: Add shutdown method to NetworkTable.
5beaf4577 TCPConnector: Add more info to debug messages.
1ca015776 Java: Add backwards compat shims for array types.
dbe4168d8 Java: allow both object arrays and native arrays.
969916851 Need to return nullptr, not false.
b00b4cb18 Avoid warnings by using sprintf_s on MSVC.
2b9e7c6af Silence MSVC warnings regarding bool conversions.
0d9aaa86c Silence unused variable warning.
28b613d60 Silence MSVC winsock deprecated warnings.
b971c741d Fix JNI for Windows and implement JNI getValue functions.
ecadb117d Merge pull request #5 from ThadHouse/master
4b7dfc025 Implements individual getters and setters for the C interface.
a990859db Initial commit of Java wrappers.
9c576b10d NetworkTable: Don't prefix path with / if key is empty.
b28807d79 Client and server tests: Prefix keys for compatibility.
b488cdd6f Support immediate notify of connection listener.
302cc064c ConnectionListener: Use bool instead of int for connected parameter.
6e4d7ca93 NetworkTable: Protect listeners with mutex.
6c8a5935c NetworkTable: Fix table and key listener behavior.
86445b667 Import llvm::SmallPtrSet.
330ba3993 Unbreak Unix build.
0f4eecebe Fix StorageTest on MSVC.
a3dbe9a80 Fix Windows client.
822dc4583 Close persistent file before attempting to rename.
b8a99690b Fix non-unit tests build on Windows.
48b1120c3 Add some basic non-unit tests.
c27a1cec4 Unbreak StorageTest.
9d4a66a40 Merge pull request #17 from 333fred/master
c846dff52 Fixed Gradle build to actually export proper functions
29f73cb5c Don't dispose in ConvertToC for NT_String and NT_Value.
a8836b766 Value: Use variant of enable_if to fix MakeString/MakeRaw in GCC.
96bf5c24b Merge pull request #4 from calcmogul/master
ab9de550d Replaced time.h with std::chrono
4514e4489 refactored HAL library
9cb9c3beb Logger: Move m_min_level init to header.
2d1bc2f4c Uninline constructors to reduce GetInstance() inlined code size.
c6bed1f46 Dispatcher: Move several fixed initial values to header.
c41341c7e Clean up trailing whitespace.
f0e31487f raw_istream and kin: a few cleanups.
a34143ae7 Update TODO.
ca9ce0f3a Implement automatic persistent saves.
a5ccafd92 Merge pull request #3 from 333fred/gradle-changes
43960b9bc changed windows file separator to unix file separator
29d029fa6 merged from frcsim branch
9458da045 Added building for arm, x86, and x64 with Gradle. This only builds ntcore currently, I'm working getting Google Test to work.
738881099 Unbreak cmake build.
4e4669219 Merge "Fixed wpilibJavaSim build"
8056aaa0a Merge "Accelerometer classes no longer use PIMPL pattern"
80247e98e Use relative include paths in tcpsockets.
293d00543 Turn on logging in unit tests.
a395e3577 Notifier: Fix condition variable race.
8d7cdeabb Implement remote procedure calls.
93b0dab7e Accelerometer classes no longer use PIMPL pattern
099056789 Fixed wpilibJavaSim build
f96b61ef1 artf4106: ISO C++ forbids variable-size array
b5695581c artf4170: Make CANTalon disable on destruction.
2bf3b6bed Replaced WPILib.h includes in integration tests with the minimum required subheaders to improve compilation times
e017f93f1 Fixed examples to build/run with new WPILib versions.
4f8c1dff2 Merge changes I8a9cf402,I8c0f8442
92edf35b4 Make deprecated warnings not error for macs.
e199e3571 Revert "Don't error on strict-aliasing warnings."
e9618df1b Avoid pointer aliasing for double/bits conversions.
c34ba968f Message: Remove ArrayRef-taking ExecuteRpc/RpcResponse.
0cbcfbc3f Import llvm::DenseMap.
cd4ebbd8a Tuned test constants for VelocityPID.
d5922bb03 artf4127: Implemented velocity PID controller
492463411 Don't error on strict-aliasing warnings.
cd53feb19 Log DEBUG() macros: avoid spurious warnings in release builds.
00feb6706 Only use enable_if template on Windows.
b3eed3818 Get build working on Windows (MSVC 2013).
f683a5c63 Export C API functions on Win32.
7d409f071 Add win32 tcpsockets implementation.
4146db6fc Visual Studio 2013 compilation fixes.
a86f65db1 Dispatcher: Implement transmit combining.
53a0531de Storage::ProcessIncoming(): Don't override parameter with local.
7db00575c NetworkConnection: Add a bit more debugging.
5b65bfb64 Storage: Fix comparison for client update-on-assign.
3b0eb56cf Update TODO.
e9073a3cc Implement notifiers.
538a19fd4 Implement GetConnections().
84ff80710 Refactor TCP-specific pieces of Dispatcher.
0dcaf56ed Add NetworkAcceptor and NetworkStream interfaces.
6703968f7 Dispatcher: Fix shutdown order race.
8ec65dbfc Use unique_ptr instead of shared_ptr for m_server_acceptor.
4670ef6ec Refactor StorageTest base class.
35e640017 Storage: Add vector include.
67de7af7b Storage: Use unique_ptr instead of shared_ptr for Entry.
3b207ad2c StorageTest: Fix string comparison for Warn().
b5274a495 Dispatcher: Don't call Storage::GetInstance() internally.
11508b77d Ensure initial synchronization is atomic.
0a1077869 NetworkConnection: Kill write thread when read dies and vice-versa.
ecbf76e94 Update tcpsockets classes to use log framework.
6c0103639 Make LOG() usable from other namespaces.
c2eb4a766 Dispatcher: Provide some INFO-level connection messages.
06e8d835d Provide ostream output for StringRef.
3a71acec5 Automatically reconnect client.
a9af4589a Don't send empty message lists from dispatch.
4356e313e Add logging framework.
afcfdb13a Clean up CMakeLists.txt a bit.
3a570add4 Build as a shared rather than static library.
ead125555 Implement client/server handshaking.
98ad6d1b4 Message: Handle receiving Server Hello.
978cdadda Storage::GetEntryType(): Check for null entry.
cde7782c2 Make StorageEntry a struct and move into Storage class.
138ebf5b4 Storage: generate messages rather than intermediate updates.
f0e3bb516 artf4165: D term of PID controller now uses change in input instead of change in error
918cde0c0 artf4155: Move Port.h from hal/lib/Athena to hal/include/HAL
43f16510f moved ctre includes from C++Devices into Hal
959f8775d Merge "Temporarily disable MutexTests until artf4167 is resolved."
0d70a39f6 Merge "Replaced ::std with std for readability/consistency."
ba57c7f24 Make gradle actually build command tests in C++.
a127bca0e Push down null check for m_queue_outgoing.
83be99e78 Immediately process incoming messages.
5b5e3ae6a Dispatcher: Start implementing processing of incoming messages.
f6576b18f Storage: Add more Dispatcher accessors.
9a621e927 Various NetworkConnection improvements.
4b575e3e7 Replaced ::std with std for readability/consistency.
c01f2977a StorageEntry: Make value() const.
683c53bab Message::str(): Return StringRef.
5823e3c78 Storage: Add CreateEntry function for Dispatcher use.
cbc372c71 Temporarily disable MutexTests until artf4167 is resolved.
a0d30ffef Storage: Use StringMap instead of ConcurrentQueue for updates.
fb1b82e23 StorageEntry: Also store copy of name here.
3bc5699ba Storage: Provide accessor for global mutex.
18659257d Storage: Make setters globally atomic.
3c7cb363b NetworkConnection: Prefer emplace to push.
787d39851 Update gradle build to match cmake build.
ae070aca7 Value: Add type check functions.
63dd895e6 Pass CMAKE_TOOLCHAIN_FILE down to external project (gmock).
507b083e7 WireEncoderTest.cpp: Don't test compiler truncation.
13bc05d9e leb128Test: Fix incorrectly sized constants.
3f24b8687 ITable: Add Persist function to make a key persistent.
1368f0ec8 NetworkTable: Use networktables.ini as persistence filename.
196fcf791 ITable: Const'ify getter functions.
6bccf528d ITableListener.h: Forward declare ITable.
1fc03803c ITableListener::ValueChanged: Don't make key const.
f74ca87e2 Merge "NamedSendable::GetName() is now const qualified"
5756be5c2 Merge "Fix std::unique_ptrs using incomplete types"
2da3f7f89 Merge "Replaced all uses of DISALLOW_COPY_AND_ASSIGN macro"
cf965d26a Merge "Make test scripts spawn driverstation as admin."
af3eaae09 Merge "Comment out SetPriority() in Task constructor."
8fa0e6c91 Add shims for old NetworkTable interface.
6f940bcaa Add immediate_notify and is_new to entry listener.
79f732f23 Import llvm::SmallString and dependencies.
593bc2844 Move StringMap.h and StringExtras.h to public includes.
9c204533e Value: Disambiguate std::string&& and StringRef.
4c14f7823 ntcore_cpp.h: Comment cleanup.
4aa2d65bb Storage: Use std::forward and emplace for updates.
bb5848a03 ConcurrentQueue: Add emplace function.
9f728b850 Add MSVC specific compiler flags.
9c2678fdb Make test scripts spawn driverstation as admin.
3bbeccfbb Replaced all uses of DISALLOW_COPY_AND_ASSIGN macro
b4c65dc21 Make global instance init thread-safe.
5df62ac17 Storage: Disable use of update queue by default.
0979c1c9c Storage, NetworkConnection: Don't in-place construct atomics.
8bbe5f9fd ArrayRef: Add portability checks for constexpr.
881dcd08e Fix std::unique_ptrs using incomplete types
3cd3d1691 Message: Use #define instead of constexpr.
6b2fb02be Dispatcher: Don't in-place construct atomics.
8938a1981 Dispatcher: Avoid warning by using for(;;) instead of while(true).
158ae6181 Dispatcher::SetUpdateRate(): Explicitly convert to int.
6bd2534f0 Comment out SetPriority() in Task constructor.
451c4e81c NamedSendable::GetName() is now const qualified
eb7d55fd5 Fixed classes with undefined constructor.
c776324f9 Merge "Make the teststand run as lvuser instead of admin."
98f2d0810 Changed const char* -> string in most of wpilibc.
534ea134a artf4154: Get rid of raw pointers in C++.
fd4c16965 artf4149: Removed references to VxWorks
571256506 Removed dependencies on pthread from frcsim.
3f59f3472 artf4156: Replaced synchronization primitives with C++11 equivalents
98d45777c Remove unnecessary llvm qualifier.
d05902207 Add logging to TODO.
c9260ea78 Change GetEntryTypeFunc to std::function.
c9ca2f902 Add TODO list.
29691e0ac StorageTest: Add LoadPersistent and SavePersistent coverage.
a3fcce891 LoadPersistent: Fix various bugs.
8db016c22 SavePersistent: Sort in name order, fix list commas.
b0802f3e2 StorageTest: Add fixture classes, add GetEntryInfo test.
e4731a4e4 Storage::GetEntryInfo: Actually filter on types.
67ae9e1ba Add initial set of unit tests for Storage.
d6afbc56c Storage: Delete functions now delete from map.
ffb54872c Storage::SetEntryFlags(): Fix deadlock, check for empty name.
ead6b4960 Storage: Use make_shared instead of reset.
21b7acc39 Storage: Make testable, make EntriesMap typedef private.
173111c64 ConcurrentQueue: Make mutex mutable.
cf18355fe Unit tests: Prefer constructor to SetUp() in fixtures.
1cc148848 StartServer: Take persist_filename as a StringRef.
ec5490434 Tighten up C++ API implementation a bit.
0a18d2e57 Storage: Make individual entries thread safe.
c08e2ed8f ConcurrentQueue: Add size() function.
2437f06c7 Implement majority of Storage functionality.
9b7e26576 Continue implementing client.
c4a7f6ec9 SavePersistent: Safely save through temp file.
d05656b71 StorageEntry: Make data public, remove accessors.
04789d9ae SequenceNumber: Add default constructor.
77acf1f35 Implement Flush() API.
412e8034d Start implementing client and server.
a6162ba99 NetworkConnection: Trigger threads as necessary in Stop().
7c5117860 TCPAcceptor: Add shutdown() function.
899c48912 TCPStream: Shutdown on close.
3062e1e74 Message: Add data accessors.
854bfba7c Value: Set last_change field.
1d4de091f Implement nt::Now().
b8f044f8e Make the teststand run as lvuser instead of admin.
440916cf2 Fix string terminator in char** output.
3f4feb2f5 Remove unused variable.
3025a7e51 Finish C wrappers.
fcbd2751b Provide C++ API. Move all classes to "nt" namespace.
56f1481c2 Add Dispatcher.
2ea20b8e8 Value: Use NT_Value for internal storage.
9906116d2 Don't base Value on NT_Value.
555725a05 NetworkConnection: Don't explicitly declare default move constructor.
13cbf4e28 Message: use shared_ptr.
beb92e6cb NetworkConnection: Ignore duplicate Start() calls.
4d3fb3c49 Storage: Use unique_ptr for instance.
dbd0c9830 Message: implement MsgType constructor.
53fb70251 ConcurrentQueue: Add empty() function.
e64070824 Start implementing network connectivity.
8fdaf61ef Use typedef for GetEntryFunc function pointer.
a5713252d Message::Read(): restructure to read directly into Message.
f5ec5e180 Message: don't explicitly convert StringValue.
27e0f22c0 StringValue: Implictly convert/assign from StringRef.
2016bcb37 Replace MessageReader and MessageWriter with Message.
1760d3201 MessageReader: Rename Run() to ReadMessage().
9808c6e62 Remove extra whitespace.
071b278b7 MessageReader: Use rvalue refs and std::move for handlers.
f4673f312 WireDecoder::Read(): Use const char instead of plain char.
8ee4c36e0 MessageReader/MessageWriter: bring in proto_rev().
0f876d198 Use StringRef instead of NT_String in various places.
eecf0deee Add WireDecoder test and finish WireEncoder test.
6aa32e875 WireDecoder: Add overloads for StringValue and Value.
a55b6565b WireDecoder ReadDouble: Use ref cast.
c1c0c8d41 Optimize Write16/32/Double a bit.
163477352 Finish WireEncoder tests and fix a bug.
547e2ad72 leb128 test: naming consistency
ca9064811 Add copyrights and header guards.
958fbaa81 ValueTest / StringValueTest: Make conversion function static.
fa19a54ab Separate ValueTest and StringValueTest into headers.
c9c1b7e5d Rename test files.
4d5e5c82d Start WireEncoder testing.
9bd4a5ecc Add proto_rev accessors to WireEncoder and WireDecoder.
09d6619a5 Add LEB128 test.
e7ba40dcf ReadUleb128: Take const buf.
ae42eee8e More Base64 fixes (correct decode return value).
1e9b9b9a3 Base64: Fix a little differently.
1225d3ef7 Slight whitespace fix.
407ded6b8 Use ASSERT_EQ with correct order of arguments.
c7b5266f9 Add Base64 tests and fix a couple of bugs found.
5a0fccc9c Add unit tests for StringValue and Value.
b66fb68f2 Finish LoadPersistent().
cb30bb5d7 Rename base64 to Base64.
40ebb9a84 C++-ify base64 functions.
b7a87bb6f Make StringValue noncopyable.
e38cce46a Add missing llvm headers.
f6deafee2 Add type-safe wrapper around NT_Value and NT_String.
8d6a0786c Move all C api functions to ntcore.cpp.
9ee307066 Storage: Make entries private, add accessors.
05e084364 Start implementing LoadPersistent.
69e91244f Rename make_StringRef to MakeStringRef.
e37a9d81f Cleanups and commenting.
95d0736bb More coding guidelines name changes, and use "using".
de4ba1aa3 Fix up naming of Base64 and Leb128 functions.
d7ca3343b File renames.
cee77a322 Reformat per new coding guidelines.
f5a82be9e timestamp.cpp: A few cleanups.
2a1ccaff1 Add timestamp function NT_Now().
b195dfbe0 Add ConcurrentQueue implementation.
0aab4c27e Use nullptr.
42ad98567 Use C++11 deleted functions for noncopyable.
c06e62541 Fix code style for pointer and references.
1a48e75d4 Implement SavePersistent.
a896a3ade Import LLVM StringMap et al.
62ef9e1c6 Remove extra Reserve calls.
047cccda8 Refactor WireEncoder.
dbed3fea6 Move remaining read functions.
b88a9295b More refactoring.
c4d4679ed Finish EXECUTE_RPC and RPC_RESPONSE handling.
c2063f3a8 Refactor MessageReader into WireDecoder.
03bae15b9 ntcore: Implement RPC_RESPONSE reading.
842fb957a ntcore: Initial commit.
7f5ee01d3 Merge "DISALLOW_COPY_AND_ASSIGN macro now uses the delete keyword and allows move assignment and construction"
f4d84cdd4 Fixed potentially uninitialized value warnings emitted by clang
974e301a8 Merge changes I3d35139f,I05bb06f6,I4a3db0f1,I452b4794,If281e46a
9dc7bb4ec Merge "Changed 'mvn.bat' to 'mvn.cmd' such that the eclipse plugins can build on Windows with the current version of maven."
1ab3ea670 artf4107: Removed most "Init" functions from classes
e4a8aacc5 artf4107: Replaced throw() with noexcept
faedfa6ed artf4107: GetInstance() calls are now atomic
368ad30d3 artf4107: Uniform initialization syntax introduced
b1befed14 artf4107: clang-modernize was run on WPILib
045a9b32d DISALLOW_COPY_AND_ASSIGN macro now uses the delete keyword and allows move assignment and construction
7a711a21f Make jenkins fail if tests fail catastrophically.
1c3882ec7 Create a WPILib Style guide.
35ccbb9c9 Fixed bad initialization of PDP.
8794f7d63 Changed 'mvn.bat' to 'mvn.cmd' such that the eclipse plugins can build on Windows with the current version of maven.
2c392d181 Fixed comment problem in GyroMecanum cpp and made other small fixes to sample programs.
7dcbe171b Merge "Major formatting changes (breaks diffs). No code changes."
6fefcc779 Merge "Added new sample programs to the eclipse plugins for C++ and Java. Modified examples.xml for the corresponding added programs."
7eb8550bd Major formatting changes (breaks diffs). No code changes.
bd64d9a7e Added and implemented GetInverted method.
0122086d2 Added tests for motor inversions.
ae90e5f6d Added new sample programs to the eclipse plugins for C++ and Java. Modified examples.xml for the corresponding added programs.
2d71c1c1c Merge "[artf4062] Eclipse now throws error on bad build."
0ad0b567e Merge "Artifact artf3896, commented out line that deletes the folders/files in wpilib/tools so teams smartdashboard extensions don't get deleted on plugin update."
401340213 Add PIDInterface for PIDController and CAN devices.
27e450967 Add CANSpeedController interface in Java.
6ce98056d Merge "Added Ultrasonic example program in Java and C++, updated examples XML."
c7944d76a Merge "Add check for CPP Perspective to CPP Launch Shortcuts. Fixes artf2627"
9c0df8c8f Add check for CPP Perspective to CPP Launch Shortcuts. Fixes artf2627
5598445a6 Improve const correctness.
c357d1dca Added Ultrasonic example program in Java and C++, updated examples XML.
c6b790cad Artifact artf3586: Added include for stdint.h in WPIErrors.h file, so the header can stand alone.
ead60eaab artf3622: Each Solenoid creates handles for all other Solenoids as well
39130721d Artifact artf3528, Added support for PDP's having addresses other than zero, and added ability to have multiple PDP's.
8d17270dc Merge "Added functions to get names, HID types and isXbox descriptors from joysticks."
bf4ccf13d Added functions to get names, HID types and isXbox descriptors from joysticks.
ee824680d Re-adjusted some PID values for the tests.
d252ed528 [artf4062] Eclipse now throws error on bad build.
3de0f162b Merge "Added modified Google Style Guide."
13948e819 Merge "[artf3943] Add LiveWindow mode to CANTalon."
ac80114c4 Merge "Fixed BuiltInAccelerometer Tests, changed expected axis of gravity from the z-axis to the y-axis."
7100052c5 Added modified Google Style Guide.
4b45b6a19 Artifact artf3896, commented out line that deletes the folders/files in wpilib/tools so teams smartdashboard extensions don't get deleted on plugin update.
b5ce28135 [artf3943] Add LiveWindow mode to CANTalon.
e48edbebd Fixed BuiltInAccelerometer Tests, changed expected axis of gravity from the z-axis to the y-axis.
0862210f5 Fix bad suffix for staticLibArchiver on macs. Needs to be tested on mac.
1c9dffc30 Commented OS X workaround in build.gradle
32251fe4a Merge "Makes the build work on Mac (needs to be tested on other platforms)"
08487b56a Merge "Changed calculate method to protected and virtual"
40c6fbe24 Makes the build work on Mac (needs to be tested on other platforms)
33f012a60 Merge "CANTalon: Add getter methods for soft limits."
fafc8635c Merge "add some comments etc documenting various not-implemented things"
8674ac20f Merge "Added missing archiver prefix for wpilibc"
2296d6560 Changed calculate method to protected and virtual
bbffc825e Merge "Change wpilibcZip to use "lib" instead of "libs" to match where eclipse plugins expect libraries"
682bc171f Change wpilibcZip to use "lib" instead of "libs" to match where eclipse plugins expect libraries
47088c035 CANTalon: Add getter methods for soft limits.
4cac5a957 add some comments etc documenting various not-implemented things
675fbc032 Test bench fixes and updates. Attempting to make it possible to have a stable build again. Gyro test still seems a bit unreliable.
880eae142 don't use uninitialized variables
d1d28e70e Merge "This commit adds JNI bindings for the C++ Notifier."
269bf9db6 Merge "Removed confusing error on deploy."
671954a66 Merge "Add MSYS Makefile option for cmake to Building.md as well as a note about the warning that's generated. Fixes artf3748"
19526361f Merge "Add DisabledInit to C++ Command Based template. Move and modify comment on Java version. Fixes artf3840"
a9593854d Merge "Fix usage reporting for new motor controllers and Analog output"
9cda6e3ff Merge "Tuned some values in tests to account for hardware imperfections."
0853dc8e5 Merge "Fixed access issues and 'overridableParamatar' misspelling."
0b7bb41b2 This commit adds JNI bindings for the C++ Notifier.
90f05dd31 Removed confusing error on deploy.
9b6e48e14 Add MSYS Makefile option for cmake to Building.md as well as a note about the warning that's generated. Fixes artf3748
5a094879b Add DisabledInit to C++ Command Based template. Move and modify comment on Java version. Fixes artf3840
8b71ddc30 Fix usage reporting for new motor controllers and Analog output
1805968d7 Tuned some values in tests to account for hardware imperfections.
01d73d04f Added missing archiver prefix for wpilibc
1e4e0bacd Gradle Build
569f02de8 Fixed access issues and 'overridableParamatar' misspelling.
0dffbd863 Catch exception when instantiating USB camera if camera isn't present
0e46592ad Don't send DS errors if no DS.
d2edb80da Merge "Use PCM Device ID when getting status. Fixes artf4014."
6159fde98 Set POV values on error to return -1 rather than 0 AND bump the version number (artf4005)
7bdd91a05 Use PCM Device ID when getting status. Fixes artf4014.
605bb45e0 Fix endian order of buffers in AnalogTrigger.java
215002e48 Fix analog trigger bug with MXP mapping (artf4010) Add the interrupt code for MXP mapping and analog triggers Took out the unneeded static definition Change-Id: I9a3483ee8f806b46b4349845e7a189f497c36916
964475c72 Bump the version number to 1.1 for the network table changes
bfa4bbaf7 Final move of Dustins network tables patches
39158754d Partial merge of patch from James Killian Narrows scope of locks in write manager added delay to incomming stream monitor loop
048b02e6c Applied patch from Dustin Spicuzza to fix robot hang
130319b77 Merge "Fixes artf3989: Java SerialPort no longer ignores return value of serialRead"
0b414b1bd Merge "Disable Encoder console spam introduced in e13720b."
8a244cc9d Merge "Make index encoder constructors work."
397162390 Merge "Correct energy to be in Joules rather then millijoules. Fixes artf3940"
bbc216f99 Disable Encoder console spam introduced in e13720b.
72a56e6a8 Make index encoder constructors work.
102c992e5 Fixes artf3989: Java SerialPort no longer ignores return value of serialRead
9f057fddf Correct energy to be in Joules rather then millijoules. Fixes artf3940
e614217d4 New netconsole-host that overwrites the old one on every deploy
9b7042a51 Fix errors in Vision examples.
081d7f736 Merge "Applied updated DIOJNI file from Ron Rossbach. Fixes artf3982."
352c021b1 Merge "Updated the Java CameraServer to use the new USBCamera and prevent large camera data copies. Fixed a small bug in USBCamera to prevent reinitializing a camera if it is already initialized. Also fixed some issues with the getJpegSize function to correct for Java incorrectly casting 0xff to an integer, and the byte buffer limit being set incorrectly."
5f90bf167 Merge "Enable nivision Java wrappers to be generated with Python 3."
445eafefb Merge "More Java nivision wrapper fixes."
a917f63e7 Merge "2015 Color and Retroreflective vision samples for C++ and Java"
2228361f3 Merge "Add SetCANJaguarSyncGroup to RobotDrive"
aaa599fa2 Updated the Java CameraServer to use the new USBCamera and prevent large camera data copies. Fixed a small bug in USBCamera to prevent reinitializing a camera if it is already initialized. Also fixed some issues with the getJpegSize function to correct for Java incorrectly casting 0xff to an integer, and the byte buffer limit being set incorrectly.
5d95bbb33 Enable nivision Java wrappers to be generated with Python 3.
d0258923e More Java nivision wrapper fixes.
91ccc5d10 2015 Color and Retroreflective vision samples for C++ and Java
9fda92005 Merge "Add @file annotation so files are picked up in doxygen"
e9dd72ac7 Merge changes I0ec40c14,I4d099e62
cce1bbc1f Merge "Update to point to Gazebo3.2 header location."
9fc79c41d nivision Java wrappers: implement our own error text function.
1dba91688 Add @file annotation so files are picked up in doxygen
ce7a56284 Fix a few major nivision Java wrapper issues.
34d515deb Make sure Utility file is included in doxygen output.
cff103d15 Merge "Add encoder indexing in Java"
1b5cabc0d Merge "Add encoder indexing support in C++"
9fcfc5b3b Merge "Added the C++ implementation of Peter Johnson's UsbCamera. Rewrote CameraServer to use the new USBCamera implementation and get rid of some unnecessary copying of the entire image."
f181c7013 Merge "Add USBCamera class."
46c40da53 Merge "NIVision: Add dx functions."
1c05a982e Merge "Synchronize CANTalon documentation between languages."
ba7f56833 Add SetCANJaguarSyncGroup to RobotDrive
7600473da Applied updated DIOJNI file from Ron Rossbach. Fixes artf3982.
9f04b7958 Fix Timer.hasPeriodPassed().
2282a11a7 Added the C++ implementation of Peter Johnson's UsbCamera. Rewrote CameraServer to use the new USBCamera implementation and get rid of some unnecessary copying of the entire image.
1a2344bdd Add USBCamera class.
ae9a7d19f Merge "Miscellaneous AnalogTrigger fixes"
e1141b9f2 Merge "Disable C optimize setting so better C++ doc is generated"
ff71aca57 Merge "Update docs to add missing channel numbers"
837671e95 Merge "Document that PDP must be address 0 and add/fix measurement units"
38c0308fc Merge "Correct path of sfx so that it can be launched from eclipse menu"
f21e4a9da Miscellaneous AnalogTrigger fixes
e13720bb9 Add encoder indexing in Java
0cf7d6f45 Update docs to add missing channel numbers
a2dfffedd Add encoder indexing support in C++
87e1df068 Fixed a null pointer exception in the mecanum drive sample program (Fixes artf3974)
f19c290fd NIVision: Add dx functions.
5c342a8e1 Document that PDP must be address 0 and add/fix measurement units
f7117aac4 Correct path of sfx so that it can be launched from eclipse menu
05cd0627b Update to point to Gazebo3.2 header location.
2bc83bd80 Disable C optimize setting so better C++ doc is generated
79fbbbc0d Synchronize CANTalon documentation between languages.
359a15591 Merge "Make 3 axis Accelerometers work in LiveWindow. Fixes artf3902."
fb7f5e9de Add methods to retreive the FPGA index for counters and encoders and return the encoding type as an integer Change-Id: Iaa4062ec124b968b27e7c812cc754032fcb354d2
7db63055f Make 3 axis Accelerometers work in LiveWindow. Fixes artf3902.
b94341a23 Merge "Update nivision JNI generator to correctly gen Priv_ReadJPEGString_C."
afbd70d39 Update nivision JNI generator to correctly gen Priv_ReadJPEGString_C.
ceccd9508 Add PDP to LiveWindow for C++
91b981248 Merge "Add PDP LiveWindow code"
0dbc40e51 Added missing .java file
5ce89b338 Added a Java AxisCamera sample program
8ccf3d9c1 Add AxisCamera Java class
230fa2d16 Add PDP LiveWindow code
d165f57e6 Clean up misc documentation
2d15b6b03 Merge "Update Java install URL to the new URL with the java installer."
5d9baa44e Merge changes Ie40db6c9,I0b5e752e
822416d2f Merge "Write lib version from C++ (fixes artf3788)"
3fe726d85 Merge "Update docs for C++ (fixes artf3761 and artf3953)"
4c0b2c18a Write lib version from Java (fixes artf3788)
b4c5a3af7 Update Javadocs for Java (fixes artf3761 and artf3953)
eddb0b20b Write lib version from C++ (fixes artf3788)
6d8e782f5 Update docs for C++ (fixes artf3761 and artf3953)
036832238 Update Camera templates to make C++ and Java more similar.
19e05ff52 Update Java install URL to the new URL with the java installer.
a6aef54ef Merge "Axis camera C++ example program"
32f3bea46 Axis camera C++ example program
9aacf5eb2 Merge "Artifact artf3925 : PCM : Can't find any user facing java/C++ API for getting/clearing PCM faults"
f3484686c Fix some typos in AxixCamera.cpp
b78b14bf5 Merge "Add AxisCamera C++ class"
c08dc9865 Merge "Add the 2014 C++ vision classes back in"
9fbffd88c Merge "Change the java intermediate vision filename to match c++"
6c15a3600 Change the java intermediate vision filename to match c++
548941dd9 Artifact artf3925 : PCM : Can't find any user facing java/C++ API for getting/clearing PCM faults
9d8418c14 Add AxisCamera C++ class
326bf4fc9 Merge "Updates the InterrupatableSensorBase documentation to reflect the bug described in artf3623."
3c4a1d9a1 NIVision Forward Port
768702826 Updates the InterrupatableSensorBase documentation to reflect the bug described in artf3623.
a55f34646 Encoder/Counter Fixes
53473e21b Add the 2014 C++ vision classes back in
b4097fbd5 Merge "ClearStickyFaults() should not take a param, just clears sticky flags in a one shot manner. GetCompressorFault() => GetCompressorCurrentTooHighFault() There are now three compressor related faults so getters needed to be more verbose. New getters()... GetCompressorCurrentTooHighStickyFault GetCompressorShortedStickyFault GetCompressorShortedFault GetCompressorNotConnectedStickyFault GetCompressorNotConnectedFault"
3b7211455 Merge "Fix imports on vision examples so they compile. Fix Typo."
cc36454b9 Merge "Add C interface for CanTalonSRX::SetModeSelect(modeSelect, demand)."
aae20ddbf Artifact artf3945 : CANTalon : Motor Safety Object never feed
ffd906176 Fix imports on vision examples so they compile. Fix Typo.
9ffdea188 Add C interface for CanTalonSRX::SetModeSelect(modeSelect, demand).
46dc99a11 Adding SFX to tools zip
91d714d2e Merge "Single line bug in CanTalonSRX::GetAnalogInVel(). return value was not being sign-extended."
9a28aaaa7 Merge "Change expected voltage on CAN tests"
96a76ba89 Single line bug in CanTalonSRX::GetAnalogInVel(). return value was not being sign-extended.
d26059a4f Change expected voltage on CAN tests
ee0d83530 Remove an extra constructor from a bad merge
6080a3b18 Duplicate of gerrit 739; changed method from public to private.
3d06a763a CanTalon : Adding config routines for limit switch normally open vs normally closed. They already existed in Labview, so this will keep parity New C++/Java funcs ConfigFwdLimitSwitchNormallyOpen ConfigRevLimitSwitchNormallyOpen
e1480ec79 Noticed that if changeControlMode() is called every teleop loop, it causes motor to stutter as it enters and immediately leaves kDisabled. A simple improvement was to only perform the disable-before-next-set strategy if the caller's request mode is not equal to the current mode.
a5d9ba412 Second pass through all the HAL functions and cpp/java API. Filled in some parity holes between java and cpp.
2434515d4 artf3913 Increased wait delay to 4ms to cover worst case delays for solicted signal getters. Specifically.... -Get firmware vers -Get P,I,D,F gains -Get IZone, Get CloseLoopRampRate -Get IAccum (integral accumulator)
741618250 Merge "C++ CANTalon was missing SetIzone. Added SetIzone to match java, and made the set/get Izone integral."
8b8d7e77c C++ CANTalon was missing SetIzone. Added SetIzone to match java, and made the set/get Izone integral.
c093a553e changed variable type of closeLoopRampRate in setpid to double from int. It's represents V per sec since it calls setCloseLoopRampRate() underneath.
a1375e58c Merge "Don't fail silently if DIO or PWM allocation fails"
15ff7f503 Merge "Added the getButtons method back that reads all the buttons at the same time"
c17ba98f7 Added the getButtons method back that reads all the buttons at the same time
dee755ab1 Merge "renamed param to match function name."
92c54f5f5 Merge "Image v23"
1fde00643 Merge "Fixed post4066 bug: Prestart() inaccessible."
47443b4e1 Fixed post4066 bug: Prestart() inaccessible.
f01e5b557 fixed robotCommand in src
198e2eed1 ClearStickyFaults() should not take a param, just clears sticky flags in a one shot manner. GetCompressorFault() => GetCompressorCurrentTooHighFault() There are now three compressor related faults so getters needed to be more verbose. New getters()... GetCompressorCurrentTooHighStickyFault GetCompressorShortedStickyFault GetCompressorShortedFault GetCompressorNotConnectedStickyFault GetCompressorNotConnectedFault
22c420755 Image v23
bea9eb0ef renamed param to match function name.
b72eb4b81 Merge "added Java vision example programs"
0d8c45472 Don't fail silently if DIO or PWM allocation fails
d61d491a0 added Java vision example programs
786e844a9 Merge "Fix ControllerPower 5v faults and add javadocs. Fixes artf3918."
170b5860e Fix javadoc compile errors that broke build.
26c50ebe0 fixed java CameraServer
46c659d6b Enable Java 8 doclint checking (except for missing tags).
6fdd49108 Fix javadoc warnings.
fe4535dfa Merge "Resolved artf3579: robot can no longer be enabled until robotInit() finishes in IterativeRobot; similar options available by overriding prestart() for other base classes."
636e2e13a Wrong package declaration in camera server
d3f5b7466 added CameraServer.java
8116bbd15 Merge "Fix various bugs in nivision wrappers."
37052246a Fix various bugs in nivision wrappers.
a649d3b55 Fix ControllerPower 5v faults and add javadocs. Fixes artf3918.
6a7e7cf61 Two param constructor added to C++/java CANTalon so caller can optionally specify the periodMs at which the talon control frame is sent. The param is capped in the HAL C++ class to [1ms, 95ms] so that zero and negative periods are caped to 1ms, and so that caller can't pass an absurdly large value, which causes TALON is appear disabled.
77997e52f Merge "added PDP methods to javalib"
e655072ef Synchronize access to buffered Joystick data.
0427fc34c Merge "Check for negative button value and add missing newline."
e33d80be1 Merge "Add USB serial port option. Uses kUSB for ALSR3"
8381eee18 Merge "Wrap IMAQdx functions."
1c24096cc Resolved artf3579: robot can no longer be enabled until robotInit() finishes in IterativeRobot; similar options available by overriding prestart() for other base classes.
3a684d28b PWM timing change for SP and SRX. added 3us to outer bounds
8786b242b Add USB serial port option. Uses kUSB for ALSR3
b29a4bebf Check for negative button value and add missing newline.
db0b42101 Wrap IMAQdx functions.
8efe99827 Make VictorSP and TalonSRX use correct bounds (give an extra 1us on min and max to ensure saturation). Fixes artf3914 for C++ and Java
ac6019884 Merge "Change vision defaults from "cam1" to cam0". Add some error reporting to Intermediate Vision example"
8a5ee71fd Merge "Make SetImaqError actually set the error"
af4ce1074 Merge "Image v22"
763604139 Don't use raw type for HALSetNewDataSem
745489fec Image v22
04f9ca4fe Change vision defaults from "cam1" to cam0". Add some error reporting to Intermediate Vision example
ca5dfbe49 Make SetImaqError actually set the error
07619a37a Merge "Add C function wrappers for CanTalonSRX."
34d3d756e Merge "Update javadoc for RobotDrive. Mecanum methods are implemented."
61a5fcce1 Merge "Squashed commit of the following:"
82c4563d3 Merge "getHALErrorMessage(): Add missing CTRE errors."
fa337bc74 Add C function wrappers for CanTalonSRX.
8ae7e973f getHALErrorMessage(): Add missing CTRE errors.
574f2e692 Java nivision: Add RawData to wrap void*.
827341caa Squashed commit of the following:
dd272e6bc Merge "Add Java nivision wrappers."
3bdaa63a2 Update javadoc for RobotDrive. Mecanum methods are implemented.
41b393c21 Merge "Fixed minor issues in CANTalon. Fixes artf3884, 3885, 3887."
11cf860ec Merge "Check and coerce rumble inputs to range of 0 - 1."
2168d2cb7 Merge "Require Jaguar version v108 or higher."
430722c4a Add Java nivision wrappers.
497f38fe0 Check and coerce rumble inputs to range of 0 - 1.
9f2dcdeab Fixed minor issues in CANTalon. Fixes artf3884, 3885, 3887.
ac07142e4 added PDP methods to javalib
19a7243bf C++ Added Get/clear routine for IntegralAccumulator Added missing status check in GetFirmwareVersion(). I don't expect this to affect anything.
e3ac0b628 Merge "Fixed issue in setting CANTalon values."
709a88ad6 Fixed issue in setting CANTalon values.
6b844b52e comment change and added SetModeSelect(int modeSelect,int demand) {
9056edf93 commented out system.out.prints in CANTalon.set()
ff2ea1287 Merge "Added C++ versions of the joystick query functions"
b41690b38 Added C++ versions of the joystick query functions
ce8e65d41 Merge "Changed AnalogPotentiometer to use angle specification and rail voltage."
66622b43e Fixed accidental confusion between seconds/milliseconds.
568b842c7 added setPosition to java. Great for zero-ing your relative sensors, also exists in cpp and LV.
4d142cdaf commented out throws in getP,getI,getD,getIzone, getRampRate. Getting/setting these should be available all the time.
2ae8f40a5 Changed AnalogPotentiometer to use angle specification and rail voltage.
483331657 Added more Talon SRX documentation and PID samples.
16f9db30a Merge "fixed bug artf3676 : Typing in a project name into the create command dialog in eclipse is broken"
e092742f4 fixed bug artf3676 : Typing in a project name into the create command dialog in eclipse is broken
4f6fa2482 added joystick and driverstation counts for POV, buttons, and axis
52408e265 Add classes for VictorSP and TalonSRX PWM control.
d986ffac8 Merge "Java-Installer"
bc3c5447e Java-Installer
b125e6b40 Merge "Various getters and setters added to C++. usleep added to the getters that require a little time for solicted response (getPIDF, getIzone, and getFirmwareVers. Tested against the TALON SRX unit test originally written for CanTalonSrx HAL class."
88a043bda Merge "Change Periodic Status rate to 20ms. Jaguar firmware v109 fixes issue with periodic status sending."
c57d01af9 Merge "Add USB IP to deploy fallbacks and make fallbacks work."
6abde412c Merge "Image v20"
5e6cd0bf9 Merge "Implement Joystick Outputs and Rumble (fixes artf3807)"
ec03c3068 Add USB IP to deploy fallbacks and make fallbacks work.
45f3b7610 Fix off-by-one in button checking (fixes artf3861)
dac04cb4a Implement Joystick Outputs and Rumble (fixes artf3807)
7d026be26 Various getters and setters added to C++. usleep added to the getters that require a little time for solicted response (getPIDF, getIzone, and getFirmwareVers. Tested against the TALON SRX unit test originally written for CanTalonSrx HAL class.
5893d28f3 Added support for basic PID in java Talon SRX.
cd0194590 Image v20
36c53667c Require Jaguar version v108 or higher.
ea610eb30 Getters for : AppliedThrotte, CloseLoopErr, Sensor/Ain/Enc Pos and Vel are now signed extended. Before this negative values would not de-serialize correctly. There are some redundant TALON fixes in this particular commit, hopefully it handles ok on Jenkins. Tested with Talon SRX Unit Test (firm 0.34)
d04476bb2 Wired close loop pos and vel to CANTalon::Set(). Did basic testing with close loop pos with talon slaving.
2bb0a32c1 Change Periodic Status rate to 20ms. Jaguar firmware v109 fixes issue with periodic status sending.
cdbe80315 Image v19 This updates the hal headers and ni libraries for image v19. There were very few changes this time around, only some network communications stuff. Also updated the minimum version number in the build properties to the new image version
517e708fd Merge "Reorded network table init to avoid error and added disabledInit to template (artf3841, artf3840)"
70825be69 Reorded network table init to avoid error and added disabledInit to template (artf3841, artf3840)
43532198c Merge "Artifact artf3520 : Need a PDP Clear Sticky Faults API"
4da9ebe1f Artifact artf3520 : Need a PDP Clear Sticky Faults API
9479793e1 Merge "Open scope of several data fields to be able to extend CommandGroup"
20e9f499b Merge "Add hasPeriodPassed function to java, for parity with C++ Timer API"
3d897cef5 Make robot programs deploy as lvuser for correct permissions (artf3860)
fa229f2b1 Added java joystick message spam fix (artf3836)
b1056cf6d Prevented missing joystick messages from coming out more than once a seccond (fixes artf3836)
8e707169a Add hasPeriodPassed function to java, for parity with C++ Timer API
47961c8b1 Open scope of several data fields to be able to extend CommandGroup
b59f4141c Merge "Open scope for gyro methods. Fixes FirstForge artf1699."
d62d82b28 Merge "Feed motor safety when StopMotor is called. Fixes artf1687 on FirstForge."
a9d30c038 Fixed a typo in the SRX sample project to correct a variable name error
6e0c84d94 Feed motor safety when StopMotor is called. Fixes artf1687 on FirstForge.
bb8ea17ac Open scope for gyro methods. Fixes FirstForge artf1699.
c683e24aa Merge changes If51bf61d,Ia6f4997b
7b371f6d7 Added Omar's new CanTalonSRX code.
f6de7bc96 Merge "Java debug launcher no longer waits for text marker to appear in console."
c00d9f152 Updated the names and descriptions for the c++ vision examples
6ec2d262c Added nicer Java interface for Talon SRX -- throttle mode works.
3c8b31608 Merge "Use standard eclipse dialogs instead of Swing dialogs"
29f36b0ea Merge "Overwrite instead of append during version check. Fixes artf3818"
486885e8b Merge changes Id7a97940,I6234fe06
020d97580 Merge "Fixed bug with SDFormat version changing."
28a41e4ac Added support for CAN Talon SRX in C++ and Java.
f590cda8f Merge "match templates with robot builder."
c98f54dbb match templates with robot builder.
81840b2c4 Add a getControlWord() call to the run thread in DS so that the program is kept alive
78ccb48fd Java debug launcher no longer waits for text marker to appear in console.
b9913d3e1 Overwrite instead of append during version check. Fixes artf3818
56430ccd7 Merge "Pipe java program output through NetConsole"
d412584f1 Merge "Tried to improve reliability of a couple of unit tests."
364a3afad Pipe java program output through NetConsole
97456f40f Don't buffer NetComms data and add IsDSAttached() check to C++ IsEnabled() method (fixes artf3747)
7e5ed03d2 Check if Joystick Button exists when requested and pass 0 and warn if it doesn't
14a1e6ae8 Get MatchTime from NetComms (fixes artf2538)
529f5b773 Use standard eclipse dialogs instead of Swing dialogs
91c70daf5 Tried to improve reliability of a couple of unit tests.
e86312cd6 Fixed bug with SDFormat version changing.
99dc3c90e Merge "Removed the tail command"
4ad8818a8 Added vision samples
e4babbe4d Removed the tail command
9ec516407 Merge "Handle cases where no DS is attached (initial m_controlWord, reportError, getAlliance and getLocation) fixes artf3778"
033e5f37b Merge "Add methods for checking Watchdog status, ds status, and brownout status"
e3d256e44 Merge "Change uint to int for channels on constructors which can take a single channel or single pointer to avoid ambiguous calls."
867e4080d Change uint to int for channels on constructors which can take a single channel or single pointer to avoid ambiguous calls.
4be9732e9 Moves C++ global build properties to properties file to match Java. Adds host reachability check and static IP fallback Adds roboRIO Image check Adds JRE check for Java
cd29e1c32 Handle cases where no DS is attached (initial m_controlWord, reportError, getAlliance and getLocation) fixes artf3778
e73b3ed7b Add methods for checking Watchdog status, ds status, and brownout status
d7a979408 Simulator makefiles: Set file extension based on platform
6234fe06f Fix CMakeLists.txt to not be platform specific
c7a90b2cc Merge "Fix write when used with long byte array."
e5443f0e7 Merge "Added in new headers and libraries for image version 18. This image contains a change to fix artf3773, which switched setDataSem to be a pthread_cond_t variable instead of a mutex. As a result, a few new HAL functions had to be exposed over JNI, specifically the functions for MultiWait."
0abe19a1a Merge "Added support for launching a simulation friendly SmartDashboard."
ccd64090b Fix write when used with long byte array.
c6891fc03 Added in new headers and libraries for image version 18. This image contains a change to fix artf3773, which switched setDataSem to be a pthread_cond_t variable instead of a mutex. As a result, a few new HAL functions had to be exposed over JNI, specifically the functions for MultiWait.
6f4d6ed99 Add support for vision in C++
0670ff145 Merge "Using netconsole-host to start programs and get output directed to netconsole and the log file (fixes artf3777, artf3750)"
655ade643 Using netconsole-host to start programs and get output directed to netconsole and the log file (fixes artf3777, artf3750)
7cfa0d04d Added support for launching a simulation friendly SmartDashboard.
f1476be27 Reverted accidental commits
9be6ee471 CANTalon throttle works.
9050ea7e3 Generalize CANJaguar and CANTalon with a CANSpeedController interface in C++
c1f68eb2b Stick the CanTalonSrx code in, get it to compile
fb53eea6b Merge "[artf3749] Repaired undefined behavior in takeMultiWait."
6c294e137 Increase timeout on network table test
988defee1 Merge "Adds the new shared object libraries and headers for image version 17"
279ae1cd9 Merge "Removed remains of the old toolchain method."
49f6b90d1 Merge "Removed the timing option from Iterative Robot Template since it conflicted with its purpose (artf3751)"
6cd5eeab6 Adds the new shared object libraries and headers for image version 17
c883c9e2f Removed release configuration from template (fixes artf3688)
54951c888 Removed remains of the old toolchain method.
739508ff8 Merge "First cut at pulling in riolog plugin."
f67849a9b [artf3749] Repaired undefined behavior in takeMultiWait.
7c5b3c628 Merge "Added the OutlineViewer to distribute with the plugins."
eb536ba34 Merge "Added default world files to examples."
19737ba44 Merge "Implement user API for roboRIO power methods (fixes artf3728 and artf3537)"
9f0bed2e6 Merge "Correct off-by-one error in DigOut PWM Gen B HAL code (fixes artf3705 for C++/Java)"
86e4c3b77 Merge "athena-deploy now calls the clean step to deal with a known ant issue where it does not detect changed constants. This addresses art3766."
e216d1abd Merge "Fix all the samples to build with the C++11/14 language features (constexpr)"
20aeb5c6c Added the OutlineViewer to distribute with the plugins.
3ad31dd4d Implement user API for roboRIO power methods (fixes artf3728 and artf3537)
4c5b8c8c4 Correct off-by-one error in DigOut PWM Gen B HAL code (fixes artf3705 for C++/Java)
747cdc8a5 Updated an incorrect voltage constant for the 5V input rail, and added parenthesis to make the order of operations explicit. Fix for artf3728
c3c7baa15 Removed the timing option from Iterative Robot Template since it conflicted with its purpose (artf3751)
2fdb7c8eb athena-deploy now calls the clean step to deal with a known ant issue where it does not detect changed constants. This addresses art3766.
1d0a6b8ac Fix all the samples to build with the C++11/14 language features (constexpr)
08fdf45f6 Added default world files to examples.
733847119 First cut at pulling in riolog plugin.
da0cc0c83 Merge "Fixes for 0 based joysticks and joystick axes in simulation."
6e0637e77 Merge "Upped the limits for the output on some PID tests."
8d49d8255 Merge "Move SerialPort to HAL and add SerialPort support for Java Squashed commit of the following:"
3b53f84c8 Fixes for 0 based joysticks and joystick axes in simulation.
05bb3cdd7 Upped the limits for the output on some PID tests.
18de3aebd Make sure the whole JVM exits if an exception is thrown. This prevents the DS thread, NT thread or any additional user thread from keeping the program alive when the main thread exits (fixes artf3743)
de5e5ab40 Merge "[artf3709] Fixed PIDController loop timing."
6b6e5d953 Move SerialPort to HAL and add SerialPort support for Java Squashed commit of the following:
fa20e6ca4 Check for fatal interrupt status on multiple interrupt methods to avoid hanging program (fixes artf3602)
e56aa87af Merge "Change Talon to use 1x update rate (fixes artf3733)"
63bb8e1f3 Merge "Remove unimplemented sendErrorStreamToDriverStation method (fixes artf3617)"
c1e63acc1 Merge "Use ByteBuffer for conversion from raw sensor bytes to Java types (fixes artf2673)"
68ba9bfea Merge "Detect projects which are duplicates on Windows due to casing (fixes artf3487)."
aa643d8ba Merge "Update Interrupt Javadocs (fixes artf3492 and artf3602)"
1f8a3d5bf Merge "DigitalInputs are now automatically added the LiveWindow in both C++ and Java"
2fa04c175 Merge "Don't raise exception for Joystick axis/POV out of active range. Shorten error message and change to Warning (filtered by DS by default)"
cd3db9631 Merge "Move user program to home\lvuser based on comments from Joe"
8ccb99d87 Merge "Added ignore support for intellij"
b14ca0847 Merge "[artf3717] Added isEnabled to Teleop Loops in Samples."
b898cec90 Change Talon to use 1x update rate (fixes artf3733)
687e2c671 [artf3709] Fixed PIDController loop timing.
594d0d802 Use ByteBuffer for conversion from raw sensor bytes to Java types (fixes artf2673)
0f825b717 Added ignore support for intellij
345ceafa0 DigitalInputs are now automatically added the LiveWindow in both C++ and Java
b030be68d Detect projects which are duplicates on Windows due to casing (fixes artf3487).
fba155804 Update Interrupt Javadocs (fixes artf3492 and artf3602)
97f954aef Remove unimplemented sendErrorStreamToDriverStation method (fixes artf3617)
80194e980 Merge "Added message to notify when simulation is unsupported."
767686ae2 [artf3717] Added isEnabled to Teleop Loops in Samples.
7f30b6bff Don't raise exception for Joystick axis/POV out of active range. Shorten error message and change to Warning (filtered by DS by default)
8c395ca29 Move user program to home\lvuser based on comments from Joe
5b2520c35 Merge "Fixed building of the frcsim-libwpilibsim-cpp deb."
fa8d7b843 Fixed building of the frcsim-libwpilibsim-cpp deb.
93100c0e6 Merge "Increases the runtime of the PID test to improve stability."
b80565d06 Merge "Decreases the amount of console spam during tests."
2d45cda74 Increases the runtime of the PID test to improve stability.
e4d90c6cb Decreases the amount of console spam during tests.
18bdb7fde Merge "Added C++ Encoder samples to Eclipse Plugin."
f6e8db50f Merge "Fixed New Project Wizard to have a radio option always selected"
20c60a5fe Added C++ Encoder samples to Eclipse Plugin.
66b7a8b66 Merge "Use either DO PWM A or B not A and B and update javadoc to reflect 6 generators (artf3698)"
8ebf88b74 Java DriverStation.InTest: Set correct flag.
b85b0c8eb Merge "Keep Notifier firing after FPGA rollover (fixes artf3582), simulation may still have an issue with counter rollover"
c58fde19f Increase the number of joystick ports to 6.
003dc0dc2 Pass errors to DS in C++ and Java
26419ec20 Don't use "final" in command-based template RobotMap.
383439369 Merge "Improves the general stability of the CANJaguarDefault tests"
97be9765c Changed the version to include time to fix issue with replacing.
0881ac0b2 Fixed issue where plugins don't show up on some installs.
1b7e5970f Merge "Added C++ sample for CAN monitoring of PDP."
bc84c7ac7 Improves the general stability of the CANJaguarDefault tests
fc34b9b80 Merge "Aggregate javadocs and use JavaFinal docs when building plugins (fixes artf3533)"
9af070a4a Added C++ sample for CAN monitoring of PDP.
93925bc02 Fixes the GyroTest
132804a4c Updates the test scripts to prevent a race time condition
9e6d68367 Merge "Increases tolerances for the PID tests"
f7e8b95a2 Increases tolerances for the PID tests
213e73c43 Merge "v16 Image"
455654a95 Merge "Fix joystick issues [artf3707]"
261b1857c make getControlMode public. Was public in 2014.
f3fe64a60 Keep Notifier firing after FPGA rollover (fixes artf3582), simulation may still have an issue with counter rollover
f108853e1 Merge "Added sample programs for Solenoids and Relays."
a56c0eb4a Fix joystick issues [artf3707]
8c01e9065 Fixes a bug with the test stand launch script
be30d3ab1 Fix CANJaguar brownout recovery in Java
53255a764 Merge "Relay: Allow "On" state to be set via SmartDashboard."
3abd352be Added sample programs for Solenoids and Relays.
70be534fe v16 Image
e677d52a2 Increases the allowed runtime for two network tables tests
62790c0f4 Use either DO PWM A or B not A and B and update javadoc to reflect 6 generators (artf3698)
cd75dc71e Merge "Recover from signals in Wait() [artf3495]"
a381b60e3 Merge "Added sample program for Motor Controller."
311a69026 Added sample program for Motor Controller.
a2f015c25 Merge "Dynamically generates tools zip file."
5c26b37d3 Dynamically generates tools zip file.
8dba364be Recover from signals in Wait() [artf3495]
76f9b3bbc Merge "Adding stdint.h to the Joystick.h makes the indexer work (fixes artf3505)"
bbeb0084a Merge "Set RobotBase instance in constructor [artf3652]"
e51c3daf0 Set RobotBase instance in constructor [artf3652]
dc89ec673 Adding stdint.h to the Joystick.h makes the indexer work (fixes artf3505)
fc7c01582 Fix warnings for javadocs
c52e29432 Merge "make preferences check for [ and ] in key"
53d50f470 Merge "updted licesne strings in eclipse plugins"
ca303e016 Merge "fixed template on checkedin java examples"
042a1dbc8 make preferences check for [ and ] in key
3c91de56d Merge "Fix segfault in DIO PWM generators [artf3653]"
0c2f3c19c Merge "Fix Java Joystick.getPOV()."
023d20abc Fix segfault in DIO PWM generators [artf3653]
5c702edd8 Support for pushing NetworkTables (java) to the maven repository.
d90bbc195 Merge "Removed vestigial POM file from NetworkTables"
3365d0dc1 Fix Java Joystick.getPOV().
615d62a21 Relay: Allow "On" state to be set via SmartDashboard.
78988584e Removed vestigial POM file from NetworkTables
294e224fc Merge "allow installation on eclipse 3.8 (ubuntu 14.04)"
436c92961 Merge "Add new joystick features"
341abbfaa Merge "Run the scheduler in disabled (fixes artf3631)"
eab34bbb8 Merge "Add SD methods with default values to match Java (fixes artf3648)"
5db532079 Merge "Add method to get Device ID to Can Jaguar (fixes artf3613)"
54eaa913f Merge "Make Java ignore section headers in Preferences file and start file with [Preferences] to match C++ (fixes artf3629)"
8a541a67c Add new joystick features
7fa0eea49 Merge "ADXL345_SPI: Report usage."
cc431354b Merge "Counter::setUpSource(AnalogTrigger): actually set the source."
65c10cd46 Aggregate javadocs and use JavaFinal docs when building plugins (fixes artf3533)
fea52a77a Add SD methods with default values to match Java (fixes artf3648)
4e31b6800 Add method to get Device ID to Can Jaguar (fixes artf3613)
f99b57b1f Run the scheduler in disabled (fixes artf3631)
dad3b68f3 Make Java ignore section headers in Preferences file and start file with [Preferences] to match C++ (fixes artf3629)
08c872317 Merge "Add error message to new project wizard if project already exists"
ce768ae34 ADXL345_SPI: Report usage.
217c50c28 allow installation on eclipse 3.8 (ubuntu 14.04)
fcc8230db Counter::setUpSource(AnalogTrigger): actually set the source.
d2c1bc174 updted licesne strings in eclipse plugins
6fe638e97 Fixed New Project Wizard to have a radio option always selected
07837c4ab fixed template on checkedin java examples
daee45780 Added additional NI libraries to make C++ builds work
807948282 Create HOME on windows
0b828eec6 Merge "Disable CANJaguar current PID test"
49e06bd13 Merge "Move interrupt methods to InterruptableSensorBase"
eca4d36a4 Disable CANJaguar current PID test
4d2a720f4 Move interrupt methods to InterruptableSensorBase
591e1de72 use WPILIB eclipse var & use luna to build
dc09233fc Merge "void* -> void by creating proxy fuction"
037d3b2fb void* -> void by creating proxy fuction
a3995a202 Fix bitfield indexing on PWM Latch
a71f07ed6 Merge "HAL: build shared library as well as static library."
cb81aa6fe Merge "Update headers and .sos to v15 image + most API changes"
ace43a6a1 Merge "DigitalOutput: Fix enablePWM()."
a4e8d65b7 Merge "Relay: In free(), set both forward and reverse to 0."
bfd88f1da Reserve network communications
a65cb500f Relay: In free(), set both forward and reverse to 0.
f27df43b5 DigitalOutput: Fix enablePWM().
7e9f183cf Update headers and .sos to v15 image + most API changes
2f2636139 Added Mecanum drive sample program
52ecbd38a HAL: build shared library as well as static library.
6089722c4 Merge "Too many bugs with LTO in GCC 4.9 & Binutils 2.24. Disabling. Maybe later."
244ecd23e Too many bugs with LTO in GCC 4.9 & Binutils 2.24. Disabling. Maybe later.
8aeacac30 Set Start Mode to remote to allow Debug As->WPILib Deploy to launch without error on Windows
45021c7f3 Merge "Figured out the madness: not launching properly (no copy)"
857a1abb0 Merge "Prevent leading zeroes in team number and warn user about them (fixes artf3429)"
c11f194cb Merge "Allow dataRecieved to be null in I2C transaction (fixes artf3603)"
8b806e11e Added Arcade C++ example and a hierarchy for C++ examples.
ba5111b99 Add a Motor Controller example java program
88bf4ee56 Merge "Added a hierarchy of example categories that looks very much like what's in LabVIEW and placed the one project in a bunch of categories as a proof of concept."
76295a574 Fix eclipse launching of tools (SmartDashboard, sfx, OutlineViewer, and RobotBuilder)
90a106ccf Added a hierarchy of example categories that looks very much like what's in LabVIEW and placed the one project in a bunch of categories as a proof of concept.
0fcef9490 Whoops, need to change the joystick port assignments to be zero based on the sample program.
3f38f3e84 Added a tank drive example for java
64abdb822 Allow dataRecieved to be null in I2C transaction (fixes artf3603)
aaa7eabd0 Prevent leading zeroes in team number and warn user about them (fixes artf3429)
1cef27134 Changed joystick port numbers to be zero-based for C++ and Java.
aaab77cdb Figured out the madness: not launching properly (no copy)
7e2c68214 Set debug flag user to lvuser to allow it to be deleted (fixes artf3415)
ad906da67 Merge "Squashed commit of the following:"
a6ea51ad0 Fix simulator builds (and don't clean, dh does that also)
d72ee199f Squashed commit of the following:
19b2d0523 Fix simulator builds (dh knows how to CMake)
26d789b89 Copy to the correct folder name
f50b05845 Merge changes I6b5d2767,I6f4b94d1,Iada981fc
39da9d67b JNI should ignore -lfrc and installing the new ld scripts
b6475d050 Renaming and merging WPILibC++ into Devices and simulator files
295f212c8 Change digital input to return boolean values to match Java
fa4a39dcc Initial linker script to abstract away the massive library list
66c653a21 Get the simulator build to accept c++11 languge
340a3d492 Fixing pedantics and using RTTI for command name
6710ac3a2 fixing all warnings and making sure they will stay fixed
9e62e60e6 Merge "Remove CPP Preferences page from WPILib preferences (code has already been deleted)"
e6c56e444 Modified simulation debs to exclude building the toolchain.
35f1aded6 Merge "Change RobotState functions to return actual values (this time with nullptrs) [artf3611]"
4904e1dc2 Change RobotState functions to return actual values (this time with nullptrs) [artf3611]
28b9c18e2 Merge "Add a getDeviceNumber method to CANJaguar"
a548b14b7 Add a getDeviceNumber method to CANJaguar
323022acf Remove "using namespace std;" from headers
1bcdd301e Merge "Fix changes where the default value was always being returned for many of the robot state status functions."
21f728c80 Moving to arm-frc-linux-gnueabi in cproject and attempting to use gdb (overwritten)
49d440ecc Merge changes I4f5a36e6,I248d27cc,I55769599,I7688b8cd
00486e2ec Fix changes where the default value was always being returned for many of the robot state status functions.
a3115dac1 Removing Toolchains!
1f35670a1 Enabling C++14 and removing path for new toolchains
d1d81e5e1 Remove unnecessary config for cproject/Simulate target
a7b166e3f Remove CPP Preferences page from WPILib preferences (code has already been deleted)
6c28e0966 Updated bootstrap file to install the new toolchains
8199fb28d Updating template .cproject to avoid specifiyng commands and defaults Fixes unknown GCC errors (supposedly)
f2920fd77 Enable C++14 and Wextra
ebd9667ba Expose and fix error where old subsystems were being referended after use in tests
3f0f7931b Changing cmake to test the tests (Jenkins)
cad83ed3c Bump the version number for the windows toolchains to force them to reload.
62d657942 Add missing semi-colon to cproject file
1d7b17a2b Merge "Add quotes around linker flag path to libs (fixes artf2390 / artf3453)"
738859c4e Fixed bug where mac toolchains always reinstall on Eclipse start
127ff0ac0 Fixing extraction recursion: use provided version
472f51fc7 Add version=current to global wpilib.properties file on any property save
887a4e94f Add error message to new project wizard if project already exists
0f0850ca9 Merge "Update to v14 headers and libraries"
ab27f795b Update to v14 headers and libraries
b16a03775 Store preferences in a directory writable by lvuser
1e812ac4d Added comments to the compressor class per artf3527.
ecc6815f6 Merge "Fix status buffer allocation in SolenoidBase"
ca9f5a676 Merge "Make all channel errors throw IndexOutOfBounds"
debf9e0ee Make all channel errors throw IndexOutOfBounds
15abbb36c Fix status buffer allocation in SolenoidBase
d9b974300 Add quotes around linker flag path to libs (fixes artf2390 / artf3453)
e60baf41a Added the "version=current" property to allow projects to correctly reference the updated installation
09cb3a22c Merge "Change the tail command for capturing the logs on deployment to check the file every second instead of continuously to avoid the 100% CPU time problem from artf3524"
27ecd3583 Change the tail command for capturing the logs on deployment to check the file every second instead of continuously to avoid the 100% CPU time problem from artf3524
ff6d18030 Revert "Fixing java version number to be current"
410b739c2 Fixing java version number to be current
2144b853d Set the cpp-version variable per-project
f87c517e6 Merge "Remove Version number from zips"
77dac9bd7 Remove Version number from zips
56cf287b3 Merge "require pthread and rt lib for Itests"
dc970d9a6 require pthread and rt lib for Itests
da2ea9ea8 remove/fix references to cRIO documentation. Edited comments related to sidecar, breakout, 9472. Some references were to unused methods in simulation that were removed.
b1ace7937 Fixes the MotorEncoderTest sometimes failing because a counter registers movement from the jaguar after reset.
2a8ade093 Adds the ability to run test classes with --repeat rule.
b7458e7ba Merge "Make Talon the default speed controller for RobotDrive"
3fddee51c Make Talon the default speed controller for RobotDrive
21967fcb2 Merge "Fixes testing framework typos & adds rule to keep unix line endings for .sh"
9b896eab7 Make DoubleSolenoid work in Java [artf3457]
f439adc2a Merge "fix for Artifact artf3431 : Solenoids initialize to random/arbitrary stat"
67cb85467 Fixes testing framework typos & adds rule to keep unix line endings for .sh
ef7c55402 Merge "Wrap CPP Lib and Include paths in quotes (fixes artf2390)"
359b4ec86 Merge "Added support for 32-bit builds."
21153fc63 Merge "Fix artf3476 move RobotState and HLReporting implementation set to somewhere they will get called"
daa8bd67e Added support for 32-bit builds.
e5e568fa7 Wrap CPP Lib and Include paths in quotes (fixes artf2390)
c9f6fcd96 Fix artf3447 Java only runs teleop - Correct off by one error in Control Word compares
778620b0a Fix artf3476 move RobotState and HLReporting implementation set to somewhere they will get called
d58c6f0c0 Merge "Kill program before debugging C++ so file upload doesn't fail"
a14d85421 Cpp tests without color for jenkins. Fixes startDS to not kill the driver station.
c5fc1dc5b Merge "Change SampleRobot template to use 0 based PWM"
cded5351d Test scripts have permission to run and fixes sshpass.
47169e0ce Adds test scripts to deploy, run and retrieve results from integration tests.
4ef798a0c Merge "Updates gitignore to use a file generated using http://www.gitignore.io"
7ec8d4e9a Updates gitignore to use a file generated using http://www.gitignore.io
17e7fc8f2 fix for Artifact artf3431 : Solenoids initialize to random/arbitrary stat
023f955a5 Change SampleRobot template to use 0 based PWM
52e358c18 Merge "Add Preferences to simulation"
7638e2b6e Kill program before debugging C++ so file upload doesn't fail
f9ab84d91 Integration tests now run with the Ant Junit test framework.
04fadb85f Add Preferences to simulation
698b371b1 Merge "Add OI and RobotMap files to Command Project template (fixes artf2407)"
6dde2c2b4 Merge "Adds interrupts to Java"
8ba0eada1 Adds interrupts to Java
bf5eaf657 Add OI and RobotMap files to Command Project template (fixes artf2407)
3baaea5a4 Squashed commit of the following:
2cc937f5e Fixes debugging in Java
23b6a980c Merge "Uses ${ant.java.version} for javac when compiling"
89b80db2d Merge "Fix PIDError property"
1f27d3688 Fix PIDError property
125dfac8b Merge "Fix Java IT build"
4215d1c79 Fix Java IT build
dddba82d1 Fix artf3337 - add include to define int32_t in CounterBase.h
78e2a8d1b Uses ${ant.java.version} for javac when compiling
687bc44ae Add new CTRE classes and update PDP tests
c82a94b26 Merge "Make Java tests run with TestNG"
d407fe546 Merge "Fixes for simulation parallel builds."
699949fdf Fixes for simulation parallel builds.
6d8997401 Make Java tests run with TestNG
e52315750 Merge "Fixed bug with joystick buttons/axes out of range."
3eba1c468 Merge "Add delays to make C++ ITs more reliable"
d466d17ed Add delays to make C++ ITs more reliable
9dfd6bde9 Adds a Vagrant configuration file and setup script
eded28ebf Fixed bug with joystick buttons/axes out of range.
c68ee3001 Added message to notify when simulation is unsupported.
777dc2113 Merge "Updated installer to point to the new location."
174f2c0e2 Merge "Increased build speed + caching of debs."
434caf81d Merge "Add back SampleRobot Template Add GettingStarted example based on IterativeRobot"
932717006 Merge "Beginning of gradle conversion."
597e209c0 Add back SampleRobot Template Add GettingStarted example based on IterativeRobot
ad1ace102 Increased build speed + caching of debs.
70d09de2e Fixed frcsim script to have the proper LOAD_LIBRARY_PATH.
f7e1753e0 Fix C++ linker settings
df3f3cc0e Updated installer to point to the new location.
25308e244 Beginning of gradle conversion.
6b3e2690d Fixed placement of libWPILibAthena.a
ae10d4390 Fixes for examples and Gazebo 3.1.
d4e377fc0 Merge "Adds the Trigger template and adds WPILib.h import to all templates"
9126646fe Adds the Trigger template and adds WPILib.h import to all templates
d3f632486 Merge "Added support for Jenkins to generate doxygen."
268459206 Added support for Jenkins to generate doxygen.
df390c275 Merge "Merged sources in wpilibJavaFinal."
1742634a9 Merge "Fix the example programs"
0f8f83500 Merged sources in wpilibJavaFinal.
d5c73c95d Fix the example programs
ca7dc5d6a Removed excessive linking.
66e1f2a18 Fixed a few bugs with C++ due to the merge.
1301d76d6 Fixes for HLUsageReporting due to Jonathan's exceptions.
a72ea14f9 Removed Simple Robot template option
14b2f1466 Merge "Implement DriverStation::GetBatteryVoltage"
d2cd5f357 Implement DriverStation::GetBatteryVoltage
7ecde3a33 Merge "Fix the default C++ linker settings"
81143fc53 Merge "Adds Exception throwing the basic robot systems are not properly initialized."
c58a86a3a Fix the default C++ linker settings
2f655bb49 Merge "Fixed bug with plugins not including all simulation dependencies."
657054c9e Fixed bug with plugins not including all simulation dependencies.
f4d542b21 Add FakeEncoderTest for C++
8db11a4c6 Fix to deal with the certificates on collabnet having expired.
14d784bca Fix import, resolves artf3339
7c8124d76 Allowed sharing of common C++ code between RoboRIO and Simulation.
b371600f0 Merge "Completed artf2675 - rename SimpleRobot -> SampleRobot."
6c3b002a8 Merge "Refactors the CANJaguar tests to be more straightforward."
0f9324764 Completed artf2675 - rename SimpleRobot -> SampleRobot.
54439e719 Refactors the CANJaguar tests to be more straightforward.
5b8279f40 Remove old driver station code
8abbcf53f Update to the v13 headers and libraries
b8eeeabbb Merge "Removes encoder.start() from the example programs"
9a2bd8c49 Removes encoder.start() from the example programs
4db634b34 Fix PCM channel indexes
57e670c18 Merge "Move PWM allocation to HAL to allow for checking against DIO allocation Re-number MXP DIO to match pinout (include SPI and I2C pins) (fixes artf2664) Change PWM MXP mapping to accommodate DIO re-mapping This re-implementation also fixes artf2668 for C++ and Java Change the test bench to reflect this change also"
59473ab7a Move PWM allocation to HAL to allow for checking against DIO allocation Re-number MXP DIO to match pinout (include SPI and I2C pins) (fixes artf2664) Change PWM MXP mapping to accommodate DIO re-mapping This re-implementation also fixes artf2668 for C++ and Java Change the test bench to reflect this change also
d1d4c7521 Merge "Fixed interrupt freeing in C++"
2356008d8 Fixed interrupt freeing in C++
deb335d96 Fixed DoubleSolenoid, added a double solenoid test
1ce03b9c4 DoubleSolenoid works in C++ now
a09f75934 The output range can be set on a PIDSubSystem
aab98c063 Adds Exception throwing the basic robot systems are not properly initialized.
741e28b85 Merge "Added version numbers to maven plugins"
f817f6d04 Added version numbers to maven plugins
7442a7ed7 Merge "Only update FRC Java Projects (fixes artf2627)"
765198f5f Merge "Updated some comments that mention the cRIO"
ed08ab298 Fixed voltage range checking and error message
4b22742cd Merge "Cleaned up C++ compiler warnings"
45f93e9ab Merge "Added support for building debs on jenkins."
049377c9e Added support for building debs on jenkins.
f4ace4a36 Cleaned up C++ compiler warnings
9ff420547 Updated some comments that mention the cRIO
1be31431b Merge "Removed the User LED functions"
32cafd0ef Removed the User LED functions
0216d1b33 Merge "Gyro deadband defaults to 0"
43c566bd8 Gyro deadband defaults to 0
b86c74722 Only set up once in the C++ tests
60a3fd069 Added gyro deadbands
b86c11493 Only update FRC Java Projects (fixes artf2627)
14f201cd3 Merge "getAnalogAverageValue should use a 32-bit int"
c49ea255b getAnalogAverageValue should use a 32-bit int
065e1c24e Update plugin menu text and make template menu options only show for correct language (fixes artf2408)
ecdb77e4b Update plugin target to use mDNS (causes Java debug to now use mDNS)
10aad6d1c Merge "Fixed a few more small TODOs"
e73c8d06e Fixed a few more small TODOs
dc341a448 Fixed a few simple SmartDashboard FIXMEs and TODOs
d521eb79b Analog interrupts in C++
f57a2dc5a Merge "Change deploys to use MDNS and to retry tail on missing file (fixes artf2663)"
7006d1ebc Change deploys to use MDNS and to retry tail on missing file (fixes artf2663)
c32e5707d Merge "Remove extra semi-colon"
c27da3587 Merge "Added an interrupt test for C++"
f18cccbc3 Remove extra semi-colon
b91b68143 Added an interrupt test for C++
b26667f86 Fixed the PCM test solenoid numbers
792e3b6cc Removed modules from the HAL and JNI bindings
fd4379a94 Makes the Counter.Mode an enum and adds Null Checking
a40cdf519 Implements the AnalogTriggerType as an enumeration
ba4e74d29 AnalogTrigger support in Java
38583789b Fixes the TiltPanCamera test (now GyroTest)
45e43b627 Merge "Changes the name of the AccelerometerTest to BuiltInAccelerometerTest"
e837d9083 Changes the name of the AccelerometerTest to BuiltInAccelerometerTest
e0e2b498a Merge "Accumulators wait for the next sample after reset"
8fe888dbc Accumulators wait for the next sample after reset
41bb0da4e Merge "Fixes bugs with the Gyro"
97ade3606 Fixes bugs with the Gyro
2735406bf Merge "Added a Java internal accelerometer test"
ab04e19aa Added a Java internal accelerometer test
a58288ae6 Merge "Refactors the RobotBase Setup into a method."
7905259e2 Refactors the RobotBase Setup into a method.
f018689d0 Merge "Completed artf2662: removed Start()/Stop() in Encoders and Counters."
0bb13d86e Completed artf2662: removed Start()/Stop() in Encoders and Counters.
526df3679 Merge "Added a C++ Preferences test"
d8da3e5f1 Added a C++ Preferences test
c0af23505 Removes the dependency-reduced-pom.xml from the repository.
7f6ca6824 Merge "HALInitialize should be the first thing called"
231bb55b2 HALInitialize should be the first thing called
76e488061 Removed cRIO tests, NetBeans stuff, and Ant stuff
5e8ea3846 Merge "Fixes the PDP test."
a5b72d62a Remove the last obsolete interface
a5e15b16f Fixes the PDP test.
264c38a67 Merge "Removed the old "parsing" interfaces"
20de3abe8 Merge "Updates the TimerTest to give a clearer output."
3536d4783 Updates the TimerTest to give a clearer output.
60a294fba Removed the old "parsing" interfaces
dc42a1129 Merge "The LiveWindow instance isn't a global static"
386dc1f16 Added AnalogTrigger tests
038478e43 The LiveWindow instance isn't a global static
26e90a988 Merge "Adds/Updates CANJava Testing Framework."
d5cd47bfa Merge "Minor updates to the C++ CANJaguar ITs"
1e35ef780 Adds/Updates CANJava Testing Framework.
65607b5bc Merge "Fixed CANJaguar::GetOutputVoltage for negative voltages"
30c0cc056 Minor updates to the C++ CANJaguar ITs
92bd69741 Fixes a bug where the testing framework would never set the implementation for the libraries.
ed0df5432 Fixed CANJaguar::GetOutputVoltage for negative voltages
6deb196e9 Support for the "USER" button on the RoboRIO
8b612f713 Merge "CANJaguar::Disable stops periodic setpoints"
d66bafb68 CANJaguar::Disable stops periodic setpoints
78d2ccd29 Merge "Added stack traces and better error reporting in C++"
06d59447b Merge "Adds missing Javadocs and @Overrides annotations to the PIDController in Java"
3475a4a8c Adds missing Javadocs and @Overrides annotations to the PIDController in Java
6af242b55 Merge "Fixes for javadoc eclipse plugin."
c72e70439 Fixes for javadoc eclipse plugin.
89fe909ae Added stack traces and better error reporting in C++
c1d8e4ef4 Make AnalogInput PIDGet return an average voltage. artf2391 for Java. Equivalent to Ia7f06ca2 Previously it returned a raw value instead of a voltage.
338120c3a Merge "Fixed wpi_setErrnoError to print the error name"
a7efbe0d7 Merge "Fixed Preferences in C++"
4c7828030 Merge "Correct voltage range in javadocs for RoboRIO"
5a3889a3a Correct voltage range in javadocs for RoboRIO
2fd4964b6 Merge "ADXL345_I2C: Make constructor explicit."
6ae639454 Merge "AnalogPotentiometer: Make constructors explicit."
310151132 AnalogPotentiometer: Make constructors explicit.
7f4e1e39a ADXL345_I2C: Make constructor explicit.
eebdc3d20 BuiltInAccelerometer: Add virtual destructor.
980ea96b0 Fixed Preferences in C++
1038f98e8 Fixed wpi_setErrnoError to print the error name
326aa2e85 Fixed a typo with the tGlobal commit
6071fc7fb Fixed CANJaguar percent scaling issue [artf2637]
f958b65ba CANJaguar can be disabled [artf2647]
f4f7588cf Merge "A few small changes to the C++ ITs"
80ecff6bd Merge "AnalogInput::PIDGet returns an average voltage[artf2391]"
e487c950e Merge "Only create one tGlobal object"
191e9d5d6 AnalogInput::PIDGet returns an average voltage[artf2391]
40fc8326a Only create one tGlobal object
fdbe750d3 A few small changes to the C++ ITs
3ec797a8c Updates the CANJaguar to free itself before throwing an exception in the constructor. This allows it to be allocated later without throwing an Allocation exception.
78e6cf720 Updates the AbstractComsSetup message to report JUnits multiple exceptions correctly. Adds a simple logger to the AbstractComsSetup that prints messages to the console based on the log level. Replaces all System.out prints with TestBench.out()
2481e98bc Fixes a deallocation of the Relay resource when calling free. Changes fake "Enum Classes" into real Enumerations
c81d510eb CANJaguar::ChangeControlMode marks the controlmode as unverified
3fb415910 Merge "Added missing call to m_ds.waitForData()"
2e1bd171a Added missing call to m_ds.waitForData()
25e7a077c Merge "Implemented FRCSim artf2628, fixed bugs in non-sim Relay.java and sim PWM.cpp."
dc48dc7f7 Implemented FRCSim artf2628, fixed bugs in non-sim Relay.java and sim PWM.cpp.
2dd45c3ea Fixed FRCSim artf2619, and misc reformatting.
461e35948 Merge "Remove the Kinect code from C++"
78dac49cf Remove the Kinect code from C++
66ba9a728 Fixed some bugs with CANJaguar verification in Java
c3d1e80a6 Merge "Fixed some bugs with CANJaguar verification in C++"
01ca19f78 Merge "Added a Jaguar brownout test in C++, cleaned up some C++ tests"
202bfb295 Added a Jaguar brownout test in C++, cleaned up some C++ tests
b0369342e Fixed some bugs with CANJaguar verification in C++
26d101caf Restructure WPILibJ to share code.
e84e0ebab Updates the TestBench to use parameters to run specific test methods or test/suite classes. Updates the test bench to only print "Waiting for enable" on one line with a counter. Updates all SubSuites to extend the AbstractTestSuite class. Also includes a small set of tests to prove the validity of the base AbstractTestSuite
0704a697c Merge "Updated the C++ TiltPanCameraTest"
13f97bb6e Merge "Added an Accelerometer interface"
5eddb69aa Updated the C++ TiltPanCameraTest
41c2b9402 Added an Accelerometer interface
99632e003 Merge "Fixed the Command-Based Robot template [artf2550]"
fe12394c9 Fixed the Command-Based Robot template [artf2550]
fbf196763 Merge "Removed AnalogModule, DigitalModule, and Module from C++"
b5fb35c0c Removed AnalogModule, DigitalModule, and Module from Java
48e8b2136 Merge "Add support for downloading models hosted on FIRSTForge."
e962c770b Merge "Fixed installation of frc_gazebo_plugins and a few minor fixes."
1b7a352cb Add support for downloading models hosted on FIRSTForge.
1a77cea13 Removed AnalogModule, DigitalModule, and Module from C++
afa39deec Fixed installation of frc_gazebo_plugins and a few minor fixes.
f27e16735 Adds resource tracking to CANJaguar in C++
d8a5ced01 Merge "Fixes a bug with ErrorBase where the correct error code would not be set when using wpi_setWPIErrorWithContext()"
8fe606a4b Fixes a bug with ErrorBase where the correct error code would not be set when using wpi_setWPIErrorWithContext()
6053a0cc2 Added BuiltInAccelerometer in Java and updated C++
be106b352 Merge "Added a C++ built-in accelerometer class"
ebaf2ef05 Merge "Added HAL methods for using the built-in accelerometer"
9f1a9a07c Added a C++ built-in accelerometer class
ec2a455bc Added HAL methods for using the built-in accelerometer
3d740a9a2 Adds Resource tracking to CANJaguar
1dd1e0be1 Merge "Adds a Unit Test for the Resource object in Java. Fixes a bug in the Resource class caused by allocating a negative resource value."
437e3ff26 Adds a Unit Test for the Resource object in Java. Fixes a bug in the Resource class caused by allocating a negative resource value.
f373c8708 Merge "The camera fixture tests now include an SPI accelerometer test"
54a657a7d The camera fixture tests now include an SPI accelerometer test
60d8508a6 Fix artf2636 Don't consume ByteBuffer when checking class specific status
02a28c8f0 Add allocation checking for I2C MXP. Update DIO counts in Lib layer until resource checking moves down to HAL
b12882897 Update Digital Pin count to reflect full 16 DIO on MXP
1a1a12316 Remove JNA hack no longer being used
d0fdb3e70 Merge "Port SPI to roboRIO. Java SPIDevice renamed to SPI and rewritten to match C++ API."
5d2e20eae Merge "More CANJaguar integration tests"
fc0eb4e95 Adds/updates the documentation for the CANJaguar Classes for C++ & Java. Also removes private unused methods in Java and an unused constructor.
968b69d37 More CANJaguar integration tests
343c7f4f3 Port SPI to roboRIO. Java SPIDevice renamed to SPI and rewritten to match C++ API.
80c5c09f7 Merge "Encoders and counters work on the MXP"
cb9df310d Encoders and counters work on the MXP
f566c087d Fix a few wrong messages in CANJaguar
7ca1b498e Merge "Added generic CAN methods to the HAL"
8bba58b9a Added generic CAN methods to the HAL
8ae64a12e Removed modules from the simulation infrastructure and refactored FRCPlugin.
3b4718fc9 Merge "Fixed FRCSim artf2609 - double ports handled wrong."
5800af49b Merge "Fixed FRCSim artf2599."
63fc4f6cf Merge "Makes the tests take parameters at runtime so that you can selectively run a suite without having to run the entire framework."
8b770ffb4 Makes the tests take parameters at runtime so that you can selectively run a suite without having to run the entire framework.
55fde6b61 Fixed FRCSim artf2609 - double ports handled wrong.
5ddacb43c Fixed FRCSim artf2599.
65c3c0ba0 Merge "Updated the HAL, wpilibj, and wpilibc for PCM and PDP"
fc3ed33f7 Merge "PDP and PCM updated to rely on CtreCanNode parent class, which uses new CAN API. CtreCanNode registers the periodic tx messages and provides an rx function to child classes for easy getters and setters. Some template magic to make the PDP and PCM getters/setters easy to stamp out."
255a3a5b1 Updated the HAL, wpilibj, and wpilibc for PCM and PDP
0ef5c3adf PDP and PCM updated to rely on CtreCanNode parent class, which uses new CAN API. CtreCanNode registers the periodic tx messages and provides an rx function to child classes for easy getters and setters. Some template magic to make the PDP and PCM getters/setters easy to stamp out.
37ebcabc4 Merge "Fixed periodic voltage status message"
244ee8d92 Merge "Fixed C++ deploy in Eclipse"
b97d2eb0c Fixed periodic voltage status message
ae8d22b0f Fixed C++ deploy in Eclipse
ff8016c08 Merge "Fixes CounterTest for C++"
f0fb3023a Merge "CANJaguar uses periodic status updates [artf2621]"
1d33edffe Fixes CounterTest for C++
5bd546f1f CANJaguar uses periodic status updates [artf2621]
d8003899f Merge "Fixed FRCSim artf2615: added more thorough cleaning system to Makefile."
f7bb5cd8f Merge "Re-tuned PID for PacGoat."
4f2d1d9d3 Fixed FRCSim artf2615: added more thorough cleaning system to Makefile.
981f941ca Changed .gitattributes to keep Unix line endings in the robot scripts
5ca2506a7 Merge "Fixed Java deploy script"
25f65a158 Merge "Java Ant script now works with run-at-startup"
15212967e Fixed Java deploy script
2aa030170 comment change
455506976 Merge "Made Java deploy work with run-at-startup"
ef5729b3d Made Java deploy work with run-at-startup
256b052a5 Java Ant script now works with run-at-startup
56cf73168 Re-tuned PID for PacGoat.
0926fa493 Merge changes I7e8735d9,Ida66361c
4de246876 Adds/Formats the CANJaguar.set() Javadocs
130485d76 Adds CANJaguar integration tests testing that in every control mode the motors can be rotated Adds a separate test suite for explicitly testing CAN
3b6e5b9b1 Merge changes I59b6180e,Ic86e922b
b2000a20d * Fix issue if I2C initialized before DigitalSystem.
9e6d04b2e Added v10 libraries
f380d9c10 Corrected the number of CAN init attempts in C++
1ba20bc1e added space for testing gi review
a0799718f Merge "Fixes a bug in the TiltPanCameraFixture that would cause the test to freeze and never complete instead of failing"
afe1b0b34 Merge "Adds CANJaguar Java Tests to the Integration Test Suite -Makes the MotorEncoderFixture Generic for a specific motor type -Adds Methods on the FakePotentiometerSource to allow raw values to be set -Adds Runtime Printing of the Tests to indicate where we are in the program if something unexpected happens"
072b92e55 Fixes a bug in the TiltPanCameraFixture that would cause the test to freeze and never complete instead of failing
b27791544 Adds CANJaguar Java Tests to the Integration Test Suite -Makes the MotorEncoderFixture Generic for a specific motor type -Adds Methods on the FakePotentiometerSource to allow raw values to be set -Adds Runtime Printing of the Tests to indicate where we are in the program if something unexpected happens
e4e199f06 Added support for simulation time.
15e378180 Merge "Fixed C++ side of artf2604 in FRCSim - synchronized C++ codebases, updated examples."
606eaa67b Merge "CANJaguar waits in the constructor for initial status data"
6273a407e Merge "Added a C++ CANJaguar test for initial status data"
1cafebc5a CANJaguar waits in the constructor for initial status data
06f8ff922 Added a C++ CANJaguar test for initial status data
cc76500fd Merge "* Add WriteBulk and ReadOnly to C++ I2C"
ff597e6ac Fixed C++ side of artf2604 in FRCSim - synchronized C++ codebases, updated examples.
02e19a014 Merge "Added PacGoat code for C++."
c7e17b8e3 Added PacGoat code for C++.
41897af45 Merge "CANJaguar in Java now requires control mode configuration data at compile time"
73ed1d42e Merge "CANJaguar in C++ now requires control mode configuration data at compile time"
f3593c698 CANJaguar in Java now requires control mode configuration data at compile time
abed665c6 CANJaguar in C++ now requires control mode configuration data at compile time
945c7519e Merge "Fixed Java PCM test"
81a0664c5 Fixed Java PCM test
12af2db15 Merge "Java CANJaguar changes"
1c8cd1dab Merge "Adds a missing Hamcrest dependency for the Java Integration Test system"
df9b702e0 Adds a missing Hamcrest dependency for the Java Integration Test system
0d62d0985 Added C++ support for solenoids.
1bbf35081 Java CANJaguar changes
31ab66ba2 Merge "Added support for PacGoat robot for artf2591."
de9657760 Adds an error if you try to use SetVoltageRampRate in the wrong control mode
605148456 * Add WriteBulk and ReadOnly to C++ I2C
40628a817 Added support for PacGoat robot for artf2591.
0f8c83f69 Merge "Adds CommandTests to the C++ Integration Test Suite Also adds/updates some comments in the Java Command Tests"
61ca86511 Adds CommandTests to the C++ Integration Test Suite Also adds/updates some comments in the Java Command Tests
f5862582e FRCSim artf2604: Synchronized the codebases of WPILibJ-Simulation and the main WPILibJ.
698f38d40 Fixed FRCSim artf2594 - JavaGazebo no longer crashes if gzserver hasn't started, and cleaned up some code in the area.
e9ade472e Merge "Updated CAN Jaguar for C++"
21b58aebd Updated CAN Jaguar for C++
08ed0b286 Fixed eclipse bug on windows when not run from command prompt.
801efe601 Merge "Makes the ToolChain Plugins platform specific so that you can no longer install multiple versions of the tool chains simultaneously. [artf2558]"
3927967ac Merge "Added PDP tests for java and C++, updated TestBench.h"
2cc2e6a9e Added PDP tests for java and C++, updated TestBench.h
2cb9d55ef Makes the ToolChain Plugins platform specific so that you can no longer install multiple versions of the tool chains simultaneously. [artf2558]
f598abf5b Fix FRCSim artf2589 and cleanup the surrounding code.
e69c1ea19 Merge "Some much need love for the eclipse plugins."
1fb6d9fd0 Updates/Tests the AnalogPotentiometer New constructor for the AnalogPotentiometer to allow users to pass it an AnalogInput into the constructor New FakePotentiometerSource to emulate a AnalogPotentiometer
60cfabca8 Merge "Changed the AnalogPot.cpp class, added AnalogPot test for CPP"
71a66d01c Changed the AnalogPot.cpp class, added AnalogPot test for CPP
c106939bc Some much need love for the eclipse plugins.
4a5a14ad8 FRCSim installation script upgrades to fix artf2579: Improved error-handling, added environment checking, added uninstallation option.
52654851d Add C++ Counter Test
d9c1a4edf Fixes for building the Java plugin to include the JNI.
9ff741278 Fixes for rebasing.
bd1aea0d2 Adds RelayCrossConnect tests as well as AnalogCrossConnect tests for java Also splits up the tests into multiple TestSuites so that the they are explicitly associated with the tests in the package that they are running
fc2f0e37b Adds JNI methods for the new CANSessionMUX
974362bd8 Updates CANJNI.cpp so that it compiles properly (CAN NOT WORKING)
85dff7d2e New netcomms .so and headers.
58021f739 Removed analog and digital module numbers
aa3b24092 Adds several more tests to the PID Test Class Adds Logger output to tests when they fail to allow the rest of the tests to run while you can follow the failure stack trace. This allows you to begin working on fixing the failure before the remainder of the tests have run.
fdfc33a38 Merge "Removes the print line from the Preferences class so that the write method no longer causes a system print"
4be3bc25a Removes the print line from the Preferences class so that the write method no longer causes a system print
c7e7f39c4 Merge "Updates the PID.free() method to release the NetworkTable listener. [artf2571] Documentation update on the Depreciated method. Removes the PID.setTolerance(Tolerance tolerance) method because it was private and never used"
94894931a Updates the PID.free() method to release the NetworkTable listener. [artf2571] Documentation update on the Depreciated method. Removes the PID.setTolerance(Tolerance tolerance) method because it was private and never used
cb56c9a14 Initial commit of the WPILib simulation support in an alpha quality state.
d5a509c7e Merge "Changed AnalogChannel to AnalogInput, added AnalogOutput for MXP"
3538e2c05 Changed AnalogChannel to AnalogInput, added AnalogOutput for MXP
a4708d850 Makes the PID Test run 10 times in order to determine how many times it fails out of 10 runs per motor. (Unstable Test!)
a46c24658 Moves the Talon to port 10 to reflect the hardware change
8d5c67e6a Added Omar's changes to the compressor interface
5d646536f C++ PCM integration tests
3c5d46c2a Merge "Added support for digital and analog IO pins on the MXP"
29c4534c5 Added support for digital and analog IO pins on the MXP
d019ec982 Merge "WPILibJ More Integration Tests Refactors the MotorEncoderTest to make use of the parameterized testing framework Adds a test for the Preferences Class Updates the TiltPanCameraTest to work Makes the TimerTest use math for long values Adds a Button Test to Test the internal Button Speeds up the FakeCounterSource/FakeEncoderSource to decrease test time Moves the AbstractComsSetup Block to a static method so that it only runs once Updates the logging.properties class so that tests are quieter"
81aab6645 Adds Java debug script and updates the Ant file to run with the plugins [artf2570]
8b19137ca WPILibJ More Integration Tests Refactors the MotorEncoderTest to make use of the parameterized testing framework Adds a test for the Preferences Class Updates the TiltPanCameraTest to work Makes the TimerTest use math for long values Adds a Button Test to Test the internal Button Speeds up the FakeCounterSource/FakeEncoderSource to decrease test time Moves the AbstractComsSetup Block to a static method so that it only runs once Updates the logging.properties class so that tests are quieter
85d9ead4e Sets the default PIDSourceParameter to be kDistance so there is no null pointer exception
eb00824a5 Updates the MotorEncoder and TestBench to clarify where setup/teardown methods are called
c90c38fa2 Adds a PIDTest to the integration tests. Contributors: Jonathan Leitschuh [artf2568]
59a1fb2c0 Makes the PIDController completely thread safe and ensures that freeing the PID Loop truly clears it [artf2567]
d418271a6 Updates the HAL to use the most recent control data [artf2557]
32dc451a7 Merge "Fixes the Preferences putting the preferences in a file 'file:' and instead puts it in the root directory [artf2566]"
63ae47b7e Fixes the Preferences putting the preferences in a file 'file:' and instead puts it in the root directory [artf2566]
35ac240d4 Switch to 0-based for all pins on the RoboRIO [artf2564]
59dfb4d21 Removed the old compressor code
cf798049e Disable driver station at C++ program start
a3e11f201 More C++ tests
09feff102 Integrates tests for Commands
97fead073 Merge "Adds/Updates the JavaIntegrationTest Framework"
70ccca881 Adds/Updates the JavaIntegrationTest Framework
c937c409a Made PIDController use pthreads in C++
36470d3b7 Made Java PCMCompressor methods public
4c61ab4ea Fixed C++ PWM values to be 16 bits
15c2798de Merge "Don't do doubles"
1e3a5389b Merge "Tilt pan camera test"
3227e779a Adds .cproject to the .gitignore to remove eclipse files
2e39540f2 Tilt pan camera test
bb50f4b13 C++ testing
a3b65a684 Don't do doubles
9a145db3d Merge "Updates the C++ servo class to have the PWM values that are on the spec sheet"
884a374f4 Updates the C++ servo class to have the PWM values that are on the spec sheet
187aa7a13 Support for the CAN power distribution panel
bf7ef4376 Changed the default logging level to WARNING This prevents excessive logging from the HAL. Put it back as needed
5d21444c4 Fixed a missing include
b219d1915 Fixed several files to use .hpp headers
2bf9db001 Merge "Adds/Extends several integration tests. Modifies Java Servo with correct values according to the datasheet assoiciated with the Hitec HS-322HD"
efeec5d98 Adds/Extends several integration tests. Modifies Java Servo with correct values according to the datasheet assoiciated with the Hitec HS-322HD
447cec4df Support for the CAN pneumatics module in C++ and Java
980d52bec Support for the CAN pneumatics module in C++ and Java
9b831ed34 Reverting back to static .a files for C++ and fixing lots of other assorted items
c1482cb26 Made CAN actually work in Java
db940d8c4 Adds Integration tests for WPILib
859983049 Added in LiveWindow initialization code, and the network tables dependecies for WPILibJ. - Fredric Silberberg
609fbfd8f Merge "Adds the Accumulator code to the AnalogJNI.cpp Disables the debug printlines from the AnalogJNI.cpp file"
6d8629a8b Adds the Accumulator code to the AnalogJNI.cpp Disables the debug printlines from the AnalogJNI.cpp file
04b6afb1c WPILibJ Integration Tests
6b83175b7 Merge "Fixed the package for CANJaguar.java"
9925598da Merge "Updated POM files to allow use of compile phase."
9a29c684a Fixed the package for CANJaguar.java
66c9aabec Merge "Updated CANJaguar.h/.cpp/.java for the RoboRIO"
736cb754f Updated POM files to allow use of compile phase.
b955ec994 Merge "Adds maven configuration information to use m2e This also removes all of the .project and .classpath files generated by eclipse"
da2e1769c Updated CANJaguar.h/.cpp/.java for the RoboRIO
85b0a46fd Adds maven configuration information to use m2e This also removes all of the .project and .classpath files generated by eclipse
ed6ac3bff Fixed digital channel routing
7e215ef18 Removed the old cRIO channel routing that was preventing encoders from working in C++
6e01adaa5 Revert "Modifies maven files to work with m2e" This commit causes Eclipse to give a vaugue error message when creating a new Robot Java Project or Robot C++ Project.
36241b0d6 Modifies maven files to work with m2e
12e811250 Driver Station
0227264de Merge "Added .classpath to the gitignore"
059cee8b2 Merge "Fixed the module order so the libraries are built before the plugins"
5d81894d1 Merge "WPILibJ Unit Tests"
21074eea4 Added .classpath to the gitignore
acb963612 WPILibJ Unit Tests
cdc94f062 Added .gitignore file
508425c97 Fixed some typos in pom files
9f64cf615 Fixed the module order so the libraries are built before the plugins
27896984f Added the new NI shared libraries and headers
848a043f9 Fixing some compile warnings in C++
1c943ff6f Changed the build.xml files to write the runjavaprogram and runcppprogram Still need to fix the debug c++, it has references to java
82795d6a3 Fix 2 path problems in some scripts
a42a7943b Init HAL from WPILibJ to remove segfaults
e4be9eb09 Added mvn profiles to define the cmake required properties depending on the build platform.
b7ad001b4 Fixing packaging
87e9b6ce5 toolchain name...
885c3ab83 reverting building opkg in maven/cmake (now uses ant)
af2368b6f Moving opkg build to deployment
c0222d4e2 Automatic SO downloading & updating
69d9ad70a CMake Changes
33134bef1 Java 8 Compilation Fixes
4546abc8c Version 4 Image
b1ef11610 Revert "Applied patch from Dustin Spicuzza to fix robot hang"
d3ef8de5e Applied patch from Dustin Spicuzza to fix robot hang
8d1fc91e8 .gitreview file
5f727e57a Eclipse toolchain installer now preserves executable bit on Linux
260636250 Changed the CPU Architecture
aad6d11f4 Renamed log.h to Log.h
938a422b2 Added human-readable error messages to the Maven and Java version enforcer rules
1a7526fc8 Disabled NetworkTables java Azalea build by default
5d1d9fcde Added enforcer rules to restrict Maven and Java versions
616acc26d Corrected incorrect relative path to parent POM
0d5410a11 Removed all repository definitions pointing to Jenkins (aka. frcbuilder)
3924a4b6f fixed the path name for sflt
aa40fd0c5 Replaced hardcoded forward slash with system correct separator
476dccdd3 Corrected <relativePath> that pointed to directory instead of pom.xml
bbc0a6b95 Corrected <relativePath> that pointed to directory instead of pom.xml
203debb46 Updated wpilibJavaJNI JDK include path to use default location in user's home directory
2bdd95d72 Set Azalea wpilibc off by default
9880ff3fd turn off network tables desktop and azalea builds by default
3e74499d4 Turn off Azalea hal by default
f2746b7d4 Merge branch 'master' of ssh://charris@usfirst.collab.net:29418/allwpilib
28848553a missing file from original commit and push
6a87f9057 Updated <relativePath> references to static-library
155af5966 Replaced hardcoded JDK include path with property
08d06bd22 Updated parent pom <relativePath> properties to be correct
f7146d423 JNI for java Normal vs recursive mutex HAL delineation
b62b60611 JNI implementation for Java Normal vs
4297b2bc9 Merge branch 'master' of ssh://usfirst.collab.net:29418/allwpilib
d09371bc0 Initial empty repository
3178911ee Initial checkin of unified hierarchy of WPILib 2015
REVERT: 00e090877 Fix bounds of SPI AutoRead sizes
REVERT: 8fce748cf Rename our allwpilib (which is now 2020) to not have 2019 in the name
Change-Id: I8247665e5386c0696e597eafeed095e26ef12c79
git-subtree-dir: third_party/allwpilib
git-subtree-split: 66b57f0323d55b8c875f0391f48e69880a3b4389
diff --git a/hal/CMakeLists.txt b/hal/CMakeLists.txt
index c29f770..2e99064 100644
--- a/hal/CMakeLists.txt
+++ b/hal/CMakeLists.txt
@@ -37,7 +37,7 @@
if(USE_EXTERNAL_HAL)
include(${EXTERNAL_HAL_FILE})
else()
- target_sources(hal PRIVATE ${hal_sim_native_src} ${hal_sim_jni_src})
+ target_sources(hal PRIVATE ${hal_sim_native_src})
endif()
configure_file(src/generate/FRCUsageReporting.h.in gen/hal/FRCUsageReporting.h)
@@ -57,9 +57,9 @@
install(TARGETS hal EXPORT hal DESTINATION "${main_lib_dest}")
install(DIRECTORY src/main/native/include/ DESTINATION "${include_dest}/hal")
-install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/gen DESTINATION "${include_dest}/hal")
+install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/gen/ DESTINATION "${include_dest}/hal")
-if (MSVC OR FLAT_INSTALL_WPILIB)
+if (WITH_FLAT_INSTALL)
set (hal_config_dir ${wpilib_dest})
else()
set (hal_config_dir share/hal)
@@ -70,7 +70,7 @@
install(EXPORT hal DESTINATION ${hal_config_dir})
# Java bindings
-if (NOT WITHOUT_JAVA)
+if (WITH_JAVA)
find_package(Java REQUIRED)
find_package(JNI REQUIRED)
include(UseJava)
@@ -78,9 +78,7 @@
configure_file(src/generate/FRCNetComm.java.in FRCNetComm.java)
- file(GLOB
- hal_shared_jni_src src/main/native/cpp/jni/*.cpp
- hal_sim_jni_src src/main/native/sim/jni/*.cpp)
+ file(GLOB_RECURSE hal_shared_jni_src src/main/native/cpp/jni/*.cpp)
file(GLOB_RECURSE JAVA_SOURCES
${CMAKE_CURRENT_BINARY_DIR}/FRCNetComm.java
@@ -103,8 +101,6 @@
if(USE_EXTERNAL_HAL)
include(${EXTERNAL_HAL_FILE})
- else()
- target_sources(haljni PRIVATE ${hal_sim_jni_src})
endif()
set_target_properties(haljni PROPERTIES OUTPUT_NAME "wpiHaljni")
diff --git a/hal/build.gradle b/hal/build.gradle
index d744259..e5b5f6c 100644
--- a/hal/build.gradle
+++ b/hal/build.gradle
@@ -62,40 +62,13 @@
nativeName = 'hal'
setBaseName = 'wpiHal'
- devMain = 'DevMain'
+ devMain = 'edu.wpi.first.hal.DevMain'
niLibraries = true
generatedHeaders = "$buildDir/generated/headers"
jniSplitSetup = {
it.tasks.withType(AbstractNativeSourceCompileTask) {
it.dependsOn generateUsageReporting
}
- if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
- it.sources {
- athenaJniCpp(CppSourceSet) {
- source {
- srcDirs = ["${rootDir}/shared/singlelib", "$buildDir/generated/cpp"]
- include '**/*.cpp'
- }
- exportedHeaders {
- srcDir 'src/main/native/include'
- srcDir generatedHeaders
- }
- }
- }
- } else {
- it.sources {
- simJniCpp(CppSourceSet) {
- source {
- srcDirs 'src/main/native/sim'
- include '**/jni/*.cpp'
- }
- exportedHeaders {
- srcDir 'src/main/native/include'
- srcDir generatedHeaders
- }
- }
- }
- }
}
splitSetup = {
it.tasks.withType(AbstractNativeSourceCompileTask) {
@@ -107,7 +80,6 @@
source {
srcDirs = ['src/main/native/athena']
include '**/*.cpp'
- exclude '**/jni/*.cpp'
}
exportedHeaders {
srcDir 'src/main/native/include'
@@ -121,7 +93,6 @@
source {
srcDirs 'src/main/native/sim'
include '**/*.cpp'
- exclude '**/jni/*.cpp'
}
exportedHeaders {
srcDir 'src/main/native/include'
@@ -134,7 +105,6 @@
}
apply from: "${rootDir}/shared/jni/setupBuild.gradle"
-apply from: 'simjni.gradle'
sourceSets.main.java.srcDir "${buildDir}/generated/java/"
@@ -150,12 +120,6 @@
from('src/main/native/sim') {
into '/sim'
}
-
- from("$buildDir/generated/cpp") {
- into '/athena/jni'
- }
-
- dependsOn generateAthenaSimFiles
}
cppHeadersZip {
diff --git a/hal/simjni.gradle b/hal/simjni.gradle
deleted file mode 100644
index c1aef73..0000000
--- a/hal/simjni.gradle
+++ /dev/null
@@ -1,111 +0,0 @@
-def athenaSimJniOutputDir = file("$buildDir/generated/cpp")
-def athenaSimJniOutputFile = file("$athenaSimJniOutputDir/simjni.cpp")
-
-task generateAthenaSimFiles() {
- Set dirs = [];
-
- def createdTask = it
- outputs.file athenaSimJniOutputFile
-
- model {
- components {
- it.all { component ->
- if (component in getJniSpecClass()) {
- component.binaries.all { binary ->
- if (binary.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
- binary.tasks.withType(CppCompile) {
- it.dependsOn createdTask
- }
- component.jniHeaderLocations.each {
- dependsOn it.key
- createdTask.inputs.dir it.value
- dirs << it.value
- }
- }
- }
- }
- }
- }
- }
-
- doLast {
- def symbolList = []
- dirs.each {
- def tree = fileTree(dir: it)
- tree.each { file ->
- if (!file.name.contains('edu_wpi_first_hal_sim_mockdata_')) {
- return
- }
- boolean reading = false
- String currentLine = ''
- file.eachLine { line ->
- if (line.trim()) {
- if (line.contains(';') && reading) {
- currentLine += line.trim()
- reading = false
- symbolList << currentLine
- currentLine = ''
- }
- if (line.startsWith("JNIEXPORT ") && line.contains('JNICALL')) {
- if (line.contains(';')) {
- symbolList << line
- currentLine = ''
- reading = false
- } else {
- reading = true
- currentLine += line.trim()
- }
-
- }
- }
- }
- }
- }
- athenaSimJniOutputDir.mkdirs()
- athenaSimJniOutputFile.withWriter { out ->
- out.println '#include <jni.h>'
- out.println '''
-static JavaVM* jvm = nullptr;
-
-namespace sim {
-jint SimOnLoad(JavaVM* vm, void* reserved) {
- jvm = vm;
-
- JNIEnv *env;
- if (vm->GetEnv(reinterpret_cast<void **>(&env), JNI_VERSION_1_6) != JNI_OK)
- return JNI_ERR;
-
- return JNI_VERSION_1_6;
-}
-
-void SimOnUnload(JavaVM * vm, void* reserved) {
- JNIEnv *env;
- if (vm->GetEnv(reinterpret_cast<void **>(&env), JNI_VERSION_1_6) != JNI_OK)
- return;
- jvm = nullptr;
-}
-}
-
-static void ThrowSimException(JNIEnv* env) {
-
-}
-'''
- out.println 'extern "C" {'
- symbolList.each {
- def symbol = it.replace('JNIEnv *', 'JNIEnv * env')
- if (symbol.contains('JNIEXPORT void')) {
- symbol = symbol.replace(';', ''' {
- ThrowSimException(env);
-}''')
- } else {
- symbol = symbol.replace(';', ''' {
- ThrowSimException(env);
- return 0;
-}''')
- }
- out.println symbol
- }
- out.println '}'
- }
- }
-}
diff --git a/hal/src/dev/java/DevMain.java b/hal/src/dev/java/edu/wpi/first/hal/DevMain.java
similarity index 84%
rename from hal/src/dev/java/DevMain.java
rename to hal/src/dev/java/edu/wpi/first/hal/DevMain.java
index 8cdb8ba..25c6c90 100644
--- a/hal/src/dev/java/DevMain.java
+++ b/hal/src/dev/java/edu/wpi/first/hal/DevMain.java
@@ -1,10 +1,12 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
/*----------------------------------------------------------------------------*/
+package edu.wpi.first.hal;
+
public final class DevMain {
public static void main(String[] args) {
diff --git a/hal/src/main/java/edu/wpi/first/hal/CANAPIJNI.java b/hal/src/main/java/edu/wpi/first/hal/CANAPIJNI.java
index 029cc6d..3507569 100644
--- a/hal/src/main/java/edu/wpi/first/hal/CANAPIJNI.java
+++ b/hal/src/main/java/edu/wpi/first/hal/CANAPIJNI.java
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -20,6 +20,13 @@
public static native void writeCANRTRFrame(int handle, int length, int apiId);
+ public static native int writeCANPacketNoThrow(int handle, byte[] data, int apiId);
+
+ public static native int writeCANPacketRepeatingNoThrow(int handle, byte[] data, int apiId,
+ int repeatMs);
+
+ public static native int writeCANRTRFrameNoThrow(int handle, int length, int apiId);
+
public static native void stopCANPacketRepeating(int handle, int apiId);
public static native boolean readCANPacketNew(int handle, int apiId, CANData data);
diff --git a/hal/src/main/java/edu/wpi/first/hal/HAL.java b/hal/src/main/java/edu/wpi/first/hal/HAL.java
index 8f09a0a..5e07488 100644
--- a/hal/src/main/java/edu/wpi/first/hal/HAL.java
+++ b/hal/src/main/java/edu/wpi/first/hal/HAL.java
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -12,12 +12,14 @@
/**
* JNI Wrapper for HAL<br>.
*/
-@SuppressWarnings({"AbbreviationAsWordInName", "MethodName", "PMD.TooManyMethods"})
+@SuppressWarnings({"AbbreviationAsWordInName", "MethodName"})
public final class HAL extends JNIWrapper {
public static native void waitForDSData();
public static native boolean initialize(int timeout, int mode);
+ public static native void shutdown();
+
public static native boolean hasMain();
public static native void runMain();
@@ -130,6 +132,8 @@
String details, String location, String callStack,
boolean printMsg);
+ public static native int sendConsoleLine(String line);
+
public static native int getPortWithModule(byte module, byte channel);
public static native int getPort(byte channel);
diff --git a/hal/src/main/java/edu/wpi/first/hal/InterruptJNI.java b/hal/src/main/java/edu/wpi/first/hal/InterruptJNI.java
index 8574a25..e370d5b 100644
--- a/hal/src/main/java/edu/wpi/first/hal/InterruptJNI.java
+++ b/hal/src/main/java/edu/wpi/first/hal/InterruptJNI.java
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -38,4 +38,6 @@
public static native void setInterruptUpSourceEdge(int interruptHandle, boolean risingEdge,
boolean fallingEdge);
+
+ public static native void releaseWaitingInterrupt(int interruptHandle);
}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/AccelerometerSim.java b/hal/src/main/java/edu/wpi/first/hal/sim/AccelerometerSim.java
deleted file mode 100644
index d9c95af..0000000
--- a/hal/src/main/java/edu/wpi/first/hal/sim/AccelerometerSim.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* 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. */
-/*----------------------------------------------------------------------------*/
-
-package edu.wpi.first.hal.sim;
-
-import edu.wpi.first.hal.sim.mockdata.AccelerometerDataJNI;
-
-public class AccelerometerSim {
- private final int m_index;
-
- public AccelerometerSim() {
- m_index = 0;
- }
-
- public CallbackStore registerActiveCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = AccelerometerDataJNI.registerActiveCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, AccelerometerDataJNI::cancelActiveCallback);
- }
- public boolean getActive() {
- return AccelerometerDataJNI.getActive(m_index);
- }
- public void setActive(boolean active) {
- AccelerometerDataJNI.setActive(m_index, active);
- }
-
- public CallbackStore registerRangeCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = AccelerometerDataJNI.registerRangeCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, AccelerometerDataJNI::cancelRangeCallback);
- }
- public int getRange() {
- return AccelerometerDataJNI.getRange(m_index);
- }
- public void setRange(int range) {
- AccelerometerDataJNI.setRange(m_index, range);
- }
-
- public CallbackStore registerXCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = AccelerometerDataJNI.registerXCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, AccelerometerDataJNI::cancelXCallback);
- }
- public double getX() {
- return AccelerometerDataJNI.getX(m_index);
- }
- public void setX(double x) {
- AccelerometerDataJNI.setX(m_index, x);
- }
-
- public CallbackStore registerYCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = AccelerometerDataJNI.registerYCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, AccelerometerDataJNI::cancelYCallback);
- }
- public double getY() {
- return AccelerometerDataJNI.getY(m_index);
- }
- public void setY(double y) {
- AccelerometerDataJNI.setY(m_index, y);
- }
-
- public CallbackStore registerZCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = AccelerometerDataJNI.registerZCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, AccelerometerDataJNI::cancelZCallback);
- }
- public double getZ() {
- return AccelerometerDataJNI.getZ(m_index);
- }
- public void setZ(double z) {
- AccelerometerDataJNI.setZ(m_index, z);
- }
-
- public void resetData() {
- AccelerometerDataJNI.resetData(m_index);
- }
-}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/AddressableLEDSim.java b/hal/src/main/java/edu/wpi/first/hal/sim/AddressableLEDSim.java
deleted file mode 100644
index cc6eefa..0000000
--- a/hal/src/main/java/edu/wpi/first/hal/sim/AddressableLEDSim.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 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. */
-/*----------------------------------------------------------------------------*/
-
-package edu.wpi.first.hal.sim;
-
-import edu.wpi.first.hal.sim.mockdata.AddressableLEDDataJNI;
-
-public class AddressableLEDSim {
- private final int m_index;
-
- public AddressableLEDSim(int index) {
- m_index = index;
- }
-
- public CallbackStore registerInitializedCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = AddressableLEDDataJNI.registerInitializedCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, AddressableLEDDataJNI::cancelInitializedCallback);
- }
- public boolean getInitialized() {
- return AddressableLEDDataJNI.getInitialized(m_index);
- }
- public void setInitialized(boolean initialized) {
- AddressableLEDDataJNI.setInitialized(m_index, initialized);
- }
-
- public CallbackStore registerOutputPortCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = AddressableLEDDataJNI.registerOutputPortCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, AddressableLEDDataJNI::cancelOutputPortCallback);
- }
- public int getOutputPort() {
- return AddressableLEDDataJNI.getOutputPort(m_index);
- }
- public void setOutputPort(int outputPort) {
- AddressableLEDDataJNI.setOutputPort(m_index, outputPort);
- }
-
- public CallbackStore registerLengthCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = AddressableLEDDataJNI.registerLengthCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, AddressableLEDDataJNI::cancelLengthCallback);
- }
- public int getLength() {
- return AddressableLEDDataJNI.getLength(m_index);
- }
- public void setLength(int length) {
- AddressableLEDDataJNI.setLength(m_index, length);
- }
-
- public CallbackStore registerRunningCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = AddressableLEDDataJNI.registerRunningCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, AddressableLEDDataJNI::cancelRunningCallback);
- }
- public boolean getRunning() {
- return AddressableLEDDataJNI.getRunning(m_index);
- }
- public void setRunning(boolean running) {
- AddressableLEDDataJNI.setRunning(m_index, running);
- }
-
- public CallbackStore registerDataCallback(ConstBufferCallback callback) {
- int uid = AddressableLEDDataJNI.registerDataCallback(m_index, callback);
- return new CallbackStore(m_index, uid, AddressableLEDDataJNI::cancelDataCallback);
- }
- public byte[] getData() {
- return AddressableLEDDataJNI.getData(m_index);
- }
- public void setData(byte[] data) {
- AddressableLEDDataJNI.setData(m_index, data);
- }
-
- public void resetData() {
- AddressableLEDDataJNI.resetData(m_index);
- }
-}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/AnalogGyroSim.java b/hal/src/main/java/edu/wpi/first/hal/sim/AnalogGyroSim.java
deleted file mode 100644
index ddaa0ce..0000000
--- a/hal/src/main/java/edu/wpi/first/hal/sim/AnalogGyroSim.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* 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. */
-/*----------------------------------------------------------------------------*/
-
-package edu.wpi.first.hal.sim;
-
-import edu.wpi.first.hal.sim.mockdata.AnalogGyroDataJNI;
-
-public class AnalogGyroSim {
- private final int m_index;
-
- public AnalogGyroSim(int index) {
- m_index = index;
- }
-
- public CallbackStore registerAngleCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = AnalogGyroDataJNI.registerAngleCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, AnalogGyroDataJNI::cancelAngleCallback);
- }
- public double getAngle() {
- return AnalogGyroDataJNI.getAngle(m_index);
- }
- public void setAngle(double angle) {
- AnalogGyroDataJNI.setAngle(m_index, angle);
- }
-
- public CallbackStore registerRateCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = AnalogGyroDataJNI.registerRateCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, AnalogGyroDataJNI::cancelRateCallback);
- }
- public double getRate() {
- return AnalogGyroDataJNI.getRate(m_index);
- }
- public void setRate(double rate) {
- AnalogGyroDataJNI.setRate(m_index, rate);
- }
-
- public CallbackStore registerInitializedCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = AnalogGyroDataJNI.registerInitializedCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, AnalogGyroDataJNI::cancelInitializedCallback);
- }
- public boolean getInitialized() {
- return AnalogGyroDataJNI.getInitialized(m_index);
- }
- public void setInitialized(boolean initialized) {
- AnalogGyroDataJNI.setInitialized(m_index, initialized);
- }
-
- public void resetData() {
- AnalogGyroDataJNI.resetData(m_index);
- }
-}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/AnalogInSim.java b/hal/src/main/java/edu/wpi/first/hal/sim/AnalogInSim.java
deleted file mode 100644
index f7f86bb..0000000
--- a/hal/src/main/java/edu/wpi/first/hal/sim/AnalogInSim.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* 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. */
-/*----------------------------------------------------------------------------*/
-
-package edu.wpi.first.hal.sim;
-
-import edu.wpi.first.hal.sim.mockdata.AnalogInDataJNI;
-
-public class AnalogInSim {
- private final int m_index;
-
- public AnalogInSim(int index) {
- m_index = index;
- }
-
- public CallbackStore registerInitializedCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = AnalogInDataJNI.registerInitializedCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, AnalogInDataJNI::cancelInitializedCallback);
- }
- public boolean getInitialized() {
- return AnalogInDataJNI.getInitialized(m_index);
- }
- public void setInitialized(boolean initialized) {
- AnalogInDataJNI.setInitialized(m_index, initialized);
- }
-
- public CallbackStore registerAverageBitsCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = AnalogInDataJNI.registerAverageBitsCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, AnalogInDataJNI::cancelAverageBitsCallback);
- }
- public int getAverageBits() {
- return AnalogInDataJNI.getAverageBits(m_index);
- }
- public void setAverageBits(int averageBits) {
- AnalogInDataJNI.setAverageBits(m_index, averageBits);
- }
-
- public CallbackStore registerOversampleBitsCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = AnalogInDataJNI.registerOversampleBitsCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, AnalogInDataJNI::cancelOversampleBitsCallback);
- }
- public int getOversampleBits() {
- return AnalogInDataJNI.getOversampleBits(m_index);
- }
- public void setOversampleBits(int oversampleBits) {
- AnalogInDataJNI.setOversampleBits(m_index, oversampleBits);
- }
-
- public CallbackStore registerVoltageCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = AnalogInDataJNI.registerVoltageCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, AnalogInDataJNI::cancelVoltageCallback);
- }
- public double getVoltage() {
- return AnalogInDataJNI.getVoltage(m_index);
- }
- public void setVoltage(double voltage) {
- AnalogInDataJNI.setVoltage(m_index, voltage);
- }
-
- public CallbackStore registerAccumulatorInitializedCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = AnalogInDataJNI.registerAccumulatorInitializedCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, AnalogInDataJNI::cancelAccumulatorInitializedCallback);
- }
- public boolean getAccumulatorInitialized() {
- return AnalogInDataJNI.getAccumulatorInitialized(m_index);
- }
- public void setAccumulatorInitialized(boolean accumulatorInitialized) {
- AnalogInDataJNI.setAccumulatorInitialized(m_index, accumulatorInitialized);
- }
-
- public CallbackStore registerAccumulatorValueCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = AnalogInDataJNI.registerAccumulatorValueCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, AnalogInDataJNI::cancelAccumulatorValueCallback);
- }
- public long getAccumulatorValue() {
- return AnalogInDataJNI.getAccumulatorValue(m_index);
- }
- public void setAccumulatorValue(long accumulatorValue) {
- AnalogInDataJNI.setAccumulatorValue(m_index, accumulatorValue);
- }
-
- public CallbackStore registerAccumulatorCountCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = AnalogInDataJNI.registerAccumulatorCountCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, AnalogInDataJNI::cancelAccumulatorCountCallback);
- }
- public long getAccumulatorCount() {
- return AnalogInDataJNI.getAccumulatorCount(m_index);
- }
- public void setAccumulatorCount(long accumulatorCount) {
- AnalogInDataJNI.setAccumulatorCount(m_index, accumulatorCount);
- }
-
- public CallbackStore registerAccumulatorCenterCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = AnalogInDataJNI.registerAccumulatorCenterCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, AnalogInDataJNI::cancelAccumulatorCenterCallback);
- }
- public int getAccumulatorCenter() {
- return AnalogInDataJNI.getAccumulatorCenter(m_index);
- }
- public void setAccumulatorCenter(int accumulatorCenter) {
- AnalogInDataJNI.setAccumulatorCenter(m_index, accumulatorCenter);
- }
-
- public CallbackStore registerAccumulatorDeadbandCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = AnalogInDataJNI.registerAccumulatorDeadbandCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, AnalogInDataJNI::cancelAccumulatorDeadbandCallback);
- }
- public int getAccumulatorDeadband() {
- return AnalogInDataJNI.getAccumulatorDeadband(m_index);
- }
- public void setAccumulatorDeadband(int accumulatorDeadband) {
- AnalogInDataJNI.setAccumulatorDeadband(m_index, accumulatorDeadband);
- }
-
- public void resetData() {
- AnalogInDataJNI.resetData(m_index);
- }
-}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/AnalogOutSim.java b/hal/src/main/java/edu/wpi/first/hal/sim/AnalogOutSim.java
deleted file mode 100644
index 4731b11..0000000
--- a/hal/src/main/java/edu/wpi/first/hal/sim/AnalogOutSim.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* 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. */
-/*----------------------------------------------------------------------------*/
-
-package edu.wpi.first.hal.sim;
-
-import edu.wpi.first.hal.sim.mockdata.AnalogOutDataJNI;
-
-public class AnalogOutSim {
- private final int m_index;
-
- public AnalogOutSim(int index) {
- m_index = index;
- }
-
- public CallbackStore registerVoltageCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = AnalogOutDataJNI.registerVoltageCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, AnalogOutDataJNI::cancelVoltageCallback);
- }
- public double getVoltage() {
- return AnalogOutDataJNI.getVoltage(m_index);
- }
- public void setVoltage(double voltage) {
- AnalogOutDataJNI.setVoltage(m_index, voltage);
- }
-
- public CallbackStore registerInitializedCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = AnalogOutDataJNI.registerInitializedCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, AnalogOutDataJNI::cancelInitializedCallback);
- }
- public boolean getInitialized() {
- return AnalogOutDataJNI.getInitialized(m_index);
- }
- public void setInitialized(boolean initialized) {
- AnalogOutDataJNI.setInitialized(m_index, initialized);
- }
-
- public void resetData() {
- AnalogOutDataJNI.resetData(m_index);
- }
-}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/AnalogTriggerSim.java b/hal/src/main/java/edu/wpi/first/hal/sim/AnalogTriggerSim.java
deleted file mode 100644
index fd88d5f..0000000
--- a/hal/src/main/java/edu/wpi/first/hal/sim/AnalogTriggerSim.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* 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. */
-/*----------------------------------------------------------------------------*/
-
-package edu.wpi.first.hal.sim;
-
-import edu.wpi.first.hal.sim.mockdata.AnalogTriggerDataJNI;
-
-public class AnalogTriggerSim {
- private final int m_index;
-
- public AnalogTriggerSim(int index) {
- m_index = index;
- }
-
- public CallbackStore registerInitializedCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = AnalogTriggerDataJNI.registerInitializedCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, AnalogTriggerDataJNI::cancelInitializedCallback);
- }
- public boolean getInitialized() {
- return AnalogTriggerDataJNI.getInitialized(m_index);
- }
- public void setInitialized(boolean initialized) {
- AnalogTriggerDataJNI.setInitialized(m_index, initialized);
- }
-
- public CallbackStore registerTriggerLowerBoundCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = AnalogTriggerDataJNI.registerTriggerLowerBoundCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, AnalogTriggerDataJNI::cancelTriggerLowerBoundCallback);
- }
- public double getTriggerLowerBound() {
- return AnalogTriggerDataJNI.getTriggerLowerBound(m_index);
- }
- public void setTriggerLowerBound(double triggerLowerBound) {
- AnalogTriggerDataJNI.setTriggerLowerBound(m_index, triggerLowerBound);
- }
-
- public CallbackStore registerTriggerUpperBoundCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = AnalogTriggerDataJNI.registerTriggerUpperBoundCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, AnalogTriggerDataJNI::cancelTriggerUpperBoundCallback);
- }
- public double getTriggerUpperBound() {
- return AnalogTriggerDataJNI.getTriggerUpperBound(m_index);
- }
- public void setTriggerUpperBound(double triggerUpperBound) {
- AnalogTriggerDataJNI.setTriggerUpperBound(m_index, triggerUpperBound);
- }
-
- public void resetData() {
- AnalogTriggerDataJNI.resetData(m_index);
- }
-}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/CallbackStore.java b/hal/src/main/java/edu/wpi/first/hal/sim/CallbackStore.java
deleted file mode 100644
index 7564104..0000000
--- a/hal/src/main/java/edu/wpi/first/hal/sim/CallbackStore.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* 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. */
-/*----------------------------------------------------------------------------*/
-
-package edu.wpi.first.hal.sim;
-
-public class CallbackStore implements AutoCloseable {
- interface CancelCallbackFunc {
- void cancel(int index, int uid);
- }
-
- interface CancelCallbackChannelFunc {
- void cancel(int index, int channel, int uid);
- }
-
- interface CancelCallbackNoIndexFunc {
- void cancel(int uid);
- }
-
- public CallbackStore(int index, int uid, CancelCallbackFunc ccf) {
- this.m_cancelType = kNormalCancel;
- this.m_index = index;
- this.m_uid = uid;
- this.m_cancelCallback = ccf;
- }
-
- public CallbackStore(int index, int channel, int uid, CancelCallbackChannelFunc ccf) {
- this.m_cancelType = kChannelCancel;
- this.m_index = index;
- this.m_uid = uid;
- this.m_channel = channel;
- this.m_cancelCallbackChannel = ccf;
- }
-
- public CallbackStore(int uid, CancelCallbackNoIndexFunc ccf) {
- this.m_cancelType = kNoIndexCancel;
- this.m_uid = uid;
- this.m_cancelCallbackNoIndex = ccf;
- }
-
- private int m_index;
- private int m_channel;
- private final int m_uid;
- private CancelCallbackFunc m_cancelCallback;
- private CancelCallbackChannelFunc m_cancelCallbackChannel;
- private CancelCallbackNoIndexFunc m_cancelCallbackNoIndex;
- private static final int kNormalCancel = 0;
- private static final int kChannelCancel = 1;
- private static final int kNoIndexCancel = 2;
- private int m_cancelType;
-
- @Override
- public void close() {
- switch (m_cancelType) {
- case kNormalCancel:
- m_cancelCallback.cancel(m_index, m_uid);
- break;
- case kChannelCancel:
- m_cancelCallbackChannel.cancel(m_index, m_channel, m_uid);
- break;
- case kNoIndexCancel:
- m_cancelCallbackNoIndex.cancel(m_uid);
- break;
- default:
- assert false;
- break;
- }
- m_cancelType = -1;
- }
-
- @Override
- protected void finalize() throws Throwable {
- try {
- if (m_cancelType >= 0) {
- close(); // close open files
- }
- } finally {
- super.finalize();
- }
- }
-}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/DIOSim.java b/hal/src/main/java/edu/wpi/first/hal/sim/DIOSim.java
deleted file mode 100644
index cd75822..0000000
--- a/hal/src/main/java/edu/wpi/first/hal/sim/DIOSim.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* 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. */
-/*----------------------------------------------------------------------------*/
-
-package edu.wpi.first.hal.sim;
-
-import edu.wpi.first.hal.sim.mockdata.DIODataJNI;
-
-public class DIOSim {
- private final int m_index;
-
- public DIOSim(int index) {
- m_index = index;
- }
-
- public CallbackStore registerInitializedCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = DIODataJNI.registerInitializedCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, DIODataJNI::cancelInitializedCallback);
- }
- public boolean getInitialized() {
- return DIODataJNI.getInitialized(m_index);
- }
- public void setInitialized(boolean initialized) {
- DIODataJNI.setInitialized(m_index, initialized);
- }
-
- public CallbackStore registerValueCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = DIODataJNI.registerValueCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, DIODataJNI::cancelValueCallback);
- }
- public boolean getValue() {
- return DIODataJNI.getValue(m_index);
- }
- public void setValue(boolean value) {
- DIODataJNI.setValue(m_index, value);
- }
-
- public CallbackStore registerPulseLengthCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = DIODataJNI.registerPulseLengthCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, DIODataJNI::cancelPulseLengthCallback);
- }
- public double getPulseLength() {
- return DIODataJNI.getPulseLength(m_index);
- }
- public void setPulseLength(double pulseLength) {
- DIODataJNI.setPulseLength(m_index, pulseLength);
- }
-
- public CallbackStore registerIsInputCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = DIODataJNI.registerIsInputCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, DIODataJNI::cancelIsInputCallback);
- }
- public boolean getIsInput() {
- return DIODataJNI.getIsInput(m_index);
- }
- public void setIsInput(boolean isInput) {
- DIODataJNI.setIsInput(m_index, isInput);
- }
-
- public CallbackStore registerFilterIndexCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = DIODataJNI.registerFilterIndexCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, DIODataJNI::cancelFilterIndexCallback);
- }
- public int getFilterIndex() {
- return DIODataJNI.getFilterIndex(m_index);
- }
- public void setFilterIndex(int filterIndex) {
- DIODataJNI.setFilterIndex(m_index, filterIndex);
- }
-
- public void resetData() {
- DIODataJNI.resetData(m_index);
- }
-}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/DigitalPWMSim.java b/hal/src/main/java/edu/wpi/first/hal/sim/DigitalPWMSim.java
deleted file mode 100644
index 314d994..0000000
--- a/hal/src/main/java/edu/wpi/first/hal/sim/DigitalPWMSim.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* 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. */
-/*----------------------------------------------------------------------------*/
-
-package edu.wpi.first.hal.sim;
-
-import edu.wpi.first.hal.sim.mockdata.DigitalPWMDataJNI;
-
-public class DigitalPWMSim {
- private final int m_index;
-
- public DigitalPWMSim(int index) {
- m_index = index;
- }
-
- public CallbackStore registerInitializedCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = DigitalPWMDataJNI.registerInitializedCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, DigitalPWMDataJNI::cancelInitializedCallback);
- }
- public boolean getInitialized() {
- return DigitalPWMDataJNI.getInitialized(m_index);
- }
- public void setInitialized(boolean initialized) {
- DigitalPWMDataJNI.setInitialized(m_index, initialized);
- }
-
- public CallbackStore registerDutyCycleCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = DigitalPWMDataJNI.registerDutyCycleCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, DigitalPWMDataJNI::cancelDutyCycleCallback);
- }
- public double getDutyCycle() {
- return DigitalPWMDataJNI.getDutyCycle(m_index);
- }
- public void setDutyCycle(double dutyCycle) {
- DigitalPWMDataJNI.setDutyCycle(m_index, dutyCycle);
- }
-
- public CallbackStore registerPinCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = DigitalPWMDataJNI.registerPinCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, DigitalPWMDataJNI::cancelPinCallback);
- }
- public int getPin() {
- return DigitalPWMDataJNI.getPin(m_index);
- }
- public void setPin(int pin) {
- DigitalPWMDataJNI.setPin(m_index, pin);
- }
-
- public void resetData() {
- DigitalPWMDataJNI.resetData(m_index);
- }
-}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/DriverStationSim.java b/hal/src/main/java/edu/wpi/first/hal/sim/DriverStationSim.java
deleted file mode 100644
index d14af9f..0000000
--- a/hal/src/main/java/edu/wpi/first/hal/sim/DriverStationSim.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 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. */
-/*----------------------------------------------------------------------------*/
-
-package edu.wpi.first.hal.sim;
-
-import edu.wpi.first.hal.sim.mockdata.DriverStationDataJNI;
-
-public class DriverStationSim {
- public CallbackStore registerEnabledCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = DriverStationDataJNI.registerEnabledCallback(callback, initialNotify);
- return new CallbackStore(uid, DriverStationDataJNI::cancelEnabledCallback);
- }
- public boolean getEnabled() {
- return DriverStationDataJNI.getEnabled();
- }
- public void setEnabled(boolean enabled) {
- DriverStationDataJNI.setEnabled(enabled);
- }
-
- public CallbackStore registerAutonomousCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = DriverStationDataJNI.registerAutonomousCallback(callback, initialNotify);
- return new CallbackStore(uid, DriverStationDataJNI::cancelAutonomousCallback);
- }
- public boolean getAutonomous() {
- return DriverStationDataJNI.getAutonomous();
- }
- public void setAutonomous(boolean autonomous) {
- DriverStationDataJNI.setAutonomous(autonomous);
- }
-
- public CallbackStore registerTestCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = DriverStationDataJNI.registerTestCallback(callback, initialNotify);
- return new CallbackStore(uid, DriverStationDataJNI::cancelTestCallback);
- }
- public boolean getTest() {
- return DriverStationDataJNI.getTest();
- }
- public void setTest(boolean test) {
- DriverStationDataJNI.setTest(test);
- }
-
- public CallbackStore registerEStopCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = DriverStationDataJNI.registerEStopCallback(callback, initialNotify);
- return new CallbackStore(uid, DriverStationDataJNI::cancelEStopCallback);
- }
- public boolean getEStop() {
- return DriverStationDataJNI.getEStop();
- }
- public void setEStop(boolean eStop) {
- DriverStationDataJNI.setEStop(eStop);
- }
-
- public CallbackStore registerFmsAttachedCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = DriverStationDataJNI.registerFmsAttachedCallback(callback, initialNotify);
- return new CallbackStore(uid, DriverStationDataJNI::cancelFmsAttachedCallback);
- }
- public boolean getFmsAttached() {
- return DriverStationDataJNI.getFmsAttached();
- }
- public void setFmsAttached(boolean fmsAttached) {
- DriverStationDataJNI.setFmsAttached(fmsAttached);
- }
-
- public CallbackStore registerDsAttachedCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = DriverStationDataJNI.registerDsAttachedCallback(callback, initialNotify);
- return new CallbackStore(uid, DriverStationDataJNI::cancelDsAttachedCallback);
- }
- public boolean getDsAttached() {
- return DriverStationDataJNI.getDsAttached();
- }
- public void setDsAttached(boolean dsAttached) {
- DriverStationDataJNI.setDsAttached(dsAttached);
- }
- public void notifyNewData() {
- DriverStationDataJNI.notifyNewData();
- }
-
- /**
- * Toggles suppression of DriverStation.reportError and reportWarning messages.
- *
- * @param shouldSend If false then messages will will be suppressed.
- */
- public void setSendError(boolean shouldSend) {
- DriverStationDataJNI.setSendError(shouldSend);
- }
-
- public void resetData() {
- DriverStationDataJNI.resetData();
- }
-}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/DutyCycleSim.java b/hal/src/main/java/edu/wpi/first/hal/sim/DutyCycleSim.java
deleted file mode 100644
index 9b2806b..0000000
--- a/hal/src/main/java/edu/wpi/first/hal/sim/DutyCycleSim.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 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. */
-/*----------------------------------------------------------------------------*/
-
-package edu.wpi.first.hal.sim;
-
-import edu.wpi.first.hal.sim.mockdata.DutyCycleDataJNI;
-
-public class DutyCycleSim {
- private final int m_index;
-
- public DutyCycleSim(int index) {
- m_index = index;
- }
-
- public CallbackStore registerInitializedCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = DutyCycleDataJNI.registerInitializedCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, DutyCycleDataJNI::cancelInitializedCallback);
- }
- public boolean getInitialized() {
- return DutyCycleDataJNI.getInitialized(m_index);
- }
- public void setInitialized(boolean initialized) {
- DutyCycleDataJNI.setInitialized(m_index, initialized);
- }
-
- public CallbackStore registerFrequencyCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = DutyCycleDataJNI.registerFrequencyCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, DutyCycleDataJNI::cancelFrequencyCallback);
- }
- public int getFrequency() {
- return DutyCycleDataJNI.getFrequency(m_index);
- }
- public void setFrequency(int frequency) {
- DutyCycleDataJNI.setFrequency(m_index, frequency);
- }
-
- public CallbackStore registerOutputCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = DutyCycleDataJNI.registerOutputCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, DutyCycleDataJNI::cancelOutputCallback);
- }
- public double getOutput() {
- return DutyCycleDataJNI.getOutput(m_index);
- }
- public void setOutput(double output) {
- DutyCycleDataJNI.setOutput(m_index, output);
- }
-}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/EncoderSim.java b/hal/src/main/java/edu/wpi/first/hal/sim/EncoderSim.java
deleted file mode 100644
index 408ca84..0000000
--- a/hal/src/main/java/edu/wpi/first/hal/sim/EncoderSim.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* 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. */
-/*----------------------------------------------------------------------------*/
-
-package edu.wpi.first.hal.sim;
-
-import edu.wpi.first.hal.sim.mockdata.EncoderDataJNI;
-
-public class EncoderSim {
- private final int m_index;
-
- public EncoderSim(int index) {
- m_index = index;
- }
-
- public CallbackStore registerInitializedCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = EncoderDataJNI.registerInitializedCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, EncoderDataJNI::cancelInitializedCallback);
- }
- public boolean getInitialized() {
- return EncoderDataJNI.getInitialized(m_index);
- }
- public void setInitialized(boolean initialized) {
- EncoderDataJNI.setInitialized(m_index, initialized);
- }
-
- public CallbackStore registerCountCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = EncoderDataJNI.registerCountCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, EncoderDataJNI::cancelCountCallback);
- }
- public int getCount() {
- return EncoderDataJNI.getCount(m_index);
- }
- public void setCount(int count) {
- EncoderDataJNI.setCount(m_index, count);
- }
-
- public CallbackStore registerPeriodCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = EncoderDataJNI.registerPeriodCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, EncoderDataJNI::cancelPeriodCallback);
- }
- public double getPeriod() {
- return EncoderDataJNI.getPeriod(m_index);
- }
- public void setPeriod(double period) {
- EncoderDataJNI.setPeriod(m_index, period);
- }
-
- public CallbackStore registerResetCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = EncoderDataJNI.registerResetCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, EncoderDataJNI::cancelResetCallback);
- }
- public boolean getReset() {
- return EncoderDataJNI.getReset(m_index);
- }
- public void setReset(boolean reset) {
- EncoderDataJNI.setReset(m_index, reset);
- }
-
- public CallbackStore registerMaxPeriodCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = EncoderDataJNI.registerMaxPeriodCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, EncoderDataJNI::cancelMaxPeriodCallback);
- }
- public double getMaxPeriod() {
- return EncoderDataJNI.getMaxPeriod(m_index);
- }
- public void setMaxPeriod(double maxPeriod) {
- EncoderDataJNI.setMaxPeriod(m_index, maxPeriod);
- }
-
- public CallbackStore registerDirectionCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = EncoderDataJNI.registerDirectionCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, EncoderDataJNI::cancelDirectionCallback);
- }
- public boolean getDirection() {
- return EncoderDataJNI.getDirection(m_index);
- }
- public void setDirection(boolean direction) {
- EncoderDataJNI.setDirection(m_index, direction);
- }
-
- public CallbackStore registerReverseDirectionCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = EncoderDataJNI.registerReverseDirectionCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, EncoderDataJNI::cancelReverseDirectionCallback);
- }
- public boolean getReverseDirection() {
- return EncoderDataJNI.getReverseDirection(m_index);
- }
- public void setReverseDirection(boolean reverseDirection) {
- EncoderDataJNI.setReverseDirection(m_index, reverseDirection);
- }
-
- public CallbackStore registerSamplesToAverageCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = EncoderDataJNI.registerSamplesToAverageCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, EncoderDataJNI::cancelSamplesToAverageCallback);
- }
- public int getSamplesToAverage() {
- return EncoderDataJNI.getSamplesToAverage(m_index);
- }
- public void setSamplesToAverage(int samplesToAverage) {
- EncoderDataJNI.setSamplesToAverage(m_index, samplesToAverage);
- }
-
- public void resetData() {
- EncoderDataJNI.resetData(m_index);
- }
-}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/I2CSim.java b/hal/src/main/java/edu/wpi/first/hal/sim/I2CSim.java
deleted file mode 100644
index 3a9aa02..0000000
--- a/hal/src/main/java/edu/wpi/first/hal/sim/I2CSim.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* 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. */
-/*----------------------------------------------------------------------------*/
-
-package edu.wpi.first.hal.sim;
-
-import edu.wpi.first.hal.sim.mockdata.I2CDataJNI;
-
-public class I2CSim {
- private final int m_index;
-
- public I2CSim(int index) {
- m_index = index;
- }
-
- public CallbackStore registerInitializedCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = I2CDataJNI.registerInitializedCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, I2CDataJNI::cancelInitializedCallback);
- }
- public boolean getInitialized() {
- return I2CDataJNI.getInitialized(m_index);
- }
- public void setInitialized(boolean initialized) {
- I2CDataJNI.setInitialized(m_index, initialized);
- }
-
- public CallbackStore registerReadCallback(BufferCallback callback) {
- int uid = I2CDataJNI.registerReadCallback(m_index, callback);
- return new CallbackStore(m_index, uid, I2CDataJNI::cancelReadCallback);
- }
-
- public CallbackStore registerWriteCallback(ConstBufferCallback callback) {
- int uid = I2CDataJNI.registerWriteCallback(m_index, callback);
- return new CallbackStore(m_index, uid, I2CDataJNI::cancelWriteCallback);
- }
-
- public void resetData() {
- I2CDataJNI.resetData(m_index);
- }
-}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/NotifierSim.java b/hal/src/main/java/edu/wpi/first/hal/sim/NotifierSim.java
deleted file mode 100644
index f19a674..0000000
--- a/hal/src/main/java/edu/wpi/first/hal/sim/NotifierSim.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 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. */
-/*----------------------------------------------------------------------------*/
-
-package edu.wpi.first.hal.sim;
-
-import edu.wpi.first.hal.sim.mockdata.NotifierDataJNI;
-
-public final class NotifierSim {
- private NotifierSim() {
- }
-
- public static long getNextTimeout() {
- return NotifierDataJNI.getNextTimeout();
- }
-
- public static int getNumNotifiers() {
- return NotifierDataJNI.getNumNotifiers();
- }
-}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/PCMSim.java b/hal/src/main/java/edu/wpi/first/hal/sim/PCMSim.java
deleted file mode 100644
index f8cc327..0000000
--- a/hal/src/main/java/edu/wpi/first/hal/sim/PCMSim.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* 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. */
-/*----------------------------------------------------------------------------*/
-
-package edu.wpi.first.hal.sim;
-
-import edu.wpi.first.hal.sim.mockdata.PCMDataJNI;
-
-public class PCMSim {
- private final int m_index;
-
- public PCMSim(int index) {
- m_index = index;
- }
-
- public CallbackStore registerSolenoidInitializedCallback(int channel, NotifyCallback callback, boolean initialNotify) {
- int uid = PCMDataJNI.registerSolenoidInitializedCallback(m_index, channel, callback, initialNotify);
- return new CallbackStore(m_index, channel, uid, PCMDataJNI::cancelSolenoidInitializedCallback);
- }
- public boolean getSolenoidInitialized(int channel) {
- return PCMDataJNI.getSolenoidInitialized(m_index, channel);
- }
- public void setSolenoidInitialized(int channel, boolean solenoidInitialized) {
- PCMDataJNI.setSolenoidInitialized(m_index, channel, solenoidInitialized);
- }
-
- public CallbackStore registerSolenoidOutputCallback(int channel, NotifyCallback callback, boolean initialNotify) {
- int uid = PCMDataJNI.registerSolenoidOutputCallback(m_index, channel, callback, initialNotify);
- return new CallbackStore(m_index, channel, uid, PCMDataJNI::cancelSolenoidOutputCallback);
- }
- public boolean getSolenoidOutput(int channel) {
- return PCMDataJNI.getSolenoidOutput(m_index, channel);
- }
- public void setSolenoidOutput(int channel, boolean solenoidOutput) {
- PCMDataJNI.setSolenoidOutput(m_index, channel, solenoidOutput);
- }
-
- public CallbackStore registerCompressorInitializedCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = PCMDataJNI.registerCompressorInitializedCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, PCMDataJNI::cancelCompressorInitializedCallback);
- }
- public boolean getCompressorInitialized() {
- return PCMDataJNI.getCompressorInitialized(m_index);
- }
- public void setCompressorInitialized(boolean compressorInitialized) {
- PCMDataJNI.setCompressorInitialized(m_index, compressorInitialized);
- }
-
- public CallbackStore registerCompressorOnCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = PCMDataJNI.registerCompressorOnCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, PCMDataJNI::cancelCompressorOnCallback);
- }
- public boolean getCompressorOn() {
- return PCMDataJNI.getCompressorOn(m_index);
- }
- public void setCompressorOn(boolean compressorOn) {
- PCMDataJNI.setCompressorOn(m_index, compressorOn);
- }
-
- public CallbackStore registerClosedLoopEnabledCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = PCMDataJNI.registerClosedLoopEnabledCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, PCMDataJNI::cancelClosedLoopEnabledCallback);
- }
- public boolean getClosedLoopEnabled() {
- return PCMDataJNI.getClosedLoopEnabled(m_index);
- }
- public void setClosedLoopEnabled(boolean closedLoopEnabled) {
- PCMDataJNI.setClosedLoopEnabled(m_index, closedLoopEnabled);
- }
-
- public CallbackStore registerPressureSwitchCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = PCMDataJNI.registerPressureSwitchCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, PCMDataJNI::cancelPressureSwitchCallback);
- }
- public boolean getPressureSwitch() {
- return PCMDataJNI.getPressureSwitch(m_index);
- }
- public void setPressureSwitch(boolean pressureSwitch) {
- PCMDataJNI.setPressureSwitch(m_index, pressureSwitch);
- }
-
- public CallbackStore registerCompressorCurrentCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = PCMDataJNI.registerCompressorCurrentCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, PCMDataJNI::cancelCompressorCurrentCallback);
- }
- public double getCompressorCurrent() {
- return PCMDataJNI.getCompressorCurrent(m_index);
- }
- public void setCompressorCurrent(double compressorCurrent) {
- PCMDataJNI.setCompressorCurrent(m_index, compressorCurrent);
- }
-
- public void resetData() {
- PCMDataJNI.resetData(m_index);
- }
-}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/PDPSim.java b/hal/src/main/java/edu/wpi/first/hal/sim/PDPSim.java
deleted file mode 100644
index d44cf3a..0000000
--- a/hal/src/main/java/edu/wpi/first/hal/sim/PDPSim.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* 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. */
-/*----------------------------------------------------------------------------*/
-
-package edu.wpi.first.hal.sim;
-
-import edu.wpi.first.hal.sim.mockdata.PDPDataJNI;
-
-public class PDPSim {
- private final int m_index;
-
- public PDPSim(int index) {
- m_index = index;
- }
-
- public CallbackStore registerInitializedCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = PDPDataJNI.registerInitializedCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, PDPDataJNI::cancelInitializedCallback);
- }
- public boolean getInitialized() {
- return PDPDataJNI.getInitialized(m_index);
- }
- public void setInitialized(boolean initialized) {
- PDPDataJNI.setInitialized(m_index, initialized);
- }
-
- public CallbackStore registerTemperatureCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = PDPDataJNI.registerTemperatureCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, PDPDataJNI::cancelTemperatureCallback);
- }
- public double getTemperature() {
- return PDPDataJNI.getTemperature(m_index);
- }
- public void setTemperature(double temperature) {
- PDPDataJNI.setTemperature(m_index, temperature);
- }
-
- public CallbackStore registerVoltageCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = PDPDataJNI.registerVoltageCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, PDPDataJNI::cancelVoltageCallback);
- }
- public double getVoltage() {
- return PDPDataJNI.getVoltage(m_index);
- }
- public void setVoltage(double voltage) {
- PDPDataJNI.setVoltage(m_index, voltage);
- }
-
- public CallbackStore registerCurrentCallback(int channel, NotifyCallback callback, boolean initialNotify) {
- int uid = PDPDataJNI.registerCurrentCallback(m_index, channel, callback, initialNotify);
- return new CallbackStore(m_index, channel, uid, PDPDataJNI::cancelCurrentCallback);
- }
- public double getCurrent(int channel) {
- return PDPDataJNI.getCurrent(m_index, channel);
- }
- public void setCurrent(int channel, double current) {
- PDPDataJNI.setCurrent(m_index, channel, current);
- }
-
- public void resetData() {
- PDPDataJNI.resetData(m_index);
- }
-}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/PWMSim.java b/hal/src/main/java/edu/wpi/first/hal/sim/PWMSim.java
deleted file mode 100644
index dde38a4..0000000
--- a/hal/src/main/java/edu/wpi/first/hal/sim/PWMSim.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* 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. */
-/*----------------------------------------------------------------------------*/
-
-package edu.wpi.first.hal.sim;
-
-import edu.wpi.first.hal.sim.mockdata.PWMDataJNI;
-
-public class PWMSim {
- private final int m_index;
-
- public PWMSim(int index) {
- m_index = index;
- }
-
- public CallbackStore registerInitializedCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = PWMDataJNI.registerInitializedCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, PWMDataJNI::cancelInitializedCallback);
- }
- public boolean getInitialized() {
- return PWMDataJNI.getInitialized(m_index);
- }
- public void setInitialized(boolean initialized) {
- PWMDataJNI.setInitialized(m_index, initialized);
- }
-
- public CallbackStore registerRawValueCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = PWMDataJNI.registerRawValueCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, PWMDataJNI::cancelRawValueCallback);
- }
- public int getRawValue() {
- return PWMDataJNI.getRawValue(m_index);
- }
- public void setRawValue(int rawValue) {
- PWMDataJNI.setRawValue(m_index, rawValue);
- }
-
- public CallbackStore registerSpeedCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = PWMDataJNI.registerSpeedCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, PWMDataJNI::cancelSpeedCallback);
- }
- public double getSpeed() {
- return PWMDataJNI.getSpeed(m_index);
- }
- public void setSpeed(double speed) {
- PWMDataJNI.setSpeed(m_index, speed);
- }
-
- public CallbackStore registerPositionCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = PWMDataJNI.registerPositionCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, PWMDataJNI::cancelPositionCallback);
- }
- public double getPosition() {
- return PWMDataJNI.getPosition(m_index);
- }
- public void setPosition(double position) {
- PWMDataJNI.setPosition(m_index, position);
- }
-
- public CallbackStore registerPeriodScaleCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = PWMDataJNI.registerPeriodScaleCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, PWMDataJNI::cancelPeriodScaleCallback);
- }
- public int getPeriodScale() {
- return PWMDataJNI.getPeriodScale(m_index);
- }
- public void setPeriodScale(int periodScale) {
- PWMDataJNI.setPeriodScale(m_index, periodScale);
- }
-
- public CallbackStore registerZeroLatchCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = PWMDataJNI.registerZeroLatchCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, PWMDataJNI::cancelZeroLatchCallback);
- }
- public boolean getZeroLatch() {
- return PWMDataJNI.getZeroLatch(m_index);
- }
- public void setZeroLatch(boolean zeroLatch) {
- PWMDataJNI.setZeroLatch(m_index, zeroLatch);
- }
-
- public void resetData() {
- PWMDataJNI.resetData(m_index);
- }
-}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/RelaySim.java b/hal/src/main/java/edu/wpi/first/hal/sim/RelaySim.java
deleted file mode 100644
index 84059e8..0000000
--- a/hal/src/main/java/edu/wpi/first/hal/sim/RelaySim.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* 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. */
-/*----------------------------------------------------------------------------*/
-
-package edu.wpi.first.hal.sim;
-
-import edu.wpi.first.hal.sim.mockdata.RelayDataJNI;
-
-public class RelaySim {
- private final int m_index;
-
- public RelaySim(int index) {
- m_index = index;
- }
-
- public CallbackStore registerInitializedForwardCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = RelayDataJNI.registerInitializedForwardCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, RelayDataJNI::cancelInitializedForwardCallback);
- }
- public boolean getInitializedForward() {
- return RelayDataJNI.getInitializedForward(m_index);
- }
- public void setInitializedForward(boolean initializedForward) {
- RelayDataJNI.setInitializedForward(m_index, initializedForward);
- }
-
- public CallbackStore registerInitializedReverseCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = RelayDataJNI.registerInitializedReverseCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, RelayDataJNI::cancelInitializedReverseCallback);
- }
- public boolean getInitializedReverse() {
- return RelayDataJNI.getInitializedReverse(m_index);
- }
- public void setInitializedReverse(boolean initializedReverse) {
- RelayDataJNI.setInitializedReverse(m_index, initializedReverse);
- }
-
- public CallbackStore registerForwardCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = RelayDataJNI.registerForwardCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, RelayDataJNI::cancelForwardCallback);
- }
- public boolean getForward() {
- return RelayDataJNI.getForward(m_index);
- }
- public void setForward(boolean forward) {
- RelayDataJNI.setForward(m_index, forward);
- }
-
- public CallbackStore registerReverseCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = RelayDataJNI.registerReverseCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, RelayDataJNI::cancelReverseCallback);
- }
- public boolean getReverse() {
- return RelayDataJNI.getReverse(m_index);
- }
- public void setReverse(boolean reverse) {
- RelayDataJNI.setReverse(m_index, reverse);
- }
-
- public void resetData() {
- RelayDataJNI.resetData(m_index);
- }
-}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/RoboRioSim.java b/hal/src/main/java/edu/wpi/first/hal/sim/RoboRioSim.java
deleted file mode 100644
index 082f712..0000000
--- a/hal/src/main/java/edu/wpi/first/hal/sim/RoboRioSim.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* 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. */
-/*----------------------------------------------------------------------------*/
-
-package edu.wpi.first.hal.sim;
-
-import edu.wpi.first.hal.sim.mockdata.RoboRioDataJNI;
-
-@SuppressWarnings({"PMD.ExcessivePublicCount", "PMD.TooManyMethods"})
-public class RoboRioSim {
- private final int m_index;
-
- public RoboRioSim(int index) {
- m_index = index;
- }
-
- public CallbackStore registerFPGAButtonCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = RoboRioDataJNI.registerFPGAButtonCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, RoboRioDataJNI::cancelFPGAButtonCallback);
- }
- public boolean getFPGAButton() {
- return RoboRioDataJNI.getFPGAButton(m_index);
- }
- public void setFPGAButton(boolean fPGAButton) {
- RoboRioDataJNI.setFPGAButton(m_index, fPGAButton);
- }
-
- public CallbackStore registerVInVoltageCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = RoboRioDataJNI.registerVInVoltageCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, RoboRioDataJNI::cancelVInVoltageCallback);
- }
- public double getVInVoltage() {
- return RoboRioDataJNI.getVInVoltage(m_index);
- }
- public void setVInVoltage(double vInVoltage) {
- RoboRioDataJNI.setVInVoltage(m_index, vInVoltage);
- }
-
- public CallbackStore registerVInCurrentCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = RoboRioDataJNI.registerVInCurrentCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, RoboRioDataJNI::cancelVInCurrentCallback);
- }
- public double getVInCurrent() {
- return RoboRioDataJNI.getVInCurrent(m_index);
- }
- public void setVInCurrent(double vInCurrent) {
- RoboRioDataJNI.setVInCurrent(m_index, vInCurrent);
- }
-
- public CallbackStore registerUserVoltage6VCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = RoboRioDataJNI.registerUserVoltage6VCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, RoboRioDataJNI::cancelUserVoltage6VCallback);
- }
- public double getUserVoltage6V() {
- return RoboRioDataJNI.getUserVoltage6V(m_index);
- }
- public void setUserVoltage6V(double userVoltage6V) {
- RoboRioDataJNI.setUserVoltage6V(m_index, userVoltage6V);
- }
-
- public CallbackStore registerUserCurrent6VCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = RoboRioDataJNI.registerUserCurrent6VCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, RoboRioDataJNI::cancelUserCurrent6VCallback);
- }
- public double getUserCurrent6V() {
- return RoboRioDataJNI.getUserCurrent6V(m_index);
- }
- public void setUserCurrent6V(double userCurrent6V) {
- RoboRioDataJNI.setUserCurrent6V(m_index, userCurrent6V);
- }
-
- public CallbackStore registerUserActive6VCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = RoboRioDataJNI.registerUserActive6VCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, RoboRioDataJNI::cancelUserActive6VCallback);
- }
- public boolean getUserActive6V() {
- return RoboRioDataJNI.getUserActive6V(m_index);
- }
- public void setUserActive6V(boolean userActive6V) {
- RoboRioDataJNI.setUserActive6V(m_index, userActive6V);
- }
-
- public CallbackStore registerUserVoltage5VCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = RoboRioDataJNI.registerUserVoltage5VCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, RoboRioDataJNI::cancelUserVoltage5VCallback);
- }
- public double getUserVoltage5V() {
- return RoboRioDataJNI.getUserVoltage5V(m_index);
- }
- public void setUserVoltage5V(double userVoltage5V) {
- RoboRioDataJNI.setUserVoltage5V(m_index, userVoltage5V);
- }
-
- public CallbackStore registerUserCurrent5VCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = RoboRioDataJNI.registerUserCurrent5VCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, RoboRioDataJNI::cancelUserCurrent5VCallback);
- }
- public double getUserCurrent5V() {
- return RoboRioDataJNI.getUserCurrent5V(m_index);
- }
- public void setUserCurrent5V(double userCurrent5V) {
- RoboRioDataJNI.setUserCurrent5V(m_index, userCurrent5V);
- }
-
- public CallbackStore registerUserActive5VCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = RoboRioDataJNI.registerUserActive5VCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, RoboRioDataJNI::cancelUserActive5VCallback);
- }
- public boolean getUserActive5V() {
- return RoboRioDataJNI.getUserActive5V(m_index);
- }
- public void setUserActive5V(boolean userActive5V) {
- RoboRioDataJNI.setUserActive5V(m_index, userActive5V);
- }
-
- public CallbackStore registerUserVoltage3V3Callback(NotifyCallback callback, boolean initialNotify) {
- int uid = RoboRioDataJNI.registerUserVoltage3V3Callback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, RoboRioDataJNI::cancelUserVoltage3V3Callback);
- }
- public double getUserVoltage3V3() {
- return RoboRioDataJNI.getUserVoltage3V3(m_index);
- }
- public void setUserVoltage3V3(double userVoltage3V3) {
- RoboRioDataJNI.setUserVoltage3V3(m_index, userVoltage3V3);
- }
-
- public CallbackStore registerUserCurrent3V3Callback(NotifyCallback callback, boolean initialNotify) {
- int uid = RoboRioDataJNI.registerUserCurrent3V3Callback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, RoboRioDataJNI::cancelUserCurrent3V3Callback);
- }
- public double getUserCurrent3V3() {
- return RoboRioDataJNI.getUserCurrent3V3(m_index);
- }
- public void setUserCurrent3V3(double userCurrent3V3) {
- RoboRioDataJNI.setUserCurrent3V3(m_index, userCurrent3V3);
- }
-
- public CallbackStore registerUserActive3V3Callback(NotifyCallback callback, boolean initialNotify) {
- int uid = RoboRioDataJNI.registerUserActive3V3Callback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, RoboRioDataJNI::cancelUserActive3V3Callback);
- }
- public boolean getUserActive3V3() {
- return RoboRioDataJNI.getUserActive3V3(m_index);
- }
- public void setUserActive3V3(boolean userActive3V3) {
- RoboRioDataJNI.setUserActive3V3(m_index, userActive3V3);
- }
-
- public CallbackStore registerUserFaults6VCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = RoboRioDataJNI.registerUserFaults6VCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, RoboRioDataJNI::cancelUserFaults6VCallback);
- }
- public int getUserFaults6V() {
- return RoboRioDataJNI.getUserFaults6V(m_index);
- }
- public void setUserFaults6V(int userFaults6V) {
- RoboRioDataJNI.setUserFaults6V(m_index, userFaults6V);
- }
-
- public CallbackStore registerUserFaults5VCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = RoboRioDataJNI.registerUserFaults5VCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, RoboRioDataJNI::cancelUserFaults5VCallback);
- }
- public int getUserFaults5V() {
- return RoboRioDataJNI.getUserFaults5V(m_index);
- }
- public void setUserFaults5V(int userFaults5V) {
- RoboRioDataJNI.setUserFaults5V(m_index, userFaults5V);
- }
-
- public CallbackStore registerUserFaults3V3Callback(NotifyCallback callback, boolean initialNotify) {
- int uid = RoboRioDataJNI.registerUserFaults3V3Callback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, RoboRioDataJNI::cancelUserFaults3V3Callback);
- }
- public int getUserFaults3V3() {
- return RoboRioDataJNI.getUserFaults3V3(m_index);
- }
- public void setUserFaults3V3(int userFaults3V3) {
- RoboRioDataJNI.setUserFaults3V3(m_index, userFaults3V3);
- }
-
- public void resetData() {
- RoboRioDataJNI.resetData(m_index);
- }
-}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/SPIAccelerometerSim.java b/hal/src/main/java/edu/wpi/first/hal/sim/SPIAccelerometerSim.java
deleted file mode 100644
index 94577bd..0000000
--- a/hal/src/main/java/edu/wpi/first/hal/sim/SPIAccelerometerSim.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* 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. */
-/*----------------------------------------------------------------------------*/
-
-package edu.wpi.first.hal.sim;
-
-import edu.wpi.first.hal.sim.mockdata.SPIAccelerometerDataJNI;
-
-public class SPIAccelerometerSim {
- private final int m_index;
-
- public SPIAccelerometerSim(int index) {
- m_index = index;
- }
-
- public CallbackStore registerActiveCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = SPIAccelerometerDataJNI.registerActiveCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, SPIAccelerometerDataJNI::cancelActiveCallback);
- }
- public boolean getActive() {
- return SPIAccelerometerDataJNI.getActive(m_index);
- }
- public void setActive(boolean active) {
- SPIAccelerometerDataJNI.setActive(m_index, active);
- }
-
- public CallbackStore registerRangeCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = SPIAccelerometerDataJNI.registerRangeCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, SPIAccelerometerDataJNI::cancelRangeCallback);
- }
- public int getRange() {
- return SPIAccelerometerDataJNI.getRange(m_index);
- }
- public void setRange(int range) {
- SPIAccelerometerDataJNI.setRange(m_index, range);
- }
-
- public CallbackStore registerXCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = SPIAccelerometerDataJNI.registerXCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, SPIAccelerometerDataJNI::cancelXCallback);
- }
- public double getX() {
- return SPIAccelerometerDataJNI.getX(m_index);
- }
- public void setX(double x) {
- SPIAccelerometerDataJNI.setX(m_index, x);
- }
-
- public CallbackStore registerYCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = SPIAccelerometerDataJNI.registerYCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, SPIAccelerometerDataJNI::cancelYCallback);
- }
- public double getY() {
- return SPIAccelerometerDataJNI.getY(m_index);
- }
- public void setY(double y) {
- SPIAccelerometerDataJNI.setY(m_index, y);
- }
-
- public CallbackStore registerZCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = SPIAccelerometerDataJNI.registerZCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, SPIAccelerometerDataJNI::cancelZCallback);
- }
- public double getZ() {
- return SPIAccelerometerDataJNI.getZ(m_index);
- }
- public void setZ(double z) {
- SPIAccelerometerDataJNI.setZ(m_index, z);
- }
-
- public void resetData() {
- SPIAccelerometerDataJNI.resetData(m_index);
- }
-}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/SPISim.java b/hal/src/main/java/edu/wpi/first/hal/sim/SPISim.java
deleted file mode 100644
index 5f43bca..0000000
--- a/hal/src/main/java/edu/wpi/first/hal/sim/SPISim.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* 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. */
-/*----------------------------------------------------------------------------*/
-
-package edu.wpi.first.hal.sim;
-
-import edu.wpi.first.hal.sim.mockdata.SPIDataJNI;
-
-public class SPISim {
- private final int m_index;
-
- public SPISim(int index) {
- m_index = index;
- }
-
- public CallbackStore registerInitializedCallback(NotifyCallback callback, boolean initialNotify) {
- int uid = SPIDataJNI.registerInitializedCallback(m_index, callback, initialNotify);
- return new CallbackStore(m_index, uid, SPIDataJNI::cancelInitializedCallback);
- }
- public boolean getInitialized() {
- return SPIDataJNI.getInitialized(m_index);
- }
- public void setInitialized(boolean initialized) {
- SPIDataJNI.setInitialized(m_index, initialized);
- }
-
- public CallbackStore registerReadCallback(BufferCallback callback) {
- int uid = SPIDataJNI.registerReadCallback(m_index, callback);
- return new CallbackStore(m_index, uid, SPIDataJNI::cancelReadCallback);
- }
-
- public CallbackStore registerWriteCallback(ConstBufferCallback callback) {
- int uid = SPIDataJNI.registerWriteCallback(m_index, callback);
- return new CallbackStore(m_index, uid, SPIDataJNI::cancelWriteCallback);
- }
-
- public CallbackStore registerReadAutoReceiveBufferCallback(SpiReadAutoReceiveBufferCallback callback) {
- int uid = SPIDataJNI.registerReadAutoReceiveBufferCallback(m_index, callback);
- return new CallbackStore(m_index, uid, SPIDataJNI::cancelReadAutoReceiveBufferCallback);
- }
-
- public void resetData() {
- SPIDataJNI.resetData(m_index);
- }
-}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/SimDeviceSim.java b/hal/src/main/java/edu/wpi/first/hal/sim/SimDeviceSim.java
deleted file mode 100644
index e46c811..0000000
--- a/hal/src/main/java/edu/wpi/first/hal/sim/SimDeviceSim.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 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. */
-/*----------------------------------------------------------------------------*/
-
-package edu.wpi.first.hal.sim;
-
-import edu.wpi.first.hal.SimBoolean;
-import edu.wpi.first.hal.SimDouble;
-import edu.wpi.first.hal.SimEnum;
-import edu.wpi.first.hal.SimValue;
-import edu.wpi.first.hal.sim.mockdata.SimDeviceDataJNI;
-
-public class SimDeviceSim {
- private final int m_handle;
-
- public SimDeviceSim(String name) {
- m_handle = SimDeviceDataJNI.getSimDeviceHandle(name);
- }
-
- public SimValue getValue(String name) {
- int handle = SimDeviceDataJNI.getSimValueHandle(m_handle, name);
- if (handle <= 0) {
- return null;
- }
- return new SimValue(handle);
- }
-
- public SimDouble getDouble(String name) {
- int handle = SimDeviceDataJNI.getSimValueHandle(m_handle, name);
- if (handle <= 0) {
- return null;
- }
- return new SimDouble(handle);
- }
-
- public SimEnum getEnum(String name) {
- int handle = SimDeviceDataJNI.getSimValueHandle(m_handle, name);
- if (handle <= 0) {
- return null;
- }
- return new SimEnum(handle);
- }
-
- public SimBoolean getBoolean(String name) {
- int handle = SimDeviceDataJNI.getSimValueHandle(m_handle, name);
- if (handle <= 0) {
- return null;
- }
- return new SimBoolean(handle);
- }
-
- public static String[] getEnumOptions(SimEnum val) {
- return SimDeviceDataJNI.getSimValueEnumOptions(val.getNativeHandle());
- }
-
- public SimDeviceDataJNI.SimValueInfo[] enumerateValues() {
- return SimDeviceDataJNI.enumerateSimValues(m_handle);
- }
-
- public int getNativeHandle() {
- return m_handle;
- }
-
- public CallbackStore registerValueCreatedCallback(SimValueCallback callback, boolean initialNotify) {
- int uid = SimDeviceDataJNI.registerSimValueCreatedCallback(m_handle, callback, initialNotify);
- return new CallbackStore(uid, SimDeviceDataJNI::cancelSimValueCreatedCallback);
- }
-
- public CallbackStore registerValueChangedCallback(SimValueCallback callback, boolean initialNotify) {
- int uid = SimDeviceDataJNI.registerSimValueChangedCallback(m_handle, callback, initialNotify);
- return new CallbackStore(uid, SimDeviceDataJNI::cancelSimValueChangedCallback);
- }
-
- public static SimDeviceDataJNI.SimDeviceInfo[] enumerateDevices(String prefix) {
- return SimDeviceDataJNI.enumerateSimDevices(prefix);
- }
-
- public CallbackStore registerDeviceCreatedCallback(String prefix, SimDeviceCallback callback, boolean initialNotify) {
- int uid = SimDeviceDataJNI.registerSimDeviceCreatedCallback(prefix, callback, initialNotify);
- return new CallbackStore(uid, SimDeviceDataJNI::cancelSimDeviceCreatedCallback);
- }
-
- public CallbackStore registerDeviceFreedCallback(String prefix, SimDeviceCallback callback) {
- int uid = SimDeviceDataJNI.registerSimDeviceFreedCallback(prefix, callback);
- return new CallbackStore(uid, SimDeviceDataJNI::cancelSimDeviceFreedCallback);
- }
-
- public static void resetData() {
- SimDeviceDataJNI.resetSimDeviceData();
- }
-}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/SimHooks.java b/hal/src/main/java/edu/wpi/first/hal/sim/SimHooks.java
deleted file mode 100644
index 9805497..0000000
--- a/hal/src/main/java/edu/wpi/first/hal/sim/SimHooks.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 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. */
-/*----------------------------------------------------------------------------*/
-
-package edu.wpi.first.hal.sim;
-
-import edu.wpi.first.hal.sim.mockdata.SimulatorJNI;
-
-public final class SimHooks {
- private SimHooks() {
- }
-
- public static void waitForProgramStart() {
- SimulatorJNI.waitForProgramStart();
- }
-
- public static void setProgramStarted() {
- SimulatorJNI.setProgramStarted();
- }
-
- public static void restartTiming() {
- SimulatorJNI.restartTiming();
- }
-
- public static void pauseTiming() {
- SimulatorJNI.pauseTiming();
- }
-
- public static void resumeTiming() {
- SimulatorJNI.resumeTiming();
- }
-
- public static boolean isTimingPaused() {
- return SimulatorJNI.isTimingPaused();
- }
-
- public static void stepTiming(long delta) {
- SimulatorJNI.stepTiming(delta);
- }
-}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/DriverStationDataJNI.java b/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/DriverStationDataJNI.java
deleted file mode 100644
index ec19735..0000000
--- a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/DriverStationDataJNI.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 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. */
-/*----------------------------------------------------------------------------*/
-
-package edu.wpi.first.hal.sim.mockdata;
-
-import edu.wpi.first.hal.JNIWrapper;
-import edu.wpi.first.hal.sim.NotifyCallback;
-
-public class DriverStationDataJNI extends JNIWrapper {
- public static native int registerEnabledCallback(NotifyCallback callback, boolean initialNotify);
- public static native void cancelEnabledCallback(int uid);
- public static native boolean getEnabled();
- public static native void setEnabled(boolean enabled);
-
- public static native int registerAutonomousCallback(NotifyCallback callback, boolean initialNotify);
- public static native void cancelAutonomousCallback(int uid);
- public static native boolean getAutonomous();
- public static native void setAutonomous(boolean autonomous);
-
- public static native int registerTestCallback(NotifyCallback callback, boolean initialNotify);
- public static native void cancelTestCallback(int uid);
- public static native boolean getTest();
- public static native void setTest(boolean test);
-
- public static native int registerEStopCallback(NotifyCallback callback, boolean initialNotify);
- public static native void cancelEStopCallback(int uid);
- public static native boolean getEStop();
- public static native void setEStop(boolean eStop);
-
- public static native int registerFmsAttachedCallback(NotifyCallback callback, boolean initialNotify);
- public static native void cancelFmsAttachedCallback(int uid);
- public static native boolean getFmsAttached();
- public static native void setFmsAttached(boolean fmsAttached);
-
- public static native int registerDsAttachedCallback(NotifyCallback callback, boolean initialNotify);
- public static native void cancelDsAttachedCallback(int uid);
- public static native boolean getDsAttached();
- public static native void setDsAttached(boolean dsAttached);
-
- public static native void setJoystickAxes(byte joystickNum, float[] axesArray);
- public static native void setJoystickPOVs(byte joystickNum, short[] povsArray);
- public static native void setJoystickButtons(byte joystickNum, int buttons, int count);
-
- public static native void setMatchInfo(String eventName, String gameSpecificMessage, int matchNumber, int replayNumber, int matchType);
- public static native void registerAllCallbacks(NotifyCallback callback, boolean initialNotify);
- public static native void notifyNewData();
-
- public static native void setSendError(boolean shouldSend);
-
- public static native void resetData();
-}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/RoboRioDataJNI.java b/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/RoboRioDataJNI.java
deleted file mode 100644
index a13845c..0000000
--- a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/RoboRioDataJNI.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* 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. */
-/*----------------------------------------------------------------------------*/
-
-package edu.wpi.first.hal.sim.mockdata;
-
-import edu.wpi.first.hal.sim.NotifyCallback;
-import edu.wpi.first.hal.JNIWrapper;
-
-public class RoboRioDataJNI extends JNIWrapper {
- public static native int registerFPGAButtonCallback(int index, NotifyCallback callback, boolean initialNotify);
- public static native void cancelFPGAButtonCallback(int index, int uid);
- public static native boolean getFPGAButton(int index);
- public static native void setFPGAButton(int index, boolean fPGAButton);
-
- public static native int registerVInVoltageCallback(int index, NotifyCallback callback, boolean initialNotify);
- public static native void cancelVInVoltageCallback(int index, int uid);
- public static native double getVInVoltage(int index);
- public static native void setVInVoltage(int index, double vInVoltage);
-
- public static native int registerVInCurrentCallback(int index, NotifyCallback callback, boolean initialNotify);
- public static native void cancelVInCurrentCallback(int index, int uid);
- public static native double getVInCurrent(int index);
- public static native void setVInCurrent(int index, double vInCurrent);
-
- public static native int registerUserVoltage6VCallback(int index, NotifyCallback callback, boolean initialNotify);
- public static native void cancelUserVoltage6VCallback(int index, int uid);
- public static native double getUserVoltage6V(int index);
- public static native void setUserVoltage6V(int index, double userVoltage6V);
-
- public static native int registerUserCurrent6VCallback(int index, NotifyCallback callback, boolean initialNotify);
- public static native void cancelUserCurrent6VCallback(int index, int uid);
- public static native double getUserCurrent6V(int index);
- public static native void setUserCurrent6V(int index, double userCurrent6V);
-
- public static native int registerUserActive6VCallback(int index, NotifyCallback callback, boolean initialNotify);
- public static native void cancelUserActive6VCallback(int index, int uid);
- public static native boolean getUserActive6V(int index);
- public static native void setUserActive6V(int index, boolean userActive6V);
-
- public static native int registerUserVoltage5VCallback(int index, NotifyCallback callback, boolean initialNotify);
- public static native void cancelUserVoltage5VCallback(int index, int uid);
- public static native double getUserVoltage5V(int index);
- public static native void setUserVoltage5V(int index, double userVoltage5V);
-
- public static native int registerUserCurrent5VCallback(int index, NotifyCallback callback, boolean initialNotify);
- public static native void cancelUserCurrent5VCallback(int index, int uid);
- public static native double getUserCurrent5V(int index);
- public static native void setUserCurrent5V(int index, double userCurrent5V);
-
- public static native int registerUserActive5VCallback(int index, NotifyCallback callback, boolean initialNotify);
- public static native void cancelUserActive5VCallback(int index, int uid);
- public static native boolean getUserActive5V(int index);
- public static native void setUserActive5V(int index, boolean userActive5V);
-
- public static native int registerUserVoltage3V3Callback(int index, NotifyCallback callback, boolean initialNotify);
- public static native void cancelUserVoltage3V3Callback(int index, int uid);
- public static native double getUserVoltage3V3(int index);
- public static native void setUserVoltage3V3(int index, double userVoltage3V3);
-
- public static native int registerUserCurrent3V3Callback(int index, NotifyCallback callback, boolean initialNotify);
- public static native void cancelUserCurrent3V3Callback(int index, int uid);
- public static native double getUserCurrent3V3(int index);
- public static native void setUserCurrent3V3(int index, double userCurrent3V3);
-
- public static native int registerUserActive3V3Callback(int index, NotifyCallback callback, boolean initialNotify);
- public static native void cancelUserActive3V3Callback(int index, int uid);
- public static native boolean getUserActive3V3(int index);
- public static native void setUserActive3V3(int index, boolean userActive3V3);
-
- public static native int registerUserFaults6VCallback(int index, NotifyCallback callback, boolean initialNotify);
- public static native void cancelUserFaults6VCallback(int index, int uid);
- public static native int getUserFaults6V(int index);
- public static native void setUserFaults6V(int index, int userFaults6V);
-
- public static native int registerUserFaults5VCallback(int index, NotifyCallback callback, boolean initialNotify);
- public static native void cancelUserFaults5VCallback(int index, int uid);
- public static native int getUserFaults5V(int index);
- public static native void setUserFaults5V(int index, int userFaults5V);
-
- public static native int registerUserFaults3V3Callback(int index, NotifyCallback callback, boolean initialNotify);
- public static native void cancelUserFaults3V3Callback(int index, int uid);
- public static native int getUserFaults3V3(int index);
- public static native void setUserFaults3V3(int index, int userFaults3V3);
-
- public static native void resetData(int index);
-}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/AccelerometerDataJNI.java b/hal/src/main/java/edu/wpi/first/hal/simulation/AccelerometerDataJNI.java
similarity index 92%
rename from hal/src/main/java/edu/wpi/first/hal/sim/mockdata/AccelerometerDataJNI.java
rename to hal/src/main/java/edu/wpi/first/hal/simulation/AccelerometerDataJNI.java
index 22276d4..cb42c98 100644
--- a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/AccelerometerDataJNI.java
+++ b/hal/src/main/java/edu/wpi/first/hal/simulation/AccelerometerDataJNI.java
@@ -1,13 +1,12 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
/*----------------------------------------------------------------------------*/
-package edu.wpi.first.hal.sim.mockdata;
+package edu.wpi.first.hal.simulation;
-import edu.wpi.first.hal.sim.NotifyCallback;
import edu.wpi.first.hal.JNIWrapper;
public class AccelerometerDataJNI extends JNIWrapper {
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/AddressableLEDDataJNI.java b/hal/src/main/java/edu/wpi/first/hal/simulation/AddressableLEDDataJNI.java
similarity index 91%
rename from hal/src/main/java/edu/wpi/first/hal/sim/mockdata/AddressableLEDDataJNI.java
rename to hal/src/main/java/edu/wpi/first/hal/simulation/AddressableLEDDataJNI.java
index 8098e68..0aa4d47 100644
--- a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/AddressableLEDDataJNI.java
+++ b/hal/src/main/java/edu/wpi/first/hal/simulation/AddressableLEDDataJNI.java
@@ -1,14 +1,12 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2019-2020 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. */
/*----------------------------------------------------------------------------*/
-package edu.wpi.first.hal.sim.mockdata;
+package edu.wpi.first.hal.simulation;
-import edu.wpi.first.hal.sim.ConstBufferCallback;
-import edu.wpi.first.hal.sim.NotifyCallback;
import edu.wpi.first.hal.JNIWrapper;
public class AddressableLEDDataJNI extends JNIWrapper {
@@ -38,4 +36,6 @@
public static native void setData(int index, byte[] data);
public static native void resetData(int index);
+
+ public static native int findForChannel(int channel);
}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/AnalogGyroDataJNI.java b/hal/src/main/java/edu/wpi/first/hal/simulation/AnalogGyroDataJNI.java
similarity index 90%
rename from hal/src/main/java/edu/wpi/first/hal/sim/mockdata/AnalogGyroDataJNI.java
rename to hal/src/main/java/edu/wpi/first/hal/simulation/AnalogGyroDataJNI.java
index 4995df2..42cc508 100644
--- a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/AnalogGyroDataJNI.java
+++ b/hal/src/main/java/edu/wpi/first/hal/simulation/AnalogGyroDataJNI.java
@@ -1,13 +1,12 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
/*----------------------------------------------------------------------------*/
-package edu.wpi.first.hal.sim.mockdata;
+package edu.wpi.first.hal.simulation;
-import edu.wpi.first.hal.sim.NotifyCallback;
import edu.wpi.first.hal.JNIWrapper;
public class AnalogGyroDataJNI extends JNIWrapper {
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/AnalogInDataJNI.java b/hal/src/main/java/edu/wpi/first/hal/simulation/AnalogInDataJNI.java
similarity index 95%
rename from hal/src/main/java/edu/wpi/first/hal/sim/mockdata/AnalogInDataJNI.java
rename to hal/src/main/java/edu/wpi/first/hal/simulation/AnalogInDataJNI.java
index ed4fbac..3656ffa 100644
--- a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/AnalogInDataJNI.java
+++ b/hal/src/main/java/edu/wpi/first/hal/simulation/AnalogInDataJNI.java
@@ -1,13 +1,12 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
/*----------------------------------------------------------------------------*/
-package edu.wpi.first.hal.sim.mockdata;
+package edu.wpi.first.hal.simulation;
-import edu.wpi.first.hal.sim.NotifyCallback;
import edu.wpi.first.hal.JNIWrapper;
public class AnalogInDataJNI extends JNIWrapper {
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/AnalogOutDataJNI.java b/hal/src/main/java/edu/wpi/first/hal/simulation/AnalogOutDataJNI.java
similarity index 88%
rename from hal/src/main/java/edu/wpi/first/hal/sim/mockdata/AnalogOutDataJNI.java
rename to hal/src/main/java/edu/wpi/first/hal/simulation/AnalogOutDataJNI.java
index 2f7596c..23bc8ac 100644
--- a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/AnalogOutDataJNI.java
+++ b/hal/src/main/java/edu/wpi/first/hal/simulation/AnalogOutDataJNI.java
@@ -1,13 +1,12 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
/*----------------------------------------------------------------------------*/
-package edu.wpi.first.hal.sim.mockdata;
+package edu.wpi.first.hal.simulation;
-import edu.wpi.first.hal.sim.NotifyCallback;
import edu.wpi.first.hal.JNIWrapper;
public class AnalogOutDataJNI extends JNIWrapper {
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/AnalogTriggerDataJNI.java b/hal/src/main/java/edu/wpi/first/hal/simulation/AnalogTriggerDataJNI.java
similarity index 90%
rename from hal/src/main/java/edu/wpi/first/hal/sim/mockdata/AnalogTriggerDataJNI.java
rename to hal/src/main/java/edu/wpi/first/hal/simulation/AnalogTriggerDataJNI.java
index cf4187f..ca89a28 100644
--- a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/AnalogTriggerDataJNI.java
+++ b/hal/src/main/java/edu/wpi/first/hal/simulation/AnalogTriggerDataJNI.java
@@ -1,13 +1,12 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
/*----------------------------------------------------------------------------*/
-package edu.wpi.first.hal.sim.mockdata;
+package edu.wpi.first.hal.simulation;
-import edu.wpi.first.hal.sim.NotifyCallback;
import edu.wpi.first.hal.JNIWrapper;
public class AnalogTriggerDataJNI extends JNIWrapper {
@@ -27,4 +26,6 @@
public static native void setTriggerUpperBound(int index, double triggerUpperBound);
public static native void resetData(int index);
+
+ public static native int findForChannel(int channel);
}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/BufferCallback.java b/hal/src/main/java/edu/wpi/first/hal/simulation/BufferCallback.java
similarity index 83%
rename from hal/src/main/java/edu/wpi/first/hal/sim/BufferCallback.java
rename to hal/src/main/java/edu/wpi/first/hal/simulation/BufferCallback.java
index 0f7b2d9..a8d8ce1 100644
--- a/hal/src/main/java/edu/wpi/first/hal/sim/BufferCallback.java
+++ b/hal/src/main/java/edu/wpi/first/hal/simulation/BufferCallback.java
@@ -1,11 +1,11 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
/*----------------------------------------------------------------------------*/
-package edu.wpi.first.hal.sim;
+package edu.wpi.first.hal.simulation;
public interface BufferCallback {
void callback(String name, byte[] buffer, int count);
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/ConstBufferCallback.java b/hal/src/main/java/edu/wpi/first/hal/simulation/ConstBufferCallback.java
similarity index 83%
rename from hal/src/main/java/edu/wpi/first/hal/sim/ConstBufferCallback.java
rename to hal/src/main/java/edu/wpi/first/hal/simulation/ConstBufferCallback.java
index a4251c2..6cb2375 100644
--- a/hal/src/main/java/edu/wpi/first/hal/sim/ConstBufferCallback.java
+++ b/hal/src/main/java/edu/wpi/first/hal/simulation/ConstBufferCallback.java
@@ -1,11 +1,11 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
/*----------------------------------------------------------------------------*/
-package edu.wpi.first.hal.sim;
+package edu.wpi.first.hal.simulation;
public interface ConstBufferCallback {
void callback(String name, byte[] buffer, int count);
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/DIODataJNI.java b/hal/src/main/java/edu/wpi/first/hal/simulation/DIODataJNI.java
similarity index 93%
rename from hal/src/main/java/edu/wpi/first/hal/sim/mockdata/DIODataJNI.java
rename to hal/src/main/java/edu/wpi/first/hal/simulation/DIODataJNI.java
index 55de7de..5d41a2f 100644
--- a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/DIODataJNI.java
+++ b/hal/src/main/java/edu/wpi/first/hal/simulation/DIODataJNI.java
@@ -1,13 +1,12 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
/*----------------------------------------------------------------------------*/
-package edu.wpi.first.hal.sim.mockdata;
+package edu.wpi.first.hal.simulation;
-import edu.wpi.first.hal.sim.NotifyCallback;
import edu.wpi.first.hal.JNIWrapper;
public class DIODataJNI extends JNIWrapper {
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/DigitalPWMDataJNI.java b/hal/src/main/java/edu/wpi/first/hal/simulation/DigitalPWMDataJNI.java
similarity index 90%
rename from hal/src/main/java/edu/wpi/first/hal/sim/mockdata/DigitalPWMDataJNI.java
rename to hal/src/main/java/edu/wpi/first/hal/simulation/DigitalPWMDataJNI.java
index 69bee07..4e2709f 100644
--- a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/DigitalPWMDataJNI.java
+++ b/hal/src/main/java/edu/wpi/first/hal/simulation/DigitalPWMDataJNI.java
@@ -1,13 +1,12 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
/*----------------------------------------------------------------------------*/
-package edu.wpi.first.hal.sim.mockdata;
+package edu.wpi.first.hal.simulation;
-import edu.wpi.first.hal.sim.NotifyCallback;
import edu.wpi.first.hal.JNIWrapper;
public class DigitalPWMDataJNI extends JNIWrapper {
@@ -27,4 +26,6 @@
public static native void setPin(int index, int pin);
public static native void resetData(int index);
+
+ public static native int findForChannel(int channel);
}
diff --git a/hal/src/main/java/edu/wpi/first/hal/simulation/DriverStationDataJNI.java b/hal/src/main/java/edu/wpi/first/hal/simulation/DriverStationDataJNI.java
new file mode 100644
index 0000000..a1046c5
--- /dev/null
+++ b/hal/src/main/java/edu/wpi/first/hal/simulation/DriverStationDataJNI.java
@@ -0,0 +1,87 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2018-2020 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. */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.hal.simulation;
+
+import edu.wpi.first.hal.JNIWrapper;
+
+public class DriverStationDataJNI extends JNIWrapper {
+ public static native int registerEnabledCallback(NotifyCallback callback, boolean initialNotify);
+ public static native void cancelEnabledCallback(int uid);
+ public static native boolean getEnabled();
+ public static native void setEnabled(boolean enabled);
+
+ public static native int registerAutonomousCallback(NotifyCallback callback, boolean initialNotify);
+ public static native void cancelAutonomousCallback(int uid);
+ public static native boolean getAutonomous();
+ public static native void setAutonomous(boolean autonomous);
+
+ public static native int registerTestCallback(NotifyCallback callback, boolean initialNotify);
+ public static native void cancelTestCallback(int uid);
+ public static native boolean getTest();
+ public static native void setTest(boolean test);
+
+ public static native int registerEStopCallback(NotifyCallback callback, boolean initialNotify);
+ public static native void cancelEStopCallback(int uid);
+ public static native boolean getEStop();
+ public static native void setEStop(boolean eStop);
+
+ public static native int registerFmsAttachedCallback(NotifyCallback callback, boolean initialNotify);
+ public static native void cancelFmsAttachedCallback(int uid);
+ public static native boolean getFmsAttached();
+ public static native void setFmsAttached(boolean fmsAttached);
+
+ public static native int registerDsAttachedCallback(NotifyCallback callback, boolean initialNotify);
+ public static native void cancelDsAttachedCallback(int uid);
+ public static native boolean getDsAttached();
+ public static native void setDsAttached(boolean dsAttached);
+
+ public static native int registerAllianceStationIdCallback(NotifyCallback callback, boolean initialNotify);
+ public static native void cancelAllianceStationIdCallback(int uid);
+ public static native int getAllianceStationId();
+ public static native void setAllianceStationId(int allianceStationId);
+
+ public static native int registerMatchTimeCallback(NotifyCallback callback, boolean initialNotify);
+ public static native void cancelMatchTimeCallback(int uid);
+ public static native double getMatchTime();
+ public static native void setMatchTime(double matchTime);
+
+ public static native void setJoystickAxes(byte joystickNum, float[] axesArray);
+ public static native void setJoystickPOVs(byte joystickNum, short[] povsArray);
+ public static native void setJoystickButtons(byte joystickNum, int buttons, int count);
+ public static native long getJoystickOutputs(int stick);
+ public static native int getJoystickRumble(int stick, int rumbleNum);
+
+ public static native void setMatchInfo(String eventName, String gameSpecificMessage, int matchNumber, int replayNumber, int matchType);
+
+ public static native void registerAllCallbacks(NotifyCallback callback, boolean initialNotify);
+ public static native void notifyNewData();
+
+ public static native void setSendError(boolean shouldSend);
+ public static native void setSendConsoleLine(boolean shouldSend);
+
+ public static native void setJoystickButton(int stick, int button, boolean state);
+ public static native void setJoystickAxis(int stick, int axis, double value);
+ public static native void setJoystickPOV(int stick, int pov, int value);
+ public static native void setJoystickButtonsValue(int stick, int buttons);
+ public static native void setJoystickAxisCount(int stick, int count);
+ public static native void setJoystickPOVCount(int stick, int count);
+ public static native void setJoystickButtonCount(int stick, int count);
+
+ public static native void setJoystickIsXbox(int stick, boolean isXbox);
+ public static native void setJoystickType(int stick, int type);
+ public static native void setJoystickName(int stick, String name);
+ public static native void setJoystickAxisType(int stick, int axis, int type);
+
+ public static native void setGameSpecificMessage(String message);
+ public static native void setEventName(String name);
+ public static native void setMatchType(int type);
+ public static native void setMatchNumber(int matchNumber);
+ public static native void setReplayNumber(int replayNumber);
+
+ public static native void resetData();
+}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/DutyCycleDataJNI.java b/hal/src/main/java/edu/wpi/first/hal/simulation/DutyCycleDataJNI.java
similarity index 90%
rename from hal/src/main/java/edu/wpi/first/hal/sim/mockdata/DutyCycleDataJNI.java
rename to hal/src/main/java/edu/wpi/first/hal/simulation/DutyCycleDataJNI.java
index 5cbae6e..3228341 100644
--- a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/DutyCycleDataJNI.java
+++ b/hal/src/main/java/edu/wpi/first/hal/simulation/DutyCycleDataJNI.java
@@ -1,13 +1,12 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2019-2020 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. */
/*----------------------------------------------------------------------------*/
-package edu.wpi.first.hal.sim.mockdata;
+package edu.wpi.first.hal.simulation;
-import edu.wpi.first.hal.sim.NotifyCallback;
import edu.wpi.first.hal.JNIWrapper;
public class DutyCycleDataJNI extends JNIWrapper {
@@ -27,4 +26,6 @@
public static native void setOutput(int index, double output);
public static native void resetData(int index);
+
+ public static native int findForChannel(int channel);
}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/EncoderDataJNI.java b/hal/src/main/java/edu/wpi/first/hal/simulation/EncoderDataJNI.java
similarity index 88%
rename from hal/src/main/java/edu/wpi/first/hal/sim/mockdata/EncoderDataJNI.java
rename to hal/src/main/java/edu/wpi/first/hal/simulation/EncoderDataJNI.java
index 17e242e..db78d3c 100644
--- a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/EncoderDataJNI.java
+++ b/hal/src/main/java/edu/wpi/first/hal/simulation/EncoderDataJNI.java
@@ -1,13 +1,12 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
/*----------------------------------------------------------------------------*/
-package edu.wpi.first.hal.sim.mockdata;
+package edu.wpi.first.hal.simulation;
-import edu.wpi.first.hal.sim.NotifyCallback;
import edu.wpi.first.hal.JNIWrapper;
public class EncoderDataJNI extends JNIWrapper {
@@ -51,5 +50,12 @@
public static native int getSamplesToAverage(int index);
public static native void setSamplesToAverage(int index, int samplesToAverage);
+ public static native void setDistance(int index, double distance);
+ public static native double getDistance(int index);
+ public static native void setRate(int index, double rate);
+ public static native double getRate(int index);
+
public static native void resetData(int index);
+
+ public static native int findForChannel(int channel);
}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/I2CDataJNI.java b/hal/src/main/java/edu/wpi/first/hal/simulation/I2CDataJNI.java
similarity index 82%
rename from hal/src/main/java/edu/wpi/first/hal/sim/mockdata/I2CDataJNI.java
rename to hal/src/main/java/edu/wpi/first/hal/simulation/I2CDataJNI.java
index 33d78f8..8dbc9e6 100644
--- a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/I2CDataJNI.java
+++ b/hal/src/main/java/edu/wpi/first/hal/simulation/I2CDataJNI.java
@@ -1,15 +1,12 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
/*----------------------------------------------------------------------------*/
-package edu.wpi.first.hal.sim.mockdata;
+package edu.wpi.first.hal.simulation;
-import edu.wpi.first.hal.sim.BufferCallback;
-import edu.wpi.first.hal.sim.ConstBufferCallback;
-import edu.wpi.first.hal.sim.NotifyCallback;
import edu.wpi.first.hal.JNIWrapper;
public class I2CDataJNI extends JNIWrapper {
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/NotifierDataJNI.java b/hal/src/main/java/edu/wpi/first/hal/simulation/NotifierDataJNI.java
similarity index 85%
rename from hal/src/main/java/edu/wpi/first/hal/sim/mockdata/NotifierDataJNI.java
rename to hal/src/main/java/edu/wpi/first/hal/simulation/NotifierDataJNI.java
index ecc0842..823318c 100644
--- a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/NotifierDataJNI.java
+++ b/hal/src/main/java/edu/wpi/first/hal/simulation/NotifierDataJNI.java
@@ -1,11 +1,11 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2019-2020 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. */
/*----------------------------------------------------------------------------*/
-package edu.wpi.first.hal.sim.mockdata;
+package edu.wpi.first.hal.simulation;
import edu.wpi.first.hal.JNIWrapper;
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/NotifyCallback.java b/hal/src/main/java/edu/wpi/first/hal/simulation/NotifyCallback.java
similarity index 86%
rename from hal/src/main/java/edu/wpi/first/hal/sim/NotifyCallback.java
rename to hal/src/main/java/edu/wpi/first/hal/simulation/NotifyCallback.java
index 9c655e4..22ec015 100644
--- a/hal/src/main/java/edu/wpi/first/hal/sim/NotifyCallback.java
+++ b/hal/src/main/java/edu/wpi/first/hal/simulation/NotifyCallback.java
@@ -1,11 +1,11 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
/*----------------------------------------------------------------------------*/
-package edu.wpi.first.hal.sim;
+package edu.wpi.first.hal.simulation;
import edu.wpi.first.hal.HALValue;
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/PCMDataJNI.java b/hal/src/main/java/edu/wpi/first/hal/simulation/PCMDataJNI.java
similarity index 95%
rename from hal/src/main/java/edu/wpi/first/hal/sim/mockdata/PCMDataJNI.java
rename to hal/src/main/java/edu/wpi/first/hal/simulation/PCMDataJNI.java
index c5de287..6b72297 100644
--- a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/PCMDataJNI.java
+++ b/hal/src/main/java/edu/wpi/first/hal/simulation/PCMDataJNI.java
@@ -1,13 +1,12 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
/*----------------------------------------------------------------------------*/
-package edu.wpi.first.hal.sim.mockdata;
+package edu.wpi.first.hal.simulation;
-import edu.wpi.first.hal.sim.NotifyCallback;
import edu.wpi.first.hal.JNIWrapper;
public class PCMDataJNI extends JNIWrapper {
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/PDPDataJNI.java b/hal/src/main/java/edu/wpi/first/hal/simulation/PDPDataJNI.java
similarity index 92%
rename from hal/src/main/java/edu/wpi/first/hal/sim/mockdata/PDPDataJNI.java
rename to hal/src/main/java/edu/wpi/first/hal/simulation/PDPDataJNI.java
index 581a727..8825f60 100644
--- a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/PDPDataJNI.java
+++ b/hal/src/main/java/edu/wpi/first/hal/simulation/PDPDataJNI.java
@@ -1,13 +1,12 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
/*----------------------------------------------------------------------------*/
-package edu.wpi.first.hal.sim.mockdata;
+package edu.wpi.first.hal.simulation;
-import edu.wpi.first.hal.sim.NotifyCallback;
import edu.wpi.first.hal.JNIWrapper;
public class PDPDataJNI extends JNIWrapper {
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/PWMDataJNI.java b/hal/src/main/java/edu/wpi/first/hal/simulation/PWMDataJNI.java
similarity index 93%
rename from hal/src/main/java/edu/wpi/first/hal/sim/mockdata/PWMDataJNI.java
rename to hal/src/main/java/edu/wpi/first/hal/simulation/PWMDataJNI.java
index e36990e..f44b56b 100644
--- a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/PWMDataJNI.java
+++ b/hal/src/main/java/edu/wpi/first/hal/simulation/PWMDataJNI.java
@@ -1,13 +1,12 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
/*----------------------------------------------------------------------------*/
-package edu.wpi.first.hal.sim.mockdata;
+package edu.wpi.first.hal.simulation;
-import edu.wpi.first.hal.sim.NotifyCallback;
import edu.wpi.first.hal.JNIWrapper;
public class PWMDataJNI extends JNIWrapper {
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/RelayDataJNI.java b/hal/src/main/java/edu/wpi/first/hal/simulation/RelayDataJNI.java
similarity index 92%
rename from hal/src/main/java/edu/wpi/first/hal/sim/mockdata/RelayDataJNI.java
rename to hal/src/main/java/edu/wpi/first/hal/simulation/RelayDataJNI.java
index 320a86d..e7973a3 100644
--- a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/RelayDataJNI.java
+++ b/hal/src/main/java/edu/wpi/first/hal/simulation/RelayDataJNI.java
@@ -1,13 +1,12 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
/*----------------------------------------------------------------------------*/
-package edu.wpi.first.hal.sim.mockdata;
+package edu.wpi.first.hal.simulation;
-import edu.wpi.first.hal.sim.NotifyCallback;
import edu.wpi.first.hal.JNIWrapper;
public class RelayDataJNI extends JNIWrapper {
diff --git a/hal/src/main/java/edu/wpi/first/hal/simulation/RoboRioDataJNI.java b/hal/src/main/java/edu/wpi/first/hal/simulation/RoboRioDataJNI.java
new file mode 100644
index 0000000..a95abfe
--- /dev/null
+++ b/hal/src/main/java/edu/wpi/first/hal/simulation/RoboRioDataJNI.java
@@ -0,0 +1,89 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2018-2020 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. */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.hal.simulation;
+
+import edu.wpi.first.hal.JNIWrapper;
+
+public class RoboRioDataJNI extends JNIWrapper {
+ public static native int registerFPGAButtonCallback(NotifyCallback callback, boolean initialNotify);
+ public static native void cancelFPGAButtonCallback(int uid);
+ public static native boolean getFPGAButton();
+ public static native void setFPGAButton(boolean fPGAButton);
+
+ public static native int registerVInVoltageCallback(NotifyCallback callback, boolean initialNotify);
+ public static native void cancelVInVoltageCallback(int uid);
+ public static native double getVInVoltage();
+ public static native void setVInVoltage(double vInVoltage);
+
+ public static native int registerVInCurrentCallback(NotifyCallback callback, boolean initialNotify);
+ public static native void cancelVInCurrentCallback(int uid);
+ public static native double getVInCurrent();
+ public static native void setVInCurrent(double vInCurrent);
+
+ public static native int registerUserVoltage6VCallback(NotifyCallback callback, boolean initialNotify);
+ public static native void cancelUserVoltage6VCallback(int uid);
+ public static native double getUserVoltage6V();
+ public static native void setUserVoltage6V(double userVoltage6V);
+
+ public static native int registerUserCurrent6VCallback(NotifyCallback callback, boolean initialNotify);
+ public static native void cancelUserCurrent6VCallback(int uid);
+ public static native double getUserCurrent6V();
+ public static native void setUserCurrent6V(double userCurrent6V);
+
+ public static native int registerUserActive6VCallback(NotifyCallback callback, boolean initialNotify);
+ public static native void cancelUserActive6VCallback(int uid);
+ public static native boolean getUserActive6V();
+ public static native void setUserActive6V(boolean userActive6V);
+
+ public static native int registerUserVoltage5VCallback(NotifyCallback callback, boolean initialNotify);
+ public static native void cancelUserVoltage5VCallback(int uid);
+ public static native double getUserVoltage5V();
+ public static native void setUserVoltage5V(double userVoltage5V);
+
+ public static native int registerUserCurrent5VCallback(NotifyCallback callback, boolean initialNotify);
+ public static native void cancelUserCurrent5VCallback(int uid);
+ public static native double getUserCurrent5V();
+ public static native void setUserCurrent5V(double userCurrent5V);
+
+ public static native int registerUserActive5VCallback(NotifyCallback callback, boolean initialNotify);
+ public static native void cancelUserActive5VCallback(int uid);
+ public static native boolean getUserActive5V();
+ public static native void setUserActive5V(boolean userActive5V);
+
+ public static native int registerUserVoltage3V3Callback(NotifyCallback callback, boolean initialNotify);
+ public static native void cancelUserVoltage3V3Callback(int uid);
+ public static native double getUserVoltage3V3();
+ public static native void setUserVoltage3V3(double userVoltage3V3);
+
+ public static native int registerUserCurrent3V3Callback(NotifyCallback callback, boolean initialNotify);
+ public static native void cancelUserCurrent3V3Callback(int uid);
+ public static native double getUserCurrent3V3();
+ public static native void setUserCurrent3V3(double userCurrent3V3);
+
+ public static native int registerUserActive3V3Callback(NotifyCallback callback, boolean initialNotify);
+ public static native void cancelUserActive3V3Callback(int uid);
+ public static native boolean getUserActive3V3();
+ public static native void setUserActive3V3(boolean userActive3V3);
+
+ public static native int registerUserFaults6VCallback(NotifyCallback callback, boolean initialNotify);
+ public static native void cancelUserFaults6VCallback(int uid);
+ public static native int getUserFaults6V();
+ public static native void setUserFaults6V(int userFaults6V);
+
+ public static native int registerUserFaults5VCallback(NotifyCallback callback, boolean initialNotify);
+ public static native void cancelUserFaults5VCallback(int uid);
+ public static native int getUserFaults5V();
+ public static native void setUserFaults5V(int userFaults5V);
+
+ public static native int registerUserFaults3V3Callback(NotifyCallback callback, boolean initialNotify);
+ public static native void cancelUserFaults3V3Callback(int uid);
+ public static native int getUserFaults3V3();
+ public static native void setUserFaults3V3(int userFaults3V3);
+
+ public static native void resetData();
+}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/SPIAccelerometerDataJNI.java b/hal/src/main/java/edu/wpi/first/hal/simulation/SPIAccelerometerDataJNI.java
similarity index 92%
rename from hal/src/main/java/edu/wpi/first/hal/sim/mockdata/SPIAccelerometerDataJNI.java
rename to hal/src/main/java/edu/wpi/first/hal/simulation/SPIAccelerometerDataJNI.java
index d8e7353..2e8ebae 100644
--- a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/SPIAccelerometerDataJNI.java
+++ b/hal/src/main/java/edu/wpi/first/hal/simulation/SPIAccelerometerDataJNI.java
@@ -1,13 +1,12 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
/*----------------------------------------------------------------------------*/
-package edu.wpi.first.hal.sim.mockdata;
+package edu.wpi.first.hal.simulation;
-import edu.wpi.first.hal.sim.NotifyCallback;
import edu.wpi.first.hal.JNIWrapper;
public class SPIAccelerometerDataJNI extends JNIWrapper {
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/SPIDataJNI.java b/hal/src/main/java/edu/wpi/first/hal/simulation/SPIDataJNI.java
similarity index 81%
rename from hal/src/main/java/edu/wpi/first/hal/sim/mockdata/SPIDataJNI.java
rename to hal/src/main/java/edu/wpi/first/hal/simulation/SPIDataJNI.java
index a12ec66..fd6b854 100644
--- a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/SPIDataJNI.java
+++ b/hal/src/main/java/edu/wpi/first/hal/simulation/SPIDataJNI.java
@@ -1,16 +1,12 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
/*----------------------------------------------------------------------------*/
-package edu.wpi.first.hal.sim.mockdata;
+package edu.wpi.first.hal.simulation;
-import edu.wpi.first.hal.sim.BufferCallback;
-import edu.wpi.first.hal.sim.ConstBufferCallback;
-import edu.wpi.first.hal.sim.NotifyCallback;
-import edu.wpi.first.hal.sim.SpiReadAutoReceiveBufferCallback;
import edu.wpi.first.hal.JNIWrapper;
public class SPIDataJNI extends JNIWrapper {
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/SimDeviceCallback.java b/hal/src/main/java/edu/wpi/first/hal/simulation/SimDeviceCallback.java
similarity index 83%
rename from hal/src/main/java/edu/wpi/first/hal/sim/SimDeviceCallback.java
rename to hal/src/main/java/edu/wpi/first/hal/simulation/SimDeviceCallback.java
index ff9e45b..2390bf4 100644
--- a/hal/src/main/java/edu/wpi/first/hal/sim/SimDeviceCallback.java
+++ b/hal/src/main/java/edu/wpi/first/hal/simulation/SimDeviceCallback.java
@@ -1,11 +1,11 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2019-2020 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. */
/*----------------------------------------------------------------------------*/
-package edu.wpi.first.hal.sim;
+package edu.wpi.first.hal.simulation;
@FunctionalInterface
public interface SimDeviceCallback {
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/SimDeviceDataJNI.java b/hal/src/main/java/edu/wpi/first/hal/simulation/SimDeviceDataJNI.java
similarity index 85%
rename from hal/src/main/java/edu/wpi/first/hal/sim/mockdata/SimDeviceDataJNI.java
rename to hal/src/main/java/edu/wpi/first/hal/simulation/SimDeviceDataJNI.java
index 2b8a38a..ea2a9f6 100644
--- a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/SimDeviceDataJNI.java
+++ b/hal/src/main/java/edu/wpi/first/hal/simulation/SimDeviceDataJNI.java
@@ -1,18 +1,19 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2019-2020 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. */
/*----------------------------------------------------------------------------*/
-package edu.wpi.first.hal.sim.mockdata;
+package edu.wpi.first.hal.simulation;
-import edu.wpi.first.hal.sim.SimDeviceCallback;
-import edu.wpi.first.hal.sim.SimValueCallback;
import edu.wpi.first.hal.HALValue;
import edu.wpi.first.hal.JNIWrapper;
public class SimDeviceDataJNI extends JNIWrapper {
+ public static native void setSimDeviceEnabled(String prefix, boolean enabled);
+ public static native boolean isSimDeviceEnabled(String name);
+
public static native int registerSimDeviceCreatedCallback(String prefix, SimDeviceCallback callback, boolean initialNotify);
public static native void cancelSimDeviceCreatedCallback(int uid);
@@ -30,10 +31,10 @@
}
@SuppressWarnings("MemberName")
- String name;
+ public String name;
@SuppressWarnings("MemberName")
- int handle;
+ public int handle;
}
public static native SimDeviceInfo[] enumerateSimDevices(String prefix);
@@ -54,16 +55,16 @@
}
@SuppressWarnings("MemberName")
- String name;
+ public String name;
@SuppressWarnings("MemberName")
- int handle;
+ public int handle;
@SuppressWarnings("MemberName")
- boolean readonly;
+ public boolean readonly;
@SuppressWarnings("MemberName")
- HALValue value;
+ public HALValue value;
}
public static native SimValueInfo[] enumerateSimValues(int device);
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/SimValueCallback.java b/hal/src/main/java/edu/wpi/first/hal/simulation/SimValueCallback.java
similarity index 88%
rename from hal/src/main/java/edu/wpi/first/hal/sim/SimValueCallback.java
rename to hal/src/main/java/edu/wpi/first/hal/simulation/SimValueCallback.java
index 786158a..d65ab38 100644
--- a/hal/src/main/java/edu/wpi/first/hal/sim/SimValueCallback.java
+++ b/hal/src/main/java/edu/wpi/first/hal/simulation/SimValueCallback.java
@@ -1,11 +1,11 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2019-2020 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. */
/*----------------------------------------------------------------------------*/
-package edu.wpi.first.hal.sim;
+package edu.wpi.first.hal.simulation;
import edu.wpi.first.hal.HALValue;
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/SimulatorJNI.java b/hal/src/main/java/edu/wpi/first/hal/simulation/SimulatorJNI.java
similarity index 76%
rename from hal/src/main/java/edu/wpi/first/hal/sim/mockdata/SimulatorJNI.java
rename to hal/src/main/java/edu/wpi/first/hal/simulation/SimulatorJNI.java
index bfd8505..8147507 100644
--- a/hal/src/main/java/edu/wpi/first/hal/sim/mockdata/SimulatorJNI.java
+++ b/hal/src/main/java/edu/wpi/first/hal/simulation/SimulatorJNI.java
@@ -1,21 +1,24 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
/*----------------------------------------------------------------------------*/
-package edu.wpi.first.hal.sim.mockdata;
+package edu.wpi.first.hal.simulation;
import edu.wpi.first.hal.JNIWrapper;
public class SimulatorJNI extends JNIWrapper {
+ public static native void setRuntimeType(int type);
public static native void waitForProgramStart();
public static native void setProgramStarted();
+ public static native boolean getProgramStarted();
public static native void restartTiming();
public static native void pauseTiming();
public static native void resumeTiming();
public static native boolean isTimingPaused();
public static native void stepTiming(long delta);
+ public static native void stepTimingAsync(long delta);
public static native void resetHandles();
}
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/SpiReadAutoReceiveBufferCallback.java b/hal/src/main/java/edu/wpi/first/hal/simulation/SpiReadAutoReceiveBufferCallback.java
similarity index 83%
rename from hal/src/main/java/edu/wpi/first/hal/sim/SpiReadAutoReceiveBufferCallback.java
rename to hal/src/main/java/edu/wpi/first/hal/simulation/SpiReadAutoReceiveBufferCallback.java
index 5083fab..8061b5b 100644
--- a/hal/src/main/java/edu/wpi/first/hal/sim/SpiReadAutoReceiveBufferCallback.java
+++ b/hal/src/main/java/edu/wpi/first/hal/simulation/SpiReadAutoReceiveBufferCallback.java
@@ -1,11 +1,11 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
/*----------------------------------------------------------------------------*/
-package edu.wpi.first.hal.sim;
+package edu.wpi.first.hal.simulation;
public interface SpiReadAutoReceiveBufferCallback {
int callback(String name, int[] buffer, int numToRead);
diff --git a/hal/src/main/java/edu/wpi/first/hal/util/AllocationException.java b/hal/src/main/java/edu/wpi/first/hal/util/AllocationException.java
index 6f789d8..42e2059 100644
--- a/hal/src/main/java/edu/wpi/first/hal/util/AllocationException.java
+++ b/hal/src/main/java/edu/wpi/first/hal/util/AllocationException.java
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2008-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2008-2020 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. */
@@ -10,6 +10,7 @@
/**
* Exception indicating that the resource is already allocated.
*/
+@SuppressWarnings("serial")
public class AllocationException extends RuntimeException {
/**
* Create a new AllocationException.
diff --git a/hal/src/main/java/edu/wpi/first/hal/util/BoundaryException.java b/hal/src/main/java/edu/wpi/first/hal/util/BoundaryException.java
index 8f21e60..8fef4c9 100644
--- a/hal/src/main/java/edu/wpi/first/hal/util/BoundaryException.java
+++ b/hal/src/main/java/edu/wpi/first/hal/util/BoundaryException.java
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2008-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2008-2020 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. */
@@ -10,6 +10,7 @@
/**
* This exception represents an error in which a lower limit was set as higher than an upper limit.
*/
+@SuppressWarnings("serial")
public class BoundaryException extends RuntimeException {
/**
* Create a new exception with the given message.
diff --git a/hal/src/main/java/edu/wpi/first/hal/util/CheckedAllocationException.java b/hal/src/main/java/edu/wpi/first/hal/util/CheckedAllocationException.java
index f17e381..d9a8a80 100644
--- a/hal/src/main/java/edu/wpi/first/hal/util/CheckedAllocationException.java
+++ b/hal/src/main/java/edu/wpi/first/hal/util/CheckedAllocationException.java
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2008-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2008-2020 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. */
@@ -11,6 +11,7 @@
* Exception indicating that the resource is already allocated This is meant to be thrown by the
* resource class.
*/
+@SuppressWarnings("serial")
public class CheckedAllocationException extends Exception {
/**
* Create a new CheckedAllocationException.
diff --git a/hal/src/main/java/edu/wpi/first/hal/util/HalHandleException.java b/hal/src/main/java/edu/wpi/first/hal/util/HalHandleException.java
index 874b07a..a775ec4 100644
--- a/hal/src/main/java/edu/wpi/first/hal/util/HalHandleException.java
+++ b/hal/src/main/java/edu/wpi/first/hal/util/HalHandleException.java
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2008-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2008-2020 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. */
@@ -8,8 +8,9 @@
package edu.wpi.first.hal.util;
/**
- * Exception indicating that an error has occured with a HAL Handle.
+ * Exception indicating that an error has occurred with a HAL Handle.
*/
+@SuppressWarnings("serial")
public class HalHandleException extends RuntimeException {
/**
* Create a new HalHandleException.
diff --git a/hal/src/main/java/edu/wpi/first/hal/util/UncleanStatusException.java b/hal/src/main/java/edu/wpi/first/hal/util/UncleanStatusException.java
index 3a3e217..3d6ab36 100644
--- a/hal/src/main/java/edu/wpi/first/hal/util/UncleanStatusException.java
+++ b/hal/src/main/java/edu/wpi/first/hal/util/UncleanStatusException.java
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2008-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2008-2020 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. */
@@ -10,6 +10,7 @@
/**
* Exception for bad status codes from the chip object.
*/
+@SuppressWarnings("serial")
public final class UncleanStatusException extends IllegalStateException {
private final int m_statusCode;
diff --git a/hal/src/main/native/athena/Accelerometer.cpp b/hal/src/main/native/athena/Accelerometer.cpp
index f83c06e..bc4d502 100644
--- a/hal/src/main/native/athena/Accelerometer.cpp
+++ b/hal/src/main/native/athena/Accelerometer.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -176,7 +176,7 @@
* 1 g-force, taking into account the accelerometer range.
*/
static double unpackAxis(int16_t raw) {
- // The raw value is actually 12 bits, not 16, so we need to propogate the
+ // The raw value is actually 12 bits, not 16, so we need to propagate the
// 2's complement sign bit to the unused 4 bits for this to work with
// negative numbers.
raw <<= 4;
diff --git a/hal/src/main/native/athena/AddressableLED.cpp b/hal/src/main/native/athena/AddressableLED.cpp
index 64b6457..7334c99 100644
--- a/hal/src/main/native/athena/AddressableLED.cpp
+++ b/hal/src/main/native/athena/AddressableLED.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2019-2020 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. */
@@ -15,6 +15,7 @@
#include "DigitalInternal.h"
#include "HALInitializer.h"
#include "PortsInternal.h"
+#include "hal/AddressableLEDTypes.h"
#include "hal/ChipObject.h"
#include "hal/handles/HandlesInternal.h"
#include "hal/handles/LimitedHandleResource.h"
diff --git a/hal/src/main/native/athena/AnalogInternal.cpp b/hal/src/main/native/athena/AnalogInternal.cpp
index 03a246d..6ac16b8 100644
--- a/hal/src/main/native/athena/AnalogInternal.cpp
+++ b/hal/src/main/native/athena/AnalogInternal.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -93,7 +93,7 @@
config.ConvertRate = ticksPerConversion;
analogInputSystem->writeConfig(config, status);
- // Indicate that the scan size has been commited to hardware.
+ // Indicate that the scan size has been committed to hardware.
setAnalogNumChannelsToActivate(0);
}
diff --git a/hal/src/main/native/athena/CANAPI.cpp b/hal/src/main/native/athena/CANAPI.cpp
index 44cdb58..d460885 100644
--- a/hal/src/main/native/athena/CANAPI.cpp
+++ b/hal/src/main/native/athena/CANAPI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -7,7 +7,6 @@
#include "hal/CANAPI.h"
-#include <atomic>
#include <ctime>
#include <wpi/DenseMap.h>
@@ -15,7 +14,6 @@
#include "HALInitializer.h"
#include "hal/CAN.h"
#include "hal/Errors.h"
-#include "hal/HAL.h"
#include "hal/handles/UnlimitedHandleResource.h"
using namespace hal;
diff --git a/hal/src/main/native/athena/DMA.cpp b/hal/src/main/native/athena/DMA.cpp
index 19c3068..ee39d2d 100644
--- a/hal/src/main/native/athena/DMA.cpp
+++ b/hal/src/main/native/athena/DMA.cpp
@@ -18,7 +18,7 @@
#include "EncoderInternal.h"
#include "PortsInternal.h"
#include "hal/AnalogAccumulator.h"
-//#include "hal/AnalogGyro.h"
+#include "hal/AnalogGyro.h"
#include "hal/AnalogInput.h"
#include "hal/ChipObject.h"
#include "hal/Errors.h"
diff --git a/hal/src/main/native/athena/DutyCycle.cpp b/hal/src/main/native/athena/DutyCycle.cpp
index 1c1a678..3749a2b 100644
--- a/hal/src/main/native/athena/DutyCycle.cpp
+++ b/hal/src/main/native/athena/DutyCycle.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2019-2020 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. */
@@ -75,6 +75,9 @@
dutyCycleHandles->Free(dutyCycleHandle);
}
+void HAL_SetDutyCycleSimDevice(HAL_EncoderHandle handle,
+ HAL_SimDeviceHandle device) {}
+
int32_t HAL_GetDutyCycleFrequency(HAL_DutyCycleHandle dutyCycleHandle,
int32_t* status) {
auto dutyCycle = dutyCycleHandles->Get(dutyCycleHandle);
diff --git a/hal/src/main/native/athena/FRCDriverStation.cpp b/hal/src/main/native/athena/FRCDriverStation.cpp
index 5b29815..51fe327 100644
--- a/hal/src/main/native/athena/FRCDriverStation.cpp
+++ b/hal/src/main/native/athena/FRCDriverStation.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -124,7 +124,7 @@
static wpi::mutex* newDSDataAvailableMutex;
static wpi::condition_variable* newDSDataAvailableCond;
-static std::atomic_int newDSDataAvailableCounter{0};
+static int newDSDataAvailableCounter{0};
namespace hal {
namespace init {
@@ -176,27 +176,27 @@
if (baseLength + detailsRef.size() + locationRef.size() +
callStackRef.size() <=
- 65536) {
+ 65535) {
// Pass through
retval = FRC_NetworkCommunication_sendError(isError, errorCode, isLVCode,
details, location, callStack);
- } else if (baseLength + detailsRef.size() > 65536) {
+ } else if (baseLength + detailsRef.size() > 65535) {
// Details too long, cut both location and stack
- auto newLen = 65536 - baseLength;
+ auto newLen = 65535 - baseLength;
std::string newDetails{details, newLen};
char empty = '\0';
retval = FRC_NetworkCommunication_sendError(
isError, errorCode, isLVCode, newDetails.c_str(), &empty, &empty);
- } else if (baseLength + detailsRef.size() + locationRef.size() > 65536) {
+ } else if (baseLength + detailsRef.size() + locationRef.size() > 65535) {
// Location too long, cut stack
- auto newLen = 65536 - baseLength - detailsRef.size();
+ auto newLen = 65535 - baseLength - detailsRef.size();
std::string newLocation{location, newLen};
char empty = '\0';
retval = FRC_NetworkCommunication_sendError(
isError, errorCode, isLVCode, details, newLocation.c_str(), &empty);
} else {
// Stack too long
- auto newLen = 65536 - baseLength - detailsRef.size() - locationRef.size();
+ auto newLen = 65535 - baseLength - detailsRef.size() - locationRef.size();
std::string newCallStack{callStack, newLen};
retval = FRC_NetworkCommunication_sendError(isError, errorCode, isLVCode,
details, location,
@@ -229,6 +229,18 @@
return retval;
}
+int32_t HAL_SendConsoleLine(const char* line) {
+ wpi::StringRef lineRef{line};
+ if (lineRef.size() <= 65535) {
+ // Send directly
+ return FRC_NetworkCommunication_sendConsoleLine(line);
+ } else {
+ // Need to truncate
+ std::string newLine{line, 65535};
+ return FRC_NetworkCommunication_sendConsoleLine(newLine.c_str());
+ }
+}
+
int32_t HAL_GetControlWord(HAL_ControlWord* controlWord) {
return HAL_GetControlWordInternal(controlWord);
}
@@ -343,41 +355,14 @@
// will return false when instead it should return true. However, this at a
// 20ms rate occurs once every 2.7 years of DS connected runtime, so not
// worth the cycles to check.
- thread_local int lastCount{-1};
+ thread_local int lastCount{0};
return lastCount;
}
-void HAL_WaitForCachedControlData(void) {
- HAL_WaitForCachedControlDataTimeout(0);
-}
-
-HAL_Bool HAL_WaitForCachedControlDataTimeout(double timeout) {
- int& lastCount = GetThreadLocalLastCount();
- int currentCount = newDSDataAvailableCounter.load();
- if (lastCount != currentCount) {
- lastCount = currentCount;
- return true;
- }
- auto timeoutTime =
- std::chrono::steady_clock::now() + std::chrono::duration<double>(timeout);
-
- std::unique_lock lock{*newDSDataAvailableMutex};
- while (newDSDataAvailableCounter.load() == currentCount) {
- if (timeout > 0) {
- auto timedOut = newDSDataAvailableCond->wait_until(lock, timeoutTime);
- if (timedOut == std::cv_status::timeout) {
- return false;
- }
- } else {
- newDSDataAvailableCond->wait(lock);
- }
- }
- return true;
-}
-
HAL_Bool HAL_IsNewControlData(void) {
+ std::scoped_lock lock{*newDSDataAvailableMutex};
int& lastCount = GetThreadLocalLastCount();
- int currentCount = newDSDataAvailableCounter.load();
+ int currentCount = newDSDataAvailableCounter;
if (lastCount == currentCount) return false;
lastCount = currentCount;
return true;
@@ -394,12 +379,17 @@
* time has passed. Returns true on new data, false on timeout.
*/
HAL_Bool HAL_WaitForDSDataTimeout(double timeout) {
+ std::unique_lock lock{*newDSDataAvailableMutex};
+ int& lastCount = GetThreadLocalLastCount();
+ int currentCount = newDSDataAvailableCounter;
+ if (lastCount != currentCount) {
+ lastCount = currentCount;
+ return true;
+ }
auto timeoutTime =
std::chrono::steady_clock::now() + std::chrono::duration<double>(timeout);
- int currentCount = newDSDataAvailableCounter.load();
- std::unique_lock lock{*newDSDataAvailableMutex};
- while (newDSDataAvailableCounter.load() == currentCount) {
+ while (newDSDataAvailableCounter == currentCount) {
if (timeout > 0) {
auto timedOut = newDSDataAvailableCond->wait_until(lock, timeoutTime);
if (timedOut == std::cv_status::timeout) {
@@ -409,6 +399,7 @@
newDSDataAvailableCond->wait(lock);
}
}
+ lastCount = newDSDataAvailableCounter;
return true;
}
@@ -419,8 +410,9 @@
// Since we could get other values, require our specific handle
// to signal our threads
if (refNum != refNumber) return;
+ std::scoped_lock lock{*newDSDataAvailableMutex};
// Notify all threads
- newDSDataAvailableCounter.fetch_add(1);
+ ++newDSDataAvailableCounter;
newDSDataAvailableCond->notify_all();
}
diff --git a/hal/src/main/native/athena/HAL.cpp b/hal/src/main/native/athena/HAL.cpp
index f698fa0..17ef0b9 100644
--- a/hal/src/main/native/athena/HAL.cpp
+++ b/hal/src/main/native/athena/HAL.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -24,12 +24,14 @@
#include <wpi/timestamp.h>
#include "HALInitializer.h"
+#include "HALInternal.h"
#include "ctre/ctre.h"
#include "hal/ChipObject.h"
#include "hal/DriverStation.h"
#include "hal/Errors.h"
#include "hal/Notifier.h"
#include "hal/handles/HandlesInternal.h"
+#include "visa/visa.h"
using namespace hal;
@@ -44,6 +46,7 @@
InitializeAddressableLED();
InitializeAccelerometer();
InitializeAnalogAccumulator();
+ InitializeAnalogGyro();
InitializeAnalogInput();
InitializeAnalogInternal();
InitializeAnalogOutput();
@@ -61,7 +64,7 @@
InitializeFPGAEncoder();
InitializeFRCDriverStation();
InitializeI2C();
- InitialzeInterrupts();
+ InitializeInterrupts();
InitializeMain();
InitializeNotifier();
InitializePCMInternal();
@@ -70,11 +73,22 @@
InitializePower();
InitializePWM();
InitializeRelay();
+ InitializeSerialPort();
InitializeSolenoid();
InitializeSPI();
InitializeThreads();
}
} // namespace init
+
+void ReleaseFPGAInterrupt(int32_t interruptNumber) {
+ if (!global) {
+ return;
+ }
+ int32_t status = 0;
+ global->writeInterruptForceNumber(static_cast<unsigned char>(interruptNumber),
+ &status);
+ global->strobeInterruptForceOnce(&status);
+}
} // namespace hal
extern "C" {
@@ -170,6 +184,30 @@
return ERR_CANSessionMux_NotAllowed_MESSAGE;
case HAL_ERR_CANSessionMux_NotInitialized:
return ERR_CANSessionMux_NotInitialized_MESSAGE;
+ case VI_ERROR_SYSTEM_ERROR:
+ return VI_ERROR_SYSTEM_ERROR_MESSAGE;
+ case VI_ERROR_INV_OBJECT:
+ return VI_ERROR_INV_OBJECT_MESSAGE;
+ case VI_ERROR_RSRC_LOCKED:
+ return VI_ERROR_RSRC_LOCKED_MESSAGE;
+ case VI_ERROR_RSRC_NFOUND:
+ return VI_ERROR_RSRC_NFOUND_MESSAGE;
+ case VI_ERROR_INV_RSRC_NAME:
+ return VI_ERROR_INV_RSRC_NAME_MESSAGE;
+ case VI_ERROR_QUEUE_OVERFLOW:
+ return VI_ERROR_QUEUE_OVERFLOW_MESSAGE;
+ case VI_ERROR_IO:
+ return VI_ERROR_IO_MESSAGE;
+ case VI_ERROR_ASRL_PARITY:
+ return VI_ERROR_ASRL_PARITY_MESSAGE;
+ case VI_ERROR_ASRL_FRAMING:
+ return VI_ERROR_ASRL_FRAMING_MESSAGE;
+ case VI_ERROR_ASRL_OVERRUN:
+ return VI_ERROR_ASRL_OVERRUN_MESSAGE;
+ case VI_ERROR_RSRC_BUSY:
+ return VI_ERROR_RSRC_BUSY_MESSAGE;
+ case VI_ERROR_INV_PARAMETER:
+ return VI_ERROR_INV_PARAMETER_MESSAGE;
case HAL_PWM_SCALE_ERROR:
return HAL_PWM_SCALE_ERROR_MESSAGE;
case HAL_SERIAL_PORT_NOT_FOUND:
@@ -296,7 +334,7 @@
kill(pid, SIGTERM); // try to kill it
std::this_thread::sleep_for(std::chrono::milliseconds(timeout));
if (kill(pid, 0) == 0) {
- // still not successfull
+ // still not successful
wpi::outs() << "FRC pid " << pid << " did not die within " << timeout
<< "ms. Force killing with kill -9\n";
// Force kill -9
@@ -352,9 +390,8 @@
setNewDataSem(nullptr);
});
- // image 4; Fixes errors caused by multiple processes. Talk to NI about this
nFPGA::nRoboRIO_FPGANamespace::g_currentTargetClass =
- nLoadOut::kTargetClass_RoboRIO;
+ nLoadOut::getTargetClass();
int32_t status = 0;
global.reset(tGlobal::create(&status));
@@ -383,6 +420,8 @@
return true;
}
+void HAL_Shutdown(void) {}
+
int64_t HAL_Report(int32_t resource, int32_t instanceNumber, int32_t context,
const char* feature) {
if (feature == nullptr) {
diff --git a/hal/src/main/native/athena/HALInitializer.cpp b/hal/src/main/native/athena/HALInitializer.cpp
index a0456d4..5c2242b 100644
--- a/hal/src/main/native/athena/HALInitializer.cpp
+++ b/hal/src/main/native/athena/HALInitializer.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -7,7 +7,7 @@
#include "HALInitializer.h"
-#include "hal/HAL.h"
+#include "hal/HALBase.h"
namespace hal {
namespace init {
diff --git a/hal/src/main/native/athena/HALInitializer.h b/hal/src/main/native/athena/HALInitializer.h
index cf59394..c54660f 100644
--- a/hal/src/main/native/athena/HALInitializer.h
+++ b/hal/src/main/native/athena/HALInitializer.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -21,6 +21,7 @@
extern void InitializeAccelerometer();
extern void InitializeAddressableLED();
extern void InitializeAnalogAccumulator();
+extern void InitializeAnalogGyro();
extern void InitializeAnalogInput();
extern void InitializeAnalogInternal();
extern void InitializeAnalogOutput();
@@ -39,7 +40,7 @@
extern void InitializeFRCDriverStation();
extern void InitializeHAL();
extern void InitializeI2C();
-extern void InitialzeInterrupts();
+extern void InitializeInterrupts();
extern void InitializeMain();
extern void InitializeNotifier();
extern void InitializePCMInternal();
@@ -48,6 +49,7 @@
extern void InitializePower();
extern void InitializePWM();
extern void InitializeRelay();
+extern void InitializeSerialPort();
extern void InitializeSolenoid();
extern void InitializeSPI();
extern void InitializeThreads();
diff --git a/hal/src/main/java/edu/wpi/first/hal/sim/ConstBufferCallback.java b/hal/src/main/native/athena/HALInternal.h
similarity index 68%
copy from hal/src/main/java/edu/wpi/first/hal/sim/ConstBufferCallback.java
copy to hal/src/main/native/athena/HALInternal.h
index a4251c2..e3033bf 100644
--- a/hal/src/main/java/edu/wpi/first/hal/sim/ConstBufferCallback.java
+++ b/hal/src/main/native/athena/HALInternal.h
@@ -1,12 +1,15 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2020 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. */
/*----------------------------------------------------------------------------*/
-package edu.wpi.first.hal.sim;
+#pragma once
-public interface ConstBufferCallback {
- void callback(String name, byte[] buffer, int count);
-}
+#include <stdint.h>
+
+namespace hal {
+void ReleaseFPGAInterrupt(int32_t interruptNumber);
+
+} // namespace hal
diff --git a/hal/src/main/native/athena/Interrupts.cpp b/hal/src/main/native/athena/Interrupts.cpp
index 78d518c..a330e3c 100644
--- a/hal/src/main/native/athena/Interrupts.cpp
+++ b/hal/src/main/native/athena/Interrupts.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -13,9 +13,11 @@
#include "DigitalInternal.h"
#include "HALInitializer.h"
+#include "HALInternal.h"
#include "PortsInternal.h"
#include "hal/ChipObject.h"
#include "hal/Errors.h"
+#include "hal/HALBase.h"
#include "hal/handles/HandlesInternal.h"
#include "hal/handles/LimitedHandleResource.h"
@@ -82,7 +84,7 @@
namespace hal {
namespace init {
-void InitialzeInterrupts() {
+void InitializeInterrupts() {
static LimitedHandleResource<HAL_InterruptHandle, Interrupt, kNumInterrupts,
HAL_HandleEnum::Interrupt>
iH;
@@ -268,4 +270,19 @@
anInterrupt->anInterrupt->writeConfig_FallingEdge(fallingEdge, status);
}
+void HAL_ReleaseWaitingInterrupt(HAL_InterruptHandle interruptHandle,
+ int32_t* status) {
+ auto anInterrupt = interruptHandles->Get(interruptHandle);
+ if (anInterrupt == nullptr) {
+ *status = HAL_HANDLE_ERROR;
+ return;
+ }
+
+ uint32_t interruptIndex =
+ static_cast<uint32_t>(getHandleIndex(interruptHandle));
+
+ hal::ReleaseFPGAInterrupt(interruptIndex);
+ hal::ReleaseFPGAInterrupt(interruptIndex + 8);
+}
+
} // extern "C"
diff --git a/hal/src/main/native/athena/Notifier.cpp b/hal/src/main/native/athena/Notifier.cpp
index c30e8d1..905c440 100644
--- a/hal/src/main/native/athena/Notifier.cpp
+++ b/hal/src/main/native/athena/Notifier.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -10,11 +10,13 @@
#include <atomic>
#include <cstdlib> // For std::atexit()
#include <memory>
+#include <thread>
#include <wpi/condition_variable.h>
#include <wpi/mutex.h>
#include "HALInitializer.h"
+#include "HALInternal.h"
#include "hal/ChipObject.h"
#include "hal/Errors.h"
#include "hal/HAL.h"
@@ -26,7 +28,7 @@
static wpi::mutex notifierMutex;
static std::unique_ptr<tAlarm> notifierAlarm;
-static std::unique_ptr<tInterruptManager> notifierManager;
+static std::thread notifierThread;
static uint64_t closestTrigger{UINT64_MAX};
namespace {
@@ -43,6 +45,7 @@
static std::atomic_flag notifierAtexitRegistered{ATOMIC_FLAG_INIT};
static std::atomic_int notifierRefCount{0};
+static std::atomic_bool notifierRunning{false};
using namespace hal;
@@ -65,7 +68,7 @@
static NotifierHandleContainer* notifierHandles;
-static void alarmCallback(uint32_t, void*) {
+static void alarmCallback() {
std::scoped_lock lock(notifierMutex);
int32_t status = 0;
uint64_t currentTime = 0;
@@ -97,9 +100,24 @@
}
}
+static void notifierThreadMain() {
+ tRioStatusCode status = 0;
+ tInterruptManager manager{1 << kTimerInterruptNumber, true, &status};
+ while (notifierRunning) {
+ auto triggeredMask = manager.watch(10000, false, &status);
+ if (!notifierRunning) break;
+ if (triggeredMask == 0) continue;
+ alarmCallback();
+ }
+}
+
static void cleanupNotifierAtExit() {
+ int32_t status = 0;
+ if (notifierAlarm) notifierAlarm->writeEnable(false, &status);
notifierAlarm = nullptr;
- notifierManager = nullptr;
+ notifierRunning = false;
+ hal::ReleaseFPGAInterrupt(kTimerInterruptNumber);
+ if (notifierThread.joinable()) notifierThread.join();
}
namespace hal {
@@ -120,14 +138,9 @@
if (notifierRefCount.fetch_add(1) == 0) {
std::scoped_lock lock(notifierMutex);
- // create manager and alarm if not already created
- if (!notifierManager) {
- notifierManager = std::make_unique<tInterruptManager>(
- 1 << kTimerInterruptNumber, false, status);
- notifierManager->registerHandler(alarmCallback, nullptr, status);
- notifierManager->enable(status);
- }
- if (!notifierAlarm) notifierAlarm.reset(tAlarm::create(status));
+ notifierRunning = true;
+ notifierThread = std::thread(notifierThreadMain);
+ notifierAlarm.reset(tAlarm::create(status));
}
std::shared_ptr<Notifier> notifier = std::make_shared<Notifier>();
@@ -169,21 +182,19 @@
notifier->cond.notify_all();
if (notifierRefCount.fetch_sub(1) == 1) {
- // if this was the last notifier, clean up alarm and manager
+ // if this was the last notifier, clean up alarm and thread
// the notifier can call back into our callback, so don't hold the lock
// here (the atomic fetch_sub will prevent multiple parallel entries
// into this function)
- // Cleaning up the manager takes up to a second to complete, so don't do
- // that here. Fix it more permanently in 2019...
+ if (notifierAlarm) notifierAlarm->writeEnable(false, status);
+ notifierRunning = false;
+ hal::ReleaseFPGAInterrupt(kTimerInterruptNumber);
+ if (notifierThread.joinable()) notifierThread.join();
- // if (notifierAlarm) notifierAlarm->writeEnable(false, status);
- // if (notifierManager) notifierManager->disable(status);
-
- // std::scoped_lock lock(notifierMutex);
- // notifierAlarm = nullptr;
- // notifierManager = nullptr;
- // closestTrigger = UINT64_MAX;
+ std::scoped_lock lock(notifierMutex);
+ notifierAlarm = nullptr;
+ closestTrigger = UINT64_MAX;
}
}
diff --git a/hal/src/main/native/athena/PCMInternal.cpp b/hal/src/main/native/athena/PCMInternal.cpp
index dee64cf..c81dc1a 100644
--- a/hal/src/main/native/athena/PCMInternal.cpp
+++ b/hal/src/main/native/athena/PCMInternal.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -8,7 +8,6 @@
#include "PCMInternal.h"
#include "HALInitializer.h"
-#include "PortsInternal.h"
#include "hal/Errors.h"
#include "hal/Solenoid.h"
diff --git a/hal/src/main/native/athena/PCMInternal.h b/hal/src/main/native/athena/PCMInternal.h
index 52f0f75..a9d076c 100644
--- a/hal/src/main/native/athena/PCMInternal.h
+++ b/hal/src/main/native/athena/PCMInternal.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -14,7 +14,6 @@
#include "PortsInternal.h"
#include "ctre/PCM.h"
#include "hal/Errors.h"
-#include "hal/Ports.h"
#include "hal/Solenoid.h"
namespace hal {
diff --git a/hal/src/main/native/athena/PDP.cpp b/hal/src/main/native/athena/PDP.cpp
index f5cf92b..f60e881 100644
--- a/hal/src/main/native/athena/PDP.cpp
+++ b/hal/src/main/native/athena/PDP.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -7,16 +7,12 @@
#include "hal/PDP.h"
-#include <memory>
-
#include <wpi/mutex.h>
#include "HALInitializer.h"
#include "PortsInternal.h"
#include "hal/CANAPI.h"
#include "hal/Errors.h"
-#include "hal/Ports.h"
-#include "hal/handles/IndexedHandleResource.h"
using namespace hal;
@@ -438,7 +434,7 @@
energyJoules *=
pdpStatus.bits
.TmeasMs_likelywillbe20ms_; /* multiplied by TmeasMs = joules */
- return 0.125 * raw;
+ return energyJoules;
}
void HAL_ResetPDPTotalEnergy(HAL_PDPHandle handle, int32_t* status) {
diff --git a/hal/src/main/native/athena/Relay.cpp b/hal/src/main/native/athena/Relay.cpp
index 71880a8..4dffa36 100644
--- a/hal/src/main/native/athena/Relay.cpp
+++ b/hal/src/main/native/athena/Relay.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -88,8 +88,8 @@
HAL_Bool HAL_CheckRelayChannel(int32_t channel) {
// roboRIO only has 4 headers, and the FPGA has
- // seperate functions for forward and reverse,
- // instead of seperate channel IDs
+ // separate functions for forward and reverse,
+ // instead of separate channel IDs
return channel < kNumRelayHeaders && channel >= 0;
}
diff --git a/hal/src/main/native/athena/SPI.cpp b/hal/src/main/native/athena/SPI.cpp
index 977d447..37c5f0e 100644
--- a/hal/src/main/native/athena/SPI.cpp
+++ b/hal/src/main/native/athena/SPI.cpp
@@ -565,18 +565,12 @@
void HAL_SetSPIAutoTransmitData(HAL_SPIPort port, const uint8_t* dataToSend,
int32_t dataSize, int32_t zeroSize,
int32_t* status) {
- static_assert(tSPI::kNumAutoTxRegisters >= 6,
- "FPGA does not have enough tx registers");
- static_assert(tSPI::kNumAutoTxElements == 4,
- "FPGA has the wrong number of tx elements");
- // 24 = 6 * 4, but the documentation needs updating if it ever changes, so
- // just hard-code it here.
- if (dataSize < 0 || dataSize > 23) {
+ if (dataSize < 0 || dataSize > 32) {
*status = PARAMETER_OUT_OF_RANGE;
return;
}
- if (zeroSize < 0 || zeroSize >= 128) {
+ if (zeroSize < 0 || zeroSize > 127) {
*status = PARAMETER_OUT_OF_RANGE;
return;
}
diff --git a/hal/src/main/native/athena/Solenoid.cpp b/hal/src/main/native/athena/Solenoid.cpp
index c53db11..ab563b3 100644
--- a/hal/src/main/native/athena/Solenoid.cpp
+++ b/hal/src/main/native/athena/Solenoid.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -7,15 +7,11 @@
#include "hal/Solenoid.h"
-#include <FRC_NetworkCommunication/LoadOut.h>
-
#include "HALInitializer.h"
#include "PCMInternal.h"
#include "PortsInternal.h"
#include "ctre/PCM.h"
-#include "hal/ChipObject.h"
#include "hal/Errors.h"
-#include "hal/Ports.h"
#include "hal/handles/HandlesInternal.h"
#include "hal/handles/IndexedHandleResource.h"
diff --git a/hal/src/main/native/athena/cpp/SerialHelper.cpp b/hal/src/main/native/athena/cpp/SerialHelper.cpp
index e312e2a..2156147 100644
--- a/hal/src/main/native/athena/cpp/SerialHelper.cpp
+++ b/hal/src/main/native/athena/cpp/SerialHelper.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -199,7 +199,7 @@
*status = viGetAttribute(vSession, VI_ATTR_INTF_INST_NAME, &osName);
// Ignore an error here, as we want to close the session on an error
- // Use a seperate close variable so we can check
+ // Use a separate close variable so we can check
ViStatus closeStatus = viClose(vSession);
if (*status < 0) goto done;
if (closeStatus < 0) goto done;
diff --git a/hal/src/main/native/athena/ctre/CtreCanNode.h b/hal/src/main/native/athena/ctre/CtreCanNode.h
index f00060d..ce2d6ac 100644
--- a/hal/src/main/native/athena/ctre/CtreCanNode.h
+++ b/hal/src/main/native/athena/ctre/CtreCanNode.h
@@ -2,8 +2,6 @@
#define CtreCanNode_H_
#include "ctre.h" //BIT Defines + Typedefs
#include <map>
-#include <string.h> // memcpy
-#include <sys/time.h>
#include <wpi/mutex.h>
class CtreCanNode
{
diff --git a/hal/src/main/native/athena/ctre/PCM.cpp b/hal/src/main/native/athena/ctre/PCM.cpp
index e05d4d4..4fd633f 100644
--- a/hal/src/main/native/athena/ctre/PCM.cpp
+++ b/hal/src/main/native/athena/ctre/PCM.cpp
@@ -2,7 +2,6 @@
#include "PCM.h"
#include "FRC_NetworkCommunication/CANSessionMux.h"
-#include <string.h> // memset
/* This can be a constant, as long as nobody needs to update solenoids within
1/50 of a second. */
static const INT32 kCANPeriod = 20;
diff --git a/hal/src/main/native/athena/ctre/PCM.h b/hal/src/main/native/athena/ctre/PCM.h
index b485219..4923202 100644
--- a/hal/src/main/native/athena/ctre/PCM.h
+++ b/hal/src/main/native/athena/ctre/PCM.h
@@ -57,7 +57,7 @@
/* Get compressor state
* @Return - CTR_Code - Error code (if any)
- * @Param - status - True if compress ouput is on, false if otherwise
+ * @Param - status - True if compress output is on, false if otherwise
*/
CTR_Code GetCompressor(bool &status);
diff --git a/hal/src/main/native/athena/mockdata/AccelerometerData.cpp b/hal/src/main/native/athena/mockdata/AccelerometerData.cpp
new file mode 100644
index 0000000..2baaf78
--- /dev/null
+++ b/hal/src/main/native/athena/mockdata/AccelerometerData.cpp
@@ -0,0 +1,28 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2020 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. */
+/*----------------------------------------------------------------------------*/
+
+#include "hal/simulation/AccelerometerData.h"
+
+#include "hal/simulation/SimDataValue.h"
+
+extern "C" {
+void HALSIM_ResetAccelerometerData(int32_t index) {}
+
+#define DEFINE_CAPI(TYPE, CAPINAME, RETURN) \
+ HAL_SIMDATAVALUE_STUB_CAPI(TYPE, HALSIM, Accelerometer##CAPINAME, RETURN)
+
+DEFINE_CAPI(HAL_Bool, Active, false)
+DEFINE_CAPI(HAL_AccelerometerRange, Range, HAL_AccelerometerRange_k2G)
+DEFINE_CAPI(double, X, 0)
+DEFINE_CAPI(double, Y, 0)
+DEFINE_CAPI(double, Z, 0)
+
+void HALSIM_RegisterAccelerometerAllCallbacks(int32_t index,
+ HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify) {}
+} // extern "C"
diff --git a/hal/src/main/native/athena/mockdata/AddressableLEDData.cpp b/hal/src/main/native/athena/mockdata/AddressableLEDData.cpp
new file mode 100644
index 0000000..d718789
--- /dev/null
+++ b/hal/src/main/native/athena/mockdata/AddressableLEDData.cpp
@@ -0,0 +1,45 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2019-2020 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. */
+/*----------------------------------------------------------------------------*/
+
+#include "hal/simulation/AddressableLEDData.h"
+
+#include "hal/simulation/SimDataValue.h"
+
+extern "C" {
+
+int32_t HALSIM_FindAddressableLEDForChannel(int32_t channel) { return 0; }
+
+void HALSIM_ResetAddressableLEDData(int32_t index) {}
+
+int32_t HALSIM_GetAddressableLEDData(int32_t index,
+ struct HAL_AddressableLEDData* data) {
+ return 0;
+}
+
+void HALSIM_SetAddressableLEDData(int32_t index,
+ const struct HAL_AddressableLEDData* data,
+ int32_t length) {}
+
+#define DEFINE_CAPI(TYPE, CAPINAME, RETURN) \
+ HAL_SIMDATAVALUE_STUB_CAPI(TYPE, HALSIM, AddressableLED##CAPINAME, RETURN)
+
+DEFINE_CAPI(HAL_Bool, Initialized, false)
+DEFINE_CAPI(int32_t, OutputPort, 0)
+DEFINE_CAPI(int32_t, Length, 0)
+DEFINE_CAPI(HAL_Bool, Running, false)
+
+#undef DEFINE_CAPI
+#define DEFINE_CAPI(TYPE, CAPINAME, RETURN) \
+ HAL_SIMCALLBACKREGISTRY_STUB_CAPI(TYPE, HALSIM, AddressableLED##CAPINAME)
+
+DEFINE_CAPI(HAL_ConstBufferCallback, Data, data)
+
+void HALSIM_RegisterAddressableLEDAllCallbacks(int32_t index,
+ HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify) {}
+} // extern "C"
diff --git a/hal/src/main/native/athena/mockdata/AnalogGyroData.cpp b/hal/src/main/native/athena/mockdata/AnalogGyroData.cpp
new file mode 100644
index 0000000..d91ce27
--- /dev/null
+++ b/hal/src/main/native/athena/mockdata/AnalogGyroData.cpp
@@ -0,0 +1,26 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2020 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. */
+/*----------------------------------------------------------------------------*/
+
+#include "hal/simulation/AnalogGyroData.h"
+
+#include "hal/simulation/SimDataValue.h"
+
+extern "C" {
+void HALSIM_ResetAnalogGyroData(int32_t index) {}
+
+#define DEFINE_CAPI(TYPE, CAPINAME, RETURN) \
+ HAL_SIMDATAVALUE_STUB_CAPI(TYPE, HALSIM, AnalogGyro##CAPINAME, RETURN)
+
+DEFINE_CAPI(double, Angle, 0)
+DEFINE_CAPI(double, Rate, 0)
+DEFINE_CAPI(HAL_Bool, Initialized, false)
+
+void HALSIM_RegisterAnalogGyroAllCallbacks(int32_t index,
+ HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify) {}
+} // extern "C"
diff --git a/hal/src/main/native/athena/mockdata/AnalogInData.cpp b/hal/src/main/native/athena/mockdata/AnalogInData.cpp
new file mode 100644
index 0000000..4288538
--- /dev/null
+++ b/hal/src/main/native/athena/mockdata/AnalogInData.cpp
@@ -0,0 +1,33 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2020 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. */
+/*----------------------------------------------------------------------------*/
+
+#include "hal/simulation/AnalogInData.h"
+
+#include "hal/simulation/SimDataValue.h"
+
+extern "C" {
+void HALSIM_ResetAnalogInData(int32_t index) {}
+
+HAL_SimDeviceHandle HALSIM_GetAnalogInSimDevice(int32_t index) { return 0; }
+
+#define DEFINE_CAPI(TYPE, CAPINAME, RETURN) \
+ HAL_SIMDATAVALUE_STUB_CAPI(TYPE, HALSIM, AnalogIn##CAPINAME, RETURN)
+
+DEFINE_CAPI(HAL_Bool, Initialized, false)
+DEFINE_CAPI(int32_t, AverageBits, 0)
+DEFINE_CAPI(int32_t, OversampleBits, 0)
+DEFINE_CAPI(double, Voltage, 0)
+DEFINE_CAPI(HAL_Bool, AccumulatorInitialized, false)
+DEFINE_CAPI(int64_t, AccumulatorValue, 0)
+DEFINE_CAPI(int64_t, AccumulatorCount, 0)
+DEFINE_CAPI(int32_t, AccumulatorCenter, 0)
+DEFINE_CAPI(int32_t, AccumulatorDeadband, 0)
+
+void HALSIM_RegisterAnalogInAllCallbacks(int32_t index,
+ HAL_NotifyCallback callback,
+ void* param, HAL_Bool initialNotify) {}
+} // extern "C"
diff --git a/hal/src/main/native/athena/mockdata/AnalogOutData.cpp b/hal/src/main/native/athena/mockdata/AnalogOutData.cpp
new file mode 100644
index 0000000..f05b0be
--- /dev/null
+++ b/hal/src/main/native/athena/mockdata/AnalogOutData.cpp
@@ -0,0 +1,25 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2020 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. */
+/*----------------------------------------------------------------------------*/
+
+#include "hal/simulation/AnalogOutData.h"
+
+#include "hal/simulation/SimDataValue.h"
+
+extern "C" {
+void HALSIM_ResetAnalogOutData(int32_t index) {}
+
+#define DEFINE_CAPI(TYPE, CAPINAME, RETURN) \
+ HAL_SIMDATAVALUE_STUB_CAPI(TYPE, HALSIM, AnalogOut##CAPINAME, RETURN)
+
+DEFINE_CAPI(double, Voltage, 0)
+DEFINE_CAPI(HAL_Bool, Initialized, false)
+
+void HALSIM_RegisterAnalogOutAllCallbacks(int32_t index,
+ HAL_NotifyCallback callback,
+ void* param, HAL_Bool initialNotify) {
+}
+} // extern "C"
diff --git a/hal/src/main/native/athena/mockdata/AnalogTriggerData.cpp b/hal/src/main/native/athena/mockdata/AnalogTriggerData.cpp
new file mode 100644
index 0000000..7781cf2
--- /dev/null
+++ b/hal/src/main/native/athena/mockdata/AnalogTriggerData.cpp
@@ -0,0 +1,31 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2020 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. */
+/*----------------------------------------------------------------------------*/
+
+#include "hal/simulation/AnalogTriggerData.h"
+
+#include "hal/simulation/SimDataValue.h"
+
+extern "C" {
+
+int32_t HALSIM_FindAnalogTriggerForChannel(int32_t channel) { return 0; }
+
+void HALSIM_ResetAnalogTriggerData(int32_t index) {}
+
+#define DEFINE_CAPI(TYPE, CAPINAME, RETURN) \
+ HAL_SIMDATAVALUE_STUB_CAPI(TYPE, HALSIM, AnalogTrigger##CAPINAME, RETURN)
+
+DEFINE_CAPI(HAL_Bool, Initialized, false)
+DEFINE_CAPI(double, TriggerLowerBound, 0)
+DEFINE_CAPI(double, TriggerUpperBound, 0)
+DEFINE_CAPI(HALSIM_AnalogTriggerMode, TriggerMode,
+ HALSIM_AnalogTriggerUnassigned)
+
+void HALSIM_RegisterAnalogTriggerAllCallbacks(int32_t index,
+ HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify) {}
+} // extern "C"
diff --git a/hal/src/main/native/athena/mockdata/CanDataInternal.cpp b/hal/src/main/native/athena/mockdata/CanDataInternal.cpp
new file mode 100644
index 0000000..69debf0
--- /dev/null
+++ b/hal/src/main/native/athena/mockdata/CanDataInternal.cpp
@@ -0,0 +1,25 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2020 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. */
+/*----------------------------------------------------------------------------*/
+
+#include "hal/simulation/CanData.h"
+#include "hal/simulation/SimDataValue.h"
+
+extern "C" {
+
+void HALSIM_ResetCanData(void) {}
+
+#define DEFINE_CAPI(TYPE, CAPINAME) \
+ HAL_SIMCALLBACKREGISTRY_STUB_CAPI_NOINDEX(TYPE, HALSIM, Can##CAPINAME)
+
+DEFINE_CAPI(HAL_CAN_SendMessageCallback, SendMessage)
+DEFINE_CAPI(HAL_CAN_ReceiveMessageCallback, ReceiveMessage)
+DEFINE_CAPI(HAL_CAN_OpenStreamSessionCallback, OpenStream)
+DEFINE_CAPI(HAL_CAN_CloseStreamSessionCallback, CloseStream)
+DEFINE_CAPI(HAL_CAN_ReadStreamSessionCallback, ReadStream)
+DEFINE_CAPI(HAL_CAN_GetCANStatusCallback, GetCANStatus)
+
+} // extern "C"
diff --git a/hal/src/main/native/athena/mockdata/DIOData.cpp b/hal/src/main/native/athena/mockdata/DIOData.cpp
new file mode 100644
index 0000000..a06855d
--- /dev/null
+++ b/hal/src/main/native/athena/mockdata/DIOData.cpp
@@ -0,0 +1,28 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2020 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. */
+/*----------------------------------------------------------------------------*/
+
+#include "hal/simulation/DIOData.h"
+
+#include "hal/simulation/SimDataValue.h"
+
+extern "C" {
+void HALSIM_ResetDIOData(int32_t index) {}
+
+HAL_SimDeviceHandle HALSIM_GetDIOSimDevice(int32_t index) { return 0; }
+
+#define DEFINE_CAPI(TYPE, CAPINAME, RETURN) \
+ HAL_SIMDATAVALUE_STUB_CAPI(TYPE, HALSIM, DIO##CAPINAME, RETURN)
+
+DEFINE_CAPI(HAL_Bool, Initialized, false)
+DEFINE_CAPI(HAL_Bool, Value, false)
+DEFINE_CAPI(double, PulseLength, 0)
+DEFINE_CAPI(HAL_Bool, IsInput, false)
+DEFINE_CAPI(int32_t, FilterIndex, 0)
+
+void HALSIM_RegisterDIOAllCallbacks(int32_t index, HAL_NotifyCallback callback,
+ void* param, HAL_Bool initialNotify) {}
+} // extern "C"
diff --git a/hal/src/main/native/athena/mockdata/DigitalPWMData.cpp b/hal/src/main/native/athena/mockdata/DigitalPWMData.cpp
new file mode 100644
index 0000000..bcbe370
--- /dev/null
+++ b/hal/src/main/native/athena/mockdata/DigitalPWMData.cpp
@@ -0,0 +1,28 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2020 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. */
+/*----------------------------------------------------------------------------*/
+
+#include "hal/simulation/DigitalPWMData.h"
+
+#include "hal/simulation/SimDataValue.h"
+
+extern "C" {
+int32_t HALSIM_FindDigitalPWMForChannel(int32_t channel) { return 0; }
+
+void HALSIM_ResetDigitalPWMData(int32_t index) {}
+
+#define DEFINE_CAPI(TYPE, CAPINAME, RETURN) \
+ HAL_SIMDATAVALUE_STUB_CAPI(TYPE, HALSIM, DigitalPWM##CAPINAME, RETURN)
+
+DEFINE_CAPI(HAL_Bool, Initialized, false)
+DEFINE_CAPI(double, DutyCycle, 0)
+DEFINE_CAPI(int32_t, Pin, 0)
+
+void HALSIM_RegisterDigitalPWMAllCallbacks(int32_t index,
+ HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify) {}
+} // extern "C"
diff --git a/hal/src/main/native/athena/mockdata/DriverStationData.cpp b/hal/src/main/native/athena/mockdata/DriverStationData.cpp
new file mode 100644
index 0000000..b4695ba
--- /dev/null
+++ b/hal/src/main/native/athena/mockdata/DriverStationData.cpp
@@ -0,0 +1,126 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2020 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. */
+/*----------------------------------------------------------------------------*/
+
+#include "hal/simulation/DriverStationData.h"
+
+#include "hal/simulation/SimDataValue.h"
+
+extern "C" {
+void HALSIM_ResetDriverStationData(void) {}
+
+#define DEFINE_CAPI(TYPE, CAPINAME, RETURN) \
+ HAL_SIMDATAVALUE_STUB_CAPI_NOINDEX(TYPE, HALSIM, DriverStation##CAPINAME, \
+ RETURN)
+
+DEFINE_CAPI(HAL_Bool, Enabled, false)
+DEFINE_CAPI(HAL_Bool, Autonomous, false)
+DEFINE_CAPI(HAL_Bool, Test, false)
+DEFINE_CAPI(HAL_Bool, EStop, false)
+DEFINE_CAPI(HAL_Bool, FmsAttached, false)
+DEFINE_CAPI(HAL_Bool, DsAttached, false)
+DEFINE_CAPI(HAL_AllianceStationID, AllianceStationId,
+ HAL_AllianceStationID_kRed1)
+DEFINE_CAPI(double, MatchTime, 0)
+
+#undef DEFINE_CAPI
+#define DEFINE_CAPI(name, data) \
+ int32_t HALSIM_RegisterJoystick##name##Callback( \
+ int32_t joystickNum, HAL_Joystick##name##Callback callback, void* param, \
+ HAL_Bool initialNotify) { \
+ return 0; \
+ } \
+ \
+ void HALSIM_CancelJoystick##name##Callback(int32_t uid) {} \
+ \
+ void HALSIM_GetJoystick##name(int32_t joystickNum, HAL_Joystick##name* d) {} \
+ \
+ void HALSIM_SetJoystick##name(int32_t joystickNum, \
+ const HAL_Joystick##name* d) {}
+
+DEFINE_CAPI(Axes, axes)
+DEFINE_CAPI(POVs, povs)
+DEFINE_CAPI(Buttons, buttons)
+DEFINE_CAPI(Descriptor, descriptor)
+
+int32_t HALSIM_RegisterJoystickOutputsCallback(
+ int32_t joystickNum, HAL_JoystickOutputsCallback callback, void* param,
+ HAL_Bool initialNotify) {
+ return 0;
+}
+
+void HALSIM_CancelJoystickOutputsCallback(int32_t uid) {}
+
+void HALSIM_GetJoystickOutputs(int32_t joystickNum, int64_t* outputs,
+ int32_t* leftRumble, int32_t* rightRumble) {}
+
+void HALSIM_SetJoystickOutputs(int32_t joystickNum, int64_t outputs,
+ int32_t leftRumble, int32_t rightRumble) {}
+
+int32_t HALSIM_RegisterMatchInfoCallback(HAL_MatchInfoCallback callback,
+ void* param, HAL_Bool initialNotify) {
+ return 0;
+}
+
+void HALSIM_CancelMatchInfoCallback(int32_t uid) {}
+
+void HALSIM_GetMatchInfo(HAL_MatchInfo* info) {}
+
+void HALSIM_SetMatchInfo(const HAL_MatchInfo* info) {}
+
+int32_t HALSIM_RegisterDriverStationNewDataCallback(HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify) {
+ return 0;
+}
+
+void HALSIM_CancelDriverStationNewDataCallback(int32_t uid) {}
+
+void HALSIM_NotifyDriverStationNewData(void) {}
+
+void HALSIM_SetJoystickButton(int32_t stick, int32_t button, HAL_Bool state) {}
+
+void HALSIM_SetJoystickAxis(int32_t stick, int32_t axis, double value) {}
+
+void HALSIM_SetJoystickPOV(int32_t stick, int32_t pov, int32_t value) {}
+
+void HALSIM_SetJoystickButtonsValue(int32_t stick, uint32_t buttons) {}
+
+void HALSIM_SetJoystickAxisCount(int32_t stick, int32_t count) {}
+
+void HALSIM_SetJoystickPOVCount(int32_t stick, int32_t count) {}
+
+void HALSIM_SetJoystickButtonCount(int32_t stick, int32_t count) {}
+
+void HALSIM_GetJoystickCounts(int32_t stick, int32_t* axisCount,
+ int32_t* buttonCount, int32_t* povCount) {
+ *axisCount = 0;
+ *buttonCount = 0;
+ *povCount = 0;
+}
+
+void HALSIM_SetJoystickIsXbox(int32_t stick, HAL_Bool isXbox) {}
+
+void HALSIM_SetJoystickType(int32_t stick, int32_t type) {}
+
+void HALSIM_SetJoystickName(int32_t stick, const char* name) {}
+
+void HALSIM_SetJoystickAxisType(int32_t stick, int32_t axis, int32_t type) {}
+
+void HALSIM_SetGameSpecificMessage(const char* message) {}
+
+void HALSIM_SetEventName(const char* name) {}
+
+void HALSIM_SetMatchType(HAL_MatchType type) {}
+
+void HALSIM_SetMatchNumber(int32_t matchNumber) {}
+
+void HALSIM_SetReplayNumber(int32_t replayNumber) {}
+
+void HALSIM_RegisterDriverStationAllCallbacks(HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify) {}
+} // extern "C"
diff --git a/hal/src/main/native/athena/mockdata/DutyCycleData.cpp b/hal/src/main/native/athena/mockdata/DutyCycleData.cpp
new file mode 100644
index 0000000..8d3cd61
--- /dev/null
+++ b/hal/src/main/native/athena/mockdata/DutyCycleData.cpp
@@ -0,0 +1,33 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2019-2020 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. */
+/*----------------------------------------------------------------------------*/
+
+#include "hal/simulation/DutyCycleData.h"
+
+#include "hal/simulation/SimDataValue.h"
+
+extern "C" {
+int32_t HALSIM_FindDutyCycleForChannel(int32_t channel) { return 0; }
+
+void HALSIM_ResetDutyCycleData(int32_t index) {}
+
+int32_t HALSIM_GetDutyCycleDigitalChannel(int32_t index) { return 0; }
+
+HAL_SimDeviceHandle HALSIM_GetDutyCycleSimDevice(int32_t index) { return 0; }
+
+#define DEFINE_CAPI(TYPE, CAPINAME, RETURN) \
+ HAL_SIMDATAVALUE_STUB_CAPI(TYPE, HALSIM, DutyCycle##CAPINAME, RETURN)
+
+DEFINE_CAPI(HAL_Bool, Initialized, false)
+DEFINE_CAPI(int32_t, Frequency, 0)
+DEFINE_CAPI(double, Output, 0)
+
+void HALSIM_RegisterDutyCycleAllCallbacks(int32_t index,
+ HAL_NotifyCallback callback,
+ void* param, HAL_Bool initialNotify) {
+}
+
+} // extern "C"
diff --git a/hal/src/main/native/athena/mockdata/EncoderData.cpp b/hal/src/main/native/athena/mockdata/EncoderData.cpp
new file mode 100644
index 0000000..87a7385
--- /dev/null
+++ b/hal/src/main/native/athena/mockdata/EncoderData.cpp
@@ -0,0 +1,47 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2020 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. */
+/*----------------------------------------------------------------------------*/
+
+#include "hal/simulation/EncoderData.h"
+
+#include "hal/simulation/SimDataValue.h"
+
+extern "C" {
+int32_t HALSIM_FindEncoderForChannel(int32_t channel) { return 0; }
+
+void HALSIM_ResetEncoderData(int32_t index) {}
+
+int32_t HALSIM_GetEncoderDigitalChannelA(int32_t index) { return 0; }
+
+int32_t HALSIM_GetEncoderDigitalChannelB(int32_t index) { return 0; }
+
+HAL_SimDeviceHandle HALSIM_GetEncoderSimDevice(int32_t index) { return 0; }
+
+#define DEFINE_CAPI(TYPE, CAPINAME, RETURN) \
+ HAL_SIMDATAVALUE_STUB_CAPI(TYPE, HALSIM, Encoder##CAPINAME, RETURN)
+
+DEFINE_CAPI(HAL_Bool, Initialized, false)
+DEFINE_CAPI(int32_t, Count, 0)
+DEFINE_CAPI(double, Period, 0)
+DEFINE_CAPI(HAL_Bool, Reset, false)
+DEFINE_CAPI(double, MaxPeriod, 0)
+DEFINE_CAPI(HAL_Bool, Direction, false)
+DEFINE_CAPI(HAL_Bool, ReverseDirection, false)
+DEFINE_CAPI(int32_t, SamplesToAverage, 0)
+DEFINE_CAPI(double, DistancePerPulse, 0)
+
+void HALSIM_SetEncoderDistance(int32_t index, double distance) {}
+
+double HALSIM_GetEncoderDistance(int32_t index) { return 0; }
+
+void HALSIM_SetEncoderRate(int32_t index, double rate) {}
+
+double HALSIM_GetEncoderRate(int32_t index) { return 0; }
+
+void HALSIM_RegisterEncoderAllCallbacks(int32_t index,
+ HAL_NotifyCallback callback,
+ void* param, HAL_Bool initialNotify) {}
+} // extern "C"
diff --git a/hal/src/main/native/athena/mockdata/I2CData.cpp b/hal/src/main/native/athena/mockdata/I2CData.cpp
new file mode 100644
index 0000000..eb6a6c9
--- /dev/null
+++ b/hal/src/main/native/athena/mockdata/I2CData.cpp
@@ -0,0 +1,27 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2020 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. */
+/*----------------------------------------------------------------------------*/
+
+#include "hal/simulation/I2CData.h"
+
+#include "hal/simulation/SimDataValue.h"
+
+extern "C" {
+void HALSIM_ResetI2CData(int32_t index) {}
+
+#define DEFINE_CAPI(TYPE, CAPINAME, RETURN) \
+ HAL_SIMDATAVALUE_STUB_CAPI(TYPE, HALSIM, I2C##CAPINAME, RETURN)
+
+DEFINE_CAPI(HAL_Bool, Initialized, false)
+
+#undef DEFINE_CAPI
+#define DEFINE_CAPI(TYPE, CAPINAME) \
+ HAL_SIMCALLBACKREGISTRY_STUB_CAPI(TYPE, HALSIM, I2C##CAPINAME)
+
+DEFINE_CAPI(HAL_BufferCallback, Read)
+DEFINE_CAPI(HAL_ConstBufferCallback, Write)
+
+} // extern "C"
diff --git a/hal/src/main/native/athena/mockdata/MockHooks.cpp b/hal/src/main/native/athena/mockdata/MockHooks.cpp
new file mode 100644
index 0000000..2e7bcfe
--- /dev/null
+++ b/hal/src/main/native/athena/mockdata/MockHooks.cpp
@@ -0,0 +1,36 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2020 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. */
+/*----------------------------------------------------------------------------*/
+
+#include "hal/simulation/MockHooks.h"
+
+extern "C" {
+
+void HALSIM_SetRuntimeType(HAL_RuntimeType type) {}
+
+void HALSIM_WaitForProgramStart(void) {}
+
+void HALSIM_SetProgramStarted(void) {}
+
+HAL_Bool HALSIM_GetProgramStarted(void) { return false; }
+
+void HALSIM_RestartTiming(void) {}
+
+void HALSIM_PauseTiming(void) {}
+
+void HALSIM_ResumeTiming(void) {}
+
+HAL_Bool HALSIM_IsTimingPaused(void) { return false; }
+
+void HALSIM_StepTiming(uint64_t delta) {}
+
+void HALSIM_StepTimingAsync(uint64_t delta) {}
+
+void HALSIM_SetSendError(HALSIM_SendErrorHandler handler) {}
+
+void HALSIM_SetSendConsoleLine(HALSIM_SendConsoleLineHandler handler) {}
+
+} // extern "C"
diff --git a/hal/src/main/native/athena/mockdata/NotifierData.cpp b/hal/src/main/native/athena/mockdata/NotifierData.cpp
new file mode 100644
index 0000000..34aa6e7
--- /dev/null
+++ b/hal/src/main/native/athena/mockdata/NotifierData.cpp
@@ -0,0 +1,20 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2020 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. */
+/*----------------------------------------------------------------------------*/
+
+#include "hal/simulation/NotifierData.h"
+
+extern "C" {
+
+uint64_t HALSIM_GetNextNotifierTimeout(void) { return 0; }
+
+int32_t HALSIM_GetNumNotifiers(void) { return 0; }
+
+int32_t HALSIM_GetNotifierInfo(struct HALSIM_NotifierInfo* arr, int32_t size) {
+ return 0;
+}
+
+} // extern "C"
diff --git a/hal/src/main/native/athena/mockdata/PCMData.cpp b/hal/src/main/native/athena/mockdata/PCMData.cpp
new file mode 100644
index 0000000..29302cb
--- /dev/null
+++ b/hal/src/main/native/athena/mockdata/PCMData.cpp
@@ -0,0 +1,40 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2020 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. */
+/*----------------------------------------------------------------------------*/
+
+#include "hal/simulation/PCMData.h"
+
+#include "hal/simulation/SimDataValue.h"
+
+extern "C" {
+void HALSIM_ResetPCMData(int32_t index) {}
+
+#define DEFINE_CAPI(TYPE, CAPINAME, RETURN) \
+ HAL_SIMDATAVALUE_STUB_CAPI(TYPE, HALSIM, PCM##CAPINAME, RETURN)
+
+HAL_SIMDATAVALUE_STUB_CAPI_CHANNEL(HAL_Bool, HALSIM, PCMSolenoidInitialized,
+ false)
+HAL_SIMDATAVALUE_STUB_CAPI_CHANNEL(HAL_Bool, HALSIM, PCMSolenoidOutput, false)
+DEFINE_CAPI(HAL_Bool, CompressorInitialized, false)
+DEFINE_CAPI(HAL_Bool, CompressorOn, false)
+DEFINE_CAPI(HAL_Bool, ClosedLoopEnabled, false)
+DEFINE_CAPI(HAL_Bool, PressureSwitch, false)
+DEFINE_CAPI(double, CompressorCurrent, 0)
+
+void HALSIM_GetPCMAllSolenoids(int32_t index, uint8_t* values) { *values = 0; }
+
+void HALSIM_SetPCMAllSolenoids(int32_t index, uint8_t values) {}
+
+void HALSIM_RegisterPCMAllNonSolenoidCallbacks(int32_t index,
+ HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify) {}
+
+void HALSIM_RegisterPCMAllSolenoidCallbacks(int32_t index, int32_t channel,
+ HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify) {}
+} // extern "C"
diff --git a/hal/src/main/native/athena/mockdata/PDPData.cpp b/hal/src/main/native/athena/mockdata/PDPData.cpp
new file mode 100644
index 0000000..a28bb81
--- /dev/null
+++ b/hal/src/main/native/athena/mockdata/PDPData.cpp
@@ -0,0 +1,34 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2020 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. */
+/*----------------------------------------------------------------------------*/
+
+#include "hal/simulation/PDPData.h"
+
+#include "../PortsInternal.h"
+#include "hal/simulation/SimDataValue.h"
+
+extern "C" {
+void HALSIM_ResetPDPData(int32_t index) {}
+
+#define DEFINE_CAPI(TYPE, CAPINAME, RETURN) \
+ HAL_SIMDATAVALUE_STUB_CAPI(TYPE, HALSIM, PDP##CAPINAME, RETURN)
+
+DEFINE_CAPI(HAL_Bool, Initialized, false)
+DEFINE_CAPI(double, Temperature, 0)
+DEFINE_CAPI(double, Voltage, 0)
+HAL_SIMDATAVALUE_STUB_CAPI_CHANNEL(double, HALSIM, PDPCurrent, 0)
+
+void HALSIM_GetPDPAllCurrents(int32_t index, double* currents) {
+ for (int i = 0; i < hal::kNumPDPChannels; i++) currents[i] = 0;
+}
+
+void HALSIM_SetPDPAllCurrents(int32_t index, const double* currents) {}
+
+void HALSIM_RegisterPDPAllNonCurrentCallbacks(int32_t index, int32_t channel,
+ HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify) {}
+} // extern "C"
diff --git a/hal/src/main/native/athena/mockdata/PWMData.cpp b/hal/src/main/native/athena/mockdata/PWMData.cpp
new file mode 100644
index 0000000..b9c5691
--- /dev/null
+++ b/hal/src/main/native/athena/mockdata/PWMData.cpp
@@ -0,0 +1,27 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2020 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. */
+/*----------------------------------------------------------------------------*/
+
+#include "hal/simulation/PWMData.h"
+
+#include "hal/simulation/SimDataValue.h"
+
+extern "C" {
+void HALSIM_ResetPWMData(int32_t index) {}
+
+#define DEFINE_CAPI(TYPE, CAPINAME, RETURN) \
+ HAL_SIMDATAVALUE_STUB_CAPI(TYPE, HALSIM, PWM##CAPINAME, RETURN)
+
+DEFINE_CAPI(HAL_Bool, Initialized, false)
+DEFINE_CAPI(int32_t, RawValue, 0)
+DEFINE_CAPI(double, Speed, 0)
+DEFINE_CAPI(double, Position, 0)
+DEFINE_CAPI(int32_t, PeriodScale, 0)
+DEFINE_CAPI(HAL_Bool, ZeroLatch, false)
+
+void HALSIM_RegisterPWMAllCallbacks(int32_t index, HAL_NotifyCallback callback,
+ void* param, HAL_Bool initialNotify) {}
+} // extern "C"
diff --git a/hal/src/main/native/athena/mockdata/RelayData.cpp b/hal/src/main/native/athena/mockdata/RelayData.cpp
new file mode 100644
index 0000000..734bf89
--- /dev/null
+++ b/hal/src/main/native/athena/mockdata/RelayData.cpp
@@ -0,0 +1,26 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2020 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. */
+/*----------------------------------------------------------------------------*/
+
+#include "hal/simulation/RelayData.h"
+
+#include "hal/simulation/SimDataValue.h"
+
+extern "C" {
+void HALSIM_ResetRelayData(int32_t index) {}
+
+#define DEFINE_CAPI(TYPE, CAPINAME, RETURN) \
+ HAL_SIMDATAVALUE_STUB_CAPI(TYPE, HALSIM, Relay##CAPINAME, RETURN)
+
+DEFINE_CAPI(HAL_Bool, InitializedForward, false)
+DEFINE_CAPI(HAL_Bool, InitializedReverse, false)
+DEFINE_CAPI(HAL_Bool, Forward, false)
+DEFINE_CAPI(HAL_Bool, Reverse, false)
+
+void HALSIM_RegisterRelayAllCallbacks(int32_t index,
+ HAL_NotifyCallback callback, void* param,
+ HAL_Bool initialNotify) {}
+} // extern "C"
diff --git a/hal/src/main/native/athena/mockdata/RoboRioData.cpp b/hal/src/main/native/athena/mockdata/RoboRioData.cpp
new file mode 100644
index 0000000..f9e9ca7
--- /dev/null
+++ b/hal/src/main/native/athena/mockdata/RoboRioData.cpp
@@ -0,0 +1,36 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2020 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. */
+/*----------------------------------------------------------------------------*/
+
+#include "hal/simulation/RoboRioData.h"
+
+#include "hal/simulation/SimDataValue.h"
+
+extern "C" {
+void HALSIM_ResetRoboRioData(void) {}
+
+#define DEFINE_CAPI(TYPE, CAPINAME, RETURN) \
+ HAL_SIMDATAVALUE_STUB_CAPI_NOINDEX(TYPE, HALSIM, RoboRio##CAPINAME, RETURN)
+
+DEFINE_CAPI(HAL_Bool, FPGAButton, false)
+DEFINE_CAPI(double, VInVoltage, 0)
+DEFINE_CAPI(double, VInCurrent, 0)
+DEFINE_CAPI(double, UserVoltage6V, 0)
+DEFINE_CAPI(double, UserCurrent6V, 0)
+DEFINE_CAPI(HAL_Bool, UserActive6V, false)
+DEFINE_CAPI(double, UserVoltage5V, 0)
+DEFINE_CAPI(double, UserCurrent5V, 0)
+DEFINE_CAPI(HAL_Bool, UserActive5V, false)
+DEFINE_CAPI(double, UserVoltage3V3, 0)
+DEFINE_CAPI(double, UserCurrent3V3, 0)
+DEFINE_CAPI(HAL_Bool, UserActive3V3, false)
+DEFINE_CAPI(int32_t, UserFaults6V, 0)
+DEFINE_CAPI(int32_t, UserFaults5V, 0)
+DEFINE_CAPI(int32_t, UserFaults3V3, 0)
+
+void HALSIM_RegisterRoboRioAllCallbacks(HAL_NotifyCallback callback,
+ void* param, HAL_Bool initialNotify) {}
+} // extern "C"
diff --git a/hal/src/main/native/athena/mockdata/SPIAccelerometerData.cpp b/hal/src/main/native/athena/mockdata/SPIAccelerometerData.cpp
new file mode 100644
index 0000000..c3e8ede
--- /dev/null
+++ b/hal/src/main/native/athena/mockdata/SPIAccelerometerData.cpp
@@ -0,0 +1,28 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2020 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. */
+/*----------------------------------------------------------------------------*/
+
+#include "hal/simulation/SPIAccelerometerData.h"
+
+#include "hal/simulation/SimDataValue.h"
+
+extern "C" {
+void HALSIM_ResetSPIAccelerometerData(int32_t index) {}
+
+#define DEFINE_CAPI(TYPE, CAPINAME, RETURN) \
+ HAL_SIMDATAVALUE_STUB_CAPI(TYPE, HALSIM, SPIAccelerometer##CAPINAME, RETURN)
+
+DEFINE_CAPI(HAL_Bool, Active, false)
+DEFINE_CAPI(int32_t, Range, 0)
+DEFINE_CAPI(double, X, 0)
+DEFINE_CAPI(double, Y, 0)
+DEFINE_CAPI(double, Z, 0)
+
+void HALSIM_RegisterSPIAccelerometerAllCallbcaks(int32_t index,
+ HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify) {}
+} // extern "C"
diff --git a/hal/src/main/native/athena/mockdata/SPIData.cpp b/hal/src/main/native/athena/mockdata/SPIData.cpp
new file mode 100644
index 0000000..13cf67c
--- /dev/null
+++ b/hal/src/main/native/athena/mockdata/SPIData.cpp
@@ -0,0 +1,28 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2020 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. */
+/*----------------------------------------------------------------------------*/
+
+#include "hal/simulation/SPIData.h"
+
+#include "hal/simulation/SimDataValue.h"
+
+extern "C" {
+void HALSIM_ResetSPIData(int32_t index) {}
+
+#define DEFINE_CAPI(TYPE, CAPINAME, RETURN) \
+ HAL_SIMDATAVALUE_STUB_CAPI(TYPE, HALSIM, SPI##CAPINAME, RETURN)
+
+DEFINE_CAPI(HAL_Bool, Initialized, false)
+
+#undef DEFINE_CAPI
+#define DEFINE_CAPI(TYPE, CAPINAME) \
+ HAL_SIMCALLBACKREGISTRY_STUB_CAPI(TYPE, HALSIM, SPI##CAPINAME)
+
+DEFINE_CAPI(HAL_BufferCallback, Read)
+DEFINE_CAPI(HAL_ConstBufferCallback, Write)
+DEFINE_CAPI(HAL_SpiReadAutoReceiveBufferCallback, ReadAutoReceivedData)
+
+} // extern "C"
diff --git a/hal/src/main/native/athena/mockdata/SimDeviceData.cpp b/hal/src/main/native/athena/mockdata/SimDeviceData.cpp
new file mode 100644
index 0000000..a31160c
--- /dev/null
+++ b/hal/src/main/native/athena/mockdata/SimDeviceData.cpp
@@ -0,0 +1,78 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2019-2020 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. */
+/*----------------------------------------------------------------------------*/
+
+#include "hal/simulation/SimDeviceData.h"
+
+#include "hal/simulation/SimDataValue.h"
+
+extern "C" {
+
+void HALSIM_SetSimDeviceEnabled(const char* prefix, HAL_Bool enabled) {}
+
+HAL_Bool HALSIM_IsSimDeviceEnabled(const char* name) { return false; }
+
+int32_t HALSIM_RegisterSimDeviceCreatedCallback(
+ const char* prefix, void* param, HALSIM_SimDeviceCallback callback,
+ HAL_Bool initialNotify) {
+ return 0;
+}
+
+void HALSIM_CancelSimDeviceCreatedCallback(int32_t uid) {}
+
+int32_t HALSIM_RegisterSimDeviceFreedCallback(
+ const char* prefix, void* param, HALSIM_SimDeviceCallback callback) {
+ return 0;
+}
+
+void HALSIM_CancelSimDeviceFreedCallback(int32_t uid) {}
+
+HAL_SimDeviceHandle HALSIM_GetSimDeviceHandle(const char* name) { return 0; }
+
+const char* HALSIM_GetSimDeviceName(HAL_SimDeviceHandle handle) { return ""; }
+
+HAL_SimDeviceHandle HALSIM_GetSimValueDeviceHandle(HAL_SimValueHandle handle) {
+ return 0;
+}
+
+void HALSIM_EnumerateSimDevices(const char* prefix, void* param,
+ HALSIM_SimDeviceCallback callback) {}
+
+int32_t HALSIM_RegisterSimValueCreatedCallback(HAL_SimDeviceHandle device,
+ void* param,
+ HALSIM_SimValueCallback callback,
+ HAL_Bool initialNotify) {
+ return 0;
+}
+
+void HALSIM_CancelSimValueCreatedCallback(int32_t uid) {}
+
+int32_t HALSIM_RegisterSimValueChangedCallback(HAL_SimValueHandle handle,
+ void* param,
+ HALSIM_SimValueCallback callback,
+ HAL_Bool initialNotify) {
+ return 0;
+}
+
+void HALSIM_CancelSimValueChangedCallback(int32_t uid) {}
+
+HAL_SimValueHandle HALSIM_GetSimValueHandle(HAL_SimDeviceHandle device,
+ const char* name) {
+ return 0;
+}
+
+void HALSIM_EnumerateSimValues(HAL_SimDeviceHandle device, void* param,
+ HALSIM_SimValueCallback callback) {}
+
+const char** HALSIM_GetSimValueEnumOptions(HAL_SimValueHandle handle,
+ int32_t* numOptions) {
+ *numOptions = 0;
+ return nullptr;
+}
+
+void HALSIM_ResetSimDeviceData(void) {}
+
+} // extern "C"
diff --git a/hal/src/main/native/cpp/cpp/fpga_clock.cpp b/hal/src/main/native/cpp/cpp/fpga_clock.cpp
index bcec155..ae65ee7 100644
--- a/hal/src/main/native/cpp/cpp/fpga_clock.cpp
+++ b/hal/src/main/native/cpp/cpp/fpga_clock.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,9 +7,11 @@
#include "hal/cpp/fpga_clock.h"
+#include <limits>
+
#include <wpi/raw_ostream.h>
-#include "hal/HAL.h"
+#include "hal/HALBase.h"
namespace hal {
const fpga_clock::time_point fpga_clock::min_time =
diff --git a/hal/src/main/native/cpp/jni/AddressableLEDJNI.cpp b/hal/src/main/native/cpp/jni/AddressableLEDJNI.cpp
index 3f76e6a..3d74b24 100644
--- a/hal/src/main/native/cpp/jni/AddressableLEDJNI.cpp
+++ b/hal/src/main/native/cpp/jni/AddressableLEDJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2019-2020 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. */
@@ -13,7 +13,7 @@
#include "edu_wpi_first_hal_AddressableLEDJNI.h"
#include "hal/AddressableLED.h"
-using namespace frc;
+using namespace hal;
using namespace wpi::java;
static_assert(sizeof(jbyte) * 4 == sizeof(HAL_AddressableLEDData));
diff --git a/hal/src/main/native/cpp/jni/AnalogGyroJNI.cpp b/hal/src/main/native/cpp/jni/AnalogGyroJNI.cpp
index 35b7414..c06e513 100644
--- a/hal/src/main/native/cpp/jni/AnalogGyroJNI.cpp
+++ b/hal/src/main/native/cpp/jni/AnalogGyroJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -14,7 +14,7 @@
#include "hal/AnalogGyro.h"
#include "hal/handles/HandlesInternal.h"
-using namespace frc;
+using namespace hal;
extern "C" {
/*
diff --git a/hal/src/main/native/cpp/jni/AnalogJNI.cpp b/hal/src/main/native/cpp/jni/AnalogJNI.cpp
index 5571d55..8b920ac 100644
--- a/hal/src/main/native/cpp/jni/AnalogJNI.cpp
+++ b/hal/src/main/native/cpp/jni/AnalogJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -18,7 +18,7 @@
#include "hal/Ports.h"
#include "hal/handles/HandlesInternal.h"
-using namespace frc;
+using namespace hal;
extern "C" {
diff --git a/hal/src/main/native/cpp/jni/CANAPIJNI.cpp b/hal/src/main/native/cpp/jni/CANAPIJNI.cpp
index 7ac7cf6..f42cc2f 100644
--- a/hal/src/main/native/cpp/jni/CANAPIJNI.cpp
+++ b/hal/src/main/native/cpp/jni/CANAPIJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -19,7 +19,7 @@
#include "hal/CANAPI.h"
#include "hal/Errors.h"
-using namespace frc;
+using namespace hal;
using namespace wpi::java;
extern "C" {
@@ -109,6 +109,59 @@
/*
* Class: edu_wpi_first_hal_CANAPIJNI
+ * Method: writeCANPacketNoThrow
+ * Signature: (I[BI)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_CANAPIJNI_writeCANPacketNoThrow
+ (JNIEnv* env, jclass, jint handle, jbyteArray data, jint apiId)
+{
+ auto halHandle = static_cast<HAL_CANHandle>(handle);
+ JByteArrayRef arr{env, data};
+ auto arrRef = arr.array();
+ int32_t status = 0;
+ HAL_WriteCANPacket(halHandle, reinterpret_cast<const uint8_t*>(arrRef.data()),
+ arrRef.size(), apiId, &status);
+ return status;
+}
+
+/*
+ * Class: edu_wpi_first_hal_CANAPIJNI
+ * Method: writeCANPacketRepeatingNoThrow
+ * Signature: (I[BII)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_CANAPIJNI_writeCANPacketRepeatingNoThrow
+ (JNIEnv* env, jclass, jint handle, jbyteArray data, jint apiId,
+ jint timeoutMs)
+{
+ auto halHandle = static_cast<HAL_CANHandle>(handle);
+ JByteArrayRef arr{env, data};
+ auto arrRef = arr.array();
+ int32_t status = 0;
+ HAL_WriteCANPacketRepeating(halHandle,
+ reinterpret_cast<const uint8_t*>(arrRef.data()),
+ arrRef.size(), apiId, timeoutMs, &status);
+ return status;
+}
+
+/*
+ * Class: edu_wpi_first_hal_CANAPIJNI
+ * Method: writeCANRTRFrameNoThrow
+ * Signature: (III)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_CANAPIJNI_writeCANRTRFrameNoThrow
+ (JNIEnv* env, jclass, jint handle, jint length, jint apiId)
+{
+ auto halHandle = static_cast<HAL_CANHandle>(handle);
+ int32_t status = 0;
+ HAL_WriteCANRTRFrame(halHandle, static_cast<int32_t>(length), apiId, &status);
+ return status;
+}
+
+/*
+ * Class: edu_wpi_first_hal_CANAPIJNI
* Method: stopCANPacketRepeating
* Signature: (II)V
*/
diff --git a/hal/src/main/native/cpp/jni/CANJNI.cpp b/hal/src/main/native/cpp/jni/CANJNI.cpp
index 9278c24..42b484b 100644
--- a/hal/src/main/native/cpp/jni/CANJNI.cpp
+++ b/hal/src/main/native/cpp/jni/CANJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -17,7 +17,7 @@
#include "edu_wpi_first_hal_can_CANJNI.h"
#include "hal/CAN.h"
-using namespace frc;
+using namespace hal;
using namespace wpi::java;
extern "C" {
diff --git a/hal/src/main/native/cpp/jni/CompressorJNI.cpp b/hal/src/main/native/cpp/jni/CompressorJNI.cpp
index 75a5e0a..c214c60 100644
--- a/hal/src/main/native/cpp/jni/CompressorJNI.cpp
+++ b/hal/src/main/native/cpp/jni/CompressorJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -11,7 +11,7 @@
#include "hal/Ports.h"
#include "hal/Solenoid.h"
-using namespace frc;
+using namespace hal;
extern "C" {
diff --git a/hal/src/main/native/cpp/jni/ConstantsJNI.cpp b/hal/src/main/native/cpp/jni/ConstantsJNI.cpp
index fb1ae0b..9c4aa63 100644
--- a/hal/src/main/native/cpp/jni/ConstantsJNI.cpp
+++ b/hal/src/main/native/cpp/jni/ConstantsJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -13,7 +13,7 @@
#include "edu_wpi_first_hal_ConstantsJNI.h"
#include "hal/Constants.h"
-using namespace frc;
+using namespace hal;
extern "C" {
/*
diff --git a/hal/src/main/native/cpp/jni/CounterJNI.cpp b/hal/src/main/native/cpp/jni/CounterJNI.cpp
index 41dedab..06cbceb 100644
--- a/hal/src/main/native/cpp/jni/CounterJNI.cpp
+++ b/hal/src/main/native/cpp/jni/CounterJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -14,7 +14,7 @@
#include "hal/Counter.h"
#include "hal/Errors.h"
-using namespace frc;
+using namespace hal;
extern "C" {
diff --git a/hal/src/main/native/cpp/jni/DIOJNI.cpp b/hal/src/main/native/cpp/jni/DIOJNI.cpp
index 9c44b4c..428dd99 100644
--- a/hal/src/main/native/cpp/jni/DIOJNI.cpp
+++ b/hal/src/main/native/cpp/jni/DIOJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -16,7 +16,7 @@
#include "hal/Ports.h"
#include "hal/handles/HandlesInternal.h"
-using namespace frc;
+using namespace hal;
extern "C" {
diff --git a/hal/src/main/native/cpp/jni/DigitalGlitchFilterJNI.cpp b/hal/src/main/native/cpp/jni/DigitalGlitchFilterJNI.cpp
index fbbaadb..cfb504d 100644
--- a/hal/src/main/native/cpp/jni/DigitalGlitchFilterJNI.cpp
+++ b/hal/src/main/native/cpp/jni/DigitalGlitchFilterJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -11,7 +11,7 @@
#include "edu_wpi_first_hal_DigitalGlitchFilterJNI.h"
#include "hal/DIO.h"
-using namespace frc;
+using namespace hal;
extern "C" {
diff --git a/hal/src/main/native/cpp/jni/DutyCycleJNI.cpp b/hal/src/main/native/cpp/jni/DutyCycleJNI.cpp
index 510ca00..b191374 100644
--- a/hal/src/main/native/cpp/jni/DutyCycleJNI.cpp
+++ b/hal/src/main/native/cpp/jni/DutyCycleJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2019-2020 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. */
@@ -11,7 +11,7 @@
#include "edu_wpi_first_hal_DutyCycleJNI.h"
#include "hal/DutyCycle.h"
-using namespace frc;
+using namespace hal;
extern "C" {
/*
diff --git a/hal/src/main/native/cpp/jni/EncoderJNI.cpp b/hal/src/main/native/cpp/jni/EncoderJNI.cpp
index e5aa7e8..11686a6 100644
--- a/hal/src/main/native/cpp/jni/EncoderJNI.cpp
+++ b/hal/src/main/native/cpp/jni/EncoderJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -14,7 +14,7 @@
#include "hal/Encoder.h"
#include "hal/Errors.h"
-using namespace frc;
+using namespace hal;
extern "C" {
diff --git a/hal/src/main/native/cpp/jni/HAL.cpp b/hal/src/main/native/cpp/jni/HAL.cpp
index 393b0b4..3d736bf 100644
--- a/hal/src/main/native/cpp/jni/HAL.cpp
+++ b/hal/src/main/native/cpp/jni/HAL.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -19,7 +19,7 @@
#include "hal/DriverStation.h"
#include "hal/Main.h"
-using namespace frc;
+using namespace hal;
using namespace wpi::java;
extern "C" {
@@ -38,6 +38,18 @@
/*
* Class: edu_wpi_first_hal_HAL
+ * Method: shutdown
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_HAL_shutdown
+ (JNIEnv*, jclass)
+{
+ return HAL_Shutdown();
+}
+
+/*
+ * Class: edu_wpi_first_hal_HAL
* Method: hasMain
* Signature: ()Z
*/
@@ -450,6 +462,21 @@
/*
* Class: edu_wpi_first_hal_HAL
+ * Method: sendConsoleLine
+ * Signature: (Ljava/lang/String;)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_HAL_sendConsoleLine
+ (JNIEnv* env, jclass, jstring line)
+{
+ JStringRef lineStr{env, line};
+
+ jint returnValue = HAL_SendConsoleLine(lineStr.c_str());
+ return returnValue;
+}
+
+/*
+ * Class: edu_wpi_first_hal_HAL
* Method: getPortWithModule
* Signature: (BB)I
*/
diff --git a/hal/src/main/native/cpp/jni/HALUtil.cpp b/hal/src/main/native/cpp/jni/HALUtil.cpp
index 26b7919..2938f45 100644
--- a/hal/src/main/native/cpp/jni/HALUtil.cpp
+++ b/hal/src/main/native/cpp/jni/HALUtil.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -73,7 +73,7 @@
&canNotInitializedExCls},
{"edu/wpi/first/hal/util/UncleanStatusException", &uncleanStatusExCls}};
-namespace frc {
+namespace hal {
void ThrowUncleanStatusException(JNIEnv* env, wpi::StringRef msg,
int32_t status) {
@@ -304,14 +304,14 @@
JavaVM* GetJVM() { return jvm; }
-} // namespace frc
-
namespace sim {
jint SimOnLoad(JavaVM* vm, void* reserved);
void SimOnUnload(JavaVM* vm, void* reserved);
} // namespace sim
-using namespace frc;
+} // namespace hal
+
+using namespace hal;
extern "C" {
diff --git a/hal/src/main/native/cpp/jni/HALUtil.h b/hal/src/main/native/cpp/jni/HALUtil.h
index c035f75..0a192da 100644
--- a/hal/src/main/native/cpp/jni/HALUtil.h
+++ b/hal/src/main/native/cpp/jni/HALUtil.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -16,7 +16,7 @@
struct HAL_MatchInfo;
struct HAL_Value;
-namespace frc {
+namespace hal {
void ReportError(JNIEnv* env, int32_t status, bool doThrow = true);
@@ -72,6 +72,6 @@
JavaVM* GetJVM();
-} // namespace frc
+} // namespace hal
#endif // HAL_HAL_SRC_MAIN_NATIVE_CPP_JNI_HALUTIL_H_
diff --git a/hal/src/main/native/cpp/jni/I2CJNI.cpp b/hal/src/main/native/cpp/jni/I2CJNI.cpp
index 7812bdb..de27df6 100644
--- a/hal/src/main/native/cpp/jni/I2CJNI.cpp
+++ b/hal/src/main/native/cpp/jni/I2CJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -15,7 +15,7 @@
#include "edu_wpi_first_hal_I2CJNI.h"
#include "hal/I2C.h"
-using namespace frc;
+using namespace hal;
using namespace wpi::java;
extern "C" {
diff --git a/hal/src/main/native/cpp/jni/InterruptJNI.cpp b/hal/src/main/native/cpp/jni/InterruptJNI.cpp
index e3a783d..d18ef27 100644
--- a/hal/src/main/native/cpp/jni/InterruptJNI.cpp
+++ b/hal/src/main/native/cpp/jni/InterruptJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -18,7 +18,7 @@
#include "edu_wpi_first_hal_InterruptJNI.h"
#include "hal/Interrupts.h"
-using namespace frc;
+using namespace hal;
// Thread where callbacks are actually performed.
//
@@ -294,4 +294,19 @@
CheckStatus(env, status);
}
+/*
+ * Class: edu_wpi_first_hal_InterruptJNI
+ * Method: releaseWaitingInterrupt
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_InterruptJNI_releaseWaitingInterrupt
+ (JNIEnv* env, jclass, jint interruptHandle)
+{
+ int32_t status = 0;
+ HAL_ReleaseWaitingInterrupt((HAL_InterruptHandle)interruptHandle, &status);
+
+ CheckStatus(env, status);
+}
+
} // extern "C"
diff --git a/hal/src/main/native/cpp/jni/NotifierJNI.cpp b/hal/src/main/native/cpp/jni/NotifierJNI.cpp
index 874d750..ed0b324 100644
--- a/hal/src/main/native/cpp/jni/NotifierJNI.cpp
+++ b/hal/src/main/native/cpp/jni/NotifierJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -16,7 +16,7 @@
#include "edu_wpi_first_hal_NotifierJNI.h"
#include "hal/Notifier.h"
-using namespace frc;
+using namespace hal;
extern "C" {
diff --git a/hal/src/main/native/cpp/jni/PDPJNI.cpp b/hal/src/main/native/cpp/jni/PDPJNI.cpp
index f649a8d..bb28fdf 100644
--- a/hal/src/main/native/cpp/jni/PDPJNI.cpp
+++ b/hal/src/main/native/cpp/jni/PDPJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -10,7 +10,7 @@
#include "hal/PDP.h"
#include "hal/Ports.h"
-using namespace frc;
+using namespace hal;
extern "C" {
diff --git a/hal/src/main/native/cpp/jni/PWMJNI.cpp b/hal/src/main/native/cpp/jni/PWMJNI.cpp
index 80293c4..085cd0c 100644
--- a/hal/src/main/native/cpp/jni/PWMJNI.cpp
+++ b/hal/src/main/native/cpp/jni/PWMJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -16,7 +16,7 @@
#include "hal/Ports.h"
#include "hal/handles/HandlesInternal.h"
-using namespace frc;
+using namespace hal;
extern "C" {
diff --git a/hal/src/main/native/cpp/jni/PortsJNI.cpp b/hal/src/main/native/cpp/jni/PortsJNI.cpp
index 1adb7fb..65fabd4 100644
--- a/hal/src/main/native/cpp/jni/PortsJNI.cpp
+++ b/hal/src/main/native/cpp/jni/PortsJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -13,7 +13,7 @@
#include "edu_wpi_first_hal_PortsJNI.h"
#include "hal/Ports.h"
-using namespace frc;
+using namespace hal;
extern "C" {
/*
diff --git a/hal/src/main/native/cpp/jni/PowerJNI.cpp b/hal/src/main/native/cpp/jni/PowerJNI.cpp
index 9184e9e..6fc42b4 100644
--- a/hal/src/main/native/cpp/jni/PowerJNI.cpp
+++ b/hal/src/main/native/cpp/jni/PowerJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -11,7 +11,7 @@
#include "edu_wpi_first_hal_PowerJNI.h"
#include "hal/Power.h"
-using namespace frc;
+using namespace hal;
extern "C" {
diff --git a/hal/src/main/native/cpp/jni/RelayJNI.cpp b/hal/src/main/native/cpp/jni/RelayJNI.cpp
index c058435..ce43307 100644
--- a/hal/src/main/native/cpp/jni/RelayJNI.cpp
+++ b/hal/src/main/native/cpp/jni/RelayJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -15,7 +15,7 @@
#include "hal/Relay.h"
#include "hal/handles/HandlesInternal.h"
-using namespace frc;
+using namespace hal;
extern "C" {
diff --git a/hal/src/main/native/cpp/jni/SPIJNI.cpp b/hal/src/main/native/cpp/jni/SPIJNI.cpp
index 7962e21..d7709e2 100644
--- a/hal/src/main/native/cpp/jni/SPIJNI.cpp
+++ b/hal/src/main/native/cpp/jni/SPIJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -15,7 +15,7 @@
#include "edu_wpi_first_hal_SPIJNI.h"
#include "hal/SPI.h"
-using namespace frc;
+using namespace hal;
using namespace wpi::java;
extern "C" {
diff --git a/hal/src/main/native/cpp/jni/SerialPortJNI.cpp b/hal/src/main/native/cpp/jni/SerialPortJNI.cpp
index 9fe9d92..13f1f99 100644
--- a/hal/src/main/native/cpp/jni/SerialPortJNI.cpp
+++ b/hal/src/main/native/cpp/jni/SerialPortJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -15,7 +15,7 @@
#include "edu_wpi_first_hal_SerialPortJNI.h"
#include "hal/SerialPort.h"
-using namespace frc;
+using namespace hal;
using namespace wpi::java;
extern "C" {
diff --git a/hal/src/main/native/cpp/jni/SimDeviceJNI.cpp b/hal/src/main/native/cpp/jni/SimDeviceJNI.cpp
index d9652cc..b69a8bb 100644
--- a/hal/src/main/native/cpp/jni/SimDeviceJNI.cpp
+++ b/hal/src/main/native/cpp/jni/SimDeviceJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2019-2020 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. */
@@ -114,7 +114,7 @@
Java_edu_wpi_first_hal_SimDeviceJNI_getSimValue
(JNIEnv* env, jclass, jint handle)
{
- return frc::CreateHALValue(env, HAL_GetSimValue(handle));
+ return hal::CreateHALValue(env, HAL_GetSimValue(handle));
}
/*
diff --git a/hal/src/main/native/cpp/jni/SolenoidJNI.cpp b/hal/src/main/native/cpp/jni/SolenoidJNI.cpp
index 4e6f139..4877db3 100644
--- a/hal/src/main/native/cpp/jni/SolenoidJNI.cpp
+++ b/hal/src/main/native/cpp/jni/SolenoidJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -13,7 +13,7 @@
#include "hal/Solenoid.h"
#include "hal/handles/HandlesInternal.h"
-using namespace frc;
+using namespace hal;
extern "C" {
diff --git a/hal/src/main/native/cpp/jni/ThreadsJNI.cpp b/hal/src/main/native/cpp/jni/ThreadsJNI.cpp
index d4620e2..a26a4bf 100644
--- a/hal/src/main/native/cpp/jni/ThreadsJNI.cpp
+++ b/hal/src/main/native/cpp/jni/ThreadsJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -13,7 +13,7 @@
#include "edu_wpi_first_hal_ThreadsJNI.h"
#include "hal/Threads.h"
-using namespace frc;
+using namespace hal;
extern "C" {
/*
diff --git a/hal/src/main/native/sim/jni/AccelerometerDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/AccelerometerDataJNI.cpp
similarity index 63%
rename from hal/src/main/native/sim/jni/AccelerometerDataJNI.cpp
rename to hal/src/main/native/cpp/jni/simulation/AccelerometerDataJNI.cpp
index 8964a41..21d93fe 100644
--- a/hal/src/main/native/sim/jni/AccelerometerDataJNI.cpp
+++ b/hal/src/main/native/cpp/jni/simulation/AccelerometerDataJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -8,18 +8,20 @@
#include <jni.h>
#include "CallbackStore.h"
-#include "edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI.h"
-#include "mockdata/AccelerometerData.h"
+#include "edu_wpi_first_hal_simulation_AccelerometerDataJNI.h"
+#include "hal/simulation/AccelerometerData.h"
+
+using namespace hal;
extern "C" {
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AccelerometerDataJNI
* Method: registerActiveCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_registerActiveCallback
+Java_edu_wpi_first_hal_simulation_AccelerometerDataJNI_registerActiveCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -27,12 +29,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AccelerometerDataJNI
* Method: cancelActiveCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_cancelActiveCallback
+Java_edu_wpi_first_hal_simulation_AccelerometerDataJNI_cancelActiveCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -40,36 +42,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AccelerometerDataJNI
* Method: getActive
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_getActive
+Java_edu_wpi_first_hal_simulation_AccelerometerDataJNI_getActive
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetAccelerometerActive(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AccelerometerDataJNI
* Method: setActive
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_setActive
+Java_edu_wpi_first_hal_simulation_AccelerometerDataJNI_setActive
(JNIEnv*, jclass, jint index, jboolean value)
{
HALSIM_SetAccelerometerActive(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AccelerometerDataJNI
* Method: registerRangeCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_registerRangeCallback
+Java_edu_wpi_first_hal_simulation_AccelerometerDataJNI_registerRangeCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -77,12 +79,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AccelerometerDataJNI
* Method: cancelRangeCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_cancelRangeCallback
+Java_edu_wpi_first_hal_simulation_AccelerometerDataJNI_cancelRangeCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -90,24 +92,24 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AccelerometerDataJNI
* Method: getRange
* Signature: (I)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_getRange
+Java_edu_wpi_first_hal_simulation_AccelerometerDataJNI_getRange
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetAccelerometerRange(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AccelerometerDataJNI
* Method: setRange
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_setRange
+Java_edu_wpi_first_hal_simulation_AccelerometerDataJNI_setRange
(JNIEnv*, jclass, jint index, jint value)
{
HALSIM_SetAccelerometerRange(index,
@@ -115,12 +117,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AccelerometerDataJNI
* Method: registerXCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_registerXCallback
+Java_edu_wpi_first_hal_simulation_AccelerometerDataJNI_registerXCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -128,12 +130,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AccelerometerDataJNI
* Method: cancelXCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_cancelXCallback
+Java_edu_wpi_first_hal_simulation_AccelerometerDataJNI_cancelXCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -141,36 +143,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AccelerometerDataJNI
* Method: getX
* Signature: (I)D
*/
JNIEXPORT jdouble JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_getX
+Java_edu_wpi_first_hal_simulation_AccelerometerDataJNI_getX
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetAccelerometerX(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AccelerometerDataJNI
* Method: setX
* Signature: (ID)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_setX
+Java_edu_wpi_first_hal_simulation_AccelerometerDataJNI_setX
(JNIEnv*, jclass, jint index, jdouble value)
{
HALSIM_SetAccelerometerX(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AccelerometerDataJNI
* Method: registerYCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_registerYCallback
+Java_edu_wpi_first_hal_simulation_AccelerometerDataJNI_registerYCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -178,12 +180,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AccelerometerDataJNI
* Method: cancelYCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_cancelYCallback
+Java_edu_wpi_first_hal_simulation_AccelerometerDataJNI_cancelYCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -191,36 +193,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AccelerometerDataJNI
* Method: getY
* Signature: (I)D
*/
JNIEXPORT jdouble JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_getY
+Java_edu_wpi_first_hal_simulation_AccelerometerDataJNI_getY
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetAccelerometerY(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AccelerometerDataJNI
* Method: setY
* Signature: (ID)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_setY
+Java_edu_wpi_first_hal_simulation_AccelerometerDataJNI_setY
(JNIEnv*, jclass, jint index, jdouble value)
{
HALSIM_SetAccelerometerY(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AccelerometerDataJNI
* Method: registerZCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_registerZCallback
+Java_edu_wpi_first_hal_simulation_AccelerometerDataJNI_registerZCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -228,12 +230,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AccelerometerDataJNI
* Method: cancelZCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_cancelZCallback
+Java_edu_wpi_first_hal_simulation_AccelerometerDataJNI_cancelZCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -241,36 +243,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AccelerometerDataJNI
* Method: getZ
* Signature: (I)D
*/
JNIEXPORT jdouble JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_getZ
+Java_edu_wpi_first_hal_simulation_AccelerometerDataJNI_getZ
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetAccelerometerZ(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AccelerometerDataJNI
* Method: setZ
* Signature: (ID)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_setZ
+Java_edu_wpi_first_hal_simulation_AccelerometerDataJNI_setZ
(JNIEnv*, jclass, jint index, jdouble value)
{
HALSIM_SetAccelerometerZ(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AccelerometerDataJNI
* Method: resetData
* Signature: (I)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_resetData
+Java_edu_wpi_first_hal_simulation_AccelerometerDataJNI_resetData
(JNIEnv*, jclass, jint index)
{
HALSIM_ResetAccelerometerData(index);
diff --git a/hal/src/main/native/sim/jni/AddressableLEDDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/AddressableLEDDataJNI.cpp
similarity index 63%
rename from hal/src/main/native/sim/jni/AddressableLEDDataJNI.cpp
rename to hal/src/main/native/cpp/jni/simulation/AddressableLEDDataJNI.cpp
index 530eae2..8ac59ec 100644
--- a/hal/src/main/native/sim/jni/AddressableLEDDataJNI.cpp
+++ b/hal/src/main/native/cpp/jni/simulation/AddressableLEDDataJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2019-2020 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. */
@@ -9,22 +9,23 @@
#include "CallbackStore.h"
#include "ConstBufferCallbackStore.h"
-#include "edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI.h"
-#include "mockdata/AddressableLEDData.h"
+#include "edu_wpi_first_hal_simulation_AddressableLEDDataJNI.h"
+#include "hal/simulation/AddressableLEDData.h"
static_assert(sizeof(jbyte) * 4 == sizeof(HAL_AddressableLEDData));
+using namespace hal;
using namespace wpi::java;
extern "C" {
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI
+ * Class: edu_wpi_first_hal_simulation_AddressableLEDDataJNI
* Method: registerInitializedCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI_registerInitializedCallback
+Java_edu_wpi_first_hal_simulation_AddressableLEDDataJNI_registerInitializedCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(
@@ -33,12 +34,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI
+ * Class: edu_wpi_first_hal_simulation_AddressableLEDDataJNI
* Method: cancelInitializedCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI_cancelInitializedCallback
+Java_edu_wpi_first_hal_simulation_AddressableLEDDataJNI_cancelInitializedCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -46,36 +47,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI
+ * Class: edu_wpi_first_hal_simulation_AddressableLEDDataJNI
* Method: getInitialized
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI_getInitialized
+Java_edu_wpi_first_hal_simulation_AddressableLEDDataJNI_getInitialized
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetAddressableLEDInitialized(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI
+ * Class: edu_wpi_first_hal_simulation_AddressableLEDDataJNI
* Method: setInitialized
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI_setInitialized
+Java_edu_wpi_first_hal_simulation_AddressableLEDDataJNI_setInitialized
(JNIEnv*, jclass, jint index, jboolean value)
{
HALSIM_SetAddressableLEDInitialized(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI
+ * Class: edu_wpi_first_hal_simulation_AddressableLEDDataJNI
* Method: registerOutputPortCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI_registerOutputPortCallback
+Java_edu_wpi_first_hal_simulation_AddressableLEDDataJNI_registerOutputPortCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(
@@ -84,12 +85,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI
+ * Class: edu_wpi_first_hal_simulation_AddressableLEDDataJNI
* Method: cancelOutputPortCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI_cancelOutputPortCallback
+Java_edu_wpi_first_hal_simulation_AddressableLEDDataJNI_cancelOutputPortCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -97,36 +98,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI
+ * Class: edu_wpi_first_hal_simulation_AddressableLEDDataJNI
* Method: getOutputPort
* Signature: (I)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI_getOutputPort
+Java_edu_wpi_first_hal_simulation_AddressableLEDDataJNI_getOutputPort
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetAddressableLEDOutputPort(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI
+ * Class: edu_wpi_first_hal_simulation_AddressableLEDDataJNI
* Method: setOutputPort
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI_setOutputPort
+Java_edu_wpi_first_hal_simulation_AddressableLEDDataJNI_setOutputPort
(JNIEnv*, jclass, jint index, jint value)
{
HALSIM_SetAddressableLEDOutputPort(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI
+ * Class: edu_wpi_first_hal_simulation_AddressableLEDDataJNI
* Method: registerLengthCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI_registerLengthCallback
+Java_edu_wpi_first_hal_simulation_AddressableLEDDataJNI_registerLengthCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -134,12 +135,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI
+ * Class: edu_wpi_first_hal_simulation_AddressableLEDDataJNI
* Method: cancelLengthCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI_cancelLengthCallback
+Java_edu_wpi_first_hal_simulation_AddressableLEDDataJNI_cancelLengthCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -147,36 +148,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI
+ * Class: edu_wpi_first_hal_simulation_AddressableLEDDataJNI
* Method: getLength
* Signature: (I)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI_getLength
+Java_edu_wpi_first_hal_simulation_AddressableLEDDataJNI_getLength
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetAddressableLEDLength(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI
+ * Class: edu_wpi_first_hal_simulation_AddressableLEDDataJNI
* Method: setLength
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI_setLength
+Java_edu_wpi_first_hal_simulation_AddressableLEDDataJNI_setLength
(JNIEnv*, jclass, jint index, jint value)
{
HALSIM_SetAddressableLEDLength(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI
+ * Class: edu_wpi_first_hal_simulation_AddressableLEDDataJNI
* Method: registerRunningCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI_registerRunningCallback
+Java_edu_wpi_first_hal_simulation_AddressableLEDDataJNI_registerRunningCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -184,12 +185,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI
+ * Class: edu_wpi_first_hal_simulation_AddressableLEDDataJNI
* Method: cancelRunningCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI_cancelRunningCallback
+Java_edu_wpi_first_hal_simulation_AddressableLEDDataJNI_cancelRunningCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -197,36 +198,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI
+ * Class: edu_wpi_first_hal_simulation_AddressableLEDDataJNI
* Method: getRunning
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI_getRunning
+Java_edu_wpi_first_hal_simulation_AddressableLEDDataJNI_getRunning
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetAddressableLEDRunning(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI
+ * Class: edu_wpi_first_hal_simulation_AddressableLEDDataJNI
* Method: setRunning
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI_setRunning
+Java_edu_wpi_first_hal_simulation_AddressableLEDDataJNI_setRunning
(JNIEnv*, jclass, jint index, jboolean value)
{
HALSIM_SetAddressableLEDRunning(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI
+ * Class: edu_wpi_first_hal_simulation_AddressableLEDDataJNI
* Method: registerDataCallback
* Signature: (ILjava/lang/Object;)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI_registerDataCallback
+Java_edu_wpi_first_hal_simulation_AddressableLEDDataJNI_registerDataCallback
(JNIEnv* env, jclass, jint index, jobject callback)
{
return sim::AllocateConstBufferCallback(
@@ -234,12 +235,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI
+ * Class: edu_wpi_first_hal_simulation_AddressableLEDDataJNI
* Method: cancelDataCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI_cancelDataCallback
+Java_edu_wpi_first_hal_simulation_AddressableLEDDataJNI_cancelDataCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
sim::FreeConstBufferCallback(env, handle, index,
@@ -247,12 +248,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI
+ * Class: edu_wpi_first_hal_simulation_AddressableLEDDataJNI
* Method: getData
* Signature: (I)[B
*/
JNIEXPORT jbyteArray JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI_getData
+Java_edu_wpi_first_hal_simulation_AddressableLEDDataJNI_getData
(JNIEnv* env, jclass, jint index)
{
auto data =
@@ -263,12 +264,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI
+ * Class: edu_wpi_first_hal_simulation_AddressableLEDDataJNI
* Method: setData
* Signature: (I[B)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI_setData
+Java_edu_wpi_first_hal_simulation_AddressableLEDDataJNI_setData
(JNIEnv* env, jclass, jint index, jbyteArray arr)
{
JByteArrayRef jArrRef{env, arr};
@@ -279,15 +280,27 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI
+ * Class: edu_wpi_first_hal_simulation_AddressableLEDDataJNI
* Method: resetData
* Signature: (I)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AddressableLEDDataJNI_resetData
+Java_edu_wpi_first_hal_simulation_AddressableLEDDataJNI_resetData
(JNIEnv*, jclass, jint index)
{
HALSIM_ResetAddressableLEDData(index);
}
+/*
+ * Class: edu_wpi_first_hal_simulation_AddressableLEDDataJNI
+ * Method: findForChannel
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_AddressableLEDDataJNI_findForChannel
+ (JNIEnv*, jclass, jint channel)
+{
+ return HALSIM_FindAddressableLEDForChannel(channel);
+}
+
} // extern "C"
diff --git a/hal/src/main/native/sim/jni/AnalogGyroDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/AnalogGyroDataJNI.cpp
similarity index 64%
rename from hal/src/main/native/sim/jni/AnalogGyroDataJNI.cpp
rename to hal/src/main/native/cpp/jni/simulation/AnalogGyroDataJNI.cpp
index 08d18de..ed867cd 100644
--- a/hal/src/main/native/sim/jni/AnalogGyroDataJNI.cpp
+++ b/hal/src/main/native/cpp/jni/simulation/AnalogGyroDataJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -8,18 +8,20 @@
#include <jni.h>
#include "CallbackStore.h"
-#include "edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI.h"
-#include "mockdata/AnalogGyroData.h"
+#include "edu_wpi_first_hal_simulation_AnalogGyroDataJNI.h"
+#include "hal/simulation/AnalogGyroData.h"
+
+using namespace hal;
extern "C" {
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogGyroDataJNI
* Method: registerAngleCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_registerAngleCallback
+Java_edu_wpi_first_hal_simulation_AnalogGyroDataJNI_registerAngleCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -27,12 +29,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogGyroDataJNI
* Method: cancelAngleCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_cancelAngleCallback
+Java_edu_wpi_first_hal_simulation_AnalogGyroDataJNI_cancelAngleCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -40,36 +42,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogGyroDataJNI
* Method: getAngle
* Signature: (I)D
*/
JNIEXPORT jdouble JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_getAngle
+Java_edu_wpi_first_hal_simulation_AnalogGyroDataJNI_getAngle
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetAnalogGyroAngle(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogGyroDataJNI
* Method: setAngle
* Signature: (ID)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_setAngle
+Java_edu_wpi_first_hal_simulation_AnalogGyroDataJNI_setAngle
(JNIEnv*, jclass, jint index, jdouble value)
{
HALSIM_SetAnalogGyroAngle(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogGyroDataJNI
* Method: registerRateCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_registerRateCallback
+Java_edu_wpi_first_hal_simulation_AnalogGyroDataJNI_registerRateCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -77,12 +79,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogGyroDataJNI
* Method: cancelRateCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_cancelRateCallback
+Java_edu_wpi_first_hal_simulation_AnalogGyroDataJNI_cancelRateCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -90,36 +92,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogGyroDataJNI
* Method: getRate
* Signature: (I)D
*/
JNIEXPORT jdouble JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_getRate
+Java_edu_wpi_first_hal_simulation_AnalogGyroDataJNI_getRate
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetAnalogGyroRate(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogGyroDataJNI
* Method: setRate
* Signature: (ID)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_setRate
+Java_edu_wpi_first_hal_simulation_AnalogGyroDataJNI_setRate
(JNIEnv*, jclass, jint index, jdouble value)
{
HALSIM_SetAnalogGyroRate(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogGyroDataJNI
* Method: registerInitializedCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_registerInitializedCallback
+Java_edu_wpi_first_hal_simulation_AnalogGyroDataJNI_registerInitializedCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -127,12 +129,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogGyroDataJNI
* Method: cancelInitializedCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_cancelInitializedCallback
+Java_edu_wpi_first_hal_simulation_AnalogGyroDataJNI_cancelInitializedCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -140,36 +142,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogGyroDataJNI
* Method: getInitialized
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_getInitialized
+Java_edu_wpi_first_hal_simulation_AnalogGyroDataJNI_getInitialized
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetAnalogGyroInitialized(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogGyroDataJNI
* Method: setInitialized
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_setInitialized
+Java_edu_wpi_first_hal_simulation_AnalogGyroDataJNI_setInitialized
(JNIEnv*, jclass, jint index, jboolean value)
{
HALSIM_SetAnalogGyroInitialized(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogGyroDataJNI
* Method: resetData
* Signature: (I)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_resetData
+Java_edu_wpi_first_hal_simulation_AnalogGyroDataJNI_resetData
(JNIEnv*, jclass, jint index)
{
HALSIM_ResetAnalogGyroData(index);
diff --git a/hal/src/main/native/sim/jni/AnalogInDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/AnalogInDataJNI.cpp
similarity index 64%
rename from hal/src/main/native/sim/jni/AnalogInDataJNI.cpp
rename to hal/src/main/native/cpp/jni/simulation/AnalogInDataJNI.cpp
index c6cee7b..0266a76 100644
--- a/hal/src/main/native/sim/jni/AnalogInDataJNI.cpp
+++ b/hal/src/main/native/cpp/jni/simulation/AnalogInDataJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -8,18 +8,20 @@
#include <jni.h>
#include "CallbackStore.h"
-#include "edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI.h"
-#include "mockdata/AnalogInData.h"
+#include "edu_wpi_first_hal_simulation_AnalogInDataJNI.h"
+#include "hal/simulation/AnalogInData.h"
+
+using namespace hal;
extern "C" {
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: registerInitializedCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_registerInitializedCallback
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_registerInitializedCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -27,12 +29,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: cancelInitializedCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_cancelInitializedCallback
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_cancelInitializedCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -40,36 +42,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: getInitialized
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_getInitialized
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_getInitialized
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetAnalogInInitialized(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: setInitialized
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_setInitialized
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_setInitialized
(JNIEnv*, jclass, jint index, jboolean value)
{
HALSIM_SetAnalogInInitialized(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: registerAverageBitsCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_registerAverageBitsCallback
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_registerAverageBitsCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -77,12 +79,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: cancelAverageBitsCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_cancelAverageBitsCallback
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_cancelAverageBitsCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -90,36 +92,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: getAverageBits
* Signature: (I)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_getAverageBits
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_getAverageBits
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetAnalogInAverageBits(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: setAverageBits
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_setAverageBits
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_setAverageBits
(JNIEnv*, jclass, jint index, jint value)
{
HALSIM_SetAnalogInAverageBits(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: registerOversampleBitsCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_registerOversampleBitsCallback
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_registerOversampleBitsCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -127,12 +129,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: cancelOversampleBitsCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_cancelOversampleBitsCallback
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_cancelOversampleBitsCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -140,36 +142,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: getOversampleBits
* Signature: (I)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_getOversampleBits
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_getOversampleBits
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetAnalogInOversampleBits(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: setOversampleBits
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_setOversampleBits
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_setOversampleBits
(JNIEnv*, jclass, jint index, jint value)
{
HALSIM_SetAnalogInOversampleBits(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: registerVoltageCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_registerVoltageCallback
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_registerVoltageCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -177,12 +179,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: cancelVoltageCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_cancelVoltageCallback
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_cancelVoltageCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -190,36 +192,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: getVoltage
* Signature: (I)D
*/
JNIEXPORT jdouble JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_getVoltage
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_getVoltage
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetAnalogInVoltage(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: setVoltage
* Signature: (ID)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_setVoltage
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_setVoltage
(JNIEnv*, jclass, jint index, jdouble value)
{
HALSIM_SetAnalogInVoltage(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: registerAccumulatorInitializedCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_registerAccumulatorInitializedCallback
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_registerAccumulatorInitializedCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(
@@ -228,12 +230,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: cancelAccumulatorInitializedCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_cancelAccumulatorInitializedCallback
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_cancelAccumulatorInitializedCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(
@@ -241,36 +243,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: getAccumulatorInitialized
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_getAccumulatorInitialized
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_getAccumulatorInitialized
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetAnalogInAccumulatorInitialized(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: setAccumulatorInitialized
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_setAccumulatorInitialized
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_setAccumulatorInitialized
(JNIEnv*, jclass, jint index, jboolean value)
{
HALSIM_SetAnalogInAccumulatorInitialized(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: registerAccumulatorValueCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_registerAccumulatorValueCallback
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_registerAccumulatorValueCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(
@@ -279,12 +281,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: cancelAccumulatorValueCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_cancelAccumulatorValueCallback
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_cancelAccumulatorValueCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -292,36 +294,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: getAccumulatorValue
* Signature: (I)J
*/
JNIEXPORT jlong JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_getAccumulatorValue
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_getAccumulatorValue
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetAnalogInAccumulatorValue(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: setAccumulatorValue
* Signature: (IJ)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_setAccumulatorValue
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_setAccumulatorValue
(JNIEnv*, jclass, jint index, jlong value)
{
HALSIM_SetAnalogInAccumulatorValue(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: registerAccumulatorCountCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_registerAccumulatorCountCallback
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_registerAccumulatorCountCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(
@@ -330,12 +332,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: cancelAccumulatorCountCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_cancelAccumulatorCountCallback
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_cancelAccumulatorCountCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -343,36 +345,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: getAccumulatorCount
* Signature: (I)J
*/
JNIEXPORT jlong JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_getAccumulatorCount
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_getAccumulatorCount
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetAnalogInAccumulatorCount(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: setAccumulatorCount
* Signature: (IJ)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_setAccumulatorCount
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_setAccumulatorCount
(JNIEnv*, jclass, jint index, jlong value)
{
HALSIM_SetAnalogInAccumulatorCount(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: registerAccumulatorCenterCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_registerAccumulatorCenterCallback
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_registerAccumulatorCenterCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(
@@ -381,12 +383,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: cancelAccumulatorCenterCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_cancelAccumulatorCenterCallback
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_cancelAccumulatorCenterCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -394,36 +396,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: getAccumulatorCenter
* Signature: (I)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_getAccumulatorCenter
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_getAccumulatorCenter
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetAnalogInAccumulatorCenter(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: setAccumulatorCenter
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_setAccumulatorCenter
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_setAccumulatorCenter
(JNIEnv*, jclass, jint index, jint value)
{
HALSIM_SetAnalogInAccumulatorCenter(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: registerAccumulatorDeadbandCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_registerAccumulatorDeadbandCallback
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_registerAccumulatorDeadbandCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(
@@ -432,12 +434,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: cancelAccumulatorDeadbandCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_cancelAccumulatorDeadbandCallback
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_cancelAccumulatorDeadbandCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -445,36 +447,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: getAccumulatorDeadband
* Signature: (I)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_getAccumulatorDeadband
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_getAccumulatorDeadband
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetAnalogInAccumulatorDeadband(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: setAccumulatorDeadband
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_setAccumulatorDeadband
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_setAccumulatorDeadband
(JNIEnv*, jclass, jint index, jint value)
{
HALSIM_SetAnalogInAccumulatorDeadband(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogInDataJNI
* Method: resetData
* Signature: (I)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_resetData
+Java_edu_wpi_first_hal_simulation_AnalogInDataJNI_resetData
(JNIEnv*, jclass, jint index)
{
HALSIM_ResetAnalogInData(index);
diff --git a/hal/src/main/native/sim/jni/AnalogOutDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/AnalogOutDataJNI.cpp
similarity index 65%
rename from hal/src/main/native/sim/jni/AnalogOutDataJNI.cpp
rename to hal/src/main/native/cpp/jni/simulation/AnalogOutDataJNI.cpp
index af9d6d6..06f5be6 100644
--- a/hal/src/main/native/sim/jni/AnalogOutDataJNI.cpp
+++ b/hal/src/main/native/cpp/jni/simulation/AnalogOutDataJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -8,18 +8,20 @@
#include <jni.h>
#include "CallbackStore.h"
-#include "edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI.h"
-#include "mockdata/AnalogOutData.h"
+#include "edu_wpi_first_hal_simulation_AnalogOutDataJNI.h"
+#include "hal/simulation/AnalogOutData.h"
+
+using namespace hal;
extern "C" {
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogOutDataJNI
* Method: registerVoltageCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI_registerVoltageCallback
+Java_edu_wpi_first_hal_simulation_AnalogOutDataJNI_registerVoltageCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -27,12 +29,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogOutDataJNI
* Method: cancelVoltageCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI_cancelVoltageCallback
+Java_edu_wpi_first_hal_simulation_AnalogOutDataJNI_cancelVoltageCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -40,36 +42,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogOutDataJNI
* Method: getVoltage
* Signature: (I)D
*/
JNIEXPORT jdouble JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI_getVoltage
+Java_edu_wpi_first_hal_simulation_AnalogOutDataJNI_getVoltage
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetAnalogOutVoltage(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogOutDataJNI
* Method: setVoltage
* Signature: (ID)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI_setVoltage
+Java_edu_wpi_first_hal_simulation_AnalogOutDataJNI_setVoltage
(JNIEnv*, jclass, jint index, jdouble value)
{
HALSIM_SetAnalogOutVoltage(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogOutDataJNI
* Method: registerInitializedCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI_registerInitializedCallback
+Java_edu_wpi_first_hal_simulation_AnalogOutDataJNI_registerInitializedCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -77,12 +79,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogOutDataJNI
* Method: cancelInitializedCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI_cancelInitializedCallback
+Java_edu_wpi_first_hal_simulation_AnalogOutDataJNI_cancelInitializedCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -90,36 +92,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogOutDataJNI
* Method: getInitialized
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI_getInitialized
+Java_edu_wpi_first_hal_simulation_AnalogOutDataJNI_getInitialized
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetAnalogOutInitialized(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogOutDataJNI
* Method: setInitialized
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI_setInitialized
+Java_edu_wpi_first_hal_simulation_AnalogOutDataJNI_setInitialized
(JNIEnv*, jclass, jint index, jboolean value)
{
HALSIM_SetAnalogOutInitialized(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogOutDataJNI
* Method: resetData
* Signature: (I)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI_resetData
+Java_edu_wpi_first_hal_simulation_AnalogOutDataJNI_resetData
(JNIEnv*, jclass, jint index)
{
HALSIM_ResetAnalogOutData(index);
diff --git a/hal/src/main/native/sim/jni/AnalogTriggerDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/AnalogTriggerDataJNI.cpp
similarity index 61%
rename from hal/src/main/native/sim/jni/AnalogTriggerDataJNI.cpp
rename to hal/src/main/native/cpp/jni/simulation/AnalogTriggerDataJNI.cpp
index 66af737..be92c6d 100644
--- a/hal/src/main/native/sim/jni/AnalogTriggerDataJNI.cpp
+++ b/hal/src/main/native/cpp/jni/simulation/AnalogTriggerDataJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -8,18 +8,20 @@
#include <jni.h>
#include "CallbackStore.h"
-#include "edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI.h"
-#include "mockdata/AnalogTriggerData.h"
+#include "edu_wpi_first_hal_simulation_AnalogTriggerDataJNI.h"
+#include "hal/simulation/AnalogTriggerData.h"
+
+using namespace hal;
extern "C" {
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogTriggerDataJNI
* Method: registerInitializedCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_registerInitializedCallback
+Java_edu_wpi_first_hal_simulation_AnalogTriggerDataJNI_registerInitializedCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(
@@ -28,12 +30,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogTriggerDataJNI
* Method: cancelInitializedCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_cancelInitializedCallback
+Java_edu_wpi_first_hal_simulation_AnalogTriggerDataJNI_cancelInitializedCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -41,36 +43,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogTriggerDataJNI
* Method: getInitialized
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_getInitialized
+Java_edu_wpi_first_hal_simulation_AnalogTriggerDataJNI_getInitialized
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetAnalogTriggerInitialized(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogTriggerDataJNI
* Method: setInitialized
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_setInitialized
+Java_edu_wpi_first_hal_simulation_AnalogTriggerDataJNI_setInitialized
(JNIEnv*, jclass, jint index, jboolean value)
{
HALSIM_SetAnalogTriggerInitialized(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogTriggerDataJNI
* Method: registerTriggerLowerBoundCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_registerTriggerLowerBoundCallback
+Java_edu_wpi_first_hal_simulation_AnalogTriggerDataJNI_registerTriggerLowerBoundCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(
@@ -79,12 +81,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogTriggerDataJNI
* Method: cancelTriggerLowerBoundCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_cancelTriggerLowerBoundCallback
+Java_edu_wpi_first_hal_simulation_AnalogTriggerDataJNI_cancelTriggerLowerBoundCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(
@@ -92,36 +94,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogTriggerDataJNI
* Method: getTriggerLowerBound
* Signature: (I)D
*/
JNIEXPORT jdouble JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_getTriggerLowerBound
+Java_edu_wpi_first_hal_simulation_AnalogTriggerDataJNI_getTriggerLowerBound
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetAnalogTriggerTriggerLowerBound(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogTriggerDataJNI
* Method: setTriggerLowerBound
* Signature: (ID)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_setTriggerLowerBound
+Java_edu_wpi_first_hal_simulation_AnalogTriggerDataJNI_setTriggerLowerBound
(JNIEnv*, jclass, jint index, jdouble value)
{
HALSIM_SetAnalogTriggerTriggerLowerBound(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogTriggerDataJNI
* Method: registerTriggerUpperBoundCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_registerTriggerUpperBoundCallback
+Java_edu_wpi_first_hal_simulation_AnalogTriggerDataJNI_registerTriggerUpperBoundCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(
@@ -130,12 +132,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogTriggerDataJNI
* Method: cancelTriggerUpperBoundCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_cancelTriggerUpperBoundCallback
+Java_edu_wpi_first_hal_simulation_AnalogTriggerDataJNI_cancelTriggerUpperBoundCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(
@@ -143,39 +145,51 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogTriggerDataJNI
* Method: getTriggerUpperBound
* Signature: (I)D
*/
JNIEXPORT jdouble JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_getTriggerUpperBound
+Java_edu_wpi_first_hal_simulation_AnalogTriggerDataJNI_getTriggerUpperBound
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetAnalogTriggerTriggerUpperBound(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogTriggerDataJNI
* Method: setTriggerUpperBound
* Signature: (ID)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_setTriggerUpperBound
+Java_edu_wpi_first_hal_simulation_AnalogTriggerDataJNI_setTriggerUpperBound
(JNIEnv*, jclass, jint index, jdouble value)
{
HALSIM_SetAnalogTriggerTriggerUpperBound(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI
+ * Class: edu_wpi_first_hal_simulation_AnalogTriggerDataJNI
* Method: resetData
* Signature: (I)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_resetData
+Java_edu_wpi_first_hal_simulation_AnalogTriggerDataJNI_resetData
(JNIEnv*, jclass, jint index)
{
HALSIM_ResetAnalogTriggerData(index);
}
+/*
+ * Class: edu_wpi_first_hal_simulation_AnalogTriggerDataJNI
+ * Method: findForChannel
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_AnalogTriggerDataJNI_findForChannel
+ (JNIEnv*, jclass, jint channel)
+{
+ return HALSIM_FindAnalogTriggerForChannel(channel);
+}
+
} // extern "C"
diff --git a/hal/src/main/native/sim/jni/BufferCallbackStore.cpp b/hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.cpp
similarity index 95%
rename from hal/src/main/native/sim/jni/BufferCallbackStore.cpp
rename to hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.cpp
index 3c9941e..6751e03 100644
--- a/hal/src/main/native/sim/jni/BufferCallbackStore.cpp
+++ b/hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -15,15 +15,17 @@
#include "hal/Types.h"
#include "hal/Value.h"
#include "hal/handles/UnlimitedHandleResource.h"
-#include "mockdata/NotifyListener.h"
+#include "hal/simulation/NotifyListener.h"
+using namespace hal;
+using namespace hal::sim;
using namespace wpi::java;
-using namespace sim;
static hal::UnlimitedHandleResource<SIM_JniHandle, BufferCallbackStore,
hal::HAL_HandleEnum::SimulationJni>*
callbackHandles;
+namespace hal {
namespace sim {
void InitializeBufferStore() {
static hal::UnlimitedHandleResource<SIM_JniHandle, BufferCallbackStore,
@@ -32,6 +34,7 @@
callbackHandles = &cb;
}
} // namespace sim
+} // namespace hal
void BufferCallbackStore::create(JNIEnv* env, jobject obj) {
m_call = JGlobal<jobject>(env, obj);
diff --git a/hal/src/main/native/sim/jni/BufferCallbackStore.h b/hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.h
similarity index 91%
rename from hal/src/main/native/sim/jni/BufferCallbackStore.h
rename to hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.h
index 6b472ac..8e746d2 100644
--- a/hal/src/main/native/sim/jni/BufferCallbackStore.h
+++ b/hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -15,8 +15,9 @@
#include "hal/Types.h"
#include "hal/Value.h"
#include "hal/handles/UnlimitedHandleResource.h"
-#include "mockdata/NotifyListener.h"
+#include "hal/simulation/NotifyListener.h"
+namespace hal {
namespace sim {
class BufferCallbackStore {
public:
@@ -43,3 +44,4 @@
void FreeBufferCallback(JNIEnv* env, SIM_JniHandle handle, jint index,
FreeBufferCallbackFunc freeCallback);
} // namespace sim
+} // namespace hal
diff --git a/hal/src/main/native/sim/jni/CallbackStore.cpp b/hal/src/main/native/cpp/jni/simulation/CallbackStore.cpp
similarity index 96%
rename from hal/src/main/native/sim/jni/CallbackStore.cpp
rename to hal/src/main/native/cpp/jni/simulation/CallbackStore.cpp
index 318ab1e..5ce046d 100644
--- a/hal/src/main/native/sim/jni/CallbackStore.cpp
+++ b/hal/src/main/native/cpp/jni/simulation/CallbackStore.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -15,15 +15,17 @@
#include "hal/Types.h"
#include "hal/Value.h"
#include "hal/handles/UnlimitedHandleResource.h"
-#include "mockdata/NotifyListener.h"
+#include "hal/simulation/NotifyListener.h"
+using namespace hal;
+using namespace hal::sim;
using namespace wpi::java;
-using namespace sim;
static hal::UnlimitedHandleResource<SIM_JniHandle, CallbackStore,
hal::HAL_HandleEnum::SimulationJni>*
callbackHandles;
+namespace hal {
namespace sim {
void InitializeStore() {
static hal::UnlimitedHandleResource<SIM_JniHandle, CallbackStore,
@@ -32,6 +34,7 @@
callbackHandles = &cb;
}
} // namespace sim
+} // namespace hal
void CallbackStore::create(JNIEnv* env, jobject obj) {
m_call = JGlobal<jobject>(env, obj);
diff --git a/hal/src/main/native/sim/jni/CallbackStore.h b/hal/src/main/native/cpp/jni/simulation/CallbackStore.h
similarity index 94%
rename from hal/src/main/native/sim/jni/CallbackStore.h
rename to hal/src/main/native/cpp/jni/simulation/CallbackStore.h
index eacf314..0ba44d3 100644
--- a/hal/src/main/native/sim/jni/CallbackStore.h
+++ b/hal/src/main/native/cpp/jni/simulation/CallbackStore.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -15,8 +15,9 @@
#include "hal/Types.h"
#include "hal/Value.h"
#include "hal/handles/UnlimitedHandleResource.h"
-#include "mockdata/NotifyListener.h"
+#include "hal/simulation/NotifyListener.h"
+namespace hal {
namespace sim {
class CallbackStore {
public:
@@ -64,3 +65,4 @@
void FreeCallbackNoIndex(JNIEnv* env, SIM_JniHandle handle,
FreeCallbackNoIndexFunc freeCallback);
} // namespace sim
+} // namespace hal
diff --git a/hal/src/main/native/sim/jni/ConstBufferCallbackStore.cpp b/hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.cpp
similarity index 94%
rename from hal/src/main/native/sim/jni/ConstBufferCallbackStore.cpp
rename to hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.cpp
index d681983..b9c9808 100644
--- a/hal/src/main/native/sim/jni/ConstBufferCallbackStore.cpp
+++ b/hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -15,15 +15,17 @@
#include "hal/Types.h"
#include "hal/Value.h"
#include "hal/handles/UnlimitedHandleResource.h"
-#include "mockdata/NotifyListener.h"
+#include "hal/simulation/NotifyListener.h"
+using namespace hal;
+using namespace hal::sim;
using namespace wpi::java;
-using namespace sim;
static hal::UnlimitedHandleResource<SIM_JniHandle, ConstBufferCallbackStore,
hal::HAL_HandleEnum::SimulationJni>*
callbackHandles;
+namespace hal {
namespace sim {
void InitializeConstBufferStore() {
static hal::UnlimitedHandleResource<SIM_JniHandle, ConstBufferCallbackStore,
@@ -32,6 +34,7 @@
callbackHandles = &cb;
}
} // namespace sim
+} // namespace hal
void ConstBufferCallbackStore::create(JNIEnv* env, jobject obj) {
m_call = JGlobal<jobject>(env, obj);
diff --git a/hal/src/main/native/sim/jni/ConstBufferCallbackStore.h b/hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.h
similarity index 91%
rename from hal/src/main/native/sim/jni/ConstBufferCallbackStore.h
rename to hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.h
index 2164a74..b69eccf 100644
--- a/hal/src/main/native/sim/jni/ConstBufferCallbackStore.h
+++ b/hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -15,8 +15,9 @@
#include "hal/Types.h"
#include "hal/Value.h"
#include "hal/handles/UnlimitedHandleResource.h"
-#include "mockdata/NotifyListener.h"
+#include "hal/simulation/NotifyListener.h"
+namespace hal {
namespace sim {
class ConstBufferCallbackStore {
public:
@@ -44,3 +45,4 @@
void FreeConstBufferCallback(JNIEnv* env, SIM_JniHandle handle, jint index,
FreeConstBufferCallbackFunc freeCallback);
} // namespace sim
+} // namespace hal
diff --git a/hal/src/main/native/sim/jni/DIODataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/DIODataJNI.cpp
similarity index 66%
rename from hal/src/main/native/sim/jni/DIODataJNI.cpp
rename to hal/src/main/native/cpp/jni/simulation/DIODataJNI.cpp
index 2ad55f9..f757558 100644
--- a/hal/src/main/native/sim/jni/DIODataJNI.cpp
+++ b/hal/src/main/native/cpp/jni/simulation/DIODataJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -8,18 +8,20 @@
#include <jni.h>
#include "CallbackStore.h"
-#include "edu_wpi_first_hal_sim_mockdata_DIODataJNI.h"
-#include "mockdata/DIOData.h"
+#include "edu_wpi_first_hal_simulation_DIODataJNI.h"
+#include "hal/simulation/DIOData.h"
+
+using namespace hal;
extern "C" {
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
+ * Class: edu_wpi_first_hal_simulation_DIODataJNI
* Method: registerInitializedCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_registerInitializedCallback
+Java_edu_wpi_first_hal_simulation_DIODataJNI_registerInitializedCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -27,12 +29,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
+ * Class: edu_wpi_first_hal_simulation_DIODataJNI
* Method: cancelInitializedCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_cancelInitializedCallback
+Java_edu_wpi_first_hal_simulation_DIODataJNI_cancelInitializedCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -40,36 +42,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
+ * Class: edu_wpi_first_hal_simulation_DIODataJNI
* Method: getInitialized
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_getInitialized
+Java_edu_wpi_first_hal_simulation_DIODataJNI_getInitialized
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetDIOInitialized(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
+ * Class: edu_wpi_first_hal_simulation_DIODataJNI
* Method: setInitialized
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_setInitialized
+Java_edu_wpi_first_hal_simulation_DIODataJNI_setInitialized
(JNIEnv*, jclass, jint index, jboolean value)
{
HALSIM_SetDIOInitialized(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
+ * Class: edu_wpi_first_hal_simulation_DIODataJNI
* Method: registerValueCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_registerValueCallback
+Java_edu_wpi_first_hal_simulation_DIODataJNI_registerValueCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -77,48 +79,48 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
+ * Class: edu_wpi_first_hal_simulation_DIODataJNI
* Method: cancelValueCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_cancelValueCallback
+Java_edu_wpi_first_hal_simulation_DIODataJNI_cancelValueCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index, &HALSIM_CancelDIOValueCallback);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
+ * Class: edu_wpi_first_hal_simulation_DIODataJNI
* Method: getValue
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_getValue
+Java_edu_wpi_first_hal_simulation_DIODataJNI_getValue
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetDIOValue(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
+ * Class: edu_wpi_first_hal_simulation_DIODataJNI
* Method: setValue
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_setValue
+Java_edu_wpi_first_hal_simulation_DIODataJNI_setValue
(JNIEnv*, jclass, jint index, jboolean value)
{
HALSIM_SetDIOValue(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
+ * Class: edu_wpi_first_hal_simulation_DIODataJNI
* Method: registerPulseLengthCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_registerPulseLengthCallback
+Java_edu_wpi_first_hal_simulation_DIODataJNI_registerPulseLengthCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -126,12 +128,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
+ * Class: edu_wpi_first_hal_simulation_DIODataJNI
* Method: cancelPulseLengthCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_cancelPulseLengthCallback
+Java_edu_wpi_first_hal_simulation_DIODataJNI_cancelPulseLengthCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -139,36 +141,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
+ * Class: edu_wpi_first_hal_simulation_DIODataJNI
* Method: getPulseLength
* Signature: (I)D
*/
JNIEXPORT jdouble JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_getPulseLength
+Java_edu_wpi_first_hal_simulation_DIODataJNI_getPulseLength
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetDIOPulseLength(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
+ * Class: edu_wpi_first_hal_simulation_DIODataJNI
* Method: setPulseLength
* Signature: (ID)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_setPulseLength
+Java_edu_wpi_first_hal_simulation_DIODataJNI_setPulseLength
(JNIEnv*, jclass, jint index, jdouble value)
{
HALSIM_SetDIOPulseLength(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
+ * Class: edu_wpi_first_hal_simulation_DIODataJNI
* Method: registerIsInputCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_registerIsInputCallback
+Java_edu_wpi_first_hal_simulation_DIODataJNI_registerIsInputCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -176,12 +178,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
+ * Class: edu_wpi_first_hal_simulation_DIODataJNI
* Method: cancelIsInputCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_cancelIsInputCallback
+Java_edu_wpi_first_hal_simulation_DIODataJNI_cancelIsInputCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -189,36 +191,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
+ * Class: edu_wpi_first_hal_simulation_DIODataJNI
* Method: getIsInput
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_getIsInput
+Java_edu_wpi_first_hal_simulation_DIODataJNI_getIsInput
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetDIOIsInput(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
+ * Class: edu_wpi_first_hal_simulation_DIODataJNI
* Method: setIsInput
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_setIsInput
+Java_edu_wpi_first_hal_simulation_DIODataJNI_setIsInput
(JNIEnv*, jclass, jint index, jboolean value)
{
HALSIM_SetDIOIsInput(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
+ * Class: edu_wpi_first_hal_simulation_DIODataJNI
* Method: registerFilterIndexCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_registerFilterIndexCallback
+Java_edu_wpi_first_hal_simulation_DIODataJNI_registerFilterIndexCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -226,12 +228,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
+ * Class: edu_wpi_first_hal_simulation_DIODataJNI
* Method: cancelFilterIndexCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_cancelFilterIndexCallback
+Java_edu_wpi_first_hal_simulation_DIODataJNI_cancelFilterIndexCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -239,36 +241,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
+ * Class: edu_wpi_first_hal_simulation_DIODataJNI
* Method: getFilterIndex
* Signature: (I)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_getFilterIndex
+Java_edu_wpi_first_hal_simulation_DIODataJNI_getFilterIndex
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetDIOFilterIndex(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
+ * Class: edu_wpi_first_hal_simulation_DIODataJNI
* Method: setFilterIndex
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_setFilterIndex
+Java_edu_wpi_first_hal_simulation_DIODataJNI_setFilterIndex
(JNIEnv*, jclass, jint index, jint value)
{
HALSIM_SetDIOFilterIndex(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
+ * Class: edu_wpi_first_hal_simulation_DIODataJNI
* Method: resetData
* Signature: (I)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_resetData
+Java_edu_wpi_first_hal_simulation_DIODataJNI_resetData
(JNIEnv*, jclass, jint index)
{
HALSIM_ResetDIOData(index);
diff --git a/hal/src/main/native/sim/jni/DigitalPWMDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/DigitalPWMDataJNI.cpp
similarity index 61%
rename from hal/src/main/native/sim/jni/DigitalPWMDataJNI.cpp
rename to hal/src/main/native/cpp/jni/simulation/DigitalPWMDataJNI.cpp
index 0800917..ea6bee2 100644
--- a/hal/src/main/native/sim/jni/DigitalPWMDataJNI.cpp
+++ b/hal/src/main/native/cpp/jni/simulation/DigitalPWMDataJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -8,18 +8,20 @@
#include <jni.h>
#include "CallbackStore.h"
-#include "edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI.h"
-#include "mockdata/DigitalPWMData.h"
+#include "edu_wpi_first_hal_simulation_DigitalPWMDataJNI.h"
+#include "hal/simulation/DigitalPWMData.h"
+
+using namespace hal;
extern "C" {
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_DigitalPWMDataJNI
* Method: registerInitializedCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_registerInitializedCallback
+Java_edu_wpi_first_hal_simulation_DigitalPWMDataJNI_registerInitializedCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -27,12 +29,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_DigitalPWMDataJNI
* Method: cancelInitializedCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_cancelInitializedCallback
+Java_edu_wpi_first_hal_simulation_DigitalPWMDataJNI_cancelInitializedCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -40,36 +42,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_DigitalPWMDataJNI
* Method: getInitialized
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_getInitialized
+Java_edu_wpi_first_hal_simulation_DigitalPWMDataJNI_getInitialized
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetDigitalPWMInitialized(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_DigitalPWMDataJNI
* Method: setInitialized
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_setInitialized
+Java_edu_wpi_first_hal_simulation_DigitalPWMDataJNI_setInitialized
(JNIEnv*, jclass, jint index, jboolean value)
{
HALSIM_SetDigitalPWMInitialized(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_DigitalPWMDataJNI
* Method: registerDutyCycleCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_registerDutyCycleCallback
+Java_edu_wpi_first_hal_simulation_DigitalPWMDataJNI_registerDutyCycleCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -77,12 +79,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_DigitalPWMDataJNI
* Method: cancelDutyCycleCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_cancelDutyCycleCallback
+Java_edu_wpi_first_hal_simulation_DigitalPWMDataJNI_cancelDutyCycleCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -90,36 +92,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_DigitalPWMDataJNI
* Method: getDutyCycle
* Signature: (I)D
*/
JNIEXPORT jdouble JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_getDutyCycle
+Java_edu_wpi_first_hal_simulation_DigitalPWMDataJNI_getDutyCycle
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetDigitalPWMDutyCycle(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_DigitalPWMDataJNI
* Method: setDutyCycle
* Signature: (ID)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_setDutyCycle
+Java_edu_wpi_first_hal_simulation_DigitalPWMDataJNI_setDutyCycle
(JNIEnv*, jclass, jint index, jdouble value)
{
HALSIM_SetDigitalPWMDutyCycle(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_DigitalPWMDataJNI
* Method: registerPinCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_registerPinCallback
+Java_edu_wpi_first_hal_simulation_DigitalPWMDataJNI_registerPinCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -127,12 +129,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_DigitalPWMDataJNI
* Method: cancelPinCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_cancelPinCallback
+Java_edu_wpi_first_hal_simulation_DigitalPWMDataJNI_cancelPinCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -140,39 +142,51 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_DigitalPWMDataJNI
* Method: getPin
* Signature: (I)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_getPin
+Java_edu_wpi_first_hal_simulation_DigitalPWMDataJNI_getPin
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetDigitalPWMPin(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_DigitalPWMDataJNI
* Method: setPin
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_setPin
+Java_edu_wpi_first_hal_simulation_DigitalPWMDataJNI_setPin
(JNIEnv*, jclass, jint index, jint value)
{
HALSIM_SetDigitalPWMPin(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_DigitalPWMDataJNI
* Method: resetData
* Signature: (I)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_resetData
+Java_edu_wpi_first_hal_simulation_DigitalPWMDataJNI_resetData
(JNIEnv*, jclass, jint index)
{
HALSIM_ResetDigitalPWMData(index);
}
+/*
+ * Class: edu_wpi_first_hal_simulation_DigitalPWMDataJNI
+ * Method: findForChannel
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_DigitalPWMDataJNI_findForChannel
+ (JNIEnv*, jclass, jint channel)
+{
+ return HALSIM_FindDigitalPWMForChannel(channel);
+}
+
} // extern "C"
diff --git a/hal/src/main/native/cpp/jni/simulation/DriverStationDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/DriverStationDataJNI.cpp
new file mode 100644
index 0000000..7868e43
--- /dev/null
+++ b/hal/src/main/native/cpp/jni/simulation/DriverStationDataJNI.cpp
@@ -0,0 +1,825 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2018-2020 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. */
+/*----------------------------------------------------------------------------*/
+
+#include <jni.h>
+
+#include <cstring>
+
+#include <wpi/jni_util.h>
+
+#include "CallbackStore.h"
+#include "edu_wpi_first_hal_simulation_DriverStationDataJNI.h"
+#include "hal/simulation/DriverStationData.h"
+#include "hal/simulation/MockHooks.h"
+
+using namespace hal;
+using namespace wpi::java;
+
+extern "C" {
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: registerEnabledCallback
+ * Signature: (Ljava/lang/Object;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_registerEnabledCallback
+ (JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
+{
+ return sim::AllocateCallbackNoIndex(
+ env, callback, initialNotify,
+ &HALSIM_RegisterDriverStationEnabledCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: cancelEnabledCallback
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_cancelEnabledCallback
+ (JNIEnv* env, jclass, jint handle)
+{
+ return sim::FreeCallbackNoIndex(env, handle,
+ &HALSIM_CancelDriverStationEnabledCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: getEnabled
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_getEnabled
+ (JNIEnv*, jclass)
+{
+ return HALSIM_GetDriverStationEnabled();
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: setEnabled
+ * Signature: (Z)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_setEnabled
+ (JNIEnv*, jclass, jboolean value)
+{
+ HALSIM_SetDriverStationEnabled(value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: registerAutonomousCallback
+ * Signature: (Ljava/lang/Object;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_registerAutonomousCallback
+ (JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
+{
+ return sim::AllocateCallbackNoIndex(
+ env, callback, initialNotify,
+ &HALSIM_RegisterDriverStationAutonomousCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: cancelAutonomousCallback
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_cancelAutonomousCallback
+ (JNIEnv* env, jclass, jint handle)
+{
+ return sim::FreeCallbackNoIndex(
+ env, handle, &HALSIM_CancelDriverStationAutonomousCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: getAutonomous
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_getAutonomous
+ (JNIEnv*, jclass)
+{
+ return HALSIM_GetDriverStationAutonomous();
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: setAutonomous
+ * Signature: (Z)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_setAutonomous
+ (JNIEnv*, jclass, jboolean value)
+{
+ HALSIM_SetDriverStationAutonomous(value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: registerTestCallback
+ * Signature: (Ljava/lang/Object;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_registerTestCallback
+ (JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
+{
+ return sim::AllocateCallbackNoIndex(
+ env, callback, initialNotify, &HALSIM_RegisterDriverStationTestCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: cancelTestCallback
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_cancelTestCallback
+ (JNIEnv* env, jclass, jint handle)
+{
+ return sim::FreeCallbackNoIndex(env, handle,
+ &HALSIM_CancelDriverStationTestCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: getTest
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_getTest
+ (JNIEnv*, jclass)
+{
+ return HALSIM_GetDriverStationTest();
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: setTest
+ * Signature: (Z)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_setTest
+ (JNIEnv*, jclass, jboolean value)
+{
+ HALSIM_SetDriverStationTest(value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: registerEStopCallback
+ * Signature: (Ljava/lang/Object;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_registerEStopCallback
+ (JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
+{
+ return sim::AllocateCallbackNoIndex(
+ env, callback, initialNotify, &HALSIM_RegisterDriverStationEStopCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: cancelEStopCallback
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_cancelEStopCallback
+ (JNIEnv* env, jclass, jint handle)
+{
+ return sim::FreeCallbackNoIndex(env, handle,
+ &HALSIM_CancelDriverStationEStopCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: getEStop
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_getEStop
+ (JNIEnv*, jclass)
+{
+ return HALSIM_GetDriverStationEStop();
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: setEStop
+ * Signature: (Z)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_setEStop
+ (JNIEnv*, jclass, jboolean value)
+{
+ HALSIM_SetDriverStationEStop(value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: registerFmsAttachedCallback
+ * Signature: (Ljava/lang/Object;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_registerFmsAttachedCallback
+ (JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
+{
+ return sim::AllocateCallbackNoIndex(
+ env, callback, initialNotify,
+ &HALSIM_RegisterDriverStationFmsAttachedCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: cancelFmsAttachedCallback
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_cancelFmsAttachedCallback
+ (JNIEnv* env, jclass, jint handle)
+{
+ return sim::FreeCallbackNoIndex(
+ env, handle, &HALSIM_CancelDriverStationFmsAttachedCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: getFmsAttached
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_getFmsAttached
+ (JNIEnv*, jclass)
+{
+ return HALSIM_GetDriverStationFmsAttached();
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: setFmsAttached
+ * Signature: (Z)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_setFmsAttached
+ (JNIEnv*, jclass, jboolean value)
+{
+ HALSIM_SetDriverStationFmsAttached(value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: registerDsAttachedCallback
+ * Signature: (Ljava/lang/Object;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_registerDsAttachedCallback
+ (JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
+{
+ return sim::AllocateCallbackNoIndex(
+ env, callback, initialNotify,
+ &HALSIM_RegisterDriverStationDsAttachedCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: cancelDsAttachedCallback
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_cancelDsAttachedCallback
+ (JNIEnv* env, jclass, jint handle)
+{
+ return sim::FreeCallbackNoIndex(
+ env, handle, &HALSIM_CancelDriverStationDsAttachedCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: getDsAttached
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_getDsAttached
+ (JNIEnv*, jclass)
+{
+ return HALSIM_GetDriverStationDsAttached();
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: setDsAttached
+ * Signature: (Z)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_setDsAttached
+ (JNIEnv*, jclass, jboolean value)
+{
+ HALSIM_SetDriverStationDsAttached(value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: registerAllianceStationIdCallback
+ * Signature: (Ljava/lang/Object;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_registerAllianceStationIdCallback
+ (JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
+{
+ return sim::AllocateCallbackNoIndex(
+ env, callback, initialNotify,
+ &HALSIM_RegisterDriverStationAllianceStationIdCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: cancelAllianceStationIdCallback
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_cancelAllianceStationIdCallback
+ (JNIEnv* env, jclass, jint handle)
+{
+ return sim::FreeCallbackNoIndex(
+ env, handle, &HALSIM_CancelDriverStationAllianceStationIdCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: getAllianceStationId
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_getAllianceStationId
+ (JNIEnv*, jclass)
+{
+ return HALSIM_GetDriverStationAllianceStationId();
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: setAllianceStationId
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_setAllianceStationId
+ (JNIEnv*, jclass, jint value)
+{
+ HALSIM_SetDriverStationAllianceStationId(
+ static_cast<HAL_AllianceStationID>(value));
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: registerMatchTimeCallback
+ * Signature: (Ljava/lang/Object;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_registerMatchTimeCallback
+ (JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
+{
+ return sim::AllocateCallbackNoIndex(
+ env, callback, initialNotify,
+ &HALSIM_RegisterDriverStationMatchTimeCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: cancelMatchTimeCallback
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_cancelMatchTimeCallback
+ (JNIEnv* env, jclass, jint handle)
+{
+ return sim::FreeCallbackNoIndex(env, handle,
+ &HALSIM_CancelDriverStationMatchTimeCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: getMatchTime
+ * Signature: ()D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_getMatchTime
+ (JNIEnv*, jclass)
+{
+ return HALSIM_GetDriverStationMatchTime();
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: setMatchTime
+ * Signature: (D)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_setMatchTime
+ (JNIEnv*, jclass, jdouble value)
+{
+ HALSIM_SetDriverStationMatchTime(value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: setJoystickAxes
+ * Signature: (B[F)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_setJoystickAxes
+ (JNIEnv* env, jclass, jbyte joystickNum, jfloatArray axesArray)
+{
+ HAL_JoystickAxes axes;
+ {
+ wpi::java::JFloatArrayRef jArrayRef(env, axesArray);
+ auto arrayRef = jArrayRef.array();
+ auto arraySize = arrayRef.size();
+ int maxCount =
+ arraySize < HAL_kMaxJoystickAxes ? arraySize : HAL_kMaxJoystickAxes;
+ axes.count = maxCount;
+ for (int i = 0; i < maxCount; i++) {
+ axes.axes[i] = arrayRef[i];
+ }
+ }
+ HALSIM_SetJoystickAxes(joystickNum, &axes);
+ return;
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: setJoystickPOVs
+ * Signature: (B[S)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_setJoystickPOVs
+ (JNIEnv* env, jclass, jbyte joystickNum, jshortArray povsArray)
+{
+ HAL_JoystickPOVs povs;
+ {
+ wpi::java::JShortArrayRef jArrayRef(env, povsArray);
+ auto arrayRef = jArrayRef.array();
+ auto arraySize = arrayRef.size();
+ int maxCount =
+ arraySize < HAL_kMaxJoystickPOVs ? arraySize : HAL_kMaxJoystickPOVs;
+ povs.count = maxCount;
+ for (int i = 0; i < maxCount; i++) {
+ povs.povs[i] = arrayRef[i];
+ }
+ }
+ HALSIM_SetJoystickPOVs(joystickNum, &povs);
+ return;
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: setJoystickButtons
+ * Signature: (BII)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_setJoystickButtons
+ (JNIEnv* env, jclass, jbyte joystickNum, jint buttons, jint count)
+{
+ if (count > 32) {
+ count = 32;
+ }
+ HAL_JoystickButtons joystickButtons;
+ joystickButtons.count = count;
+ joystickButtons.buttons = buttons;
+ HALSIM_SetJoystickButtons(joystickNum, &joystickButtons);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: getJoystickOutputs
+ * Signature: (I)J
+ */
+JNIEXPORT jlong JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_getJoystickOutputs
+ (JNIEnv* env, jclass, jint stick)
+{
+ int64_t outputs = 0;
+ int32_t leftRumble;
+ int32_t rightRumble;
+ HALSIM_GetJoystickOutputs(stick, &outputs, &leftRumble, &rightRumble);
+ return outputs;
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: getJoystickRumble
+ * Signature: (II)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_getJoystickRumble
+ (JNIEnv* env, jclass, jint stick, jint rumbleNum)
+{
+ int64_t outputs;
+ int32_t leftRumble = 0;
+ int32_t rightRumble = 0;
+ HALSIM_GetJoystickOutputs(stick, &outputs, &leftRumble, &rightRumble);
+ return rumbleNum == 0 ? leftRumble : rightRumble;
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: setMatchInfo
+ * Signature: (Ljava/lang/String;Ljava/lang/String;III)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_setMatchInfo
+ (JNIEnv* env, jclass, jstring eventName, jstring gameSpecificMessage,
+ jint matchNumber, jint replayNumber, jint matchType)
+{
+ JStringRef eventNameRef{env, eventName};
+ JStringRef gameSpecificMessageRef{env, gameSpecificMessage};
+
+ HAL_MatchInfo halMatchInfo;
+ std::snprintf(halMatchInfo.eventName, sizeof(halMatchInfo.eventName), "%s",
+ eventNameRef.c_str());
+ std::snprintf(reinterpret_cast<char*>(halMatchInfo.gameSpecificMessage),
+ sizeof(halMatchInfo.gameSpecificMessage), "%s",
+ gameSpecificMessageRef.c_str());
+ halMatchInfo.gameSpecificMessageSize = gameSpecificMessageRef.size();
+ halMatchInfo.matchType = (HAL_MatchType)matchType;
+ halMatchInfo.matchNumber = matchNumber;
+ halMatchInfo.replayNumber = replayNumber;
+ HALSIM_SetMatchInfo(&halMatchInfo);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: registerAllCallbacks
+ * Signature: (Ljava/lang/Object;Z)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_registerAllCallbacks
+ (JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
+{
+ sim::AllocateCallbackNoIndex(
+ env, callback, initialNotify,
+ [](HAL_NotifyCallback cb, void* param, HAL_Bool in) {
+ HALSIM_RegisterDriverStationAllCallbacks(cb, param, in);
+ return 0;
+ });
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: notifyNewData
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_notifyNewData
+ (JNIEnv*, jclass)
+{
+ HALSIM_NotifyDriverStationNewData();
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: setSendError
+ * Signature: (Z)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_setSendError
+ (JNIEnv*, jclass, jboolean shouldSend)
+{
+ if (shouldSend) {
+ HALSIM_SetSendError(nullptr);
+ } else {
+ HALSIM_SetSendError([](HAL_Bool isError, int32_t errorCode,
+ HAL_Bool isLVCode, const char* details,
+ const char* location, const char* callStack,
+ HAL_Bool printMsg) { return 0; });
+ }
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: setSendConsoleLine
+ * Signature: (Z)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_setSendConsoleLine
+ (JNIEnv*, jclass, jboolean shouldSend)
+{
+ if (shouldSend) {
+ HALSIM_SetSendConsoleLine(nullptr);
+ } else {
+ HALSIM_SetSendConsoleLine([](const char* line) { return 0; });
+ }
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: setJoystickButton
+ * Signature: (IIZ)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_setJoystickButton
+ (JNIEnv*, jclass, jint stick, jint button, jboolean state)
+{
+ HALSIM_SetJoystickButton(stick, button, state);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: setJoystickAxis
+ * Signature: (IID)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_setJoystickAxis
+ (JNIEnv*, jclass, jint stick, jint axis, jdouble value)
+{
+ HALSIM_SetJoystickAxis(stick, axis, value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: setJoystickPOV
+ * Signature: (III)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_setJoystickPOV
+ (JNIEnv*, jclass, jint stick, jint pov, jint value)
+{
+ HALSIM_SetJoystickPOV(stick, pov, value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: setJoystickButtonsValue
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_setJoystickButtonsValue
+ (JNIEnv*, jclass, jint stick, jint buttons)
+{
+ HALSIM_SetJoystickButtonsValue(stick, buttons);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: setJoystickAxisCount
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_setJoystickAxisCount
+ (JNIEnv*, jclass, jint stick, jint count)
+{
+ HALSIM_SetJoystickAxisCount(stick, count);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: setJoystickPOVCount
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_setJoystickPOVCount
+ (JNIEnv*, jclass, jint stick, jint count)
+{
+ HALSIM_SetJoystickPOVCount(stick, count);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: setJoystickButtonCount
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_setJoystickButtonCount
+ (JNIEnv*, jclass, jint stick, jint count)
+{
+ HALSIM_SetJoystickButtonCount(stick, count);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: setJoystickIsXbox
+ * Signature: (IZ)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_setJoystickIsXbox
+ (JNIEnv*, jclass, jint stick, jboolean isXbox)
+{
+ HALSIM_SetJoystickIsXbox(stick, isXbox);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: setJoystickType
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_setJoystickType
+ (JNIEnv*, jclass, jint stick, jint type)
+{
+ HALSIM_SetJoystickType(stick, type);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: setJoystickName
+ * Signature: (ILjava/lang/String;)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_setJoystickName
+ (JNIEnv* env, jclass, jint stick, jstring name)
+{
+ HALSIM_SetJoystickName(stick, JStringRef{env, name}.c_str());
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: setJoystickAxisType
+ * Signature: (III)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_setJoystickAxisType
+ (JNIEnv*, jclass, jint stick, jint axis, jint type)
+{
+ HALSIM_SetJoystickAxisType(stick, axis, type);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: setGameSpecificMessage
+ * Signature: (Ljava/lang/String;)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_setGameSpecificMessage
+ (JNIEnv* env, jclass, jstring message)
+{
+ HALSIM_SetGameSpecificMessage(JStringRef{env, message}.c_str());
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: setEventName
+ * Signature: (Ljava/lang/String;)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_setEventName
+ (JNIEnv* env, jclass, jstring name)
+{
+ HALSIM_SetEventName(JStringRef{env, name}.c_str());
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: setMatchType
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_setMatchType
+ (JNIEnv*, jclass, jint type)
+{
+ HALSIM_SetMatchType(static_cast<HAL_MatchType>(static_cast<int>(type)));
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: setMatchNumber
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_setMatchNumber
+ (JNIEnv*, jclass, jint matchNumber)
+{
+ HALSIM_SetMatchNumber(matchNumber);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: setReplayNumber
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_setReplayNumber
+ (JNIEnv*, jclass, jint replayNumber)
+{
+ HALSIM_SetReplayNumber(replayNumber);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_DriverStationDataJNI
+ * Method: resetData
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_DriverStationDataJNI_resetData
+ (JNIEnv*, jclass)
+{
+ HALSIM_ResetDriverStationData();
+}
+
+} // extern "C"
diff --git a/hal/src/main/native/sim/jni/DutyCycleDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/DutyCycleDataJNI.cpp
similarity index 62%
rename from hal/src/main/native/sim/jni/DutyCycleDataJNI.cpp
rename to hal/src/main/native/cpp/jni/simulation/DutyCycleDataJNI.cpp
index d746ce1..054fa67 100644
--- a/hal/src/main/native/sim/jni/DutyCycleDataJNI.cpp
+++ b/hal/src/main/native/cpp/jni/simulation/DutyCycleDataJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2019-2020 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. */
@@ -8,18 +8,20 @@
#include <jni.h>
#include "CallbackStore.h"
-#include "edu_wpi_first_hal_sim_mockdata_DutyCycleDataJNI.h"
-#include "mockdata/DutyCycleData.h"
+#include "edu_wpi_first_hal_simulation_DutyCycleDataJNI.h"
+#include "hal/simulation/DutyCycleData.h"
+
+using namespace hal;
extern "C" {
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DutyCycleDataJNI
+ * Class: edu_wpi_first_hal_simulation_DutyCycleDataJNI
* Method: registerInitializedCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DutyCycleDataJNI_registerInitializedCallback
+Java_edu_wpi_first_hal_simulation_DutyCycleDataJNI_registerInitializedCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -27,12 +29,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DutyCycleDataJNI
+ * Class: edu_wpi_first_hal_simulation_DutyCycleDataJNI
* Method: cancelInitializedCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DutyCycleDataJNI_cancelInitializedCallback
+Java_edu_wpi_first_hal_simulation_DutyCycleDataJNI_cancelInitializedCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -40,36 +42,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DutyCycleDataJNI
+ * Class: edu_wpi_first_hal_simulation_DutyCycleDataJNI
* Method: getInitialized
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DutyCycleDataJNI_getInitialized
+Java_edu_wpi_first_hal_simulation_DutyCycleDataJNI_getInitialized
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetDutyCycleInitialized(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DutyCycleDataJNI
+ * Class: edu_wpi_first_hal_simulation_DutyCycleDataJNI
* Method: setInitialized
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DutyCycleDataJNI_setInitialized
+Java_edu_wpi_first_hal_simulation_DutyCycleDataJNI_setInitialized
(JNIEnv*, jclass, jint index, jboolean value)
{
HALSIM_SetDutyCycleInitialized(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DutyCycleDataJNI
+ * Class: edu_wpi_first_hal_simulation_DutyCycleDataJNI
* Method: registerFrequencyCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DutyCycleDataJNI_registerFrequencyCallback
+Java_edu_wpi_first_hal_simulation_DutyCycleDataJNI_registerFrequencyCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -77,12 +79,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DutyCycleDataJNI
+ * Class: edu_wpi_first_hal_simulation_DutyCycleDataJNI
* Method: cancelFrequencyCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DutyCycleDataJNI_cancelFrequencyCallback
+Java_edu_wpi_first_hal_simulation_DutyCycleDataJNI_cancelFrequencyCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -90,36 +92,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DutyCycleDataJNI
+ * Class: edu_wpi_first_hal_simulation_DutyCycleDataJNI
* Method: getFrequency
* Signature: (I)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DutyCycleDataJNI_getFrequency
+Java_edu_wpi_first_hal_simulation_DutyCycleDataJNI_getFrequency
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetDutyCycleFrequency(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DutyCycleDataJNI
+ * Class: edu_wpi_first_hal_simulation_DutyCycleDataJNI
* Method: setFrequency
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DutyCycleDataJNI_setFrequency
+Java_edu_wpi_first_hal_simulation_DutyCycleDataJNI_setFrequency
(JNIEnv*, jclass, jint index, jint value)
{
HALSIM_SetDutyCycleFrequency(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DutyCycleDataJNI
+ * Class: edu_wpi_first_hal_simulation_DutyCycleDataJNI
* Method: registerOutputCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DutyCycleDataJNI_registerOutputCallback
+Java_edu_wpi_first_hal_simulation_DutyCycleDataJNI_registerOutputCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -127,12 +129,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DutyCycleDataJNI
+ * Class: edu_wpi_first_hal_simulation_DutyCycleDataJNI
* Method: cancelOutputCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DutyCycleDataJNI_cancelOutputCallback
+Java_edu_wpi_first_hal_simulation_DutyCycleDataJNI_cancelOutputCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -140,39 +142,51 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DutyCycleDataJNI
+ * Class: edu_wpi_first_hal_simulation_DutyCycleDataJNI
* Method: getOutput
* Signature: (I)D
*/
JNIEXPORT jdouble JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DutyCycleDataJNI_getOutput
+Java_edu_wpi_first_hal_simulation_DutyCycleDataJNI_getOutput
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetDutyCycleOutput(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DutyCycleDataJNI
+ * Class: edu_wpi_first_hal_simulation_DutyCycleDataJNI
* Method: setOutput
* Signature: (ID)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DutyCycleDataJNI_setOutput
+Java_edu_wpi_first_hal_simulation_DutyCycleDataJNI_setOutput
(JNIEnv*, jclass, jint index, jdouble value)
{
HALSIM_SetDutyCycleOutput(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_DutyCycleDataJNI
+ * Class: edu_wpi_first_hal_simulation_DutyCycleDataJNI
* Method: resetData
* Signature: (I)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DutyCycleDataJNI_resetData
+Java_edu_wpi_first_hal_simulation_DutyCycleDataJNI_resetData
(JNIEnv*, jclass, jint index)
{
HALSIM_ResetDutyCycleData(index);
}
+/*
+ * Class: edu_wpi_first_hal_simulation_DutyCycleDataJNI
+ * Method: findForChannel
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_DutyCycleDataJNI_findForChannel
+ (JNIEnv*, jclass, jint channel)
+{
+ return HALSIM_FindDutyCycleForChannel(channel);
+}
+
} // extern "C"
diff --git a/hal/src/main/native/cpp/jni/simulation/EncoderDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/EncoderDataJNI.cpp
new file mode 100644
index 0000000..b97e0fe
--- /dev/null
+++ b/hal/src/main/native/cpp/jni/simulation/EncoderDataJNI.cpp
@@ -0,0 +1,490 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2018-2020 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. */
+/*----------------------------------------------------------------------------*/
+
+#include <jni.h>
+
+#include "CallbackStore.h"
+#include "edu_wpi_first_hal_simulation_EncoderDataJNI.h"
+#include "hal/simulation/EncoderData.h"
+
+using namespace hal;
+
+extern "C" {
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: registerInitializedCallback
+ * Signature: (ILjava/lang/Object;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_registerInitializedCallback
+ (JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
+{
+ return sim::AllocateCallback(env, index, callback, initialNotify,
+ &HALSIM_RegisterEncoderInitializedCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: cancelInitializedCallback
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_cancelInitializedCallback
+ (JNIEnv* env, jclass, jint index, jint handle)
+{
+ return sim::FreeCallback(env, handle, index,
+ &HALSIM_CancelEncoderInitializedCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: getInitialized
+ * Signature: (I)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_getInitialized
+ (JNIEnv*, jclass, jint index)
+{
+ return HALSIM_GetEncoderInitialized(index);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: setInitialized
+ * Signature: (IZ)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_setInitialized
+ (JNIEnv*, jclass, jint index, jboolean value)
+{
+ HALSIM_SetEncoderInitialized(index, value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: registerCountCallback
+ * Signature: (ILjava/lang/Object;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_registerCountCallback
+ (JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
+{
+ return sim::AllocateCallback(env, index, callback, initialNotify,
+ &HALSIM_RegisterEncoderCountCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: cancelCountCallback
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_cancelCountCallback
+ (JNIEnv* env, jclass, jint index, jint handle)
+{
+ return sim::FreeCallback(env, handle, index,
+ &HALSIM_CancelEncoderCountCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: getCount
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_getCount
+ (JNIEnv*, jclass, jint index)
+{
+ return HALSIM_GetEncoderCount(index);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: setCount
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_setCount
+ (JNIEnv*, jclass, jint index, jint value)
+{
+ HALSIM_SetEncoderCount(index, value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: registerPeriodCallback
+ * Signature: (ILjava/lang/Object;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_registerPeriodCallback
+ (JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
+{
+ return sim::AllocateCallback(env, index, callback, initialNotify,
+ &HALSIM_RegisterEncoderPeriodCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: cancelPeriodCallback
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_cancelPeriodCallback
+ (JNIEnv* env, jclass, jint index, jint handle)
+{
+ return sim::FreeCallback(env, handle, index,
+ &HALSIM_CancelEncoderPeriodCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: getPeriod
+ * Signature: (I)D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_getPeriod
+ (JNIEnv*, jclass, jint index)
+{
+ return HALSIM_GetEncoderPeriod(index);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: setPeriod
+ * Signature: (ID)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_setPeriod
+ (JNIEnv*, jclass, jint index, jdouble value)
+{
+ HALSIM_SetEncoderPeriod(index, value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: registerResetCallback
+ * Signature: (ILjava/lang/Object;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_registerResetCallback
+ (JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
+{
+ return sim::AllocateCallback(env, index, callback, initialNotify,
+ &HALSIM_RegisterEncoderResetCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: cancelResetCallback
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_cancelResetCallback
+ (JNIEnv* env, jclass, jint index, jint handle)
+{
+ return sim::FreeCallback(env, handle, index,
+ &HALSIM_CancelEncoderResetCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: getReset
+ * Signature: (I)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_getReset
+ (JNIEnv*, jclass, jint index)
+{
+ return HALSIM_GetEncoderReset(index);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: setReset
+ * Signature: (IZ)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_setReset
+ (JNIEnv*, jclass, jint index, jboolean value)
+{
+ HALSIM_SetEncoderReset(index, value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: registerMaxPeriodCallback
+ * Signature: (ILjava/lang/Object;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_registerMaxPeriodCallback
+ (JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
+{
+ return sim::AllocateCallback(env, index, callback, initialNotify,
+ &HALSIM_RegisterEncoderMaxPeriodCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: cancelMaxPeriodCallback
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_cancelMaxPeriodCallback
+ (JNIEnv* env, jclass, jint index, jint handle)
+{
+ return sim::FreeCallback(env, handle, index,
+ &HALSIM_CancelEncoderMaxPeriodCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: getMaxPeriod
+ * Signature: (I)D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_getMaxPeriod
+ (JNIEnv*, jclass, jint index)
+{
+ return HALSIM_GetEncoderMaxPeriod(index);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: setMaxPeriod
+ * Signature: (ID)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_setMaxPeriod
+ (JNIEnv*, jclass, jint index, jdouble value)
+{
+ HALSIM_SetEncoderMaxPeriod(index, value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: registerDirectionCallback
+ * Signature: (ILjava/lang/Object;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_registerDirectionCallback
+ (JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
+{
+ return sim::AllocateCallback(env, index, callback, initialNotify,
+ &HALSIM_RegisterEncoderDirectionCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: cancelDirectionCallback
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_cancelDirectionCallback
+ (JNIEnv* env, jclass, jint index, jint handle)
+{
+ return sim::FreeCallback(env, handle, index,
+ &HALSIM_CancelEncoderDirectionCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: getDirection
+ * Signature: (I)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_getDirection
+ (JNIEnv*, jclass, jint index)
+{
+ return HALSIM_GetEncoderDirection(index);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: setDirection
+ * Signature: (IZ)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_setDirection
+ (JNIEnv*, jclass, jint index, jboolean value)
+{
+ HALSIM_SetEncoderDirection(index, value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: registerReverseDirectionCallback
+ * Signature: (ILjava/lang/Object;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_registerReverseDirectionCallback
+ (JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
+{
+ return sim::AllocateCallback(env, index, callback, initialNotify,
+ &HALSIM_RegisterEncoderReverseDirectionCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: cancelReverseDirectionCallback
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_cancelReverseDirectionCallback
+ (JNIEnv* env, jclass, jint index, jint handle)
+{
+ return sim::FreeCallback(env, handle, index,
+ &HALSIM_CancelEncoderReverseDirectionCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: getReverseDirection
+ * Signature: (I)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_getReverseDirection
+ (JNIEnv*, jclass, jint index)
+{
+ return HALSIM_GetEncoderReverseDirection(index);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: setReverseDirection
+ * Signature: (IZ)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_setReverseDirection
+ (JNIEnv*, jclass, jint index, jboolean value)
+{
+ HALSIM_SetEncoderReverseDirection(index, value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: registerSamplesToAverageCallback
+ * Signature: (ILjava/lang/Object;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_registerSamplesToAverageCallback
+ (JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
+{
+ return sim::AllocateCallback(env, index, callback, initialNotify,
+ &HALSIM_RegisterEncoderSamplesToAverageCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: cancelSamplesToAverageCallback
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_cancelSamplesToAverageCallback
+ (JNIEnv* env, jclass, jint index, jint handle)
+{
+ return sim::FreeCallback(env, handle, index,
+ &HALSIM_CancelEncoderSamplesToAverageCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: getSamplesToAverage
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_getSamplesToAverage
+ (JNIEnv*, jclass, jint index)
+{
+ return HALSIM_GetEncoderSamplesToAverage(index);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: setSamplesToAverage
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_setSamplesToAverage
+ (JNIEnv*, jclass, jint index, jint value)
+{
+ HALSIM_SetEncoderSamplesToAverage(index, value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: setDistance
+ * Signature: (ID)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_setDistance
+ (JNIEnv*, jclass, jint index, jdouble value)
+{
+ HALSIM_SetEncoderDistance(index, value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: getDistance
+ * Signature: (I)D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_getDistance
+ (JNIEnv*, jclass, jint index)
+{
+ return HALSIM_GetEncoderDistance(index);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: setRate
+ * Signature: (ID)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_setRate
+ (JNIEnv*, jclass, jint index, jdouble value)
+{
+ HALSIM_SetEncoderRate(index, value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: getRate
+ * Signature: (I)D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_getRate
+ (JNIEnv*, jclass, jint index)
+{
+ return HALSIM_GetEncoderRate(index);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: resetData
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_resetData
+ (JNIEnv*, jclass, jint index)
+{
+ HALSIM_ResetEncoderData(index);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_EncoderDataJNI
+ * Method: findForChannel
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_EncoderDataJNI_findForChannel
+ (JNIEnv*, jclass, jint channel)
+{
+ return HALSIM_FindEncoderForChannel(channel);
+}
+
+} // extern "C"
diff --git a/hal/src/main/native/sim/jni/I2CDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/I2CDataJNI.cpp
similarity index 68%
rename from hal/src/main/native/sim/jni/I2CDataJNI.cpp
rename to hal/src/main/native/cpp/jni/simulation/I2CDataJNI.cpp
index 14b3292..e4c2259 100644
--- a/hal/src/main/native/sim/jni/I2CDataJNI.cpp
+++ b/hal/src/main/native/cpp/jni/simulation/I2CDataJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -10,18 +10,20 @@
#include "BufferCallbackStore.h"
#include "CallbackStore.h"
#include "ConstBufferCallbackStore.h"
-#include "edu_wpi_first_hal_sim_mockdata_I2CDataJNI.h"
-#include "mockdata/I2CData.h"
+#include "edu_wpi_first_hal_simulation_I2CDataJNI.h"
+#include "hal/simulation/I2CData.h"
+
+using namespace hal;
extern "C" {
/*
- * Class: edu_wpi_first_hal_sim_mockdata_I2CDataJNI
+ * Class: edu_wpi_first_hal_simulation_I2CDataJNI
* Method: registerInitializedCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_I2CDataJNI_registerInitializedCallback
+Java_edu_wpi_first_hal_simulation_I2CDataJNI_registerInitializedCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -29,12 +31,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_I2CDataJNI
+ * Class: edu_wpi_first_hal_simulation_I2CDataJNI
* Method: cancelInitializedCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_I2CDataJNI_cancelInitializedCallback
+Java_edu_wpi_first_hal_simulation_I2CDataJNI_cancelInitializedCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -42,36 +44,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_I2CDataJNI
+ * Class: edu_wpi_first_hal_simulation_I2CDataJNI
* Method: getInitialized
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_I2CDataJNI_getInitialized
+Java_edu_wpi_first_hal_simulation_I2CDataJNI_getInitialized
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetI2CInitialized(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_I2CDataJNI
+ * Class: edu_wpi_first_hal_simulation_I2CDataJNI
* Method: setInitialized
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_I2CDataJNI_setInitialized
+Java_edu_wpi_first_hal_simulation_I2CDataJNI_setInitialized
(JNIEnv*, jclass, jint index, jboolean value)
{
HALSIM_SetI2CInitialized(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_I2CDataJNI
+ * Class: edu_wpi_first_hal_simulation_I2CDataJNI
* Method: registerReadCallback
* Signature: (ILjava/lang/Object;)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_I2CDataJNI_registerReadCallback
+Java_edu_wpi_first_hal_simulation_I2CDataJNI_registerReadCallback
(JNIEnv* env, jclass, jint index, jobject callback)
{
return sim::AllocateBufferCallback(env, index, callback,
@@ -79,24 +81,24 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_I2CDataJNI
+ * Class: edu_wpi_first_hal_simulation_I2CDataJNI
* Method: cancelReadCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_I2CDataJNI_cancelReadCallback
+Java_edu_wpi_first_hal_simulation_I2CDataJNI_cancelReadCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
sim::FreeBufferCallback(env, handle, index, &HALSIM_CancelI2CReadCallback);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_I2CDataJNI
+ * Class: edu_wpi_first_hal_simulation_I2CDataJNI
* Method: registerWriteCallback
* Signature: (ILjava/lang/Object;)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_I2CDataJNI_registerWriteCallback
+Java_edu_wpi_first_hal_simulation_I2CDataJNI_registerWriteCallback
(JNIEnv* env, jclass, jint index, jobject callback)
{
return sim::AllocateConstBufferCallback(env, index, callback,
@@ -104,12 +106,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_I2CDataJNI
+ * Class: edu_wpi_first_hal_simulation_I2CDataJNI
* Method: cancelWriteCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_I2CDataJNI_cancelWriteCallback
+Java_edu_wpi_first_hal_simulation_I2CDataJNI_cancelWriteCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
sim::FreeConstBufferCallback(env, handle, index,
@@ -117,12 +119,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_I2CDataJNI
+ * Class: edu_wpi_first_hal_simulation_I2CDataJNI
* Method: resetData
* Signature: (I)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_I2CDataJNI_resetData
+Java_edu_wpi_first_hal_simulation_I2CDataJNI_resetData
(JNIEnv*, jclass, jint index)
{
HALSIM_ResetI2CData(index);
diff --git a/hal/src/main/native/sim/jni/NotifierDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/NotifierDataJNI.cpp
similarity index 63%
rename from hal/src/main/native/sim/jni/NotifierDataJNI.cpp
rename to hal/src/main/native/cpp/jni/simulation/NotifierDataJNI.cpp
index b59b6e0..845c164 100644
--- a/hal/src/main/native/sim/jni/NotifierDataJNI.cpp
+++ b/hal/src/main/native/cpp/jni/simulation/NotifierDataJNI.cpp
@@ -1,34 +1,34 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2019-2020 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. */
/*----------------------------------------------------------------------------*/
-#include "edu_wpi_first_hal_sim_mockdata_NotifierDataJNI.h"
-#include "mockdata/NotifierData.h"
+#include "edu_wpi_first_hal_simulation_NotifierDataJNI.h"
+#include "hal/simulation/NotifierData.h"
extern "C" {
/*
- * Class: edu_wpi_first_hal_sim_mockdata_NotifierDataJNI
+ * Class: edu_wpi_first_hal_simulation_NotifierDataJNI
* Method: getNextTimeout
* Signature: ()J
*/
JNIEXPORT jlong JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_NotifierDataJNI_getNextTimeout
+Java_edu_wpi_first_hal_simulation_NotifierDataJNI_getNextTimeout
(JNIEnv*, jclass)
{
return HALSIM_GetNextNotifierTimeout();
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_NotifierDataJNI
+ * Class: edu_wpi_first_hal_simulation_NotifierDataJNI
* Method: getNumNotifiers
* Signature: ()I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_NotifierDataJNI_getNumNotifiers
+Java_edu_wpi_first_hal_simulation_NotifierDataJNI_getNumNotifiers
(JNIEnv*, jclass)
{
return HALSIM_GetNumNotifiers();
diff --git a/hal/src/main/native/sim/jni/PCMDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/PCMDataJNI.cpp
similarity index 68%
rename from hal/src/main/native/sim/jni/PCMDataJNI.cpp
rename to hal/src/main/native/cpp/jni/simulation/PCMDataJNI.cpp
index de6f738..cfcd2c0 100644
--- a/hal/src/main/native/sim/jni/PCMDataJNI.cpp
+++ b/hal/src/main/native/cpp/jni/simulation/PCMDataJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -8,18 +8,20 @@
#include <jni.h>
#include "CallbackStore.h"
-#include "edu_wpi_first_hal_sim_mockdata_PCMDataJNI.h"
-#include "mockdata/PCMData.h"
+#include "edu_wpi_first_hal_simulation_PCMDataJNI.h"
+#include "hal/simulation/PCMData.h"
+
+using namespace hal;
extern "C" {
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PCMDataJNI
* Method: registerSolenoidInitializedCallback
* Signature: (IILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_registerSolenoidInitializedCallback
+Java_edu_wpi_first_hal_simulation_PCMDataJNI_registerSolenoidInitializedCallback
(JNIEnv* env, jclass, jint index, jint channel, jobject callback,
jboolean initialNotify)
{
@@ -29,12 +31,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PCMDataJNI
* Method: cancelSolenoidInitializedCallback
* Signature: (III)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_cancelSolenoidInitializedCallback
+Java_edu_wpi_first_hal_simulation_PCMDataJNI_cancelSolenoidInitializedCallback
(JNIEnv* env, jclass, jint index, jint channel, jint handle)
{
return sim::FreeChannelCallback(env, handle, index, channel,
@@ -42,36 +44,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PCMDataJNI
* Method: getSolenoidInitialized
* Signature: (II)Z
*/
JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_getSolenoidInitialized
+Java_edu_wpi_first_hal_simulation_PCMDataJNI_getSolenoidInitialized
(JNIEnv*, jclass, jint index, jint channel)
{
return HALSIM_GetPCMSolenoidInitialized(index, channel);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PCMDataJNI
* Method: setSolenoidInitialized
* Signature: (IIZ)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_setSolenoidInitialized
+Java_edu_wpi_first_hal_simulation_PCMDataJNI_setSolenoidInitialized
(JNIEnv*, jclass, jint index, jint channel, jboolean value)
{
HALSIM_SetPCMSolenoidInitialized(index, channel, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PCMDataJNI
* Method: registerSolenoidOutputCallback
* Signature: (IILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_registerSolenoidOutputCallback
+Java_edu_wpi_first_hal_simulation_PCMDataJNI_registerSolenoidOutputCallback
(JNIEnv* env, jclass, jint index, jint channel, jobject callback,
jboolean initialNotify)
{
@@ -81,12 +83,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PCMDataJNI
* Method: cancelSolenoidOutputCallback
* Signature: (III)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_cancelSolenoidOutputCallback
+Java_edu_wpi_first_hal_simulation_PCMDataJNI_cancelSolenoidOutputCallback
(JNIEnv* env, jclass, jint index, jint channel, jint handle)
{
return sim::FreeChannelCallback(env, handle, index, channel,
@@ -94,36 +96,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PCMDataJNI
* Method: getSolenoidOutput
* Signature: (II)Z
*/
JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_getSolenoidOutput
+Java_edu_wpi_first_hal_simulation_PCMDataJNI_getSolenoidOutput
(JNIEnv*, jclass, jint index, jint channel)
{
return HALSIM_GetPCMSolenoidOutput(index, channel);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PCMDataJNI
* Method: setSolenoidOutput
* Signature: (IIZ)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_setSolenoidOutput
+Java_edu_wpi_first_hal_simulation_PCMDataJNI_setSolenoidOutput
(JNIEnv*, jclass, jint index, jint channel, jboolean value)
{
HALSIM_SetPCMSolenoidOutput(index, channel, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PCMDataJNI
* Method: registerCompressorInitializedCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_registerCompressorInitializedCallback
+Java_edu_wpi_first_hal_simulation_PCMDataJNI_registerCompressorInitializedCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(
@@ -132,12 +134,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PCMDataJNI
* Method: cancelCompressorInitializedCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_cancelCompressorInitializedCallback
+Java_edu_wpi_first_hal_simulation_PCMDataJNI_cancelCompressorInitializedCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -145,36 +147,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PCMDataJNI
* Method: getCompressorInitialized
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_getCompressorInitialized
+Java_edu_wpi_first_hal_simulation_PCMDataJNI_getCompressorInitialized
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetPCMCompressorInitialized(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PCMDataJNI
* Method: setCompressorInitialized
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_setCompressorInitialized
+Java_edu_wpi_first_hal_simulation_PCMDataJNI_setCompressorInitialized
(JNIEnv*, jclass, jint index, jboolean value)
{
HALSIM_SetPCMCompressorInitialized(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PCMDataJNI
* Method: registerCompressorOnCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_registerCompressorOnCallback
+Java_edu_wpi_first_hal_simulation_PCMDataJNI_registerCompressorOnCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -182,12 +184,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PCMDataJNI
* Method: cancelCompressorOnCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_cancelCompressorOnCallback
+Java_edu_wpi_first_hal_simulation_PCMDataJNI_cancelCompressorOnCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -195,36 +197,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PCMDataJNI
* Method: getCompressorOn
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_getCompressorOn
+Java_edu_wpi_first_hal_simulation_PCMDataJNI_getCompressorOn
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetPCMCompressorOn(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PCMDataJNI
* Method: setCompressorOn
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_setCompressorOn
+Java_edu_wpi_first_hal_simulation_PCMDataJNI_setCompressorOn
(JNIEnv*, jclass, jint index, jboolean value)
{
HALSIM_SetPCMCompressorOn(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PCMDataJNI
* Method: registerClosedLoopEnabledCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_registerClosedLoopEnabledCallback
+Java_edu_wpi_first_hal_simulation_PCMDataJNI_registerClosedLoopEnabledCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -232,12 +234,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PCMDataJNI
* Method: cancelClosedLoopEnabledCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_cancelClosedLoopEnabledCallback
+Java_edu_wpi_first_hal_simulation_PCMDataJNI_cancelClosedLoopEnabledCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -245,36 +247,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PCMDataJNI
* Method: getClosedLoopEnabled
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_getClosedLoopEnabled
+Java_edu_wpi_first_hal_simulation_PCMDataJNI_getClosedLoopEnabled
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetPCMClosedLoopEnabled(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PCMDataJNI
* Method: setClosedLoopEnabled
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_setClosedLoopEnabled
+Java_edu_wpi_first_hal_simulation_PCMDataJNI_setClosedLoopEnabled
(JNIEnv*, jclass, jint index, jboolean value)
{
HALSIM_SetPCMClosedLoopEnabled(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PCMDataJNI
* Method: registerPressureSwitchCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_registerPressureSwitchCallback
+Java_edu_wpi_first_hal_simulation_PCMDataJNI_registerPressureSwitchCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -282,12 +284,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PCMDataJNI
* Method: cancelPressureSwitchCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_cancelPressureSwitchCallback
+Java_edu_wpi_first_hal_simulation_PCMDataJNI_cancelPressureSwitchCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -295,36 +297,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PCMDataJNI
* Method: getPressureSwitch
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_getPressureSwitch
+Java_edu_wpi_first_hal_simulation_PCMDataJNI_getPressureSwitch
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetPCMPressureSwitch(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PCMDataJNI
* Method: setPressureSwitch
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_setPressureSwitch
+Java_edu_wpi_first_hal_simulation_PCMDataJNI_setPressureSwitch
(JNIEnv*, jclass, jint index, jboolean value)
{
HALSIM_SetPCMPressureSwitch(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PCMDataJNI
* Method: registerCompressorCurrentCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_registerCompressorCurrentCallback
+Java_edu_wpi_first_hal_simulation_PCMDataJNI_registerCompressorCurrentCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -332,12 +334,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PCMDataJNI
* Method: cancelCompressorCurrentCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_cancelCompressorCurrentCallback
+Java_edu_wpi_first_hal_simulation_PCMDataJNI_cancelCompressorCurrentCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -345,36 +347,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PCMDataJNI
* Method: getCompressorCurrent
* Signature: (I)D
*/
JNIEXPORT jdouble JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_getCompressorCurrent
+Java_edu_wpi_first_hal_simulation_PCMDataJNI_getCompressorCurrent
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetPCMCompressorCurrent(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PCMDataJNI
* Method: setCompressorCurrent
* Signature: (ID)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_setCompressorCurrent
+Java_edu_wpi_first_hal_simulation_PCMDataJNI_setCompressorCurrent
(JNIEnv*, jclass, jint index, jdouble value)
{
HALSIM_SetPCMCompressorCurrent(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PCMDataJNI
* Method: registerAllNonSolenoidCallbacks
* Signature: (ILjava/lang/Object;Z)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_registerAllNonSolenoidCallbacks
+Java_edu_wpi_first_hal_simulation_PCMDataJNI_registerAllNonSolenoidCallbacks
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
sim::AllocateCallback(
@@ -386,12 +388,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PCMDataJNI
* Method: registerAllSolenoidCallbacks
* Signature: (IILjava/lang/Object;Z)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_registerAllSolenoidCallbacks
+Java_edu_wpi_first_hal_simulation_PCMDataJNI_registerAllSolenoidCallbacks
(JNIEnv* env, jclass, jint index, jint channel, jobject callback,
jboolean initialNotify)
{
@@ -405,12 +407,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PCMDataJNI
* Method: resetData
* Signature: (I)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_resetData
+Java_edu_wpi_first_hal_simulation_PCMDataJNI_resetData
(JNIEnv*, jclass, jint index)
{
HALSIM_ResetPCMData(index);
diff --git a/hal/src/main/native/sim/jni/PDPDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/PDPDataJNI.cpp
similarity index 67%
rename from hal/src/main/native/sim/jni/PDPDataJNI.cpp
rename to hal/src/main/native/cpp/jni/simulation/PDPDataJNI.cpp
index 5d39e87..2ce6cbd 100644
--- a/hal/src/main/native/sim/jni/PDPDataJNI.cpp
+++ b/hal/src/main/native/cpp/jni/simulation/PDPDataJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -8,18 +8,20 @@
#include <jni.h>
#include "CallbackStore.h"
-#include "edu_wpi_first_hal_sim_mockdata_PDPDataJNI.h"
-#include "mockdata/PDPData.h"
+#include "edu_wpi_first_hal_simulation_PDPDataJNI.h"
+#include "hal/simulation/PDPData.h"
+
+using namespace hal;
extern "C" {
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
+ * Class: edu_wpi_first_hal_simulation_PDPDataJNI
* Method: registerInitializedCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_registerInitializedCallback
+Java_edu_wpi_first_hal_simulation_PDPDataJNI_registerInitializedCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -27,12 +29,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
+ * Class: edu_wpi_first_hal_simulation_PDPDataJNI
* Method: cancelInitializedCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_cancelInitializedCallback
+Java_edu_wpi_first_hal_simulation_PDPDataJNI_cancelInitializedCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -40,36 +42,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
+ * Class: edu_wpi_first_hal_simulation_PDPDataJNI
* Method: getInitialized
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_getInitialized
+Java_edu_wpi_first_hal_simulation_PDPDataJNI_getInitialized
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetPDPInitialized(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
+ * Class: edu_wpi_first_hal_simulation_PDPDataJNI
* Method: setInitialized
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_setInitialized
+Java_edu_wpi_first_hal_simulation_PDPDataJNI_setInitialized
(JNIEnv*, jclass, jint index, jboolean value)
{
HALSIM_SetPDPInitialized(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
+ * Class: edu_wpi_first_hal_simulation_PDPDataJNI
* Method: registerTemperatureCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_registerTemperatureCallback
+Java_edu_wpi_first_hal_simulation_PDPDataJNI_registerTemperatureCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -77,12 +79,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
+ * Class: edu_wpi_first_hal_simulation_PDPDataJNI
* Method: cancelTemperatureCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_cancelTemperatureCallback
+Java_edu_wpi_first_hal_simulation_PDPDataJNI_cancelTemperatureCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -90,36 +92,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
+ * Class: edu_wpi_first_hal_simulation_PDPDataJNI
* Method: getTemperature
* Signature: (I)D
*/
JNIEXPORT jdouble JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_getTemperature
+Java_edu_wpi_first_hal_simulation_PDPDataJNI_getTemperature
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetPDPTemperature(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
+ * Class: edu_wpi_first_hal_simulation_PDPDataJNI
* Method: setTemperature
* Signature: (ID)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_setTemperature
+Java_edu_wpi_first_hal_simulation_PDPDataJNI_setTemperature
(JNIEnv*, jclass, jint index, jdouble value)
{
HALSIM_SetPDPTemperature(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
+ * Class: edu_wpi_first_hal_simulation_PDPDataJNI
* Method: registerVoltageCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_registerVoltageCallback
+Java_edu_wpi_first_hal_simulation_PDPDataJNI_registerVoltageCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -127,12 +129,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
+ * Class: edu_wpi_first_hal_simulation_PDPDataJNI
* Method: cancelVoltageCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_cancelVoltageCallback
+Java_edu_wpi_first_hal_simulation_PDPDataJNI_cancelVoltageCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -140,36 +142,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
+ * Class: edu_wpi_first_hal_simulation_PDPDataJNI
* Method: getVoltage
* Signature: (I)D
*/
JNIEXPORT jdouble JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_getVoltage
+Java_edu_wpi_first_hal_simulation_PDPDataJNI_getVoltage
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetPDPVoltage(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
+ * Class: edu_wpi_first_hal_simulation_PDPDataJNI
* Method: setVoltage
* Signature: (ID)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_setVoltage
+Java_edu_wpi_first_hal_simulation_PDPDataJNI_setVoltage
(JNIEnv*, jclass, jint index, jdouble value)
{
HALSIM_SetPDPVoltage(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
+ * Class: edu_wpi_first_hal_simulation_PDPDataJNI
* Method: registerCurrentCallback
* Signature: (IILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_registerCurrentCallback
+Java_edu_wpi_first_hal_simulation_PDPDataJNI_registerCurrentCallback
(JNIEnv* env, jclass, jint index, jint channel, jobject callback,
jboolean initialNotify)
{
@@ -179,12 +181,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
+ * Class: edu_wpi_first_hal_simulation_PDPDataJNI
* Method: cancelCurrentCallback
* Signature: (III)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_cancelCurrentCallback
+Java_edu_wpi_first_hal_simulation_PDPDataJNI_cancelCurrentCallback
(JNIEnv* env, jclass, jint index, jint channel, jint handle)
{
return sim::FreeChannelCallback(env, handle, index, channel,
@@ -192,36 +194,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
+ * Class: edu_wpi_first_hal_simulation_PDPDataJNI
* Method: getCurrent
* Signature: (II)D
*/
JNIEXPORT jdouble JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_getCurrent
+Java_edu_wpi_first_hal_simulation_PDPDataJNI_getCurrent
(JNIEnv*, jclass, jint index, jint channel)
{
return HALSIM_GetPDPCurrent(index, channel);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
+ * Class: edu_wpi_first_hal_simulation_PDPDataJNI
* Method: setCurrent
* Signature: (IID)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_setCurrent
+Java_edu_wpi_first_hal_simulation_PDPDataJNI_setCurrent
(JNIEnv*, jclass, jint index, jint channel, jdouble value)
{
HALSIM_SetPDPCurrent(index, channel, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
+ * Class: edu_wpi_first_hal_simulation_PDPDataJNI
* Method: resetData
* Signature: (I)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_resetData
+Java_edu_wpi_first_hal_simulation_PDPDataJNI_resetData
(JNIEnv*, jclass, jint index)
{
HALSIM_ResetPDPData(index);
diff --git a/hal/src/main/native/sim/jni/PWMDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/PWMDataJNI.cpp
similarity index 65%
rename from hal/src/main/native/sim/jni/PWMDataJNI.cpp
rename to hal/src/main/native/cpp/jni/simulation/PWMDataJNI.cpp
index b8a7c41..03e61ef 100644
--- a/hal/src/main/native/sim/jni/PWMDataJNI.cpp
+++ b/hal/src/main/native/cpp/jni/simulation/PWMDataJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -8,18 +8,20 @@
#include <jni.h>
#include "CallbackStore.h"
-#include "edu_wpi_first_hal_sim_mockdata_PWMDataJNI.h"
-#include "mockdata/PWMData.h"
+#include "edu_wpi_first_hal_simulation_PWMDataJNI.h"
+#include "hal/simulation/PWMData.h"
+
+using namespace hal;
extern "C" {
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PWMDataJNI
* Method: registerInitializedCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_registerInitializedCallback
+Java_edu_wpi_first_hal_simulation_PWMDataJNI_registerInitializedCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -27,12 +29,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PWMDataJNI
* Method: cancelInitializedCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_cancelInitializedCallback
+Java_edu_wpi_first_hal_simulation_PWMDataJNI_cancelInitializedCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -40,36 +42,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PWMDataJNI
* Method: getInitialized
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_getInitialized
+Java_edu_wpi_first_hal_simulation_PWMDataJNI_getInitialized
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetPWMInitialized(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PWMDataJNI
* Method: setInitialized
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_setInitialized
+Java_edu_wpi_first_hal_simulation_PWMDataJNI_setInitialized
(JNIEnv*, jclass, jint index, jboolean value)
{
HALSIM_SetPWMInitialized(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PWMDataJNI
* Method: registerRawValueCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_registerRawValueCallback
+Java_edu_wpi_first_hal_simulation_PWMDataJNI_registerRawValueCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -77,12 +79,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PWMDataJNI
* Method: cancelRawValueCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_cancelRawValueCallback
+Java_edu_wpi_first_hal_simulation_PWMDataJNI_cancelRawValueCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -90,36 +92,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PWMDataJNI
* Method: getRawValue
* Signature: (I)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_getRawValue
+Java_edu_wpi_first_hal_simulation_PWMDataJNI_getRawValue
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetPWMRawValue(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PWMDataJNI
* Method: setRawValue
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_setRawValue
+Java_edu_wpi_first_hal_simulation_PWMDataJNI_setRawValue
(JNIEnv*, jclass, jint index, jint value)
{
HALSIM_SetPWMRawValue(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PWMDataJNI
* Method: registerSpeedCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_registerSpeedCallback
+Java_edu_wpi_first_hal_simulation_PWMDataJNI_registerSpeedCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -127,48 +129,48 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PWMDataJNI
* Method: cancelSpeedCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_cancelSpeedCallback
+Java_edu_wpi_first_hal_simulation_PWMDataJNI_cancelSpeedCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index, &HALSIM_CancelPWMSpeedCallback);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PWMDataJNI
* Method: getSpeed
* Signature: (I)D
*/
JNIEXPORT jdouble JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_getSpeed
+Java_edu_wpi_first_hal_simulation_PWMDataJNI_getSpeed
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetPWMSpeed(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PWMDataJNI
* Method: setSpeed
* Signature: (ID)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_setSpeed
+Java_edu_wpi_first_hal_simulation_PWMDataJNI_setSpeed
(JNIEnv*, jclass, jint index, jdouble value)
{
HALSIM_SetPWMSpeed(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PWMDataJNI
* Method: registerPositionCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_registerPositionCallback
+Java_edu_wpi_first_hal_simulation_PWMDataJNI_registerPositionCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -176,12 +178,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PWMDataJNI
* Method: cancelPositionCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_cancelPositionCallback
+Java_edu_wpi_first_hal_simulation_PWMDataJNI_cancelPositionCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -189,36 +191,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PWMDataJNI
* Method: getPosition
* Signature: (I)D
*/
JNIEXPORT jdouble JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_getPosition
+Java_edu_wpi_first_hal_simulation_PWMDataJNI_getPosition
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetPWMPosition(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PWMDataJNI
* Method: setPosition
* Signature: (ID)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_setPosition
+Java_edu_wpi_first_hal_simulation_PWMDataJNI_setPosition
(JNIEnv*, jclass, jint index, jdouble value)
{
HALSIM_SetPWMPosition(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PWMDataJNI
* Method: registerPeriodScaleCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_registerPeriodScaleCallback
+Java_edu_wpi_first_hal_simulation_PWMDataJNI_registerPeriodScaleCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -226,12 +228,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PWMDataJNI
* Method: cancelPeriodScaleCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_cancelPeriodScaleCallback
+Java_edu_wpi_first_hal_simulation_PWMDataJNI_cancelPeriodScaleCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -239,36 +241,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PWMDataJNI
* Method: getPeriodScale
* Signature: (I)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_getPeriodScale
+Java_edu_wpi_first_hal_simulation_PWMDataJNI_getPeriodScale
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetPWMPeriodScale(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PWMDataJNI
* Method: setPeriodScale
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_setPeriodScale
+Java_edu_wpi_first_hal_simulation_PWMDataJNI_setPeriodScale
(JNIEnv*, jclass, jint index, jint value)
{
HALSIM_SetPWMPeriodScale(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PWMDataJNI
* Method: registerZeroLatchCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_registerZeroLatchCallback
+Java_edu_wpi_first_hal_simulation_PWMDataJNI_registerZeroLatchCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -276,12 +278,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PWMDataJNI
* Method: cancelZeroLatchCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_cancelZeroLatchCallback
+Java_edu_wpi_first_hal_simulation_PWMDataJNI_cancelZeroLatchCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -289,36 +291,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PWMDataJNI
* Method: getZeroLatch
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_getZeroLatch
+Java_edu_wpi_first_hal_simulation_PWMDataJNI_getZeroLatch
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetPWMZeroLatch(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PWMDataJNI
* Method: setZeroLatch
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_setZeroLatch
+Java_edu_wpi_first_hal_simulation_PWMDataJNI_setZeroLatch
(JNIEnv*, jclass, jint index, jboolean value)
{
HALSIM_SetPWMZeroLatch(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
+ * Class: edu_wpi_first_hal_simulation_PWMDataJNI
* Method: resetData
* Signature: (I)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_resetData
+Java_edu_wpi_first_hal_simulation_PWMDataJNI_resetData
(JNIEnv*, jclass, jint index)
{
HALSIM_ResetPWMData(index);
diff --git a/hal/src/main/native/sim/jni/RelayDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/RelayDataJNI.cpp
similarity index 66%
rename from hal/src/main/native/sim/jni/RelayDataJNI.cpp
rename to hal/src/main/native/cpp/jni/simulation/RelayDataJNI.cpp
index bf85407..7abe7cb 100644
--- a/hal/src/main/native/sim/jni/RelayDataJNI.cpp
+++ b/hal/src/main/native/cpp/jni/simulation/RelayDataJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -8,18 +8,20 @@
#include <jni.h>
#include "CallbackStore.h"
-#include "edu_wpi_first_hal_sim_mockdata_RelayDataJNI.h"
-#include "mockdata/RelayData.h"
+#include "edu_wpi_first_hal_simulation_RelayDataJNI.h"
+#include "hal/simulation/RelayData.h"
+
+using namespace hal;
extern "C" {
/*
- * Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
+ * Class: edu_wpi_first_hal_simulation_RelayDataJNI
* Method: registerInitializedForwardCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_registerInitializedForwardCallback
+Java_edu_wpi_first_hal_simulation_RelayDataJNI_registerInitializedForwardCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -27,12 +29,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
+ * Class: edu_wpi_first_hal_simulation_RelayDataJNI
* Method: cancelInitializedForwardCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_cancelInitializedForwardCallback
+Java_edu_wpi_first_hal_simulation_RelayDataJNI_cancelInitializedForwardCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -40,36 +42,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
+ * Class: edu_wpi_first_hal_simulation_RelayDataJNI
* Method: getInitializedForward
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_getInitializedForward
+Java_edu_wpi_first_hal_simulation_RelayDataJNI_getInitializedForward
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetRelayInitializedForward(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
+ * Class: edu_wpi_first_hal_simulation_RelayDataJNI
* Method: setInitializedForward
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_setInitializedForward
+Java_edu_wpi_first_hal_simulation_RelayDataJNI_setInitializedForward
(JNIEnv*, jclass, jint index, jboolean value)
{
HALSIM_SetRelayInitializedForward(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
+ * Class: edu_wpi_first_hal_simulation_RelayDataJNI
* Method: registerInitializedReverseCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_registerInitializedReverseCallback
+Java_edu_wpi_first_hal_simulation_RelayDataJNI_registerInitializedReverseCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -77,12 +79,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
+ * Class: edu_wpi_first_hal_simulation_RelayDataJNI
* Method: cancelInitializedReverseCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_cancelInitializedReverseCallback
+Java_edu_wpi_first_hal_simulation_RelayDataJNI_cancelInitializedReverseCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -90,36 +92,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
+ * Class: edu_wpi_first_hal_simulation_RelayDataJNI
* Method: getInitializedReverse
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_getInitializedReverse
+Java_edu_wpi_first_hal_simulation_RelayDataJNI_getInitializedReverse
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetRelayInitializedReverse(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
+ * Class: edu_wpi_first_hal_simulation_RelayDataJNI
* Method: setInitializedReverse
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_setInitializedReverse
+Java_edu_wpi_first_hal_simulation_RelayDataJNI_setInitializedReverse
(JNIEnv*, jclass, jint index, jboolean value)
{
HALSIM_SetRelayInitializedReverse(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
+ * Class: edu_wpi_first_hal_simulation_RelayDataJNI
* Method: registerForwardCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_registerForwardCallback
+Java_edu_wpi_first_hal_simulation_RelayDataJNI_registerForwardCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -127,12 +129,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
+ * Class: edu_wpi_first_hal_simulation_RelayDataJNI
* Method: cancelForwardCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_cancelForwardCallback
+Java_edu_wpi_first_hal_simulation_RelayDataJNI_cancelForwardCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -140,36 +142,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
+ * Class: edu_wpi_first_hal_simulation_RelayDataJNI
* Method: getForward
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_getForward
+Java_edu_wpi_first_hal_simulation_RelayDataJNI_getForward
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetRelayForward(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
+ * Class: edu_wpi_first_hal_simulation_RelayDataJNI
* Method: setForward
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_setForward
+Java_edu_wpi_first_hal_simulation_RelayDataJNI_setForward
(JNIEnv*, jclass, jint index, jboolean value)
{
HALSIM_SetRelayForward(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
+ * Class: edu_wpi_first_hal_simulation_RelayDataJNI
* Method: registerReverseCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_registerReverseCallback
+Java_edu_wpi_first_hal_simulation_RelayDataJNI_registerReverseCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -177,12 +179,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
+ * Class: edu_wpi_first_hal_simulation_RelayDataJNI
* Method: cancelReverseCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_cancelReverseCallback
+Java_edu_wpi_first_hal_simulation_RelayDataJNI_cancelReverseCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -190,36 +192,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
+ * Class: edu_wpi_first_hal_simulation_RelayDataJNI
* Method: getReverse
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_getReverse
+Java_edu_wpi_first_hal_simulation_RelayDataJNI_getReverse
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetRelayReverse(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
+ * Class: edu_wpi_first_hal_simulation_RelayDataJNI
* Method: setReverse
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_setReverse
+Java_edu_wpi_first_hal_simulation_RelayDataJNI_setReverse
(JNIEnv*, jclass, jint index, jboolean value)
{
HALSIM_SetRelayReverse(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
+ * Class: edu_wpi_first_hal_simulation_RelayDataJNI
* Method: resetData
* Signature: (I)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_resetData
+Java_edu_wpi_first_hal_simulation_RelayDataJNI_resetData
(JNIEnv*, jclass, jint index)
{
HALSIM_ResetRelayData(index);
diff --git a/hal/src/main/native/cpp/jni/simulation/RoboRioDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/RoboRioDataJNI.cpp
new file mode 100644
index 0000000..1ff6044
--- /dev/null
+++ b/hal/src/main/native/cpp/jni/simulation/RoboRioDataJNI.cpp
@@ -0,0 +1,792 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2018-2020 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. */
+/*----------------------------------------------------------------------------*/
+
+#include <jni.h>
+
+#include "CallbackStore.h"
+#include "edu_wpi_first_hal_simulation_RoboRioDataJNI.h"
+#include "hal/simulation/RoboRioData.h"
+
+using namespace hal;
+
+extern "C" {
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: registerFPGAButtonCallback
+ * Signature: (Ljava/lang/Object;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_registerFPGAButtonCallback
+ (JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
+{
+ return sim::AllocateCallbackNoIndex(
+ env, callback, initialNotify, &HALSIM_RegisterRoboRioFPGAButtonCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: cancelFPGAButtonCallback
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_cancelFPGAButtonCallback
+ (JNIEnv* env, jclass, jint handle)
+{
+ return sim::FreeCallbackNoIndex(env, handle,
+ &HALSIM_CancelRoboRioFPGAButtonCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: getFPGAButton
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_getFPGAButton
+ (JNIEnv*, jclass)
+{
+ return HALSIM_GetRoboRioFPGAButton();
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: setFPGAButton
+ * Signature: (Z)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_setFPGAButton
+ (JNIEnv*, jclass, jboolean value)
+{
+ HALSIM_SetRoboRioFPGAButton(value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: registerVInVoltageCallback
+ * Signature: (Ljava/lang/Object;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_registerVInVoltageCallback
+ (JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
+{
+ return sim::AllocateCallbackNoIndex(
+ env, callback, initialNotify, &HALSIM_RegisterRoboRioVInVoltageCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: cancelVInVoltageCallback
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_cancelVInVoltageCallback
+ (JNIEnv* env, jclass, jint handle)
+{
+ return sim::FreeCallbackNoIndex(env, handle,
+ &HALSIM_CancelRoboRioVInVoltageCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: getVInVoltage
+ * Signature: ()D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_getVInVoltage
+ (JNIEnv*, jclass)
+{
+ return HALSIM_GetRoboRioVInVoltage();
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: setVInVoltage
+ * Signature: (D)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_setVInVoltage
+ (JNIEnv*, jclass, jdouble value)
+{
+ HALSIM_SetRoboRioVInVoltage(value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: registerVInCurrentCallback
+ * Signature: (Ljava/lang/Object;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_registerVInCurrentCallback
+ (JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
+{
+ return sim::AllocateCallbackNoIndex(
+ env, callback, initialNotify, &HALSIM_RegisterRoboRioVInCurrentCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: cancelVInCurrentCallback
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_cancelVInCurrentCallback
+ (JNIEnv* env, jclass, jint handle)
+{
+ return sim::FreeCallbackNoIndex(env, handle,
+ &HALSIM_CancelRoboRioVInCurrentCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: getVInCurrent
+ * Signature: ()D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_getVInCurrent
+ (JNIEnv*, jclass)
+{
+ return HALSIM_GetRoboRioVInCurrent();
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: setVInCurrent
+ * Signature: (D)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_setVInCurrent
+ (JNIEnv*, jclass, jdouble value)
+{
+ HALSIM_SetRoboRioVInCurrent(value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: registerUserVoltage6VCallback
+ * Signature: (Ljava/lang/Object;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_registerUserVoltage6VCallback
+ (JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
+{
+ return sim::AllocateCallbackNoIndex(
+ env, callback, initialNotify,
+ &HALSIM_RegisterRoboRioUserVoltage6VCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: cancelUserVoltage6VCallback
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_cancelUserVoltage6VCallback
+ (JNIEnv* env, jclass, jint handle)
+{
+ return sim::FreeCallbackNoIndex(env, handle,
+ &HALSIM_CancelRoboRioUserVoltage6VCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: getUserVoltage6V
+ * Signature: ()D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_getUserVoltage6V
+ (JNIEnv*, jclass)
+{
+ return HALSIM_GetRoboRioUserVoltage6V();
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: setUserVoltage6V
+ * Signature: (D)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_setUserVoltage6V
+ (JNIEnv*, jclass, jdouble value)
+{
+ HALSIM_SetRoboRioUserVoltage6V(value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: registerUserCurrent6VCallback
+ * Signature: (Ljava/lang/Object;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_registerUserCurrent6VCallback
+ (JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
+{
+ return sim::AllocateCallbackNoIndex(
+ env, callback, initialNotify,
+ &HALSIM_RegisterRoboRioUserCurrent6VCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: cancelUserCurrent6VCallback
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_cancelUserCurrent6VCallback
+ (JNIEnv* env, jclass, jint handle)
+{
+ return sim::FreeCallbackNoIndex(env, handle,
+ &HALSIM_CancelRoboRioUserCurrent6VCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: getUserCurrent6V
+ * Signature: ()D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_getUserCurrent6V
+ (JNIEnv*, jclass)
+{
+ return HALSIM_GetRoboRioUserCurrent6V();
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: setUserCurrent6V
+ * Signature: (D)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_setUserCurrent6V
+ (JNIEnv*, jclass, jdouble value)
+{
+ HALSIM_SetRoboRioUserCurrent6V(value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: registerUserActive6VCallback
+ * Signature: (Ljava/lang/Object;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_registerUserActive6VCallback
+ (JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
+{
+ return sim::AllocateCallbackNoIndex(
+ env, callback, initialNotify,
+ &HALSIM_RegisterRoboRioUserActive6VCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: cancelUserActive6VCallback
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_cancelUserActive6VCallback
+ (JNIEnv* env, jclass, jint handle)
+{
+ return sim::FreeCallbackNoIndex(env, handle,
+ &HALSIM_CancelRoboRioUserActive6VCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: getUserActive6V
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_getUserActive6V
+ (JNIEnv*, jclass)
+{
+ return HALSIM_GetRoboRioUserActive6V();
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: setUserActive6V
+ * Signature: (Z)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_setUserActive6V
+ (JNIEnv*, jclass, jboolean value)
+{
+ HALSIM_SetRoboRioUserActive6V(value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: registerUserVoltage5VCallback
+ * Signature: (Ljava/lang/Object;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_registerUserVoltage5VCallback
+ (JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
+{
+ return sim::AllocateCallbackNoIndex(
+ env, callback, initialNotify,
+ &HALSIM_RegisterRoboRioUserVoltage5VCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: cancelUserVoltage5VCallback
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_cancelUserVoltage5VCallback
+ (JNIEnv* env, jclass, jint handle)
+{
+ return sim::FreeCallbackNoIndex(env, handle,
+ &HALSIM_CancelRoboRioUserVoltage5VCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: getUserVoltage5V
+ * Signature: ()D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_getUserVoltage5V
+ (JNIEnv*, jclass)
+{
+ return HALSIM_GetRoboRioUserVoltage5V();
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: setUserVoltage5V
+ * Signature: (D)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_setUserVoltage5V
+ (JNIEnv*, jclass, jdouble value)
+{
+ HALSIM_SetRoboRioUserVoltage5V(value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: registerUserCurrent5VCallback
+ * Signature: (Ljava/lang/Object;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_registerUserCurrent5VCallback
+ (JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
+{
+ return sim::AllocateCallbackNoIndex(
+ env, callback, initialNotify,
+ &HALSIM_RegisterRoboRioUserCurrent5VCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: cancelUserCurrent5VCallback
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_cancelUserCurrent5VCallback
+ (JNIEnv* env, jclass, jint handle)
+{
+ return sim::FreeCallbackNoIndex(env, handle,
+ &HALSIM_CancelRoboRioUserCurrent5VCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: getUserCurrent5V
+ * Signature: ()D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_getUserCurrent5V
+ (JNIEnv*, jclass)
+{
+ return HALSIM_GetRoboRioUserCurrent5V();
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: setUserCurrent5V
+ * Signature: (D)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_setUserCurrent5V
+ (JNIEnv*, jclass, jdouble value)
+{
+ HALSIM_SetRoboRioUserCurrent5V(value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: registerUserActive5VCallback
+ * Signature: (Ljava/lang/Object;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_registerUserActive5VCallback
+ (JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
+{
+ return sim::AllocateCallbackNoIndex(
+ env, callback, initialNotify,
+ &HALSIM_RegisterRoboRioUserActive5VCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: cancelUserActive5VCallback
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_cancelUserActive5VCallback
+ (JNIEnv* env, jclass, jint handle)
+{
+ return sim::FreeCallbackNoIndex(env, handle,
+ &HALSIM_CancelRoboRioUserActive5VCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: getUserActive5V
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_getUserActive5V
+ (JNIEnv*, jclass)
+{
+ return HALSIM_GetRoboRioUserActive5V();
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: setUserActive5V
+ * Signature: (Z)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_setUserActive5V
+ (JNIEnv*, jclass, jboolean value)
+{
+ HALSIM_SetRoboRioUserActive5V(value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: registerUserVoltage3V3Callback
+ * Signature: (Ljava/lang/Object;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_registerUserVoltage3V3Callback
+ (JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
+{
+ return sim::AllocateCallbackNoIndex(
+ env, callback, initialNotify,
+ &HALSIM_RegisterRoboRioUserVoltage3V3Callback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: cancelUserVoltage3V3Callback
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_cancelUserVoltage3V3Callback
+ (JNIEnv* env, jclass, jint handle)
+{
+ return sim::FreeCallbackNoIndex(env, handle,
+ &HALSIM_CancelRoboRioUserVoltage3V3Callback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: getUserVoltage3V3
+ * Signature: ()D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_getUserVoltage3V3
+ (JNIEnv*, jclass)
+{
+ return HALSIM_GetRoboRioUserVoltage3V3();
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: setUserVoltage3V3
+ * Signature: (D)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_setUserVoltage3V3
+ (JNIEnv*, jclass, jdouble value)
+{
+ HALSIM_SetRoboRioUserVoltage3V3(value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: registerUserCurrent3V3Callback
+ * Signature: (Ljava/lang/Object;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_registerUserCurrent3V3Callback
+ (JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
+{
+ return sim::AllocateCallbackNoIndex(
+ env, callback, initialNotify,
+ &HALSIM_RegisterRoboRioUserCurrent3V3Callback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: cancelUserCurrent3V3Callback
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_cancelUserCurrent3V3Callback
+ (JNIEnv* env, jclass, jint handle)
+{
+ return sim::FreeCallbackNoIndex(env, handle,
+ &HALSIM_CancelRoboRioUserCurrent3V3Callback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: getUserCurrent3V3
+ * Signature: ()D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_getUserCurrent3V3
+ (JNIEnv*, jclass)
+{
+ return HALSIM_GetRoboRioUserCurrent3V3();
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: setUserCurrent3V3
+ * Signature: (D)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_setUserCurrent3V3
+ (JNIEnv*, jclass, jdouble value)
+{
+ HALSIM_SetRoboRioUserCurrent3V3(value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: registerUserActive3V3Callback
+ * Signature: (Ljava/lang/Object;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_registerUserActive3V3Callback
+ (JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
+{
+ return sim::AllocateCallbackNoIndex(
+ env, callback, initialNotify,
+ &HALSIM_RegisterRoboRioUserActive3V3Callback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: cancelUserActive3V3Callback
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_cancelUserActive3V3Callback
+ (JNIEnv* env, jclass, jint handle)
+{
+ return sim::FreeCallbackNoIndex(env, handle,
+ &HALSIM_CancelRoboRioUserActive3V3Callback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: getUserActive3V3
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_getUserActive3V3
+ (JNIEnv*, jclass)
+{
+ return HALSIM_GetRoboRioUserActive3V3();
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: setUserActive3V3
+ * Signature: (Z)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_setUserActive3V3
+ (JNIEnv*, jclass, jboolean value)
+{
+ HALSIM_SetRoboRioUserActive3V3(value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: registerUserFaults6VCallback
+ * Signature: (Ljava/lang/Object;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_registerUserFaults6VCallback
+ (JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
+{
+ return sim::AllocateCallbackNoIndex(
+ env, callback, initialNotify,
+ &HALSIM_RegisterRoboRioUserFaults6VCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: cancelUserFaults6VCallback
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_cancelUserFaults6VCallback
+ (JNIEnv* env, jclass, jint handle)
+{
+ return sim::FreeCallbackNoIndex(env, handle,
+ &HALSIM_CancelRoboRioUserFaults6VCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: getUserFaults6V
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_getUserFaults6V
+ (JNIEnv*, jclass)
+{
+ return HALSIM_GetRoboRioUserFaults6V();
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: setUserFaults6V
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_setUserFaults6V
+ (JNIEnv*, jclass, jint value)
+{
+ HALSIM_SetRoboRioUserFaults6V(value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: registerUserFaults5VCallback
+ * Signature: (Ljava/lang/Object;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_registerUserFaults5VCallback
+ (JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
+{
+ return sim::AllocateCallbackNoIndex(
+ env, callback, initialNotify,
+ &HALSIM_RegisterRoboRioUserFaults5VCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: cancelUserFaults5VCallback
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_cancelUserFaults5VCallback
+ (JNIEnv* env, jclass, jint handle)
+{
+ return sim::FreeCallbackNoIndex(env, handle,
+ &HALSIM_CancelRoboRioUserFaults5VCallback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: getUserFaults5V
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_getUserFaults5V
+ (JNIEnv*, jclass)
+{
+ return HALSIM_GetRoboRioUserFaults5V();
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: setUserFaults5V
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_setUserFaults5V
+ (JNIEnv*, jclass, jint value)
+{
+ HALSIM_SetRoboRioUserFaults5V(value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: registerUserFaults3V3Callback
+ * Signature: (Ljava/lang/Object;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_registerUserFaults3V3Callback
+ (JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
+{
+ return sim::AllocateCallbackNoIndex(
+ env, callback, initialNotify,
+ &HALSIM_RegisterRoboRioUserFaults3V3Callback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: cancelUserFaults3V3Callback
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_cancelUserFaults3V3Callback
+ (JNIEnv* env, jclass, jint handle)
+{
+ return sim::FreeCallbackNoIndex(env, handle,
+ &HALSIM_CancelRoboRioUserFaults3V3Callback);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: getUserFaults3V3
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_getUserFaults3V3
+ (JNIEnv*, jclass)
+{
+ return HALSIM_GetRoboRioUserFaults3V3();
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: setUserFaults3V3
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_setUserFaults3V3
+ (JNIEnv*, jclass, jint value)
+{
+ HALSIM_SetRoboRioUserFaults3V3(value);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
+ * Method: resetData
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_resetData
+ (JNIEnv*, jclass)
+{
+ HALSIM_ResetRoboRioData();
+}
+
+} // extern "C"
diff --git a/hal/src/main/native/sim/jni/SPIAccelerometerDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/SPIAccelerometerDataJNI.cpp
similarity index 62%
rename from hal/src/main/native/sim/jni/SPIAccelerometerDataJNI.cpp
rename to hal/src/main/native/cpp/jni/simulation/SPIAccelerometerDataJNI.cpp
index ca12f79..fe0c410 100644
--- a/hal/src/main/native/sim/jni/SPIAccelerometerDataJNI.cpp
+++ b/hal/src/main/native/cpp/jni/simulation/SPIAccelerometerDataJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -8,18 +8,20 @@
#include <jni.h>
#include "CallbackStore.h"
-#include "edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI.h"
-#include "mockdata/SPIAccelerometerData.h"
+#include "edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI.h"
+#include "hal/simulation/SPIAccelerometerData.h"
+
+using namespace hal;
extern "C" {
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI
* Method: registerActiveCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_registerActiveCallback
+Java_edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI_registerActiveCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -27,12 +29,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI
* Method: cancelActiveCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_cancelActiveCallback
+Java_edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI_cancelActiveCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -40,36 +42,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI
* Method: getActive
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_getActive
+Java_edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI_getActive
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetSPIAccelerometerActive(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI
* Method: setActive
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_setActive
+Java_edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI_setActive
(JNIEnv*, jclass, jint index, jboolean value)
{
HALSIM_SetSPIAccelerometerActive(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI
* Method: registerRangeCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_registerRangeCallback
+Java_edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI_registerRangeCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -77,12 +79,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI
* Method: cancelRangeCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_cancelRangeCallback
+Java_edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI_cancelRangeCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -90,36 +92,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI
* Method: getRange
* Signature: (I)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_getRange
+Java_edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI_getRange
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetSPIAccelerometerRange(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI
* Method: setRange
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_setRange
+Java_edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI_setRange
(JNIEnv*, jclass, jint index, jint value)
{
HALSIM_SetSPIAccelerometerRange(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI
* Method: registerXCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_registerXCallback
+Java_edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI_registerXCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -127,12 +129,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI
* Method: cancelXCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_cancelXCallback
+Java_edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI_cancelXCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -140,36 +142,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI
* Method: getX
* Signature: (I)D
*/
JNIEXPORT jdouble JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_getX
+Java_edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI_getX
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetSPIAccelerometerX(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI
* Method: setX
* Signature: (ID)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_setX
+Java_edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI_setX
(JNIEnv*, jclass, jint index, jdouble value)
{
HALSIM_SetSPIAccelerometerX(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI
* Method: registerYCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_registerYCallback
+Java_edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI_registerYCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -177,12 +179,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI
* Method: cancelYCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_cancelYCallback
+Java_edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI_cancelYCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -190,36 +192,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI
* Method: getY
* Signature: (I)D
*/
JNIEXPORT jdouble JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_getY
+Java_edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI_getY
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetSPIAccelerometerY(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI
* Method: setY
* Signature: (ID)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_setY
+Java_edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI_setY
(JNIEnv*, jclass, jint index, jdouble value)
{
HALSIM_SetSPIAccelerometerY(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI
* Method: registerZCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_registerZCallback
+Java_edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI_registerZCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -227,12 +229,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI
* Method: cancelZCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_cancelZCallback
+Java_edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI_cancelZCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -240,36 +242,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI
* Method: getZ
* Signature: (I)D
*/
JNIEXPORT jdouble JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_getZ
+Java_edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI_getZ
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetSPIAccelerometerZ(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI
* Method: setZ
* Signature: (ID)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_setZ
+Java_edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI_setZ
(JNIEnv*, jclass, jint index, jdouble value)
{
HALSIM_SetSPIAccelerometerZ(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI
* Method: resetData
* Signature: (I)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_resetData
+Java_edu_wpi_first_hal_simulation_SPIAccelerometerDataJNI_resetData
(JNIEnv*, jclass, jint index)
{
HALSIM_ResetSPIAccelerometerData(index);
diff --git a/hal/src/main/native/sim/jni/SPIDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/SPIDataJNI.cpp
similarity index 69%
rename from hal/src/main/native/sim/jni/SPIDataJNI.cpp
rename to hal/src/main/native/cpp/jni/simulation/SPIDataJNI.cpp
index 4eb342c..3709984 100644
--- a/hal/src/main/native/sim/jni/SPIDataJNI.cpp
+++ b/hal/src/main/native/cpp/jni/simulation/SPIDataJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -11,18 +11,20 @@
#include "CallbackStore.h"
#include "ConstBufferCallbackStore.h"
#include "SpiReadAutoReceiveBufferCallbackStore.h"
-#include "edu_wpi_first_hal_sim_mockdata_SPIDataJNI.h"
-#include "mockdata/SPIData.h"
+#include "edu_wpi_first_hal_simulation_SPIDataJNI.h"
+#include "hal/simulation/SPIData.h"
+
+using namespace hal;
extern "C" {
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIDataJNI
* Method: registerInitializedCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_registerInitializedCallback
+Java_edu_wpi_first_hal_simulation_SPIDataJNI_registerInitializedCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
@@ -30,12 +32,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIDataJNI
* Method: cancelInitializedCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_cancelInitializedCallback
+Java_edu_wpi_first_hal_simulation_SPIDataJNI_cancelInitializedCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
@@ -43,36 +45,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIDataJNI
* Method: getInitialized
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_getInitialized
+Java_edu_wpi_first_hal_simulation_SPIDataJNI_getInitialized
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetSPIInitialized(index);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIDataJNI
* Method: setInitialized
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_setInitialized
+Java_edu_wpi_first_hal_simulation_SPIDataJNI_setInitialized
(JNIEnv*, jclass, jint index, jboolean value)
{
HALSIM_SetSPIInitialized(index, value);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIDataJNI
* Method: registerReadCallback
* Signature: (ILjava/lang/Object;)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_registerReadCallback
+Java_edu_wpi_first_hal_simulation_SPIDataJNI_registerReadCallback
(JNIEnv* env, jclass, jint index, jobject callback)
{
return sim::AllocateBufferCallback(env, index, callback,
@@ -80,24 +82,24 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIDataJNI
* Method: cancelReadCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_cancelReadCallback
+Java_edu_wpi_first_hal_simulation_SPIDataJNI_cancelReadCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
sim::FreeBufferCallback(env, handle, index, &HALSIM_CancelSPIReadCallback);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIDataJNI
* Method: registerWriteCallback
* Signature: (ILjava/lang/Object;)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_registerWriteCallback
+Java_edu_wpi_first_hal_simulation_SPIDataJNI_registerWriteCallback
(JNIEnv* env, jclass, jint index, jobject callback)
{
return sim::AllocateConstBufferCallback(env, index, callback,
@@ -105,12 +107,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIDataJNI
* Method: cancelWriteCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_cancelWriteCallback
+Java_edu_wpi_first_hal_simulation_SPIDataJNI_cancelWriteCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
sim::FreeConstBufferCallback(env, handle, index,
@@ -118,12 +120,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIDataJNI
* Method: registerReadAutoReceiveBufferCallback
* Signature: (ILjava/lang/Object;)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_registerReadAutoReceiveBufferCallback
+Java_edu_wpi_first_hal_simulation_SPIDataJNI_registerReadAutoReceiveBufferCallback
(JNIEnv* env, jclass, jint index, jobject callback)
{
return sim::AllocateSpiBufferCallback(
@@ -131,12 +133,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIDataJNI
* Method: cancelReadAutoReceiveBufferCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_cancelReadAutoReceiveBufferCallback
+Java_edu_wpi_first_hal_simulation_SPIDataJNI_cancelReadAutoReceiveBufferCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
sim::FreeSpiBufferCallback(env, handle, index,
@@ -144,12 +146,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SPIDataJNI
+ * Class: edu_wpi_first_hal_simulation_SPIDataJNI
* Method: resetData
* Signature: (I)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_resetData
+Java_edu_wpi_first_hal_simulation_SPIDataJNI_resetData
(JNIEnv*, jclass, jint index)
{
HALSIM_ResetSPIData(index);
diff --git a/hal/src/main/native/sim/jni/SimDeviceDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/SimDeviceDataJNI.cpp
similarity index 82%
rename from hal/src/main/native/sim/jni/SimDeviceDataJNI.cpp
rename to hal/src/main/native/cpp/jni/simulation/SimDeviceDataJNI.cpp
index f6cd05e..0b43d24 100644
--- a/hal/src/main/native/sim/jni/SimDeviceDataJNI.cpp
+++ b/hal/src/main/native/cpp/jni/simulation/SimDeviceDataJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2019-2020 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. */
@@ -17,9 +17,10 @@
#include <wpi/jni_util.h>
#include "SimulatorJNI.h"
-#include "edu_wpi_first_hal_sim_mockdata_SimDeviceDataJNI.h"
-#include "mockdata/SimDeviceData.h"
+#include "edu_wpi_first_hal_simulation_SimDeviceDataJNI.h"
+#include "hal/simulation/SimDeviceData.h"
+using namespace hal;
using namespace wpi::java;
static JClass simDeviceInfoCls;
@@ -259,25 +260,28 @@
store->Free(env);
}
+namespace hal {
namespace sim {
bool InitializeSimDeviceDataJNI(JNIEnv* env) {
simDeviceInfoCls = JClass(
- env, "edu/wpi/first/hal/sim/mockdata/SimDeviceDataJNI$SimDeviceInfo");
+ env, "edu/wpi/first/hal/simulation/SimDeviceDataJNI$SimDeviceInfo");
if (!simDeviceInfoCls) return false;
- simValueInfoCls = JClass(
- env, "edu/wpi/first/hal/sim/mockdata/SimDeviceDataJNI$SimValueInfo");
+ simValueInfoCls =
+ JClass(env, "edu/wpi/first/hal/simulation/SimDeviceDataJNI$SimValueInfo");
if (!simValueInfoCls) return false;
- simDeviceCallbackCls = JClass(env, "edu/wpi/first/hal/sim/SimDeviceCallback");
+ simDeviceCallbackCls =
+ JClass(env, "edu/wpi/first/hal/simulation/SimDeviceCallback");
if (!simDeviceCallbackCls) return false;
simDeviceCallbackCallback = env->GetMethodID(simDeviceCallbackCls, "callback",
"(Ljava/lang/String;I)V");
if (!simDeviceCallbackCallback) return false;
- simValueCallbackCls = JClass(env, "edu/wpi/first/hal/sim/SimValueCallback");
+ simValueCallbackCls =
+ JClass(env, "edu/wpi/first/hal/simulation/SimValueCallback");
if (!simValueCallbackCls) return false;
simValueCallbackCallback = env->GetMethodID(
@@ -295,16 +299,41 @@
}
} // namespace sim
+} // namespace hal
extern "C" {
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SimDeviceDataJNI
+ * Class: edu_wpi_first_hal_simulation_SimDeviceDataJNI
+ * Method: setSimDeviceEnabled
+ * Signature: (Ljava/lang/String;Z)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_SimDeviceDataJNI_setSimDeviceEnabled
+ (JNIEnv* env, jclass, jstring prefix, jboolean enabled)
+{
+ HALSIM_SetSimDeviceEnabled(JStringRef{env, prefix}.c_str(), enabled);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_SimDeviceDataJNI
+ * Method: isSimDeviceEnabled
+ * Signature: (Ljava/lang/String;)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_hal_simulation_SimDeviceDataJNI_isSimDeviceEnabled
+ (JNIEnv* env, jclass, jstring name)
+{
+ return HALSIM_IsSimDeviceEnabled(JStringRef{env, name}.c_str());
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_SimDeviceDataJNI
* Method: registerSimDeviceCreatedCallback
* Signature: (Ljava/lang/String;Ljava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SimDeviceDataJNI_registerSimDeviceCreatedCallback
+Java_edu_wpi_first_hal_simulation_SimDeviceDataJNI_registerSimDeviceCreatedCallback
(JNIEnv* env, jclass, jstring prefix, jobject callback,
jboolean initialNotify)
{
@@ -323,24 +352,24 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SimDeviceDataJNI
+ * Class: edu_wpi_first_hal_simulation_SimDeviceDataJNI
* Method: cancelSimDeviceCreatedCallback
* Signature: (I)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SimDeviceDataJNI_cancelSimDeviceCreatedCallback
+Java_edu_wpi_first_hal_simulation_SimDeviceDataJNI_cancelSimDeviceCreatedCallback
(JNIEnv* env, jclass, jint uid)
{
CallbackJNI::GetInstance().FreeCallback(env, uid);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SimDeviceDataJNI
+ * Class: edu_wpi_first_hal_simulation_SimDeviceDataJNI
* Method: registerSimDeviceFreedCallback
* Signature: (Ljava/lang/String;Ljava/lang/Object;)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SimDeviceDataJNI_registerSimDeviceFreedCallback
+Java_edu_wpi_first_hal_simulation_SimDeviceDataJNI_registerSimDeviceFreedCallback
(JNIEnv* env, jclass, jstring prefix, jobject callback)
{
auto [uid, store] =
@@ -357,48 +386,48 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SimDeviceDataJNI
+ * Class: edu_wpi_first_hal_simulation_SimDeviceDataJNI
* Method: cancelSimDeviceFreedCallback
* Signature: (I)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SimDeviceDataJNI_cancelSimDeviceFreedCallback
+Java_edu_wpi_first_hal_simulation_SimDeviceDataJNI_cancelSimDeviceFreedCallback
(JNIEnv* env, jclass, jint uid)
{
CallbackJNI::GetInstance().FreeCallback(env, uid);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SimDeviceDataJNI
+ * Class: edu_wpi_first_hal_simulation_SimDeviceDataJNI
* Method: getSimDeviceHandle
* Signature: (Ljava/lang/String;)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SimDeviceDataJNI_getSimDeviceHandle
+Java_edu_wpi_first_hal_simulation_SimDeviceDataJNI_getSimDeviceHandle
(JNIEnv* env, jclass, jstring name)
{
return HALSIM_GetSimDeviceHandle(JStringRef{env, name}.c_str());
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SimDeviceDataJNI
+ * Class: edu_wpi_first_hal_simulation_SimDeviceDataJNI
* Method: getSimValueDeviceHandle
* Signature: (I)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SimDeviceDataJNI_getSimValueDeviceHandle
+Java_edu_wpi_first_hal_simulation_SimDeviceDataJNI_getSimValueDeviceHandle
(JNIEnv*, jclass, jint handle)
{
return HALSIM_GetSimValueDeviceHandle(handle);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SimDeviceDataJNI
+ * Class: edu_wpi_first_hal_simulation_SimDeviceDataJNI
* Method: enumerateSimDevices
* Signature: (Ljava/lang/String;)[Ljava/lang/Object;
*/
JNIEXPORT jobjectArray JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SimDeviceDataJNI_enumerateSimDevices
+Java_edu_wpi_first_hal_simulation_SimDeviceDataJNI_enumerateSimDevices
(JNIEnv* env, jclass, jstring prefix)
{
// get values
@@ -423,12 +452,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SimDeviceDataJNI
+ * Class: edu_wpi_first_hal_simulation_SimDeviceDataJNI
* Method: registerSimValueCreatedCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SimDeviceDataJNI_registerSimValueCreatedCallback
+Java_edu_wpi_first_hal_simulation_SimDeviceDataJNI_registerSimValueCreatedCallback
(JNIEnv* env, jclass, jint device, jobject callback, jboolean initialNotify)
{
auto [uid, store] =
@@ -447,24 +476,24 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SimDeviceDataJNI
+ * Class: edu_wpi_first_hal_simulation_SimDeviceDataJNI
* Method: cancelSimValueCreatedCallback
* Signature: (I)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SimDeviceDataJNI_cancelSimValueCreatedCallback
+Java_edu_wpi_first_hal_simulation_SimDeviceDataJNI_cancelSimValueCreatedCallback
(JNIEnv* env, jclass, jint uid)
{
CallbackJNI::GetInstance().FreeCallback(env, uid);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SimDeviceDataJNI
+ * Class: edu_wpi_first_hal_simulation_SimDeviceDataJNI
* Method: registerSimValueChangedCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SimDeviceDataJNI_registerSimValueChangedCallback
+Java_edu_wpi_first_hal_simulation_SimDeviceDataJNI_registerSimValueChangedCallback
(JNIEnv* env, jclass, jint handle, jobject callback, jboolean initialNotify)
{
auto [uid, store] =
@@ -483,36 +512,36 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SimDeviceDataJNI
+ * Class: edu_wpi_first_hal_simulation_SimDeviceDataJNI
* Method: cancelSimValueChangedCallback
* Signature: (I)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SimDeviceDataJNI_cancelSimValueChangedCallback
+Java_edu_wpi_first_hal_simulation_SimDeviceDataJNI_cancelSimValueChangedCallback
(JNIEnv* env, jclass, jint uid)
{
CallbackJNI::GetInstance().FreeCallback(env, uid);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SimDeviceDataJNI
+ * Class: edu_wpi_first_hal_simulation_SimDeviceDataJNI
* Method: getSimValueHandle
* Signature: (ILjava/lang/String;)I
*/
JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SimDeviceDataJNI_getSimValueHandle
+Java_edu_wpi_first_hal_simulation_SimDeviceDataJNI_getSimValueHandle
(JNIEnv* env, jclass, jint device, jstring name)
{
return HALSIM_GetSimValueHandle(device, JStringRef{env, name}.c_str());
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SimDeviceDataJNI
+ * Class: edu_wpi_first_hal_simulation_SimDeviceDataJNI
* Method: enumerateSimValues
* Signature: (I)[Ljava/lang/Object;
*/
JNIEXPORT jobjectArray JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SimDeviceDataJNI_enumerateSimValues
+Java_edu_wpi_first_hal_simulation_SimDeviceDataJNI_enumerateSimValues
(JNIEnv* env, jclass, jint device)
{
// get values
@@ -537,12 +566,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SimDeviceDataJNI
+ * Class: edu_wpi_first_hal_simulation_SimDeviceDataJNI
* Method: getSimValueEnumOptions
* Signature: (I)[Ljava/lang/Object;
*/
JNIEXPORT jobjectArray JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SimDeviceDataJNI_getSimValueEnumOptions
+Java_edu_wpi_first_hal_simulation_SimDeviceDataJNI_getSimValueEnumOptions
(JNIEnv* env, jclass, jint handle)
{
static JClass stringCls{env, "java/lang/String"};
@@ -559,12 +588,12 @@
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SimDeviceDataJNI
+ * Class: edu_wpi_first_hal_simulation_SimDeviceDataJNI
* Method: resetSimDeviceData
* Signature: ()V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SimDeviceDataJNI_resetSimDeviceData
+Java_edu_wpi_first_hal_simulation_SimDeviceDataJNI_resetSimDeviceData
(JNIEnv*, jclass)
{
HALSIM_ResetSimDeviceData();
diff --git a/hal/src/main/native/sim/jni/SimDeviceDataJNI.h b/hal/src/main/native/cpp/jni/simulation/SimDeviceDataJNI.h
similarity index 84%
rename from hal/src/main/native/sim/jni/SimDeviceDataJNI.h
rename to hal/src/main/native/cpp/jni/simulation/SimDeviceDataJNI.h
index 56f6d9b..44fc27f 100644
--- a/hal/src/main/native/sim/jni/SimDeviceDataJNI.h
+++ b/hal/src/main/native/cpp/jni/simulation/SimDeviceDataJNI.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2019-2020 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. */
@@ -9,7 +9,9 @@
#include <jni.h>
+namespace hal {
namespace sim {
bool InitializeSimDeviceDataJNI(JNIEnv* env);
void FreeSimDeviceDataJNI(JNIEnv* env);
} // namespace sim
+} // namespace hal
diff --git a/hal/src/main/native/sim/jni/SimulatorJNI.cpp b/hal/src/main/native/cpp/jni/simulation/SimulatorJNI.cpp
similarity index 65%
rename from hal/src/main/native/sim/jni/SimulatorJNI.cpp
rename to hal/src/main/native/cpp/jni/simulation/SimulatorJNI.cpp
index 9226f91..b6336e8 100644
--- a/hal/src/main/native/sim/jni/SimulatorJNI.cpp
+++ b/hal/src/main/native/cpp/jni/simulation/SimulatorJNI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -14,10 +14,10 @@
#include "ConstBufferCallbackStore.h"
#include "SimDeviceDataJNI.h"
#include "SpiReadAutoReceiveBufferCallbackStore.h"
-#include "edu_wpi_first_hal_sim_mockdata_SimulatorJNI.h"
+#include "edu_wpi_first_hal_simulation_SimulatorJNI.h"
#include "hal/HAL.h"
#include "hal/handles/HandlesInternal.h"
-#include "mockdata/MockHooks.h"
+#include "hal/simulation/MockHooks.h"
using namespace wpi::java;
@@ -31,6 +31,7 @@
static jmethodID constBufferCallbackCallback;
static jmethodID spiReadAutoReceiveBufferCallbackCallback;
+namespace hal {
namespace sim {
jint SimOnLoad(JavaVM* vm, void* reserved) {
jvm = vm;
@@ -39,14 +40,16 @@
if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK)
return JNI_ERR;
- notifyCallbackCls = JClass(env, "edu/wpi/first/hal/sim/NotifyCallback");
+ notifyCallbackCls =
+ JClass(env, "edu/wpi/first/hal/simulation/NotifyCallback");
if (!notifyCallbackCls) return JNI_ERR;
notifyCallbackCallback = env->GetMethodID(notifyCallbackCls, "callbackNative",
"(Ljava/lang/String;IJD)V");
if (!notifyCallbackCallback) return JNI_ERR;
- bufferCallbackCls = JClass(env, "edu/wpi/first/hal/sim/BufferCallback");
+ bufferCallbackCls =
+ JClass(env, "edu/wpi/first/hal/simulation/BufferCallback");
if (!bufferCallbackCls) return JNI_ERR;
bufferCallbackCallback = env->GetMethodID(bufferCallbackCls, "callback",
@@ -54,15 +57,15 @@
if (!bufferCallbackCallback) return JNI_ERR;
constBufferCallbackCls =
- JClass(env, "edu/wpi/first/hal/sim/ConstBufferCallback");
+ JClass(env, "edu/wpi/first/hal/simulation/ConstBufferCallback");
if (!constBufferCallbackCls) return JNI_ERR;
constBufferCallbackCallback = env->GetMethodID(
constBufferCallbackCls, "callback", "(Ljava/lang/String;[BI)V");
if (!constBufferCallbackCallback) return JNI_ERR;
- spiReadAutoReceiveBufferCallbackCls =
- JClass(env, "edu/wpi/first/hal/sim/SpiReadAutoReceiveBufferCallback");
+ spiReadAutoReceiveBufferCallbackCls = JClass(
+ env, "edu/wpi/first/hal/simulation/SpiReadAutoReceiveBufferCallback");
if (!spiReadAutoReceiveBufferCallbackCls) return JNI_ERR;
spiReadAutoReceiveBufferCallbackCallback =
@@ -104,99 +107,136 @@
return spiReadAutoReceiveBufferCallbackCallback;
}
} // namespace sim
+} // namespace hal
extern "C" {
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SimulatorJNI
+ * Class: edu_wpi_first_hal_simulation_SimulatorJNI
+ * Method: setRuntimeType
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_SimulatorJNI_setRuntimeType
+ (JNIEnv*, jclass, jint type)
+{
+ HALSIM_SetRuntimeType(static_cast<HAL_RuntimeType>(type));
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_SimulatorJNI
* Method: waitForProgramStart
* Signature: ()V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SimulatorJNI_waitForProgramStart
+Java_edu_wpi_first_hal_simulation_SimulatorJNI_waitForProgramStart
(JNIEnv*, jclass)
{
HALSIM_WaitForProgramStart();
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SimulatorJNI
+ * Class: edu_wpi_first_hal_simulation_SimulatorJNI
* Method: setProgramStarted
* Signature: ()V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SimulatorJNI_setProgramStarted
+Java_edu_wpi_first_hal_simulation_SimulatorJNI_setProgramStarted
(JNIEnv*, jclass)
{
HALSIM_SetProgramStarted();
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SimulatorJNI
+ * Class: edu_wpi_first_hal_simulation_SimulatorJNI
+ * Method: getProgramStarted
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_hal_simulation_SimulatorJNI_getProgramStarted
+ (JNIEnv*, jclass)
+{
+ return HALSIM_GetProgramStarted();
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_SimulatorJNI
* Method: restartTiming
* Signature: ()V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SimulatorJNI_restartTiming
+Java_edu_wpi_first_hal_simulation_SimulatorJNI_restartTiming
(JNIEnv*, jclass)
{
HALSIM_RestartTiming();
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SimulatorJNI
+ * Class: edu_wpi_first_hal_simulation_SimulatorJNI
* Method: pauseTiming
* Signature: ()V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SimulatorJNI_pauseTiming
+Java_edu_wpi_first_hal_simulation_SimulatorJNI_pauseTiming
(JNIEnv*, jclass)
{
HALSIM_PauseTiming();
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SimulatorJNI
+ * Class: edu_wpi_first_hal_simulation_SimulatorJNI
* Method: resumeTiming
* Signature: ()V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SimulatorJNI_resumeTiming
+Java_edu_wpi_first_hal_simulation_SimulatorJNI_resumeTiming
(JNIEnv*, jclass)
{
HALSIM_ResumeTiming();
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SimulatorJNI
+ * Class: edu_wpi_first_hal_simulation_SimulatorJNI
* Method: isTimingPaused
* Signature: ()Z
*/
JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SimulatorJNI_isTimingPaused
+Java_edu_wpi_first_hal_simulation_SimulatorJNI_isTimingPaused
(JNIEnv*, jclass)
{
return HALSIM_IsTimingPaused();
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SimulatorJNI
+ * Class: edu_wpi_first_hal_simulation_SimulatorJNI
* Method: stepTiming
* Signature: (J)V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SimulatorJNI_stepTiming
+Java_edu_wpi_first_hal_simulation_SimulatorJNI_stepTiming
(JNIEnv*, jclass, jlong delta)
{
HALSIM_StepTiming(delta);
}
/*
- * Class: edu_wpi_first_hal_sim_mockdata_SimulatorJNI
+ * Class: edu_wpi_first_hal_simulation_SimulatorJNI
+ * Method: stepTimingAsync
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_hal_simulation_SimulatorJNI_stepTimingAsync
+ (JNIEnv*, jclass, jlong delta)
+{
+ HALSIM_StepTimingAsync(delta);
+}
+
+/*
+ * Class: edu_wpi_first_hal_simulation_SimulatorJNI
* Method: resetHandles
* Signature: ()V
*/
JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_SimulatorJNI_resetHandles
+Java_edu_wpi_first_hal_simulation_SimulatorJNI_resetHandles
(JNIEnv*, jclass)
{
hal::HandleBase::ResetGlobalHandles();
diff --git a/hal/src/main/native/sim/jni/SimulatorJNI.h b/hal/src/main/native/cpp/jni/simulation/SimulatorJNI.h
similarity index 87%
rename from hal/src/main/native/sim/jni/SimulatorJNI.h
rename to hal/src/main/native/cpp/jni/simulation/SimulatorJNI.h
index 8680396..d6710e8 100644
--- a/hal/src/main/native/sim/jni/SimulatorJNI.h
+++ b/hal/src/main/native/cpp/jni/simulation/SimulatorJNI.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -12,6 +12,7 @@
typedef HAL_Handle SIM_JniHandle;
+namespace hal {
namespace sim {
JavaVM* GetJVM();
@@ -20,3 +21,4 @@
jmethodID GetConstBufferCallback();
jmethodID GetSpiReadAutoReceiveBufferCallback();
} // namespace sim
+} // namespace hal
diff --git a/hal/src/main/native/sim/jni/SpiReadAutoReceiveBufferCallbackStore.cpp b/hal/src/main/native/cpp/jni/simulation/SpiReadAutoReceiveBufferCallbackStore.cpp
similarity index 95%
rename from hal/src/main/native/sim/jni/SpiReadAutoReceiveBufferCallbackStore.cpp
rename to hal/src/main/native/cpp/jni/simulation/SpiReadAutoReceiveBufferCallbackStore.cpp
index b75bb1e..5432840 100644
--- a/hal/src/main/native/sim/jni/SpiReadAutoReceiveBufferCallbackStore.cpp
+++ b/hal/src/main/native/cpp/jni/simulation/SpiReadAutoReceiveBufferCallbackStore.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -15,15 +15,17 @@
#include "hal/Types.h"
#include "hal/Value.h"
#include "hal/handles/UnlimitedHandleResource.h"
-#include "mockdata/NotifyListener.h"
+#include "hal/simulation/NotifyListener.h"
+using namespace hal;
+using namespace hal::sim;
using namespace wpi::java;
-using namespace sim;
static hal::UnlimitedHandleResource<
SIM_JniHandle, SpiReadAutoReceiveBufferCallbackStore,
hal::HAL_HandleEnum::SimulationJni>* callbackHandles;
+namespace hal {
namespace sim {
void InitializeSpiBufferStore() {
static hal::UnlimitedHandleResource<SIM_JniHandle,
@@ -33,6 +35,7 @@
callbackHandles = &cb;
}
} // namespace sim
+} // namespace hal
void SpiReadAutoReceiveBufferCallbackStore::create(JNIEnv* env, jobject obj) {
m_call = JGlobal<jobject>(env, obj);
diff --git a/hal/src/main/native/sim/jni/SpiReadAutoReceiveBufferCallbackStore.h b/hal/src/main/native/cpp/jni/simulation/SpiReadAutoReceiveBufferCallbackStore.h
similarity index 89%
rename from hal/src/main/native/sim/jni/SpiReadAutoReceiveBufferCallbackStore.h
rename to hal/src/main/native/cpp/jni/simulation/SpiReadAutoReceiveBufferCallbackStore.h
index 1a03f59..6a457de 100644
--- a/hal/src/main/native/sim/jni/SpiReadAutoReceiveBufferCallbackStore.h
+++ b/hal/src/main/native/cpp/jni/simulation/SpiReadAutoReceiveBufferCallbackStore.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -15,9 +15,10 @@
#include "hal/Types.h"
#include "hal/Value.h"
#include "hal/handles/UnlimitedHandleResource.h"
-#include "mockdata/NotifyListener.h"
-#include "mockdata/SPIData.h"
+#include "hal/simulation/NotifyListener.h"
+#include "hal/simulation/SPIData.h"
+namespace hal {
namespace sim {
class SpiReadAutoReceiveBufferCallbackStore {
public:
@@ -45,3 +46,4 @@
void FreeSpiBufferCallback(JNIEnv* env, SIM_JniHandle handle, jint index,
FreeSpiBufferCallbackFunc freeCallback);
} // namespace sim
+} // namespace hal
diff --git a/hal/src/main/native/include/hal/CAN.h b/hal/src/main/native/include/hal/CAN.h
index 8cc9c17..4f91bc1 100644
--- a/hal/src/main/native/include/hal/CAN.h
+++ b/hal/src/main/native/include/hal/CAN.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -9,8 +9,6 @@
#include <stdint.h>
-#include "hal/Types.h"
-
/**
* @defgroup hal_canstream CAN Stream Functions
* @ingroup hal_capi
diff --git a/hal/src/main/native/include/hal/CANAPITypes.h b/hal/src/main/native/include/hal/CANAPITypes.h
index a23cee1..5155d93 100644
--- a/hal/src/main/native/include/hal/CANAPITypes.h
+++ b/hal/src/main/native/include/hal/CANAPITypes.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -35,6 +35,7 @@
HAL_CAN_Dev_kPowerDistribution = 8,
HAL_CAN_Dev_kPneumatics = 9,
HAL_CAN_Dev_kMiscellaneous = 10,
+ HAL_CAN_Dev_kIOBreakout = 11,
HAL_CAN_Dev_kFirmwareUpdate = 31
};
diff --git a/hal/src/main/native/include/hal/DriverStation.h b/hal/src/main/native/include/hal/DriverStation.h
index 471c18b..23595db 100644
--- a/hal/src/main/native/include/hal/DriverStation.h
+++ b/hal/src/main/native/include/hal/DriverStation.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2013-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2013-2020 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. */
@@ -37,6 +37,12 @@
int32_t HAL_SendError(HAL_Bool isError, int32_t errorCode, HAL_Bool isLVCode,
const char* details, const char* location,
const char* callStack, HAL_Bool printMsg);
+/**
+ * Sends a line to the driver station console.
+ *
+ * @param line the line to send (null terminated)
+ */
+int32_t HAL_SendConsoleLine(const char* line);
/**
* Gets the current control word of the driver station.
@@ -171,7 +177,7 @@
* Warning: This is not an official time (so it cannot be used to dispute ref
* calls or guarantee that a function will trigger before the match ends).
*
- * The Practice Match function of the DS approximates the behaviour seen on
+ * The Practice Match function of the DS approximates the behavior seen on
* the field.
*
* @param status the error code, or 0 for success
@@ -194,24 +200,6 @@
void HAL_ReleaseDSMutex(void);
/**
- * Checks if new control data has arrived since the last
- * HAL_WaitForCachedControlData or HAL_IsNewControlData call. If new data has
- * not arrived, waits for new data to arrive. Otherwise, returns immediately.
- */
-void HAL_WaitForCachedControlData(void);
-
-/**
- * Checks if new control data has arrived since the last
- * HAL_WaitForCachedControlData or HAL_IsNewControlData call. If new data has
- * not arrived, waits for new data to arrive, or a timeout. Otherwise, returns
- * immediately.
- *
- * @param timeout timeout in seconds
- * @return true for new data, false for timeout
- */
-HAL_Bool HAL_WaitForCachedControlDataTimeout(double timeout);
-
-/**
* Has a new control packet from the driver station arrived since the last
* time this function was called?
*
@@ -221,6 +209,9 @@
/**
* Waits for the newest DS packet to arrive. Note that this is a blocking call.
+ * Checks if new control data has arrived since the last HAL_WaitForDSData or
+ * HAL_IsNewControlData call. If new data has not arrived, waits for new data
+ * to arrive. Otherwise, returns immediately.
*/
void HAL_WaitForDSData(void);
diff --git a/hal/src/main/native/include/hal/Extensions.h b/hal/src/main/native/include/hal/Extensions.h
index 3a435c0..13de7f8 100644
--- a/hal/src/main/native/include/hal/Extensions.h
+++ b/hal/src/main/native/include/hal/Extensions.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -25,7 +25,10 @@
*/
typedef int halsim_extension_init_func_t(void);
+#ifdef __cplusplus
extern "C" {
+#endif
+
/**
* Loads a single extension from a direct path.
*
@@ -45,6 +48,31 @@
int HAL_LoadExtensions(void);
/**
+ * Registers an extension such that other extensions can discover it.
+ *
+ * The passed data pointer is retained and the extension must keep this
+ * pointer valid.
+ *
+ * @param name extension name (may embed version number)
+ * @param data data pointer
+ */
+void HAL_RegisterExtension(const char* name, void* data);
+
+/**
+ * Registers an extension registration listener function. The function will
+ * be called immediately with any currently registered extensions, and will
+ * be called later when any additional extensions are registered.
+ *
+ * @param param parameter data to pass to callback function
+ * @param func callback function to be called for each registered extension;
+ * parameters are the parameter data, extension name, and extension
+ * data pointer passed to HAL_RegisterExtension()
+ */
+void HAL_RegisterExtensionListener(void* param,
+ void (*func)(void*, const char* name,
+ void* data));
+
+/**
* Enables or disables the message saying no HAL extensions were found.
*
* Some apps don't care, and the message create clutter. For general team code,
@@ -57,5 +85,17 @@
* @param showMessage true to show message, false to not.
*/
void HAL_SetShowExtensionsNotFoundMessages(HAL_Bool showMessage);
+
+/**
+ * Registers a function to be called from HAL_Shutdown(). This is intended
+ * for use only by simulation extensions.
+ *
+ * @param param parameter data to pass to callback function
+ * @param func callback function
+ */
+void HAL_OnShutdown(void* param, void (*func)(void*));
+
+#ifdef __cplusplus
} // extern "C"
+#endif
/** @} */
diff --git a/hal/src/main/native/include/hal/HAL.h b/hal/src/main/native/include/hal/HAL.h
index cf9b2f8..4412886 100644
--- a/hal/src/main/native/include/hal/HAL.h
+++ b/hal/src/main/native/include/hal/HAL.h
@@ -11,6 +11,7 @@
#include "hal/Accelerometer.h"
#include "hal/AnalogAccumulator.h"
+#include "hal/AnalogGyro.h"
#include "hal/AnalogInput.h"
#include "hal/AnalogOutput.h"
#include "hal/AnalogTrigger.h"
@@ -35,6 +36,7 @@
#include "hal/Power.h"
#include "hal/Relay.h"
#include "hal/SPI.h"
+#include "hal/SerialPort.h"
#include "hal/SimDevice.h"
#include "hal/Solenoid.h"
#include "hal/Threads.h"
diff --git a/hal/src/main/native/include/hal/HALBase.h b/hal/src/main/native/include/hal/HALBase.h
index f61d9e4..ee5b054 100644
--- a/hal/src/main/native/include/hal/HALBase.h
+++ b/hal/src/main/native/include/hal/HALBase.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2008-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2008-2020 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. */
@@ -149,6 +149,14 @@
*/
HAL_Bool HAL_Initialize(int32_t timeout, int32_t mode);
+/**
+ * Call this to shut down HAL.
+ *
+ * This must be called at termination of the robot program to avoid potential
+ * segmentation faults with simulation extensions at exit.
+ */
+void HAL_Shutdown(void);
+
#ifdef __cplusplus
} // extern "C"
#endif
diff --git a/hal/src/main/native/include/hal/I2C.h b/hal/src/main/native/include/hal/I2C.h
index fc8b5c8..4147cbb 100644
--- a/hal/src/main/native/include/hal/I2C.h
+++ b/hal/src/main/native/include/hal/I2C.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -10,7 +10,6 @@
#include <stdint.h>
#include "hal/I2CTypes.h"
-#include "hal/Types.h"
/**
* @defgroup hal_i2c I2C Functions
diff --git a/hal/src/main/native/include/hal/Interrupts.h b/hal/src/main/native/include/hal/Interrupts.h
index 126b92c..ff68d48 100644
--- a/hal/src/main/native/include/hal/Interrupts.h
+++ b/hal/src/main/native/include/hal/Interrupts.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -153,6 +153,16 @@
void HAL_SetInterruptUpSourceEdge(HAL_InterruptHandle interruptHandle,
HAL_Bool risingEdge, HAL_Bool fallingEdge,
int32_t* status);
+
+/**
+ * Releases a waiting interrupt.
+ *
+ * This will release both rising and falling waiters.
+ *
+ * @param interruptHandle the interrupt handle to release
+ */
+void HAL_ReleaseWaitingInterrupt(HAL_InterruptHandle interruptHandle,
+ int32_t* status);
#ifdef __cplusplus
} // extern "C"
#endif
diff --git a/hal/src/main/native/include/hal/Main.h b/hal/src/main/native/include/hal/Main.h
index 866e274..097f819 100644
--- a/hal/src/main/native/include/hal/Main.h
+++ b/hal/src/main/native/include/hal/Main.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2019-2020 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. */
@@ -7,8 +7,6 @@
#pragma once
-#include <stdint.h>
-
#include "hal/Types.h"
/**
diff --git a/hal/src/main/native/include/hal/PWM.h b/hal/src/main/native/include/hal/PWM.h
index 781a423..7267823 100644
--- a/hal/src/main/native/include/hal/PWM.h
+++ b/hal/src/main/native/include/hal/PWM.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -158,7 +158,7 @@
* Sets a PWM channel to be disabled.
*
* The channel is disabled until the next time it is set. Note this is different
- * from just setting a 0 speed, as this will actively stop all signalling on the
+ * from just setting a 0 speed, as this will actively stop all signaling on the
* channel.
*
* @param pwmPortHandle the PWM handle.
diff --git a/hal/src/main/native/include/hal/SimDevice.h b/hal/src/main/native/include/hal/SimDevice.h
index b05021e..ff4c12e 100644
--- a/hal/src/main/native/include/hal/SimDevice.h
+++ b/hal/src/main/native/include/hal/SimDevice.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2019-2020 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. */
@@ -473,14 +473,6 @@
*/
SimDevice(const char* name, int index, int channel);
- /**
- * Wraps a simulated device handle as returned by HAL_CreateSimDevice().
- *
- * @param handle simulated device handle
- */
- /*implicit*/ SimDevice(HAL_SimDeviceHandle val) // NOLINT(runtime/explicit)
- : m_handle(val) {}
-
~SimDevice() {
if (m_handle != HAL_kInvalidHandle) HAL_FreeSimDevice(m_handle);
}
diff --git a/hal/src/main/native/include/hal/cpp/fpga_clock.h b/hal/src/main/native/include/hal/cpp/fpga_clock.h
index 94031b1..f6d5c6c 100644
--- a/hal/src/main/native/include/hal/cpp/fpga_clock.h
+++ b/hal/src/main/native/include/hal/cpp/fpga_clock.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -8,7 +8,6 @@
#pragma once
#include <chrono>
-#include <limits>
/** WPILib Hardware Abstraction Layer (HAL) namespace */
namespace hal {
diff --git a/hal/src/main/native/include/hal/handles/DigitalHandleResource.h b/hal/src/main/native/include/hal/handles/DigitalHandleResource.h
index dcd4b97..5fd8506 100644
--- a/hal/src/main/native/include/hal/handles/DigitalHandleResource.h
+++ b/hal/src/main/native/include/hal/handles/DigitalHandleResource.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -23,7 +23,7 @@
/**
* The DigitalHandleResource class is a way to track handles. This version
* allows a limited number of handles that are allocated by index.
- * The enum value is seperate, as 2 enum values are allowed per handle
+ * The enum value is separate, as 2 enum values are allowed per handle
* Because they are allocated by index, each individual index holds its own
* mutex, which reduces contention heavily.]
*
@@ -42,6 +42,9 @@
DigitalHandleResource& operator=(const DigitalHandleResource&) = delete;
THandle Allocate(int16_t index, HAL_HandleEnum enumValue, int32_t* status);
+ int16_t GetIndex(THandle handle, HAL_HandleEnum enumValue) {
+ return getHandleTypedIndex(handle, enumValue, m_version);
+ }
std::shared_ptr<TStruct> Get(THandle handle, HAL_HandleEnum enumValue);
void Free(THandle handle, HAL_HandleEnum enumValue);
void ResetHandles() override;
@@ -54,7 +57,7 @@
template <typename THandle, typename TStruct, int16_t size>
THandle DigitalHandleResource<THandle, TStruct, size>::Allocate(
int16_t index, HAL_HandleEnum enumValue, int32_t* status) {
- // don't aquire the lock if we can fail early.
+ // don't acquire the lock if we can fail early.
if (index < 0 || index >= size) {
*status = RESOURCE_OUT_OF_RANGE;
return HAL_kInvalidHandle;
@@ -73,12 +76,12 @@
std::shared_ptr<TStruct> DigitalHandleResource<THandle, TStruct, size>::Get(
THandle handle, HAL_HandleEnum enumValue) {
// get handle index, and fail early if index out of range or wrong handle
- int16_t index = getHandleTypedIndex(handle, enumValue, m_version);
+ int16_t index = GetIndex(handle, enumValue);
if (index < 0 || index >= size) {
return nullptr;
}
std::scoped_lock lock(m_handleMutexes[index]);
- // return structure. Null will propogate correctly, so no need to manually
+ // return structure. Null will propagate correctly, so no need to manually
// check.
return m_structures[index];
}
@@ -87,7 +90,7 @@
void DigitalHandleResource<THandle, TStruct, size>::Free(
THandle handle, HAL_HandleEnum enumValue) {
// get handle index, and fail early if index out of range or wrong handle
- int16_t index = getHandleTypedIndex(handle, enumValue, m_version);
+ int16_t index = GetIndex(handle, enumValue);
if (index < 0 || index >= size) return;
// lock and deallocated handle
std::scoped_lock lock(m_handleMutexes[index]);
diff --git a/hal/src/main/native/include/hal/handles/IndexedClassedHandleResource.h b/hal/src/main/native/include/hal/handles/IndexedClassedHandleResource.h
index 2725573..902f023 100644
--- a/hal/src/main/native/include/hal/handles/IndexedClassedHandleResource.h
+++ b/hal/src/main/native/include/hal/handles/IndexedClassedHandleResource.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -47,6 +47,9 @@
THandle Allocate(int16_t index, std::shared_ptr<TStruct> toSet,
int32_t* status);
+ int16_t GetIndex(THandle handle) {
+ return getHandleTypedIndex(handle, enumValue, m_version);
+ }
std::shared_ptr<TStruct> Get(THandle handle);
void Free(THandle handle);
void ResetHandles();
@@ -61,7 +64,7 @@
THandle
IndexedClassedHandleResource<THandle, TStruct, size, enumValue>::Allocate(
int16_t index, std::shared_ptr<TStruct> toSet, int32_t* status) {
- // don't aquire the lock if we can fail early.
+ // don't acquire the lock if we can fail early.
if (index < 0 || index >= size) {
*status = RESOURCE_OUT_OF_RANGE;
return HAL_kInvalidHandle;
@@ -82,12 +85,12 @@
IndexedClassedHandleResource<THandle, TStruct, size, enumValue>::Get(
THandle handle) {
// get handle index, and fail early if index out of range or wrong handle
- int16_t index = getHandleTypedIndex(handle, enumValue, m_version);
+ int16_t index = GetIndex(handle);
if (index < 0 || index >= size) {
return nullptr;
}
std::scoped_lock lock(m_handleMutexes[index]);
- // return structure. Null will propogate correctly, so no need to manually
+ // return structure. Null will propagate correctly, so no need to manually
// check.
return m_structures[index];
}
@@ -97,7 +100,7 @@
void IndexedClassedHandleResource<THandle, TStruct, size, enumValue>::Free(
THandle handle) {
// get handle index, and fail early if index out of range or wrong handle
- int16_t index = getHandleTypedIndex(handle, enumValue, m_version);
+ int16_t index = GetIndex(handle);
if (index < 0 || index >= size) return;
// lock and deallocated handle
std::scoped_lock lock(m_handleMutexes[index]);
diff --git a/hal/src/main/native/include/hal/handles/IndexedHandleResource.h b/hal/src/main/native/include/hal/handles/IndexedHandleResource.h
index 2bca4ce..26fda02 100644
--- a/hal/src/main/native/include/hal/handles/IndexedHandleResource.h
+++ b/hal/src/main/native/include/hal/handles/IndexedHandleResource.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -43,6 +43,9 @@
IndexedHandleResource& operator=(const IndexedHandleResource&) = delete;
THandle Allocate(int16_t index, int32_t* status);
+ int16_t GetIndex(THandle handle) {
+ return getHandleTypedIndex(handle, enumValue, m_version);
+ }
std::shared_ptr<TStruct> Get(THandle handle);
void Free(THandle handle);
void ResetHandles() override;
@@ -56,7 +59,7 @@
HAL_HandleEnum enumValue>
THandle IndexedHandleResource<THandle, TStruct, size, enumValue>::Allocate(
int16_t index, int32_t* status) {
- // don't aquire the lock if we can fail early.
+ // don't acquire the lock if we can fail early.
if (index < 0 || index >= size) {
*status = RESOURCE_OUT_OF_RANGE;
return HAL_kInvalidHandle;
@@ -76,12 +79,12 @@
std::shared_ptr<TStruct>
IndexedHandleResource<THandle, TStruct, size, enumValue>::Get(THandle handle) {
// get handle index, and fail early if index out of range or wrong handle
- int16_t index = getHandleTypedIndex(handle, enumValue, m_version);
+ int16_t index = GetIndex(handle);
if (index < 0 || index >= size) {
return nullptr;
}
std::scoped_lock lock(m_handleMutexes[index]);
- // return structure. Null will propogate correctly, so no need to manually
+ // return structure. Null will propagate correctly, so no need to manually
// check.
return m_structures[index];
}
@@ -91,7 +94,7 @@
void IndexedHandleResource<THandle, TStruct, size, enumValue>::Free(
THandle handle) {
// get handle index, and fail early if index out of range or wrong handle
- int16_t index = getHandleTypedIndex(handle, enumValue, m_version);
+ int16_t index = GetIndex(handle);
if (index < 0 || index >= size) return;
// lock and deallocated handle
std::scoped_lock lock(m_handleMutexes[index]);
diff --git a/hal/src/main/native/include/hal/handles/LimitedClassedHandleResource.h b/hal/src/main/native/include/hal/handles/LimitedClassedHandleResource.h
index a991fc3..0ab8aac 100644
--- a/hal/src/main/native/include/hal/handles/LimitedClassedHandleResource.h
+++ b/hal/src/main/native/include/hal/handles/LimitedClassedHandleResource.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -42,6 +42,9 @@
delete;
THandle Allocate(std::shared_ptr<TStruct> toSet);
+ int16_t GetIndex(THandle handle) {
+ return getHandleTypedIndex(handle, enumValue, m_version);
+ }
std::shared_ptr<TStruct> Get(THandle handle);
void Free(THandle handle);
void ResetHandles() override;
@@ -77,12 +80,12 @@
LimitedClassedHandleResource<THandle, TStruct, size, enumValue>::Get(
THandle handle) {
// get handle index, and fail early if index out of range or wrong handle
- int16_t index = getHandleTypedIndex(handle, enumValue, m_version);
+ int16_t index = GetIndex(handle);
if (index < 0 || index >= size) {
return nullptr;
}
std::scoped_lock lock(m_handleMutexes[index]);
- // return structure. Null will propogate correctly, so no need to manually
+ // return structure. Null will propagate correctly, so no need to manually
// check.
return m_structures[index];
}
@@ -92,7 +95,7 @@
void LimitedClassedHandleResource<THandle, TStruct, size, enumValue>::Free(
THandle handle) {
// get handle index, and fail early if index out of range or wrong handle
- int16_t index = getHandleTypedIndex(handle, enumValue, m_version);
+ int16_t index = GetIndex(handle);
if (index < 0 || index >= size) return;
// lock and deallocated handle
std::scoped_lock allocateLock(m_allocateMutex);
diff --git a/hal/src/main/native/include/hal/handles/LimitedHandleResource.h b/hal/src/main/native/include/hal/handles/LimitedHandleResource.h
index 0756634..2f7ed0d 100644
--- a/hal/src/main/native/include/hal/handles/LimitedHandleResource.h
+++ b/hal/src/main/native/include/hal/handles/LimitedHandleResource.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -40,6 +40,9 @@
LimitedHandleResource& operator=(const LimitedHandleResource&) = delete;
THandle Allocate();
+ int16_t GetIndex(THandle handle) {
+ return getHandleTypedIndex(handle, enumValue, m_version);
+ }
std::shared_ptr<TStruct> Get(THandle handle);
void Free(THandle handle);
void ResetHandles() override;
@@ -72,12 +75,12 @@
std::shared_ptr<TStruct>
LimitedHandleResource<THandle, TStruct, size, enumValue>::Get(THandle handle) {
// get handle index, and fail early if index out of range or wrong handle
- int16_t index = getHandleTypedIndex(handle, enumValue, m_version);
+ int16_t index = GetIndex(handle);
if (index < 0 || index >= size) {
return nullptr;
}
std::scoped_lock lock(m_handleMutexes[index]);
- // return structure. Null will propogate correctly, so no need to manually
+ // return structure. Null will propagate correctly, so no need to manually
// check.
return m_structures[index];
}
@@ -87,7 +90,7 @@
void LimitedHandleResource<THandle, TStruct, size, enumValue>::Free(
THandle handle) {
// get handle index, and fail early if index out of range or wrong handle
- int16_t index = getHandleTypedIndex(handle, enumValue, m_version);
+ int16_t index = GetIndex(handle);
if (index < 0 || index >= size) return;
// lock and deallocated handle
std::scoped_lock allocateLock(m_allocateMutex);
diff --git a/hal/src/main/native/include/hal/handles/UnlimitedHandleResource.h b/hal/src/main/native/include/hal/handles/UnlimitedHandleResource.h
index 96a91f8..5f74b88 100644
--- a/hal/src/main/native/include/hal/handles/UnlimitedHandleResource.h
+++ b/hal/src/main/native/include/hal/handles/UnlimitedHandleResource.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2008-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2008-2020 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. */
@@ -44,6 +44,9 @@
UnlimitedHandleResource& operator=(const UnlimitedHandleResource&) = delete;
THandle Allocate(std::shared_ptr<TStruct> structure);
+ int16_t GetIndex(THandle handle) {
+ return getHandleTypedIndex(handle, enumValue, m_version);
+ }
std::shared_ptr<TStruct> Get(THandle handle);
/* Returns structure previously at that handle (or nullptr if none) */
std::shared_ptr<TStruct> Free(THandle handle);
@@ -81,7 +84,7 @@
template <typename THandle, typename TStruct, HAL_HandleEnum enumValue>
std::shared_ptr<TStruct>
UnlimitedHandleResource<THandle, TStruct, enumValue>::Get(THandle handle) {
- int16_t index = getHandleTypedIndex(handle, enumValue, m_version);
+ int16_t index = GetIndex(handle);
std::scoped_lock lock(m_handleMutex);
if (index < 0 || index >= static_cast<int16_t>(m_structures.size()))
return nullptr;
@@ -91,7 +94,7 @@
template <typename THandle, typename TStruct, HAL_HandleEnum enumValue>
std::shared_ptr<TStruct>
UnlimitedHandleResource<THandle, TStruct, enumValue>::Free(THandle handle) {
- int16_t index = getHandleTypedIndex(handle, enumValue, m_version);
+ int16_t index = GetIndex(handle);
std::scoped_lock lock(m_handleMutex);
if (index < 0 || index >= static_cast<int16_t>(m_structures.size()))
return nullptr;
diff --git a/hal/src/main/native/include/mockdata/AccelerometerData.h b/hal/src/main/native/include/hal/simulation/AccelerometerData.h
similarity index 96%
rename from hal/src/main/native/include/mockdata/AccelerometerData.h
rename to hal/src/main/native/include/hal/simulation/AccelerometerData.h
index aa89f6e..0a92671 100644
--- a/hal/src/main/native/include/mockdata/AccelerometerData.h
+++ b/hal/src/main/native/include/hal/simulation/AccelerometerData.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,9 +7,9 @@
#pragma once
-#include "NotifyListener.h"
#include "hal/Accelerometer.h"
#include "hal/Types.h"
+#include "hal/simulation/NotifyListener.h"
#ifdef __cplusplus
extern "C" {
diff --git a/hal/src/main/native/include/mockdata/AddressableLEDData.h b/hal/src/main/native/include/hal/simulation/AddressableLEDData.h
similarity index 94%
rename from hal/src/main/native/include/mockdata/AddressableLEDData.h
rename to hal/src/main/native/include/hal/simulation/AddressableLEDData.h
index 0d8f3f3..91ab30c 100644
--- a/hal/src/main/native/include/mockdata/AddressableLEDData.h
+++ b/hal/src/main/native/include/hal/simulation/AddressableLEDData.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2019-2020 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. */
@@ -7,14 +7,16 @@
#pragma once
-#include "NotifyListener.h"
#include "hal/AddressableLEDTypes.h"
#include "hal/Types.h"
+#include "hal/simulation/NotifyListener.h"
#ifdef __cplusplus
extern "C" {
#endif
+int32_t HALSIM_FindAddressableLEDForChannel(int32_t channel);
+
void HALSIM_ResetAddressableLEDData(int32_t index);
int32_t HALSIM_RegisterAddressableLEDInitializedCallback(
diff --git a/hal/src/main/native/include/mockdata/AnalogGyroData.h b/hal/src/main/native/include/hal/simulation/AnalogGyroData.h
similarity index 94%
rename from hal/src/main/native/include/mockdata/AnalogGyroData.h
rename to hal/src/main/native/include/hal/simulation/AnalogGyroData.h
index 56c739d..91e684e 100644
--- a/hal/src/main/native/include/mockdata/AnalogGyroData.h
+++ b/hal/src/main/native/include/hal/simulation/AnalogGyroData.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,8 +7,8 @@
#pragma once
-#include "NotifyListener.h"
#include "hal/Types.h"
+#include "hal/simulation/NotifyListener.h"
#ifdef __cplusplus
extern "C" {
diff --git a/hal/src/main/native/include/mockdata/AnalogInData.h b/hal/src/main/native/include/hal/simulation/AnalogInData.h
similarity index 97%
rename from hal/src/main/native/include/mockdata/AnalogInData.h
rename to hal/src/main/native/include/hal/simulation/AnalogInData.h
index e571563..9ab2d3b 100644
--- a/hal/src/main/native/include/mockdata/AnalogInData.h
+++ b/hal/src/main/native/include/hal/simulation/AnalogInData.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,8 +7,8 @@
#pragma once
-#include "NotifyListener.h"
#include "hal/Types.h"
+#include "hal/simulation/NotifyListener.h"
#ifdef __cplusplus
extern "C" {
diff --git a/hal/src/main/native/include/mockdata/AnalogOutData.h b/hal/src/main/native/include/hal/simulation/AnalogOutData.h
similarity index 93%
rename from hal/src/main/native/include/mockdata/AnalogOutData.h
rename to hal/src/main/native/include/hal/simulation/AnalogOutData.h
index e8f55f6..fa1413d 100644
--- a/hal/src/main/native/include/mockdata/AnalogOutData.h
+++ b/hal/src/main/native/include/hal/simulation/AnalogOutData.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,8 +7,8 @@
#pragma once
-#include "NotifyListener.h"
#include "hal/Types.h"
+#include "hal/simulation/NotifyListener.h"
#ifdef __cplusplus
extern "C" {
diff --git a/hal/src/main/native/include/mockdata/AnalogTriggerData.h b/hal/src/main/native/include/hal/simulation/AnalogTriggerData.h
similarity index 94%
rename from hal/src/main/native/include/mockdata/AnalogTriggerData.h
rename to hal/src/main/native/include/hal/simulation/AnalogTriggerData.h
index 566f2f5..74c762c 100644
--- a/hal/src/main/native/include/mockdata/AnalogTriggerData.h
+++ b/hal/src/main/native/include/hal/simulation/AnalogTriggerData.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,8 +7,8 @@
#pragma once
-#include "NotifyListener.h"
#include "hal/Types.h"
+#include "hal/simulation/NotifyListener.h"
enum HALSIM_AnalogTriggerMode : int32_t {
HALSIM_AnalogTriggerUnassigned,
@@ -21,6 +21,8 @@
extern "C" {
#endif
+int32_t HALSIM_FindAnalogTriggerForChannel(int32_t channel);
+
void HALSIM_ResetAnalogTriggerData(int32_t index);
int32_t HALSIM_RegisterAnalogTriggerInitializedCallback(
int32_t index, HAL_NotifyCallback callback, void* param,
diff --git a/hal/src/main/native/include/mockdata/CanData.h b/hal/src/main/native/include/hal/simulation/CanData.h
similarity index 96%
rename from hal/src/main/native/include/mockdata/CanData.h
rename to hal/src/main/native/include/hal/simulation/CanData.h
index 0d48290..eb5ea63 100644
--- a/hal/src/main/native/include/mockdata/CanData.h
+++ b/hal/src/main/native/include/hal/simulation/CanData.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,9 +7,9 @@
#pragma once
-#include "NotifyListener.h"
#include "hal/Types.h"
#include "hal/Value.h"
+#include "hal/simulation/NotifyListener.h"
typedef void (*HAL_CAN_SendMessageCallback)(const char* name, void* param,
uint32_t messageID,
diff --git a/hal/src/main/native/include/mockdata/DIOData.h b/hal/src/main/native/include/hal/simulation/DIOData.h
similarity index 96%
rename from hal/src/main/native/include/mockdata/DIOData.h
rename to hal/src/main/native/include/hal/simulation/DIOData.h
index d13eee1..ddda655 100644
--- a/hal/src/main/native/include/mockdata/DIOData.h
+++ b/hal/src/main/native/include/hal/simulation/DIOData.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,8 +7,8 @@
#pragma once
-#include "NotifyListener.h"
#include "hal/Types.h"
+#include "hal/simulation/NotifyListener.h"
#ifdef __cplusplus
extern "C" {
diff --git a/hal/src/main/native/include/mockdata/DigitalPWMData.h b/hal/src/main/native/include/hal/simulation/DigitalPWMData.h
similarity index 92%
rename from hal/src/main/native/include/mockdata/DigitalPWMData.h
rename to hal/src/main/native/include/hal/simulation/DigitalPWMData.h
index 5af17e3..79428b0 100644
--- a/hal/src/main/native/include/mockdata/DigitalPWMData.h
+++ b/hal/src/main/native/include/hal/simulation/DigitalPWMData.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,13 +7,15 @@
#pragma once
-#include "NotifyListener.h"
#include "hal/Types.h"
+#include "hal/simulation/NotifyListener.h"
#ifdef __cplusplus
extern "C" {
#endif
+int32_t HALSIM_FindDigitalPWMForChannel(int32_t channel);
+
void HALSIM_ResetDigitalPWMData(int32_t index);
int32_t HALSIM_RegisterDigitalPWMInitializedCallback(
int32_t index, HAL_NotifyCallback callback, void* param,
diff --git a/hal/src/main/native/include/hal/simulation/DriverStationData.h b/hal/src/main/native/include/hal/simulation/DriverStationData.h
new file mode 100644
index 0000000..536738b
--- /dev/null
+++ b/hal/src/main/native/include/hal/simulation/DriverStationData.h
@@ -0,0 +1,172 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2020 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
+
+#include "hal/DriverStationTypes.h"
+#include "hal/Types.h"
+#include "hal/simulation/NotifyListener.h"
+
+typedef void (*HAL_JoystickAxesCallback)(const char* name, void* param,
+ int32_t joystickNum,
+ const HAL_JoystickAxes* axes);
+typedef void (*HAL_JoystickPOVsCallback)(const char* name, void* param,
+ int32_t joystickNum,
+ const HAL_JoystickPOVs* povs);
+typedef void (*HAL_JoystickButtonsCallback)(const char* name, void* param,
+ int32_t joystickNum,
+ const HAL_JoystickButtons* buttons);
+typedef void (*HAL_JoystickDescriptorCallback)(
+ const char* name, void* param, int32_t joystickNum,
+ const HAL_JoystickDescriptor* descriptor);
+typedef void (*HAL_JoystickOutputsCallback)(const char* name, void* param,
+ int32_t joystickNum,
+ int64_t outputs, int32_t leftRumble,
+ int32_t rightRumble);
+typedef void (*HAL_MatchInfoCallback)(const char* name, void* param,
+ const HAL_MatchInfo* info);
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void HALSIM_ResetDriverStationData(void);
+int32_t HALSIM_RegisterDriverStationEnabledCallback(HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify);
+void HALSIM_CancelDriverStationEnabledCallback(int32_t uid);
+HAL_Bool HALSIM_GetDriverStationEnabled(void);
+void HALSIM_SetDriverStationEnabled(HAL_Bool enabled);
+
+int32_t HALSIM_RegisterDriverStationAutonomousCallback(
+ HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
+void HALSIM_CancelDriverStationAutonomousCallback(int32_t uid);
+HAL_Bool HALSIM_GetDriverStationAutonomous(void);
+void HALSIM_SetDriverStationAutonomous(HAL_Bool autonomous);
+
+int32_t HALSIM_RegisterDriverStationTestCallback(HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify);
+void HALSIM_CancelDriverStationTestCallback(int32_t uid);
+HAL_Bool HALSIM_GetDriverStationTest(void);
+void HALSIM_SetDriverStationTest(HAL_Bool test);
+
+int32_t HALSIM_RegisterDriverStationEStopCallback(HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify);
+void HALSIM_CancelDriverStationEStopCallback(int32_t uid);
+HAL_Bool HALSIM_GetDriverStationEStop(void);
+void HALSIM_SetDriverStationEStop(HAL_Bool eStop);
+
+int32_t HALSIM_RegisterDriverStationFmsAttachedCallback(
+ HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
+void HALSIM_CancelDriverStationFmsAttachedCallback(int32_t uid);
+HAL_Bool HALSIM_GetDriverStationFmsAttached(void);
+void HALSIM_SetDriverStationFmsAttached(HAL_Bool fmsAttached);
+
+int32_t HALSIM_RegisterDriverStationDsAttachedCallback(
+ HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
+void HALSIM_CancelDriverStationDsAttachedCallback(int32_t uid);
+HAL_Bool HALSIM_GetDriverStationDsAttached(void);
+void HALSIM_SetDriverStationDsAttached(HAL_Bool dsAttached);
+
+int32_t HALSIM_RegisterDriverStationAllianceStationIdCallback(
+ HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
+void HALSIM_CancelDriverStationAllianceStationIdCallback(int32_t uid);
+HAL_AllianceStationID HALSIM_GetDriverStationAllianceStationId(void);
+void HALSIM_SetDriverStationAllianceStationId(
+ HAL_AllianceStationID allianceStationId);
+
+int32_t HALSIM_RegisterDriverStationMatchTimeCallback(
+ HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
+void HALSIM_CancelDriverStationMatchTimeCallback(int32_t uid);
+double HALSIM_GetDriverStationMatchTime(void);
+void HALSIM_SetDriverStationMatchTime(double matchTime);
+
+int32_t HALSIM_RegisterJoystickAxesCallback(int32_t joystickNum,
+ HAL_JoystickAxesCallback callback,
+ void* param,
+ HAL_Bool initialNotify);
+void HALSIM_CancelJoystickAxesCallback(int32_t uid);
+void HALSIM_GetJoystickAxes(int32_t joystickNum, HAL_JoystickAxes* axes);
+void HALSIM_SetJoystickAxes(int32_t joystickNum, const HAL_JoystickAxes* axes);
+
+int32_t HALSIM_RegisterJoystickPOVsCallback(int32_t joystickNum,
+ HAL_JoystickPOVsCallback callback,
+ void* param,
+ HAL_Bool initialNotify);
+void HALSIM_CancelJoystickPOVsCallback(int32_t uid);
+void HALSIM_GetJoystickPOVs(int32_t joystickNum, HAL_JoystickPOVs* povs);
+void HALSIM_SetJoystickPOVs(int32_t joystickNum, const HAL_JoystickPOVs* povs);
+
+int32_t HALSIM_RegisterJoystickButtonsCallback(
+ int32_t joystickNum, HAL_JoystickButtonsCallback callback, void* param,
+ HAL_Bool initialNotify);
+void HALSIM_CancelJoystickButtonsCallback(int32_t uid);
+void HALSIM_GetJoystickButtons(int32_t joystickNum,
+ HAL_JoystickButtons* buttons);
+void HALSIM_SetJoystickButtons(int32_t joystickNum,
+ const HAL_JoystickButtons* buttons);
+
+int32_t HALSIM_RegisterJoystickDescriptorCallback(
+ int32_t joystickNum, HAL_JoystickDescriptorCallback callback, void* param,
+ HAL_Bool initialNotify);
+void HALSIM_CancelJoystickDescriptorCallback(int32_t uid);
+void HALSIM_GetJoystickDescriptor(int32_t joystickNum,
+ HAL_JoystickDescriptor* descriptor);
+void HALSIM_SetJoystickDescriptor(int32_t joystickNum,
+ const HAL_JoystickDescriptor* descriptor);
+
+int32_t HALSIM_RegisterJoystickOutputsCallback(
+ int32_t joystickNum, HAL_JoystickOutputsCallback callback, void* param,
+ HAL_Bool initialNotify);
+void HALSIM_CancelJoystickOutputsCallback(int32_t uid);
+void HALSIM_GetJoystickOutputs(int32_t joystickNum, int64_t* outputs,
+ int32_t* leftRumble, int32_t* rightRumble);
+void HALSIM_SetJoystickOutputs(int32_t joystickNum, int64_t outputs,
+ int32_t leftRumble, int32_t rightRumble);
+
+int32_t HALSIM_RegisterMatchInfoCallback(HAL_MatchInfoCallback callback,
+ void* param, HAL_Bool initialNotify);
+void HALSIM_CancelMatchInfoCallback(int32_t uid);
+void HALSIM_GetMatchInfo(HAL_MatchInfo* info);
+void HALSIM_SetMatchInfo(const HAL_MatchInfo* info);
+
+void HALSIM_SetJoystickButton(int32_t stick, int32_t button, HAL_Bool state);
+void HALSIM_SetJoystickAxis(int32_t stick, int32_t axis, double value);
+void HALSIM_SetJoystickPOV(int32_t stick, int32_t pov, int32_t value);
+void HALSIM_SetJoystickButtonsValue(int32_t stick, uint32_t buttons);
+void HALSIM_SetJoystickAxisCount(int32_t stick, int32_t count);
+void HALSIM_SetJoystickPOVCount(int32_t stick, int32_t count);
+void HALSIM_SetJoystickButtonCount(int32_t stick, int32_t count);
+void HALSIM_GetJoystickCounts(int32_t stick, int32_t* axisCount,
+ int32_t* buttonCount, int32_t* povCount);
+
+void HALSIM_SetJoystickIsXbox(int32_t stick, HAL_Bool isXbox);
+void HALSIM_SetJoystickType(int32_t stick, int32_t type);
+void HALSIM_SetJoystickName(int32_t stick, const char* name);
+void HALSIM_SetJoystickAxisType(int32_t stick, int32_t axis, int32_t type);
+
+void HALSIM_SetGameSpecificMessage(const char* message);
+void HALSIM_SetEventName(const char* name);
+void HALSIM_SetMatchType(HAL_MatchType type);
+void HALSIM_SetMatchNumber(int32_t matchNumber);
+void HALSIM_SetReplayNumber(int32_t replayNumber);
+
+void HALSIM_RegisterDriverStationAllCallbacks(HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify);
+
+int32_t HALSIM_RegisterDriverStationNewDataCallback(HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify);
+void HALSIM_CancelDriverStationNewDataCallback(int32_t uid);
+void HALSIM_NotifyDriverStationNewData(void);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/hal/src/main/native/include/mockdata/DutyCycleData.h b/hal/src/main/native/include/hal/simulation/DutyCycleData.h
similarity index 93%
rename from hal/src/main/native/include/mockdata/DutyCycleData.h
rename to hal/src/main/native/include/hal/simulation/DutyCycleData.h
index b97b355..7b191f28 100644
--- a/hal/src/main/native/include/mockdata/DutyCycleData.h
+++ b/hal/src/main/native/include/hal/simulation/DutyCycleData.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2019-2020 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. */
@@ -7,13 +7,15 @@
#pragma once
-#include "NotifyListener.h"
#include "hal/Types.h"
+#include "hal/simulation/NotifyListener.h"
#ifdef __cplusplus
extern "C" {
#endif
+int32_t HALSIM_FindDutyCycleForChannel(int32_t channel);
+
void HALSIM_ResetDutyCycleData(int32_t index);
int32_t HALSIM_GetDutyCycleDigitalChannel(int32_t index);
diff --git a/hal/src/main/native/include/mockdata/EncoderData.h b/hal/src/main/native/include/hal/simulation/EncoderData.h
similarity index 92%
rename from hal/src/main/native/include/mockdata/EncoderData.h
rename to hal/src/main/native/include/hal/simulation/EncoderData.h
index d5d12be..80c142d 100644
--- a/hal/src/main/native/include/mockdata/EncoderData.h
+++ b/hal/src/main/native/include/hal/simulation/EncoderData.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,13 +7,15 @@
#pragma once
-#include "NotifyListener.h"
#include "hal/Types.h"
+#include "hal/simulation/NotifyListener.h"
#ifdef __cplusplus
extern "C" {
#endif
+int32_t HALSIM_FindEncoderForChannel(int32_t channel);
+
void HALSIM_ResetEncoderData(int32_t index);
int32_t HALSIM_GetEncoderDigitalChannelA(int32_t index);
int32_t HALSIM_GetEncoderDigitalChannelB(int32_t index);
@@ -93,6 +95,11 @@
HAL_NotifyCallback callback,
void* param, HAL_Bool initialNotify);
+void HALSIM_SetEncoderDistance(int32_t index, double distance);
+double HALSIM_GetEncoderDistance(int32_t index);
+void HALSIM_SetEncoderRate(int32_t index, double rate);
+double HALSIM_GetEncoderRate(int32_t index);
+
#ifdef __cplusplus
} // extern "C"
#endif
diff --git a/hal/src/main/native/include/mockdata/I2CData.h b/hal/src/main/native/include/hal/simulation/I2CData.h
similarity index 93%
rename from hal/src/main/native/include/mockdata/I2CData.h
rename to hal/src/main/native/include/hal/simulation/I2CData.h
index 32ae3a8..3d72850 100644
--- a/hal/src/main/native/include/mockdata/I2CData.h
+++ b/hal/src/main/native/include/hal/simulation/I2CData.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,8 +7,8 @@
#pragma once
-#include "NotifyListener.h"
#include "hal/Types.h"
+#include "hal/simulation/NotifyListener.h"
#ifdef __cplusplus
extern "C" {
diff --git a/hal/src/main/native/include/mockdata/MockHooks.h b/hal/src/main/native/include/hal/simulation/MockHooks.h
similarity index 76%
rename from hal/src/main/native/include/mockdata/MockHooks.h
rename to hal/src/main/native/include/hal/simulation/MockHooks.h
index 318ff21..cef205e 100644
--- a/hal/src/main/native/include/mockdata/MockHooks.h
+++ b/hal/src/main/native/include/hal/simulation/MockHooks.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,9 +7,11 @@
#pragma once
+#include "hal/HALBase.h"
#include "hal/Types.h"
extern "C" {
+void HALSIM_SetRuntimeType(HAL_RuntimeType type);
void HALSIM_WaitForProgramStart(void);
void HALSIM_SetProgramStarted(void);
HAL_Bool HALSIM_GetProgramStarted(void);
@@ -18,10 +20,14 @@
void HALSIM_ResumeTiming(void);
HAL_Bool HALSIM_IsTimingPaused(void);
void HALSIM_StepTiming(uint64_t delta);
+void HALSIM_StepTimingAsync(uint64_t delta);
typedef int32_t (*HALSIM_SendErrorHandler)(
HAL_Bool isError, int32_t errorCode, HAL_Bool isLVCode, const char* details,
const char* location, const char* callStack, HAL_Bool printMsg);
void HALSIM_SetSendError(HALSIM_SendErrorHandler handler);
+typedef int32_t (*HALSIM_SendConsoleLineHandler)(const char* line);
+void HALSIM_SetSendConsoleLine(HALSIM_SendConsoleLineHandler handler);
+
} // extern "C"
diff --git a/hal/src/main/native/include/mockdata/NotifierData.h b/hal/src/main/native/include/hal/simulation/NotifierData.h
similarity index 91%
rename from hal/src/main/native/include/mockdata/NotifierData.h
rename to hal/src/main/native/include/hal/simulation/NotifierData.h
index b1ed50f..a5b68b6 100644
--- a/hal/src/main/native/include/mockdata/NotifierData.h
+++ b/hal/src/main/native/include/hal/simulation/NotifierData.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2019-2020 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. */
@@ -17,7 +17,7 @@
HAL_NotifierHandle handle;
char name[64];
uint64_t timeout;
- HAL_Bool running;
+ HAL_Bool waitTimeValid;
};
uint64_t HALSIM_GetNextNotifierTimeout(void);
diff --git a/hal/src/main/native/include/mockdata/NotifyListener.h b/hal/src/main/native/include/hal/simulation/NotifyListener.h
similarity index 90%
rename from hal/src/main/native/include/mockdata/NotifyListener.h
rename to hal/src/main/native/include/hal/simulation/NotifyListener.h
index a455803..a1430c4 100644
--- a/hal/src/main/native/include/mockdata/NotifyListener.h
+++ b/hal/src/main/native/include/hal/simulation/NotifyListener.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -31,8 +31,8 @@
explicit operator bool() const { return callback != nullptr; }
- CallbackFunction callback;
- void* param;
+ CallbackFunction callback = nullptr;
+ void* param = nullptr;
};
} // namespace hal
diff --git a/hal/src/main/native/include/mockdata/PCMData.h b/hal/src/main/native/include/hal/simulation/PCMData.h
similarity index 97%
rename from hal/src/main/native/include/mockdata/PCMData.h
rename to hal/src/main/native/include/hal/simulation/PCMData.h
index 66b1ec2..ad2188d 100644
--- a/hal/src/main/native/include/mockdata/PCMData.h
+++ b/hal/src/main/native/include/hal/simulation/PCMData.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,8 +7,8 @@
#pragma once
-#include "NotifyListener.h"
#include "hal/Types.h"
+#include "hal/simulation/NotifyListener.h"
#ifdef __cplusplus
extern "C" {
diff --git a/hal/src/main/native/include/mockdata/PDPData.h b/hal/src/main/native/include/hal/simulation/PDPData.h
similarity index 95%
rename from hal/src/main/native/include/mockdata/PDPData.h
rename to hal/src/main/native/include/hal/simulation/PDPData.h
index 8315e3c..7ec11a4 100644
--- a/hal/src/main/native/include/mockdata/PDPData.h
+++ b/hal/src/main/native/include/hal/simulation/PDPData.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,8 +7,8 @@
#pragma once
-#include "NotifyListener.h"
#include "hal/Types.h"
+#include "hal/simulation/NotifyListener.h"
#ifdef __cplusplus
extern "C" {
diff --git a/hal/src/main/native/include/mockdata/PWMData.h b/hal/src/main/native/include/hal/simulation/PWMData.h
similarity index 96%
rename from hal/src/main/native/include/mockdata/PWMData.h
rename to hal/src/main/native/include/hal/simulation/PWMData.h
index 2a8c63d..a536710 100644
--- a/hal/src/main/native/include/mockdata/PWMData.h
+++ b/hal/src/main/native/include/hal/simulation/PWMData.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,8 +7,8 @@
#pragma once
-#include "NotifyListener.h"
#include "hal/Types.h"
+#include "hal/simulation/NotifyListener.h"
#ifdef __cplusplus
extern "C" {
diff --git a/hal/src/main/native/include/mockdata/RelayData.h b/hal/src/main/native/include/hal/simulation/RelayData.h
similarity index 95%
rename from hal/src/main/native/include/mockdata/RelayData.h
rename to hal/src/main/native/include/hal/simulation/RelayData.h
index c0b853d..1329d29 100644
--- a/hal/src/main/native/include/mockdata/RelayData.h
+++ b/hal/src/main/native/include/hal/simulation/RelayData.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,8 +7,8 @@
#pragma once
-#include "NotifyListener.h"
#include "hal/Types.h"
+#include "hal/simulation/NotifyListener.h"
#ifdef __cplusplus
extern "C" {
diff --git a/hal/src/main/native/include/hal/simulation/RoboRioData.h b/hal/src/main/native/include/hal/simulation/RoboRioData.h
new file mode 100644
index 0000000..49d32f3
--- /dev/null
+++ b/hal/src/main/native/include/hal/simulation/RoboRioData.h
@@ -0,0 +1,126 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2020 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
+
+#include "hal/Types.h"
+#include "hal/simulation/NotifyListener.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void HALSIM_ResetRoboRioData(void);
+int32_t HALSIM_RegisterRoboRioFPGAButtonCallback(HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify);
+void HALSIM_CancelRoboRioFPGAButtonCallback(int32_t uid);
+HAL_Bool HALSIM_GetRoboRioFPGAButton(void);
+void HALSIM_SetRoboRioFPGAButton(HAL_Bool fPGAButton);
+
+int32_t HALSIM_RegisterRoboRioVInVoltageCallback(HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify);
+void HALSIM_CancelRoboRioVInVoltageCallback(int32_t uid);
+double HALSIM_GetRoboRioVInVoltage(void);
+void HALSIM_SetRoboRioVInVoltage(double vInVoltage);
+
+int32_t HALSIM_RegisterRoboRioVInCurrentCallback(HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify);
+void HALSIM_CancelRoboRioVInCurrentCallback(int32_t uid);
+double HALSIM_GetRoboRioVInCurrent(void);
+void HALSIM_SetRoboRioVInCurrent(double vInCurrent);
+
+int32_t HALSIM_RegisterRoboRioUserVoltage6VCallback(HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify);
+void HALSIM_CancelRoboRioUserVoltage6VCallback(int32_t uid);
+double HALSIM_GetRoboRioUserVoltage6V(void);
+void HALSIM_SetRoboRioUserVoltage6V(double userVoltage6V);
+
+int32_t HALSIM_RegisterRoboRioUserCurrent6VCallback(HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify);
+void HALSIM_CancelRoboRioUserCurrent6VCallback(int32_t uid);
+double HALSIM_GetRoboRioUserCurrent6V(void);
+void HALSIM_SetRoboRioUserCurrent6V(double userCurrent6V);
+
+int32_t HALSIM_RegisterRoboRioUserActive6VCallback(HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify);
+void HALSIM_CancelRoboRioUserActive6VCallback(int32_t uid);
+HAL_Bool HALSIM_GetRoboRioUserActive6V(void);
+void HALSIM_SetRoboRioUserActive6V(HAL_Bool userActive6V);
+
+int32_t HALSIM_RegisterRoboRioUserVoltage5VCallback(HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify);
+void HALSIM_CancelRoboRioUserVoltage5VCallback(int32_t uid);
+double HALSIM_GetRoboRioUserVoltage5V(void);
+void HALSIM_SetRoboRioUserVoltage5V(double userVoltage5V);
+
+int32_t HALSIM_RegisterRoboRioUserCurrent5VCallback(HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify);
+void HALSIM_CancelRoboRioUserCurrent5VCallback(int32_t uid);
+double HALSIM_GetRoboRioUserCurrent5V(void);
+void HALSIM_SetRoboRioUserCurrent5V(double userCurrent5V);
+
+int32_t HALSIM_RegisterRoboRioUserActive5VCallback(HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify);
+void HALSIM_CancelRoboRioUserActive5VCallback(int32_t uid);
+HAL_Bool HALSIM_GetRoboRioUserActive5V(void);
+void HALSIM_SetRoboRioUserActive5V(HAL_Bool userActive5V);
+
+int32_t HALSIM_RegisterRoboRioUserVoltage3V3Callback(
+ HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
+void HALSIM_CancelRoboRioUserVoltage3V3Callback(int32_t uid);
+double HALSIM_GetRoboRioUserVoltage3V3(void);
+void HALSIM_SetRoboRioUserVoltage3V3(double userVoltage3V3);
+
+int32_t HALSIM_RegisterRoboRioUserCurrent3V3Callback(
+ HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
+void HALSIM_CancelRoboRioUserCurrent3V3Callback(int32_t uid);
+double HALSIM_GetRoboRioUserCurrent3V3(void);
+void HALSIM_SetRoboRioUserCurrent3V3(double userCurrent3V3);
+
+int32_t HALSIM_RegisterRoboRioUserActive3V3Callback(HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify);
+void HALSIM_CancelRoboRioUserActive3V3Callback(int32_t uid);
+HAL_Bool HALSIM_GetRoboRioUserActive3V3(void);
+void HALSIM_SetRoboRioUserActive3V3(HAL_Bool userActive3V3);
+
+int32_t HALSIM_RegisterRoboRioUserFaults6VCallback(HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify);
+void HALSIM_CancelRoboRioUserFaults6VCallback(int32_t uid);
+int32_t HALSIM_GetRoboRioUserFaults6V(void);
+void HALSIM_SetRoboRioUserFaults6V(int32_t userFaults6V);
+
+int32_t HALSIM_RegisterRoboRioUserFaults5VCallback(HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify);
+void HALSIM_CancelRoboRioUserFaults5VCallback(int32_t uid);
+int32_t HALSIM_GetRoboRioUserFaults5V(void);
+void HALSIM_SetRoboRioUserFaults5V(int32_t userFaults5V);
+
+int32_t HALSIM_RegisterRoboRioUserFaults3V3Callback(HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify);
+void HALSIM_CancelRoboRioUserFaults3V3Callback(int32_t uid);
+int32_t HALSIM_GetRoboRioUserFaults3V3(void);
+void HALSIM_SetRoboRioUserFaults3V3(int32_t userFaults3V3);
+
+void HALSIM_RegisterRoboRioAllCallbacks(HAL_NotifyCallback callback,
+ void* param, HAL_Bool initialNotify);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/hal/src/main/native/include/mockdata/SPIAccelerometerData.h b/hal/src/main/native/include/hal/simulation/SPIAccelerometerData.h
similarity index 96%
rename from hal/src/main/native/include/mockdata/SPIAccelerometerData.h
rename to hal/src/main/native/include/hal/simulation/SPIAccelerometerData.h
index c68da45..6515aa8 100644
--- a/hal/src/main/native/include/mockdata/SPIAccelerometerData.h
+++ b/hal/src/main/native/include/hal/simulation/SPIAccelerometerData.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,8 +7,8 @@
#pragma once
-#include "NotifyListener.h"
#include "hal/Types.h"
+#include "hal/simulation/NotifyListener.h"
#ifdef __cplusplus
extern "C" {
diff --git a/hal/src/main/native/include/mockdata/SPIData.h b/hal/src/main/native/include/hal/simulation/SPIData.h
similarity index 94%
rename from hal/src/main/native/include/mockdata/SPIData.h
rename to hal/src/main/native/include/hal/simulation/SPIData.h
index da21643..149a1ef 100644
--- a/hal/src/main/native/include/mockdata/SPIData.h
+++ b/hal/src/main/native/include/hal/simulation/SPIData.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,8 +7,8 @@
#pragma once
-#include "NotifyListener.h"
#include "hal/Types.h"
+#include "hal/simulation/NotifyListener.h"
typedef void (*HAL_SpiReadAutoReceiveBufferCallback)(const char* name,
void* param,
diff --git a/hal/src/main/native/include/mockdata/SimCallbackRegistry.h b/hal/src/main/native/include/hal/simulation/SimCallbackRegistry.h
similarity index 73%
rename from hal/src/main/native/include/mockdata/SimCallbackRegistry.h
rename to hal/src/main/native/include/hal/simulation/SimCallbackRegistry.h
index 3e1aeb0..31f64ef 100644
--- a/hal/src/main/native/include/mockdata/SimCallbackRegistry.h
+++ b/hal/src/main/native/include/hal/simulation/SimCallbackRegistry.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -14,7 +14,7 @@
#include <wpi/UidVector.h>
#include <wpi/spinlock.h>
-#include "mockdata/NotifyListener.h"
+#include "hal/simulation/NotifyListener.h"
namespace hal {
@@ -30,7 +30,7 @@
public:
void Cancel(int32_t uid) {
std::scoped_lock lock(m_mutex);
- if (m_callbacks) m_callbacks->erase(uid - 1);
+ if (m_callbacks && uid > 0) m_callbacks->erase(uid - 1);
}
void Reset() {
@@ -152,4 +152,42 @@
DATA->LOWERNAME.Cancel(uid); \
}
+/**
+ * Define a stub standard C API for SimCallbackRegistry.
+ *
+ * Functions defined:
+ * - int32 NS_RegisterCAPINAMECallback(
+ * int32_t index, TYPE callback, void* param)
+ * - void NS_CancelCAPINAMECallback(int32_t index, int32_t uid)
+ *
+ * @param TYPE the underlying callback type (e.g. HAL_BufferCallback)
+ * @param NS the "namespace" (e.g. HALSIM)
+ * @param CAPINAME the C API name (usually first letter capitalized)
+ */
+#define HAL_SIMCALLBACKREGISTRY_STUB_CAPI(TYPE, NS, CAPINAME) \
+ int32_t NS##_Register##CAPINAME##Callback(int32_t index, TYPE callback, \
+ void* param) { \
+ return 0; \
+ } \
+ \
+ void NS##_Cancel##CAPINAME##Callback(int32_t index, int32_t uid) {}
+
+/**
+ * Define a stub standard C API for SimCallbackRegistry (no index variant).
+ *
+ * Functions defined:
+ * - int32 NS_RegisterCAPINAMECallback(TYPE callback, void* param)
+ * - void NS_CancelCAPINAMECallback(int32_t uid)
+ *
+ * @param TYPE the underlying callback type (e.g. HAL_BufferCallback)
+ * @param NS the "namespace" (e.g. HALSIM)
+ * @param CAPINAME the C API name (usually first letter capitalized)
+ */
+#define HAL_SIMCALLBACKREGISTRY_STUB_CAPI_NOINDEX(TYPE, NS, CAPINAME) \
+ int32_t NS##_Register##CAPINAME##Callback(TYPE callback, void* param) { \
+ return 0; \
+ } \
+ \
+ void NS##_Cancel##CAPINAME##Callback(int32_t uid) {}
+
} // namespace hal
diff --git a/hal/src/main/native/include/mockdata/SimDataValue.h b/hal/src/main/native/include/hal/simulation/SimDataValue.h
similarity index 67%
rename from hal/src/main/native/include/mockdata/SimDataValue.h
rename to hal/src/main/native/include/hal/simulation/SimDataValue.h
index b6723bb..ff333a5 100644
--- a/hal/src/main/native/include/mockdata/SimDataValue.h
+++ b/hal/src/main/native/include/hal/simulation/SimDataValue.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -13,8 +13,8 @@
#include <wpi/UidVector.h>
#include <wpi/spinlock.h>
-#include "mockdata/NotifyListener.h"
-#include "mockdata/SimCallbackRegistry.h"
+#include "hal/simulation/NotifyListener.h"
+#include "hal/simulation/SimCallbackRegistry.h"
namespace hal {
@@ -53,7 +53,7 @@
lock.unlock();
callback(name, param, &value);
}
- return newUid + 1;
+ return newUid;
}
void DoSet(T value, const char* name) {
@@ -224,4 +224,90 @@
\
void NS##_Set##CAPINAME(TYPE LOWERNAME) { DATA->LOWERNAME = LOWERNAME; }
+/**
+ * Define a stub standard C API for simulation data.
+ *
+ * Functions defined:
+ * - int32 NS_RegisterCAPINAMECallback(
+ * int32_t index, HAL_NotifyCallback callback, void* param,
+ * HAL_Bool initialNotify)
+ * - void NS_CancelCAPINAMECallback(int32_t index, int32_t uid)
+ * - TYPE NS_GetCAPINAME(int32_t index)
+ * - void NS_SetCAPINAME(int32_t index, TYPE value)
+ *
+ * @param TYPE the underlying value type (e.g. double)
+ * @param NS the "namespace" (e.g. HALSIM)
+ * @param CAPINAME the C API name (usually first letter capitalized)
+ * @param RETURN what to return from the Get function
+ */
+#define HAL_SIMDATAVALUE_STUB_CAPI(TYPE, NS, CAPINAME, RETURN) \
+ int32_t NS##_Register##CAPINAME##Callback( \
+ int32_t index, HAL_NotifyCallback callback, void* param, \
+ HAL_Bool initialNotify) { \
+ return 0; \
+ } \
+ \
+ void NS##_Cancel##CAPINAME##Callback(int32_t index, int32_t uid) {} \
+ \
+ TYPE NS##_Get##CAPINAME(int32_t index) { return RETURN; } \
+ \
+ void NS##_Set##CAPINAME(int32_t index, TYPE) {}
+
+/**
+ * Define a stub standard C API for simulation data (channel variant).
+ *
+ * Functions defined:
+ * - int32 NS_RegisterCAPINAMECallback(
+ * int32_t index, int32_t channel, HAL_NotifyCallback callback,
+ * void* param, HAL_Bool initialNotify)
+ * - void NS_CancelCAPINAMECallback(int32_t index, int32_t channel, int32_t uid)
+ * - TYPE NS_GetCAPINAME(int32_t index, int32_t channel)
+ * - void NS_SetCAPINAME(int32_t index, int32_t channel, TYPE value)
+ *
+ * @param TYPE the underlying value type (e.g. double)
+ * @param NS the "namespace" (e.g. HALSIM)
+ * @param CAPINAME the C API name (usually first letter capitalized)
+ * @param RETURN what to return from the Get function
+ */
+#define HAL_SIMDATAVALUE_STUB_CAPI_CHANNEL(TYPE, NS, CAPINAME, RETURN) \
+ int32_t NS##_Register##CAPINAME##Callback( \
+ int32_t index, int32_t channel, HAL_NotifyCallback callback, \
+ void* param, HAL_Bool initialNotify) { \
+ return 0; \
+ } \
+ \
+ void NS##_Cancel##CAPINAME##Callback(int32_t index, int32_t channel, \
+ int32_t uid) {} \
+ \
+ TYPE NS##_Get##CAPINAME(int32_t index, int32_t channel) { return RETURN; } \
+ \
+ void NS##_Set##CAPINAME(int32_t index, int32_t channel, TYPE) {}
+
+/**
+ * Define a stub standard C API for simulation data (no index variant).
+ *
+ * Functions defined:
+ * - int32 NS_RegisterCAPINAMECallback(
+ * HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify)
+ * - void NS_CancelCAPINAMECallback(int32_t uid)
+ * - TYPE NS_GetCAPINAME(void)
+ * - void NS_SetCAPINAME(TYPE value)
+ *
+ * @param TYPE the underlying value type (e.g. double)
+ * @param NS the "namespace" (e.g. HALSIM)
+ * @param CAPINAME the C API name (usually first letter capitalized)
+ * @param RETURN what to return from the Get function
+ */
+#define HAL_SIMDATAVALUE_STUB_CAPI_NOINDEX(TYPE, NS, CAPINAME, RETURN) \
+ int32_t NS##_Register##CAPINAME##Callback( \
+ HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) { \
+ return 0; \
+ } \
+ \
+ void NS##_Cancel##CAPINAME##Callback(int32_t uid) {} \
+ \
+ TYPE NS##_Get##CAPINAME(void) { return RETURN; } \
+ \
+ void NS##_Set##CAPINAME(TYPE) {}
+
} // namespace hal
diff --git a/hal/src/main/native/include/mockdata/SimDeviceData.h b/hal/src/main/native/include/hal/simulation/SimDeviceData.h
similarity index 93%
rename from hal/src/main/native/include/mockdata/SimDeviceData.h
rename to hal/src/main/native/include/hal/simulation/SimDeviceData.h
index 44398d7..e702c5c 100644
--- a/hal/src/main/native/include/mockdata/SimDeviceData.h
+++ b/hal/src/main/native/include/hal/simulation/SimDeviceData.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2019-2020 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. */
@@ -7,7 +7,6 @@
#pragma once
-#include "NotifyListener.h"
#include "hal/Types.h"
#include "hal/Value.h"
@@ -23,6 +22,9 @@
extern "C" {
#endif
+void HALSIM_SetSimDeviceEnabled(const char* prefix, HAL_Bool enabled);
+HAL_Bool HALSIM_IsSimDeviceEnabled(const char* name);
+
int32_t HALSIM_RegisterSimDeviceCreatedCallback(
const char* prefix, void* param, HALSIM_SimDeviceCallback callback,
HAL_Bool initialNotify);
diff --git a/hal/src/main/native/include/mockdata/DriverStationData.h b/hal/src/main/native/include/mockdata/DriverStationData.h
deleted file mode 100644
index 1f69664..0000000
--- a/hal/src/main/native/include/mockdata/DriverStationData.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 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
-
-#include "NotifyListener.h"
-#include "hal/DriverStationTypes.h"
-#include "hal/Types.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void HALSIM_ResetDriverStationData(void);
-int32_t HALSIM_RegisterDriverStationEnabledCallback(HAL_NotifyCallback callback,
- void* param,
- HAL_Bool initialNotify);
-void HALSIM_CancelDriverStationEnabledCallback(int32_t uid);
-HAL_Bool HALSIM_GetDriverStationEnabled(void);
-void HALSIM_SetDriverStationEnabled(HAL_Bool enabled);
-
-int32_t HALSIM_RegisterDriverStationAutonomousCallback(
- HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
-void HALSIM_CancelDriverStationAutonomousCallback(int32_t uid);
-HAL_Bool HALSIM_GetDriverStationAutonomous(void);
-void HALSIM_SetDriverStationAutonomous(HAL_Bool autonomous);
-
-int32_t HALSIM_RegisterDriverStationTestCallback(HAL_NotifyCallback callback,
- void* param,
- HAL_Bool initialNotify);
-void HALSIM_CancelDriverStationTestCallback(int32_t uid);
-HAL_Bool HALSIM_GetDriverStationTest(void);
-void HALSIM_SetDriverStationTest(HAL_Bool test);
-
-int32_t HALSIM_RegisterDriverStationEStopCallback(HAL_NotifyCallback callback,
- void* param,
- HAL_Bool initialNotify);
-void HALSIM_CancelDriverStationEStopCallback(int32_t uid);
-HAL_Bool HALSIM_GetDriverStationEStop(void);
-void HALSIM_SetDriverStationEStop(HAL_Bool eStop);
-
-int32_t HALSIM_RegisterDriverStationFmsAttachedCallback(
- HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
-void HALSIM_CancelDriverStationFmsAttachedCallback(int32_t uid);
-HAL_Bool HALSIM_GetDriverStationFmsAttached(void);
-void HALSIM_SetDriverStationFmsAttached(HAL_Bool fmsAttached);
-
-int32_t HALSIM_RegisterDriverStationDsAttachedCallback(
- HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
-void HALSIM_CancelDriverStationDsAttachedCallback(int32_t uid);
-HAL_Bool HALSIM_GetDriverStationDsAttached(void);
-void HALSIM_SetDriverStationDsAttached(HAL_Bool dsAttached);
-
-int32_t HALSIM_RegisterDriverStationAllianceStationIdCallback(
- HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
-void HALSIM_CancelDriverStationAllianceStationIdCallback(int32_t uid);
-HAL_AllianceStationID HALSIM_GetDriverStationAllianceStationId(void);
-void HALSIM_SetDriverStationAllianceStationId(
- HAL_AllianceStationID allianceStationId);
-
-int32_t HALSIM_RegisterDriverStationMatchTimeCallback(
- HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
-void HALSIM_CancelDriverStationMatchTimeCallback(int32_t uid);
-double HALSIM_GetDriverStationMatchTime(void);
-void HALSIM_SetDriverStationMatchTime(double matchTime);
-
-void HALSIM_SetJoystickAxes(int32_t joystickNum, const HAL_JoystickAxes* axes);
-void HALSIM_SetJoystickPOVs(int32_t joystickNum, const HAL_JoystickPOVs* povs);
-void HALSIM_SetJoystickButtons(int32_t joystickNum,
- const HAL_JoystickButtons* buttons);
-void HALSIM_SetJoystickDescriptor(int32_t joystickNum,
- const HAL_JoystickDescriptor* descriptor);
-
-void HALSIM_GetJoystickOutputs(int32_t joystickNum, int64_t* outputs,
- int32_t* leftRumble, int32_t* rightRumble);
-
-void HALSIM_SetMatchInfo(const HAL_MatchInfo* info);
-
-void HALSIM_RegisterDriverStationAllCallbacks(HAL_NotifyCallback callback,
- void* param,
- HAL_Bool initialNotify);
-
-void HALSIM_NotifyDriverStationNewData(void);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/hal/src/main/native/include/mockdata/RoboRioData.h b/hal/src/main/native/include/mockdata/RoboRioData.h
deleted file mode 100644
index 3acb0ec..0000000
--- a/hal/src/main/native/include/mockdata/RoboRioData.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 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
-
-#include "NotifyListener.h"
-#include "hal/Types.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void HALSIM_ResetRoboRioData(int32_t index);
-int32_t HALSIM_RegisterRoboRioFPGAButtonCallback(int32_t index,
- HAL_NotifyCallback callback,
- void* param,
- HAL_Bool initialNotify);
-void HALSIM_CancelRoboRioFPGAButtonCallback(int32_t index, int32_t uid);
-HAL_Bool HALSIM_GetRoboRioFPGAButton(int32_t index);
-void HALSIM_SetRoboRioFPGAButton(int32_t index, HAL_Bool fPGAButton);
-
-int32_t HALSIM_RegisterRoboRioVInVoltageCallback(int32_t index,
- HAL_NotifyCallback callback,
- void* param,
- HAL_Bool initialNotify);
-void HALSIM_CancelRoboRioVInVoltageCallback(int32_t index, int32_t uid);
-double HALSIM_GetRoboRioVInVoltage(int32_t index);
-void HALSIM_SetRoboRioVInVoltage(int32_t index, double vInVoltage);
-
-int32_t HALSIM_RegisterRoboRioVInCurrentCallback(int32_t index,
- HAL_NotifyCallback callback,
- void* param,
- HAL_Bool initialNotify);
-void HALSIM_CancelRoboRioVInCurrentCallback(int32_t index, int32_t uid);
-double HALSIM_GetRoboRioVInCurrent(int32_t index);
-void HALSIM_SetRoboRioVInCurrent(int32_t index, double vInCurrent);
-
-int32_t HALSIM_RegisterRoboRioUserVoltage6VCallback(int32_t index,
- HAL_NotifyCallback callback,
- void* param,
- HAL_Bool initialNotify);
-void HALSIM_CancelRoboRioUserVoltage6VCallback(int32_t index, int32_t uid);
-double HALSIM_GetRoboRioUserVoltage6V(int32_t index);
-void HALSIM_SetRoboRioUserVoltage6V(int32_t index, double userVoltage6V);
-
-int32_t HALSIM_RegisterRoboRioUserCurrent6VCallback(int32_t index,
- HAL_NotifyCallback callback,
- void* param,
- HAL_Bool initialNotify);
-void HALSIM_CancelRoboRioUserCurrent6VCallback(int32_t index, int32_t uid);
-double HALSIM_GetRoboRioUserCurrent6V(int32_t index);
-void HALSIM_SetRoboRioUserCurrent6V(int32_t index, double userCurrent6V);
-
-int32_t HALSIM_RegisterRoboRioUserActive6VCallback(int32_t index,
- HAL_NotifyCallback callback,
- void* param,
- HAL_Bool initialNotify);
-void HALSIM_CancelRoboRioUserActive6VCallback(int32_t index, int32_t uid);
-HAL_Bool HALSIM_GetRoboRioUserActive6V(int32_t index);
-void HALSIM_SetRoboRioUserActive6V(int32_t index, HAL_Bool userActive6V);
-
-int32_t HALSIM_RegisterRoboRioUserVoltage5VCallback(int32_t index,
- HAL_NotifyCallback callback,
- void* param,
- HAL_Bool initialNotify);
-void HALSIM_CancelRoboRioUserVoltage5VCallback(int32_t index, int32_t uid);
-double HALSIM_GetRoboRioUserVoltage5V(int32_t index);
-void HALSIM_SetRoboRioUserVoltage5V(int32_t index, double userVoltage5V);
-
-int32_t HALSIM_RegisterRoboRioUserCurrent5VCallback(int32_t index,
- HAL_NotifyCallback callback,
- void* param,
- HAL_Bool initialNotify);
-void HALSIM_CancelRoboRioUserCurrent5VCallback(int32_t index, int32_t uid);
-double HALSIM_GetRoboRioUserCurrent5V(int32_t index);
-void HALSIM_SetRoboRioUserCurrent5V(int32_t index, double userCurrent5V);
-
-int32_t HALSIM_RegisterRoboRioUserActive5VCallback(int32_t index,
- HAL_NotifyCallback callback,
- void* param,
- HAL_Bool initialNotify);
-void HALSIM_CancelRoboRioUserActive5VCallback(int32_t index, int32_t uid);
-HAL_Bool HALSIM_GetRoboRioUserActive5V(int32_t index);
-void HALSIM_SetRoboRioUserActive5V(int32_t index, HAL_Bool userActive5V);
-
-int32_t HALSIM_RegisterRoboRioUserVoltage3V3Callback(
- int32_t index, HAL_NotifyCallback callback, void* param,
- HAL_Bool initialNotify);
-void HALSIM_CancelRoboRioUserVoltage3V3Callback(int32_t index, int32_t uid);
-double HALSIM_GetRoboRioUserVoltage3V3(int32_t index);
-void HALSIM_SetRoboRioUserVoltage3V3(int32_t index, double userVoltage3V3);
-
-int32_t HALSIM_RegisterRoboRioUserCurrent3V3Callback(
- int32_t index, HAL_NotifyCallback callback, void* param,
- HAL_Bool initialNotify);
-void HALSIM_CancelRoboRioUserCurrent3V3Callback(int32_t index, int32_t uid);
-double HALSIM_GetRoboRioUserCurrent3V3(int32_t index);
-void HALSIM_SetRoboRioUserCurrent3V3(int32_t index, double userCurrent3V3);
-
-int32_t HALSIM_RegisterRoboRioUserActive3V3Callback(int32_t index,
- HAL_NotifyCallback callback,
- void* param,
- HAL_Bool initialNotify);
-void HALSIM_CancelRoboRioUserActive3V3Callback(int32_t index, int32_t uid);
-HAL_Bool HALSIM_GetRoboRioUserActive3V3(int32_t index);
-void HALSIM_SetRoboRioUserActive3V3(int32_t index, HAL_Bool userActive3V3);
-
-int32_t HALSIM_RegisterRoboRioUserFaults6VCallback(int32_t index,
- HAL_NotifyCallback callback,
- void* param,
- HAL_Bool initialNotify);
-void HALSIM_CancelRoboRioUserFaults6VCallback(int32_t index, int32_t uid);
-int32_t HALSIM_GetRoboRioUserFaults6V(int32_t index);
-void HALSIM_SetRoboRioUserFaults6V(int32_t index, int32_t userFaults6V);
-
-int32_t HALSIM_RegisterRoboRioUserFaults5VCallback(int32_t index,
- HAL_NotifyCallback callback,
- void* param,
- HAL_Bool initialNotify);
-void HALSIM_CancelRoboRioUserFaults5VCallback(int32_t index, int32_t uid);
-int32_t HALSIM_GetRoboRioUserFaults5V(int32_t index);
-void HALSIM_SetRoboRioUserFaults5V(int32_t index, int32_t userFaults5V);
-
-int32_t HALSIM_RegisterRoboRioUserFaults3V3Callback(int32_t index,
- HAL_NotifyCallback callback,
- void* param,
- HAL_Bool initialNotify);
-void HALSIM_CancelRoboRioUserFaults3V3Callback(int32_t index, int32_t uid);
-int32_t HALSIM_GetRoboRioUserFaults3V3(int32_t index);
-void HALSIM_SetRoboRioUserFaults3V3(int32_t index, int32_t userFaults3V3);
-
-void HALSIM_RegisterRoboRioAllCallbacks(int32_t index,
- HAL_NotifyCallback callback,
- void* param, HAL_Bool initialNotify);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/hal/src/main/native/include/simulation/AccelerometerSim.h b/hal/src/main/native/include/simulation/AccelerometerSim.h
deleted file mode 100644
index 07860f0..0000000
--- a/hal/src/main/native/include/simulation/AccelerometerSim.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 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
-
-#include <memory>
-#include <utility>
-
-#include "CallbackStore.h"
-#include "mockdata/AccelerometerData.h"
-
-namespace frc {
-namespace sim {
-class AccelerometerSim {
- public:
- explicit AccelerometerSim(int index) { m_index = index; }
-
- std::unique_ptr<CallbackStore> RegisterActiveCallback(NotifyCallback callback,
- bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelAccelerometerActiveCallback);
- store->SetUid(HALSIM_RegisterAccelerometerActiveCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetActive() const { return HALSIM_GetAccelerometerActive(m_index); }
-
- void SetActive(bool active) {
- HALSIM_SetAccelerometerActive(m_index, active);
- }
-
- std::unique_ptr<CallbackStore> RegisterRangeCallback(NotifyCallback callback,
- bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelAccelerometerRangeCallback);
- store->SetUid(HALSIM_RegisterAccelerometerRangeCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- HAL_AccelerometerRange GetRange() const {
- return HALSIM_GetAccelerometerRange(m_index);
- }
-
- void SetRange(HAL_AccelerometerRange range) {
- HALSIM_SetAccelerometerRange(m_index, range);
- }
-
- std::unique_ptr<CallbackStore> RegisterXCallback(NotifyCallback callback,
- bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelAccelerometerXCallback);
- store->SetUid(HALSIM_RegisterAccelerometerXCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- double GetX() const { return HALSIM_GetAccelerometerX(m_index); }
-
- void SetX(double x) { HALSIM_SetAccelerometerX(m_index, x); }
-
- std::unique_ptr<CallbackStore> RegisterYCallback(NotifyCallback callback,
- bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelAccelerometerYCallback);
- store->SetUid(HALSIM_RegisterAccelerometerYCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- double GetY() const { return HALSIM_GetAccelerometerY(m_index); }
-
- void SetY(double y) { HALSIM_SetAccelerometerY(m_index, y); }
-
- std::unique_ptr<CallbackStore> RegisterZCallback(NotifyCallback callback,
- bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelAccelerometerZCallback);
- store->SetUid(HALSIM_RegisterAccelerometerZCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- double GetZ() const { return HALSIM_GetAccelerometerZ(m_index); }
-
- void SetZ(double z) { HALSIM_SetAccelerometerZ(m_index, z); }
-
- void ResetData() { HALSIM_ResetAccelerometerData(m_index); }
-
- private:
- int m_index;
-};
-} // namespace sim
-} // namespace frc
diff --git a/hal/src/main/native/include/simulation/AnalogGyroSim.h b/hal/src/main/native/include/simulation/AnalogGyroSim.h
deleted file mode 100644
index b2cdb85..0000000
--- a/hal/src/main/native/include/simulation/AnalogGyroSim.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 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
-
-#include <memory>
-#include <utility>
-
-#include "CallbackStore.h"
-#include "mockdata/AnalogGyroData.h"
-
-namespace frc {
-namespace sim {
-class AnalogGyroSim {
- public:
- explicit AnalogGyroSim(int index) { m_index = index; }
-
- std::unique_ptr<CallbackStore> RegisterAngleCallback(NotifyCallback callback,
- bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelAnalogGyroAngleCallback);
- store->SetUid(HALSIM_RegisterAnalogGyroAngleCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- double GetAngle() const { return HALSIM_GetAnalogGyroAngle(m_index); }
-
- void SetAngle(double angle) { HALSIM_SetAnalogGyroAngle(m_index, angle); }
-
- std::unique_ptr<CallbackStore> RegisterRateCallback(NotifyCallback callback,
- bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelAnalogGyroRateCallback);
- store->SetUid(HALSIM_RegisterAnalogGyroRateCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- double GetRate() const { return HALSIM_GetAnalogGyroRate(m_index); }
-
- void SetRate(double rate) { HALSIM_SetAnalogGyroRate(m_index, rate); }
-
- std::unique_ptr<CallbackStore> RegisterInitializedCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelAnalogGyroInitializedCallback);
- store->SetUid(HALSIM_RegisterAnalogGyroInitializedCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetInitialized() const {
- return HALSIM_GetAnalogGyroInitialized(m_index);
- }
-
- void SetInitialized(bool initialized) {
- HALSIM_SetAnalogGyroInitialized(m_index, initialized);
- }
-
- void ResetData() { HALSIM_ResetAnalogGyroData(m_index); }
-
- private:
- int m_index;
-};
-} // namespace sim
-} // namespace frc
diff --git a/hal/src/main/native/include/simulation/AnalogInSim.h b/hal/src/main/native/include/simulation/AnalogInSim.h
deleted file mode 100644
index 2a1bbea..0000000
--- a/hal/src/main/native/include/simulation/AnalogInSim.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 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
-
-#include <memory>
-#include <utility>
-
-#include "CallbackStore.h"
-#include "mockdata/AnalogInData.h"
-
-namespace frc {
-namespace sim {
-class AnalogInSim {
- public:
- explicit AnalogInSim(int index) { m_index = index; }
-
- std::unique_ptr<CallbackStore> RegisterInitializedCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelAnalogInInitializedCallback);
- store->SetUid(HALSIM_RegisterAnalogInInitializedCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetInitialized() const { return HALSIM_GetAnalogInInitialized(m_index); }
-
- void SetInitialized(bool initialized) {
- HALSIM_SetAnalogInInitialized(m_index, initialized);
- }
-
- std::unique_ptr<CallbackStore> RegisterAverageBitsCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelAnalogInAverageBitsCallback);
- store->SetUid(HALSIM_RegisterAnalogInAverageBitsCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- int GetAverageBits() const { return HALSIM_GetAnalogInAverageBits(m_index); }
-
- void SetAverageBits(int averageBits) {
- HALSIM_SetAnalogInAverageBits(m_index, averageBits);
- }
-
- std::unique_ptr<CallbackStore> RegisterOversampleBitsCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelAnalogInOversampleBitsCallback);
- store->SetUid(HALSIM_RegisterAnalogInOversampleBitsCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- int GetOversampleBits() const {
- return HALSIM_GetAnalogInOversampleBits(m_index);
- }
-
- void SetOversampleBits(int oversampleBits) {
- HALSIM_SetAnalogInOversampleBits(m_index, oversampleBits);
- }
-
- std::unique_ptr<CallbackStore> RegisterVoltageCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelAnalogInVoltageCallback);
- store->SetUid(HALSIM_RegisterAnalogInVoltageCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- double GetVoltage() const { return HALSIM_GetAnalogInVoltage(m_index); }
-
- void SetVoltage(double voltage) {
- HALSIM_SetAnalogInVoltage(m_index, voltage);
- }
-
- std::unique_ptr<CallbackStore> RegisterAccumulatorInitializedCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback,
- &HALSIM_CancelAnalogInAccumulatorInitializedCallback);
- store->SetUid(HALSIM_RegisterAnalogInAccumulatorInitializedCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetAccumulatorInitialized() const {
- return HALSIM_GetAnalogInAccumulatorInitialized(m_index);
- }
-
- void SetAccumulatorInitialized(bool accumulatorInitialized) {
- HALSIM_SetAnalogInAccumulatorInitialized(m_index, accumulatorInitialized);
- }
-
- std::unique_ptr<CallbackStore> RegisterAccumulatorValueCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelAnalogInAccumulatorValueCallback);
- store->SetUid(HALSIM_RegisterAnalogInAccumulatorValueCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- int64_t GetAccumulatorValue() const {
- return HALSIM_GetAnalogInAccumulatorValue(m_index);
- }
-
- void SetAccumulatorValue(int64_t accumulatorValue) {
- HALSIM_SetAnalogInAccumulatorValue(m_index, accumulatorValue);
- }
-
- std::unique_ptr<CallbackStore> RegisterAccumulatorCountCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelAnalogInAccumulatorCountCallback);
- store->SetUid(HALSIM_RegisterAnalogInAccumulatorCountCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- int64_t GetAccumulatorCount() const {
- return HALSIM_GetAnalogInAccumulatorCount(m_index);
- }
-
- void SetAccumulatorCount(int64_t accumulatorCount) {
- HALSIM_SetAnalogInAccumulatorCount(m_index, accumulatorCount);
- }
-
- std::unique_ptr<CallbackStore> RegisterAccumulatorCenterCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelAnalogInAccumulatorCenterCallback);
- store->SetUid(HALSIM_RegisterAnalogInAccumulatorCenterCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- int GetAccumulatorCenter() const {
- return HALSIM_GetAnalogInAccumulatorCenter(m_index);
- }
-
- void SetAccumulatorCenter(int accumulatorCenter) {
- HALSIM_SetAnalogInAccumulatorCenter(m_index, accumulatorCenter);
- }
-
- std::unique_ptr<CallbackStore> RegisterAccumulatorDeadbandCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback,
- &HALSIM_CancelAnalogInAccumulatorDeadbandCallback);
- store->SetUid(HALSIM_RegisterAnalogInAccumulatorDeadbandCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- int GetAccumulatorDeadband() const {
- return HALSIM_GetAnalogInAccumulatorDeadband(m_index);
- }
-
- void SetAccumulatorDeadband(int accumulatorDeadband) {
- HALSIM_SetAnalogInAccumulatorDeadband(m_index, accumulatorDeadband);
- }
-
- void ResetData() { HALSIM_ResetAnalogInData(m_index); }
-
- private:
- int m_index;
-};
-} // namespace sim
-} // namespace frc
diff --git a/hal/src/main/native/include/simulation/AnalogOutSim.h b/hal/src/main/native/include/simulation/AnalogOutSim.h
deleted file mode 100644
index 6bb6e5a..0000000
--- a/hal/src/main/native/include/simulation/AnalogOutSim.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 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
-
-#include <memory>
-#include <utility>
-
-#include "CallbackStore.h"
-#include "mockdata/AnalogOutData.h"
-
-namespace frc {
-namespace sim {
-class AnalogOutSim {
- public:
- explicit AnalogOutSim(int index) { m_index = index; }
-
- std::unique_ptr<CallbackStore> RegisterVoltageCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelAnalogOutVoltageCallback);
- store->SetUid(HALSIM_RegisterAnalogOutVoltageCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- double GetVoltage() const { return HALSIM_GetAnalogOutVoltage(m_index); }
-
- void SetVoltage(double voltage) {
- HALSIM_SetAnalogOutVoltage(m_index, voltage);
- }
-
- std::unique_ptr<CallbackStore> RegisterInitializedCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelAnalogOutInitializedCallback);
- store->SetUid(HALSIM_RegisterAnalogOutInitializedCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetInitialized() const {
- return HALSIM_GetAnalogOutInitialized(m_index);
- }
-
- void SetInitialized(bool initialized) {
- HALSIM_SetAnalogOutInitialized(m_index, initialized);
- }
-
- void ResetData() { HALSIM_ResetAnalogOutData(m_index); }
-
- private:
- int m_index;
-};
-} // namespace sim
-} // namespace frc
diff --git a/hal/src/main/native/include/simulation/AnalogTriggerSim.h b/hal/src/main/native/include/simulation/AnalogTriggerSim.h
deleted file mode 100644
index 2c41be1..0000000
--- a/hal/src/main/native/include/simulation/AnalogTriggerSim.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 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
-
-#include <memory>
-#include <utility>
-
-#include "CallbackStore.h"
-#include "mockdata/AnalogTriggerData.h"
-
-namespace frc {
-namespace sim {
-class AnalogTriggerSim {
- public:
- explicit AnalogTriggerSim(int index) { m_index = index; }
-
- std::unique_ptr<CallbackStore> RegisterInitializedCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelAnalogTriggerInitializedCallback);
- store->SetUid(HALSIM_RegisterAnalogTriggerInitializedCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetInitialized() const {
- return HALSIM_GetAnalogTriggerInitialized(m_index);
- }
-
- void SetInitialized(bool initialized) {
- HALSIM_SetAnalogTriggerInitialized(m_index, initialized);
- }
-
- std::unique_ptr<CallbackStore> RegisterTriggerLowerBoundCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback,
- &HALSIM_CancelAnalogTriggerTriggerLowerBoundCallback);
- store->SetUid(HALSIM_RegisterAnalogTriggerTriggerLowerBoundCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- double GetTriggerLowerBound() const {
- return HALSIM_GetAnalogTriggerTriggerLowerBound(m_index);
- }
-
- void SetTriggerLowerBound(double triggerLowerBound) {
- HALSIM_SetAnalogTriggerTriggerLowerBound(m_index, triggerLowerBound);
- }
-
- std::unique_ptr<CallbackStore> RegisterTriggerUpperBoundCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback,
- &HALSIM_CancelAnalogTriggerTriggerUpperBoundCallback);
- store->SetUid(HALSIM_RegisterAnalogTriggerTriggerUpperBoundCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- double GetTriggerUpperBound() const {
- return HALSIM_GetAnalogTriggerTriggerUpperBound(m_index);
- }
-
- void SetTriggerUpperBound(double triggerUpperBound) {
- HALSIM_SetAnalogTriggerTriggerUpperBound(m_index, triggerUpperBound);
- }
-
- void ResetData() { HALSIM_ResetAnalogTriggerData(m_index); }
-
- private:
- int m_index;
-};
-} // namespace sim
-} // namespace frc
diff --git a/hal/src/main/native/include/simulation/CallbackStore.h b/hal/src/main/native/include/simulation/CallbackStore.h
deleted file mode 100644
index b2d4bdf..0000000
--- a/hal/src/main/native/include/simulation/CallbackStore.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 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
-
-#include <functional>
-
-#include <wpi/StringRef.h>
-
-#include "hal/Value.h"
-
-namespace frc {
-namespace sim {
-
-using NotifyCallback = std::function<void(wpi::StringRef, const HAL_Value*)>;
-typedef void (*CancelCallbackFunc)(int32_t index, int32_t uid);
-typedef void (*CancelCallbackNoIndexFunc)(int32_t uid);
-typedef void (*CancelCallbackChannelFunc)(int32_t index, int32_t channel,
- int32_t uid);
-
-void CallbackStoreThunk(const char* name, void* param, const HAL_Value* value);
-
-class CallbackStore {
- public:
- CallbackStore(int32_t i, NotifyCallback cb, CancelCallbackNoIndexFunc ccf) {
- index = i;
- callback = cb;
- this->ccnif = ccf;
- cancelType = NoIndex;
- }
-
- CallbackStore(int32_t i, int32_t u, NotifyCallback cb,
- CancelCallbackFunc ccf) {
- index = i;
- uid = u;
- callback = cb;
- this->ccf = ccf;
- cancelType = Normal;
- }
-
- CallbackStore(int32_t i, int32_t c, int32_t u, NotifyCallback cb,
- CancelCallbackChannelFunc ccf) {
- index = i;
- channel = c;
- uid = u;
- callback = cb;
- this->cccf = ccf;
- cancelType = Channel;
- }
-
- ~CallbackStore() {
- switch (cancelType) {
- case Normal:
- ccf(index, uid);
- break;
- case Channel:
- cccf(index, channel, uid);
- break;
- case NoIndex:
- ccnif(uid);
- break;
- }
- }
-
- void SetUid(int32_t uid) { this->uid = uid; }
-
- friend void CallbackStoreThunk(const char* name, void* param,
- const HAL_Value* value);
-
- private:
- int32_t index;
- int32_t channel;
- int32_t uid;
-
- NotifyCallback callback;
- union {
- CancelCallbackFunc ccf;
- CancelCallbackChannelFunc cccf;
- CancelCallbackNoIndexFunc ccnif;
- };
- enum CancelType { Normal, Channel, NoIndex };
- CancelType cancelType;
-};
-} // namespace sim
-} // namespace frc
diff --git a/hal/src/main/native/include/simulation/DIOSim.h b/hal/src/main/native/include/simulation/DIOSim.h
deleted file mode 100644
index 57079b9..0000000
--- a/hal/src/main/native/include/simulation/DIOSim.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 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
-
-#include <memory>
-#include <utility>
-
-#include "CallbackStore.h"
-#include "mockdata/DIOData.h"
-
-namespace frc {
-namespace sim {
-class DIOSim {
- public:
- explicit DIOSim(int index) { m_index = index; }
-
- std::unique_ptr<CallbackStore> RegisterInitializedCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelDIOInitializedCallback);
- store->SetUid(HALSIM_RegisterDIOInitializedCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetInitialized() const { return HALSIM_GetDIOInitialized(m_index); }
-
- void SetInitialized(bool initialized) {
- HALSIM_SetDIOInitialized(m_index, initialized);
- }
-
- std::unique_ptr<CallbackStore> RegisterValueCallback(NotifyCallback callback,
- bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelDIOValueCallback);
- store->SetUid(HALSIM_RegisterDIOValueCallback(m_index, &CallbackStoreThunk,
- store.get(), initialNotify));
- return store;
- }
-
- bool GetValue() const { return HALSIM_GetDIOValue(m_index); }
-
- void SetValue(bool value) { HALSIM_SetDIOValue(m_index, value); }
-
- std::unique_ptr<CallbackStore> RegisterPulseLengthCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelDIOPulseLengthCallback);
- store->SetUid(HALSIM_RegisterDIOPulseLengthCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- double GetPulseLength() const { return HALSIM_GetDIOPulseLength(m_index); }
-
- void SetPulseLength(double pulseLength) {
- HALSIM_SetDIOPulseLength(m_index, pulseLength);
- }
-
- std::unique_ptr<CallbackStore> RegisterIsInputCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelDIOIsInputCallback);
- store->SetUid(HALSIM_RegisterDIOIsInputCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetIsInput() const { return HALSIM_GetDIOIsInput(m_index); }
-
- void SetIsInput(bool isInput) { HALSIM_SetDIOIsInput(m_index, isInput); }
-
- std::unique_ptr<CallbackStore> RegisterFilterIndexCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelDIOFilterIndexCallback);
- store->SetUid(HALSIM_RegisterDIOFilterIndexCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- int GetFilterIndex() const { return HALSIM_GetDIOFilterIndex(m_index); }
-
- void SetFilterIndex(int filterIndex) {
- HALSIM_SetDIOFilterIndex(m_index, filterIndex);
- }
-
- void ResetData() { HALSIM_ResetDIOData(m_index); }
-
- private:
- int m_index;
-};
-} // namespace sim
-} // namespace frc
diff --git a/hal/src/main/native/include/simulation/DigitalPWMSim.h b/hal/src/main/native/include/simulation/DigitalPWMSim.h
deleted file mode 100644
index 5f5769d..0000000
--- a/hal/src/main/native/include/simulation/DigitalPWMSim.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 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
-
-#include <memory>
-#include <utility>
-
-#include "CallbackStore.h"
-#include "mockdata/DigitalPWMData.h"
-
-namespace frc {
-namespace sim {
-class DigitalPWMSim {
- public:
- explicit DigitalPWMSim(int index) { m_index = index; }
-
- std::unique_ptr<CallbackStore> RegisterInitializedCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelDigitalPWMInitializedCallback);
- store->SetUid(HALSIM_RegisterDigitalPWMInitializedCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetInitialized() const {
- return HALSIM_GetDigitalPWMInitialized(m_index);
- }
-
- void SetInitialized(bool initialized) {
- HALSIM_SetDigitalPWMInitialized(m_index, initialized);
- }
-
- std::unique_ptr<CallbackStore> RegisterDutyCycleCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelDigitalPWMDutyCycleCallback);
- store->SetUid(HALSIM_RegisterDigitalPWMDutyCycleCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- double GetDutyCycle() const { return HALSIM_GetDigitalPWMDutyCycle(m_index); }
-
- void SetDutyCycle(double dutyCycle) {
- HALSIM_SetDigitalPWMDutyCycle(m_index, dutyCycle);
- }
-
- std::unique_ptr<CallbackStore> RegisterPinCallback(NotifyCallback callback,
- bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelDigitalPWMPinCallback);
- store->SetUid(HALSIM_RegisterDigitalPWMPinCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- int GetPin() const { return HALSIM_GetDigitalPWMPin(m_index); }
-
- void SetPin(int pin) { HALSIM_SetDigitalPWMPin(m_index, pin); }
-
- void ResetData() { HALSIM_ResetDigitalPWMData(m_index); }
-
- private:
- int m_index;
-};
-} // namespace sim
-} // namespace frc
diff --git a/hal/src/main/native/include/simulation/DriverStationSim.h b/hal/src/main/native/include/simulation/DriverStationSim.h
deleted file mode 100644
index e5071cc..0000000
--- a/hal/src/main/native/include/simulation/DriverStationSim.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 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
-
-#include <memory>
-#include <utility>
-
-#include "CallbackStore.h"
-#include "mockdata/DriverStationData.h"
-
-namespace frc {
-namespace sim {
-class DriverStationSim {
- public:
- std::unique_ptr<CallbackStore> RegisterEnabledCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- -1, callback, &HALSIM_CancelDriverStationEnabledCallback);
- store->SetUid(HALSIM_RegisterDriverStationEnabledCallback(
- &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetEnabled() const { return HALSIM_GetDriverStationEnabled(); }
-
- void SetEnabled(bool enabled) { HALSIM_SetDriverStationEnabled(enabled); }
-
- std::unique_ptr<CallbackStore> RegisterAutonomousCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- -1, callback, &HALSIM_CancelDriverStationAutonomousCallback);
- store->SetUid(HALSIM_RegisterDriverStationAutonomousCallback(
- &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetAutonomous() const { return HALSIM_GetDriverStationAutonomous(); }
-
- void SetAutonomous(bool autonomous) {
- HALSIM_SetDriverStationAutonomous(autonomous);
- }
-
- std::unique_ptr<CallbackStore> RegisterTestCallback(NotifyCallback callback,
- bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- -1, callback, &HALSIM_CancelDriverStationTestCallback);
- store->SetUid(HALSIM_RegisterDriverStationTestCallback(
- &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetTest() const { return HALSIM_GetDriverStationTest(); }
-
- void SetTest(bool test) { HALSIM_SetDriverStationTest(test); }
-
- std::unique_ptr<CallbackStore> RegisterEStopCallback(NotifyCallback callback,
- bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- -1, callback, &HALSIM_CancelDriverStationEStopCallback);
- store->SetUid(HALSIM_RegisterDriverStationEStopCallback(
- &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetEStop() const { return HALSIM_GetDriverStationEStop(); }
-
- void SetEStop(bool eStop) { HALSIM_SetDriverStationEStop(eStop); }
-
- std::unique_ptr<CallbackStore> RegisterFmsAttachedCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- -1, callback, &HALSIM_CancelDriverStationFmsAttachedCallback);
- store->SetUid(HALSIM_RegisterDriverStationFmsAttachedCallback(
- &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetFmsAttached() const { return HALSIM_GetDriverStationFmsAttached(); }
-
- void SetFmsAttached(bool fmsAttached) {
- HALSIM_SetDriverStationFmsAttached(fmsAttached);
- }
-
- std::unique_ptr<CallbackStore> RegisterDsAttachedCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- -1, callback, &HALSIM_CancelDriverStationDsAttachedCallback);
- store->SetUid(HALSIM_RegisterDriverStationDsAttachedCallback(
- &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetDsAttached() const { return HALSIM_GetDriverStationDsAttached(); }
-
- void SetDsAttached(bool dsAttached) {
- HALSIM_SetDriverStationDsAttached(dsAttached);
- }
-
- void NotifyNewData() { HALSIM_NotifyDriverStationNewData(); }
-
- void ResetData() { HALSIM_ResetDriverStationData(); }
-};
-} // namespace sim
-} // namespace frc
diff --git a/hal/src/main/native/include/simulation/DutyCycleSim.h b/hal/src/main/native/include/simulation/DutyCycleSim.h
deleted file mode 100644
index f55dfc9..0000000
--- a/hal/src/main/native/include/simulation/DutyCycleSim.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 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
-
-#include <memory>
-#include <utility>
-
-#include "CallbackStore.h"
-#include "mockdata/DutyCycleData.h"
-
-namespace frc {
-namespace sim {
-class DutyCycleSim {
- public:
- explicit DutyCycleSim(int index) { m_index = index; }
-
- std::unique_ptr<CallbackStore> RegisterInitializedCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelDutyCycleInitializedCallback);
- store->SetUid(HALSIM_RegisterDutyCycleInitializedCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetInitialized() const {
- return HALSIM_GetDutyCycleInitialized(m_index);
- }
-
- void SetInitialized(bool initialized) {
- HALSIM_SetDutyCycleInitialized(m_index, initialized);
- }
-
- std::unique_ptr<CallbackStore> RegisterFrequencyCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelDutyCycleFrequencyCallback);
- store->SetUid(HALSIM_RegisterDutyCycleFrequencyCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- int GetFrequency() const { return HALSIM_GetDutyCycleFrequency(m_index); }
-
- void SetFrequency(int count) { HALSIM_SetDutyCycleFrequency(m_index, count); }
-
- std::unique_ptr<CallbackStore> RegisterOutputCallback(NotifyCallback callback,
- bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelDutyCycleOutputCallback);
- store->SetUid(HALSIM_RegisterDutyCycleOutputCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- double GetOutput() const { return HALSIM_GetDutyCycleOutput(m_index); }
-
- void SetOutput(double period) { HALSIM_SetDutyCycleOutput(m_index, period); }
-
- void ResetData() { HALSIM_ResetDutyCycleData(m_index); }
-
- private:
- int m_index;
-};
-} // namespace sim
-} // namespace frc
diff --git a/hal/src/main/native/include/simulation/EncoderSim.h b/hal/src/main/native/include/simulation/EncoderSim.h
deleted file mode 100644
index f80e8a8..0000000
--- a/hal/src/main/native/include/simulation/EncoderSim.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 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
-
-#include <memory>
-#include <utility>
-
-#include "CallbackStore.h"
-#include "mockdata/EncoderData.h"
-
-namespace frc {
-namespace sim {
-class EncoderSim {
- public:
- explicit EncoderSim(int index) { m_index = index; }
-
- std::unique_ptr<CallbackStore> RegisterInitializedCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelEncoderInitializedCallback);
- store->SetUid(HALSIM_RegisterEncoderInitializedCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetInitialized() const { return HALSIM_GetEncoderInitialized(m_index); }
-
- void SetInitialized(bool initialized) {
- HALSIM_SetEncoderInitialized(m_index, initialized);
- }
-
- std::unique_ptr<CallbackStore> RegisterCountCallback(NotifyCallback callback,
- bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelEncoderCountCallback);
- store->SetUid(HALSIM_RegisterEncoderCountCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- int GetCount() const { return HALSIM_GetEncoderCount(m_index); }
-
- void SetCount(int count) { HALSIM_SetEncoderCount(m_index, count); }
-
- std::unique_ptr<CallbackStore> RegisterPeriodCallback(NotifyCallback callback,
- bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelEncoderPeriodCallback);
- store->SetUid(HALSIM_RegisterEncoderPeriodCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- double GetPeriod() const { return HALSIM_GetEncoderPeriod(m_index); }
-
- void SetPeriod(double period) { HALSIM_SetEncoderPeriod(m_index, period); }
-
- std::unique_ptr<CallbackStore> RegisterResetCallback(NotifyCallback callback,
- bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelEncoderResetCallback);
- store->SetUid(HALSIM_RegisterEncoderResetCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetReset() const { return HALSIM_GetEncoderReset(m_index); }
-
- void SetReset(bool reset) { HALSIM_SetEncoderReset(m_index, reset); }
-
- std::unique_ptr<CallbackStore> RegisterMaxPeriodCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelEncoderMaxPeriodCallback);
- store->SetUid(HALSIM_RegisterEncoderMaxPeriodCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- double GetMaxPeriod() const { return HALSIM_GetEncoderMaxPeriod(m_index); }
-
- void SetMaxPeriod(double maxPeriod) {
- HALSIM_SetEncoderMaxPeriod(m_index, maxPeriod);
- }
-
- std::unique_ptr<CallbackStore> RegisterDirectionCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelEncoderDirectionCallback);
- store->SetUid(HALSIM_RegisterEncoderDirectionCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetDirection() const { return HALSIM_GetEncoderDirection(m_index); }
-
- void SetDirection(bool direction) {
- HALSIM_SetEncoderDirection(m_index, direction);
- }
-
- std::unique_ptr<CallbackStore> RegisterReverseDirectionCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelEncoderReverseDirectionCallback);
- store->SetUid(HALSIM_RegisterEncoderReverseDirectionCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetReverseDirection() const {
- return HALSIM_GetEncoderReverseDirection(m_index);
- }
-
- void SetReverseDirection(bool reverseDirection) {
- HALSIM_SetEncoderReverseDirection(m_index, reverseDirection);
- }
-
- std::unique_ptr<CallbackStore> RegisterSamplesToAverageCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelEncoderSamplesToAverageCallback);
- store->SetUid(HALSIM_RegisterEncoderSamplesToAverageCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- int GetSamplesToAverage() const {
- return HALSIM_GetEncoderSamplesToAverage(m_index);
- }
-
- void SetSamplesToAverage(int samplesToAverage) {
- HALSIM_SetEncoderSamplesToAverage(m_index, samplesToAverage);
- }
-
- std::unique_ptr<CallbackStore> RegisterDistancePerPulseCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelEncoderDistancePerPulseCallback);
- store->SetUid(HALSIM_RegisterEncoderDistancePerPulseCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- double GetDistancePerPulse() const {
- return HALSIM_GetEncoderDistancePerPulse(m_index);
- }
-
- void SetDistancePerPulse(double distancePerPulse) {
- HALSIM_SetEncoderDistancePerPulse(m_index, distancePerPulse);
- }
-
- void ResetData() { HALSIM_ResetEncoderData(m_index); }
-
- private:
- int m_index;
-};
-} // namespace sim
-} // namespace frc
diff --git a/hal/src/main/native/include/simulation/PCMSim.h b/hal/src/main/native/include/simulation/PCMSim.h
deleted file mode 100644
index b6fcd5a..0000000
--- a/hal/src/main/native/include/simulation/PCMSim.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 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
-
-#include <memory>
-#include <utility>
-
-#include "CallbackStore.h"
-#include "mockdata/PCMData.h"
-
-namespace frc {
-namespace sim {
-class PCMSim {
- public:
- explicit PCMSim(int index) { m_index = index; }
-
- std::unique_ptr<CallbackStore> RegisterSolenoidInitializedCallback(
- int channel, NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, channel, -1, callback,
- &HALSIM_CancelPCMSolenoidInitializedCallback);
- store->SetUid(HALSIM_RegisterPCMSolenoidInitializedCallback(
- m_index, channel, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetSolenoidInitialized(int channel) const {
- return HALSIM_GetPCMSolenoidInitialized(m_index, channel);
- }
-
- void SetSolenoidInitialized(int channel, bool solenoidInitialized) {
- HALSIM_SetPCMSolenoidInitialized(m_index, channel, solenoidInitialized);
- }
-
- std::unique_ptr<CallbackStore> RegisterSolenoidOutputCallback(
- int channel, NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, channel, -1, callback,
- &HALSIM_CancelPCMSolenoidOutputCallback);
- store->SetUid(HALSIM_RegisterPCMSolenoidOutputCallback(
- m_index, channel, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetSolenoidOutput(int channel) const {
- return HALSIM_GetPCMSolenoidOutput(m_index, channel);
- }
-
- void SetSolenoidOutput(int channel, bool solenoidOutput) {
- HALSIM_SetPCMSolenoidOutput(m_index, channel, solenoidOutput);
- }
-
- std::unique_ptr<CallbackStore> RegisterCompressorInitializedCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelPCMCompressorInitializedCallback);
- store->SetUid(HALSIM_RegisterPCMCompressorInitializedCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetCompressorInitialized() const {
- return HALSIM_GetPCMCompressorInitialized(m_index);
- }
-
- void SetCompressorInitialized(bool compressorInitialized) {
- HALSIM_SetPCMCompressorInitialized(m_index, compressorInitialized);
- }
-
- std::unique_ptr<CallbackStore> RegisterCompressorOnCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelPCMCompressorOnCallback);
- store->SetUid(HALSIM_RegisterPCMCompressorOnCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetCompressorOn() const { return HALSIM_GetPCMCompressorOn(m_index); }
-
- void SetCompressorOn(bool compressorOn) {
- HALSIM_SetPCMCompressorOn(m_index, compressorOn);
- }
-
- std::unique_ptr<CallbackStore> RegisterClosedLoopEnabledCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelPCMClosedLoopEnabledCallback);
- store->SetUid(HALSIM_RegisterPCMClosedLoopEnabledCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetClosedLoopEnabled() const {
- return HALSIM_GetPCMClosedLoopEnabled(m_index);
- }
-
- void SetClosedLoopEnabled(bool closedLoopEnabled) {
- HALSIM_SetPCMClosedLoopEnabled(m_index, closedLoopEnabled);
- }
-
- std::unique_ptr<CallbackStore> RegisterPressureSwitchCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelPCMPressureSwitchCallback);
- store->SetUid(HALSIM_RegisterPCMPressureSwitchCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetPressureSwitch() const {
- return HALSIM_GetPCMPressureSwitch(m_index);
- }
-
- void SetPressureSwitch(bool pressureSwitch) {
- HALSIM_SetPCMPressureSwitch(m_index, pressureSwitch);
- }
-
- std::unique_ptr<CallbackStore> RegisterCompressorCurrentCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelPCMCompressorCurrentCallback);
- store->SetUid(HALSIM_RegisterPCMCompressorCurrentCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- double GetCompressorCurrent() const {
- return HALSIM_GetPCMCompressorCurrent(m_index);
- }
-
- void SetCompressorCurrent(double compressorCurrent) {
- HALSIM_SetPCMCompressorCurrent(m_index, compressorCurrent);
- }
-
- uint8_t GetAllSolenoidOutputs() {
- uint8_t ret = 0;
- HALSIM_GetPCMAllSolenoids(m_index, &ret);
- return ret;
- }
-
- void SetAllSolenoidOutputs(uint8_t outputs) {
- HALSIM_SetPCMAllSolenoids(m_index, outputs);
- }
-
- void ResetData() { HALSIM_ResetPCMData(m_index); }
-
- private:
- int m_index;
-};
-} // namespace sim
-} // namespace frc
diff --git a/hal/src/main/native/include/simulation/PDPSim.h b/hal/src/main/native/include/simulation/PDPSim.h
deleted file mode 100644
index 72d8233..0000000
--- a/hal/src/main/native/include/simulation/PDPSim.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 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
-
-#include <memory>
-#include <utility>
-
-#include "CallbackStore.h"
-#include "mockdata/PDPData.h"
-
-namespace frc {
-namespace sim {
-class PDPSim {
- public:
- explicit PDPSim(int index) { m_index = index; }
-
- std::unique_ptr<CallbackStore> RegisterInitializedCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelPDPInitializedCallback);
- store->SetUid(HALSIM_RegisterPDPInitializedCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetInitialized() const { return HALSIM_GetPDPInitialized(m_index); }
-
- void SetInitialized(bool initialized) {
- HALSIM_SetPDPInitialized(m_index, initialized);
- }
-
- std::unique_ptr<CallbackStore> RegisterTemperatureCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelPDPTemperatureCallback);
- store->SetUid(HALSIM_RegisterPDPTemperatureCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- double GetTemperature() const { return HALSIM_GetPDPTemperature(m_index); }
-
- void SetTemperature(double temperature) {
- HALSIM_SetPDPTemperature(m_index, temperature);
- }
-
- std::unique_ptr<CallbackStore> RegisterVoltageCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelPDPVoltageCallback);
- store->SetUid(HALSIM_RegisterPDPVoltageCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- double GetVoltage() const { return HALSIM_GetPDPVoltage(m_index); }
-
- void SetVoltage(double voltage) { HALSIM_SetPDPVoltage(m_index, voltage); }
-
- std::unique_ptr<CallbackStore> RegisterCurrentCallback(
- int channel, NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, channel, -1, callback, &HALSIM_CancelPDPCurrentCallback);
- store->SetUid(HALSIM_RegisterPDPCurrentCallback(
- m_index, channel, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- double GetCurrent(int channel) const {
- return HALSIM_GetPDPCurrent(m_index, channel);
- }
-
- void SetCurrent(int channel, double current) {
- HALSIM_SetPDPCurrent(m_index, channel, current);
- }
-
- void GetAllCurrents(double* currents) {
- HALSIM_GetPDPAllCurrents(m_index, currents);
- }
-
- void SetAllCurrents(const double* currents) {
- HALSIM_SetPDPAllCurrents(m_index, currents);
- }
-
- void ResetData() { HALSIM_ResetPDPData(m_index); }
-
- private:
- int m_index;
-};
-} // namespace sim
-} // namespace frc
diff --git a/hal/src/main/native/include/simulation/PWMSim.h b/hal/src/main/native/include/simulation/PWMSim.h
deleted file mode 100644
index 7aba360..0000000
--- a/hal/src/main/native/include/simulation/PWMSim.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 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
-
-#include <memory>
-#include <utility>
-
-#include "CallbackStore.h"
-#include "mockdata/PWMData.h"
-
-namespace frc {
-namespace sim {
-class PWMSim {
- public:
- explicit PWMSim(int index) { m_index = index; }
-
- std::unique_ptr<CallbackStore> RegisterInitializedCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelPWMInitializedCallback);
- store->SetUid(HALSIM_RegisterPWMInitializedCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetInitialized() const { return HALSIM_GetPWMInitialized(m_index); }
-
- void SetInitialized(bool initialized) {
- HALSIM_SetPWMInitialized(m_index, initialized);
- }
-
- std::unique_ptr<CallbackStore> RegisterRawValueCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelPWMRawValueCallback);
- store->SetUid(HALSIM_RegisterPWMRawValueCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- int GetRawValue() const { return HALSIM_GetPWMRawValue(m_index); }
-
- void SetRawValue(int rawValue) { HALSIM_SetPWMRawValue(m_index, rawValue); }
-
- std::unique_ptr<CallbackStore> RegisterSpeedCallback(NotifyCallback callback,
- bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelPWMSpeedCallback);
- store->SetUid(HALSIM_RegisterPWMSpeedCallback(m_index, &CallbackStoreThunk,
- store.get(), initialNotify));
- return store;
- }
-
- double GetSpeed() const { return HALSIM_GetPWMSpeed(m_index); }
-
- void SetSpeed(double speed) { HALSIM_SetPWMSpeed(m_index, speed); }
-
- std::unique_ptr<CallbackStore> RegisterPositionCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelPWMPositionCallback);
- store->SetUid(HALSIM_RegisterPWMPositionCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- double GetPosition() const { return HALSIM_GetPWMPosition(m_index); }
-
- void SetPosition(double position) {
- HALSIM_SetPWMPosition(m_index, position);
- }
-
- std::unique_ptr<CallbackStore> RegisterPeriodScaleCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelPWMPeriodScaleCallback);
- store->SetUid(HALSIM_RegisterPWMPeriodScaleCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- int GetPeriodScale() const { return HALSIM_GetPWMPeriodScale(m_index); }
-
- void SetPeriodScale(int periodScale) {
- HALSIM_SetPWMPeriodScale(m_index, periodScale);
- }
-
- std::unique_ptr<CallbackStore> RegisterZeroLatchCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelPWMZeroLatchCallback);
- store->SetUid(HALSIM_RegisterPWMZeroLatchCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetZeroLatch() const { return HALSIM_GetPWMZeroLatch(m_index); }
-
- void SetZeroLatch(bool zeroLatch) {
- HALSIM_SetPWMZeroLatch(m_index, zeroLatch);
- }
-
- void ResetData() { HALSIM_ResetPWMData(m_index); }
-
- private:
- int m_index;
-};
-} // namespace sim
-} // namespace frc
diff --git a/hal/src/main/native/include/simulation/RelaySim.h b/hal/src/main/native/include/simulation/RelaySim.h
deleted file mode 100644
index 6958a40..0000000
--- a/hal/src/main/native/include/simulation/RelaySim.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 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
-
-#include <memory>
-#include <utility>
-
-#include "CallbackStore.h"
-#include "mockdata/RelayData.h"
-
-namespace frc {
-namespace sim {
-class RelaySim {
- public:
- explicit RelaySim(int index) { m_index = index; }
-
- std::unique_ptr<CallbackStore> RegisterInitializedForwardCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelRelayInitializedForwardCallback);
- store->SetUid(HALSIM_RegisterRelayInitializedForwardCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetInitializedForward() const {
- return HALSIM_GetRelayInitializedForward(m_index);
- }
-
- void SetInitializedForward(bool initializedForward) {
- HALSIM_SetRelayInitializedForward(m_index, initializedForward);
- }
-
- std::unique_ptr<CallbackStore> RegisterInitializedReverseCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelRelayInitializedReverseCallback);
- store->SetUid(HALSIM_RegisterRelayInitializedReverseCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetInitializedReverse() const {
- return HALSIM_GetRelayInitializedReverse(m_index);
- }
-
- void SetInitializedReverse(bool initializedReverse) {
- HALSIM_SetRelayInitializedReverse(m_index, initializedReverse);
- }
-
- std::unique_ptr<CallbackStore> RegisterForwardCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelRelayForwardCallback);
- store->SetUid(HALSIM_RegisterRelayForwardCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetForward() const { return HALSIM_GetRelayForward(m_index); }
-
- void SetForward(bool forward) { HALSIM_SetRelayForward(m_index, forward); }
-
- std::unique_ptr<CallbackStore> RegisterReverseCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelRelayReverseCallback);
- store->SetUid(HALSIM_RegisterRelayReverseCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetReverse() const { return HALSIM_GetRelayReverse(m_index); }
-
- void SetReverse(bool reverse) { HALSIM_SetRelayReverse(m_index, reverse); }
-
- void ResetData() { HALSIM_ResetRelayData(m_index); }
-
- private:
- int m_index;
-};
-} // namespace sim
-} // namespace frc
diff --git a/hal/src/main/native/include/simulation/RoboRioSim.h b/hal/src/main/native/include/simulation/RoboRioSim.h
deleted file mode 100644
index 9b020ae..0000000
--- a/hal/src/main/native/include/simulation/RoboRioSim.h
+++ /dev/null
@@ -1,273 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 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
-
-#include <memory>
-#include <utility>
-
-#include "CallbackStore.h"
-#include "mockdata/RoboRioData.h"
-
-namespace frc {
-namespace sim {
-class RoboRioSim {
- public:
- explicit RoboRioSim(int index) { m_index = index; }
-
- std::unique_ptr<CallbackStore> RegisterFPGAButtonCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelRoboRioFPGAButtonCallback);
- store->SetUid(HALSIM_RegisterRoboRioFPGAButtonCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetFPGAButton() const { return HALSIM_GetRoboRioFPGAButton(m_index); }
-
- void SetFPGAButton(bool fPGAButton) {
- HALSIM_SetRoboRioFPGAButton(m_index, fPGAButton);
- }
-
- std::unique_ptr<CallbackStore> RegisterVInVoltageCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelRoboRioVInVoltageCallback);
- store->SetUid(HALSIM_RegisterRoboRioVInVoltageCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- double GetVInVoltage() const { return HALSIM_GetRoboRioVInVoltage(m_index); }
-
- void SetVInVoltage(double vInVoltage) {
- HALSIM_SetRoboRioVInVoltage(m_index, vInVoltage);
- }
-
- std::unique_ptr<CallbackStore> RegisterVInCurrentCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelRoboRioVInCurrentCallback);
- store->SetUid(HALSIM_RegisterRoboRioVInCurrentCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- double GetVInCurrent() const { return HALSIM_GetRoboRioVInCurrent(m_index); }
-
- void SetVInCurrent(double vInCurrent) {
- HALSIM_SetRoboRioVInCurrent(m_index, vInCurrent);
- }
-
- std::unique_ptr<CallbackStore> RegisterUserVoltage6VCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelRoboRioUserVoltage6VCallback);
- store->SetUid(HALSIM_RegisterRoboRioUserVoltage6VCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- double GetUserVoltage6V() const {
- return HALSIM_GetRoboRioUserVoltage6V(m_index);
- }
-
- void SetUserVoltage6V(double userVoltage6V) {
- HALSIM_SetRoboRioUserVoltage6V(m_index, userVoltage6V);
- }
-
- std::unique_ptr<CallbackStore> RegisterUserCurrent6VCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelRoboRioUserCurrent6VCallback);
- store->SetUid(HALSIM_RegisterRoboRioUserCurrent6VCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- double GetUserCurrent6V() const {
- return HALSIM_GetRoboRioUserCurrent6V(m_index);
- }
-
- void SetUserCurrent6V(double userCurrent6V) {
- HALSIM_SetRoboRioUserCurrent6V(m_index, userCurrent6V);
- }
-
- std::unique_ptr<CallbackStore> RegisterUserActive6VCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelRoboRioUserActive6VCallback);
- store->SetUid(HALSIM_RegisterRoboRioUserActive6VCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetUserActive6V() const {
- return HALSIM_GetRoboRioUserActive6V(m_index);
- }
-
- void SetUserActive6V(bool userActive6V) {
- HALSIM_SetRoboRioUserActive6V(m_index, userActive6V);
- }
-
- std::unique_ptr<CallbackStore> RegisterUserVoltage5VCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelRoboRioUserVoltage5VCallback);
- store->SetUid(HALSIM_RegisterRoboRioUserVoltage5VCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- double GetUserVoltage5V() const {
- return HALSIM_GetRoboRioUserVoltage5V(m_index);
- }
-
- void SetUserVoltage5V(double userVoltage5V) {
- HALSIM_SetRoboRioUserVoltage5V(m_index, userVoltage5V);
- }
-
- std::unique_ptr<CallbackStore> RegisterUserCurrent5VCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelRoboRioUserCurrent5VCallback);
- store->SetUid(HALSIM_RegisterRoboRioUserCurrent5VCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- double GetUserCurrent5V() const {
- return HALSIM_GetRoboRioUserCurrent5V(m_index);
- }
-
- void SetUserCurrent5V(double userCurrent5V) {
- HALSIM_SetRoboRioUserCurrent5V(m_index, userCurrent5V);
- }
-
- std::unique_ptr<CallbackStore> RegisterUserActive5VCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelRoboRioUserActive5VCallback);
- store->SetUid(HALSIM_RegisterRoboRioUserActive5VCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetUserActive5V() const {
- return HALSIM_GetRoboRioUserActive5V(m_index);
- }
-
- void SetUserActive5V(bool userActive5V) {
- HALSIM_SetRoboRioUserActive5V(m_index, userActive5V);
- }
-
- std::unique_ptr<CallbackStore> RegisterUserVoltage3V3Callback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelRoboRioUserVoltage3V3Callback);
- store->SetUid(HALSIM_RegisterRoboRioUserVoltage3V3Callback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- double GetUserVoltage3V3() const {
- return HALSIM_GetRoboRioUserVoltage3V3(m_index);
- }
-
- void SetUserVoltage3V3(double userVoltage3V3) {
- HALSIM_SetRoboRioUserVoltage3V3(m_index, userVoltage3V3);
- }
-
- std::unique_ptr<CallbackStore> RegisterUserCurrent3V3Callback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelRoboRioUserCurrent3V3Callback);
- store->SetUid(HALSIM_RegisterRoboRioUserCurrent3V3Callback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- double GetUserCurrent3V3() const {
- return HALSIM_GetRoboRioUserCurrent3V3(m_index);
- }
-
- void SetUserCurrent3V3(double userCurrent3V3) {
- HALSIM_SetRoboRioUserCurrent3V3(m_index, userCurrent3V3);
- }
-
- std::unique_ptr<CallbackStore> RegisterUserActive3V3Callback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelRoboRioUserActive3V3Callback);
- store->SetUid(HALSIM_RegisterRoboRioUserActive3V3Callback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetUserActive3V3() const {
- return HALSIM_GetRoboRioUserActive3V3(m_index);
- }
-
- void SetUserActive3V3(bool userActive3V3) {
- HALSIM_SetRoboRioUserActive3V3(m_index, userActive3V3);
- }
-
- std::unique_ptr<CallbackStore> RegisterUserFaults6VCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelRoboRioUserFaults6VCallback);
- store->SetUid(HALSIM_RegisterRoboRioUserFaults6VCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- int GetUserFaults6V() const { return HALSIM_GetRoboRioUserFaults6V(m_index); }
-
- void SetUserFaults6V(int userFaults6V) {
- HALSIM_SetRoboRioUserFaults6V(m_index, userFaults6V);
- }
-
- std::unique_ptr<CallbackStore> RegisterUserFaults5VCallback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelRoboRioUserFaults5VCallback);
- store->SetUid(HALSIM_RegisterRoboRioUserFaults5VCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- int GetUserFaults5V() const { return HALSIM_GetRoboRioUserFaults5V(m_index); }
-
- void SetUserFaults5V(int userFaults5V) {
- HALSIM_SetRoboRioUserFaults5V(m_index, userFaults5V);
- }
-
- std::unique_ptr<CallbackStore> RegisterUserFaults3V3Callback(
- NotifyCallback callback, bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelRoboRioUserFaults3V3Callback);
- store->SetUid(HALSIM_RegisterRoboRioUserFaults3V3Callback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- int GetUserFaults3V3() const {
- return HALSIM_GetRoboRioUserFaults3V3(m_index);
- }
-
- void SetUserFaults3V3(int userFaults3V3) {
- HALSIM_SetRoboRioUserFaults3V3(m_index, userFaults3V3);
- }
-
- void ResetData() { HALSIM_ResetRoboRioData(m_index); }
-
- private:
- int m_index;
-};
-} // namespace sim
-} // namespace frc
diff --git a/hal/src/main/native/include/simulation/SPIAccelerometerSim.h b/hal/src/main/native/include/simulation/SPIAccelerometerSim.h
deleted file mode 100644
index d7795ee..0000000
--- a/hal/src/main/native/include/simulation/SPIAccelerometerSim.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 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
-
-#include <memory>
-#include <utility>
-
-#include "CallbackStore.h"
-#include "mockdata/SPIAccelerometerData.h"
-
-namespace frc {
-namespace sim {
-class SPIAccelerometerSim {
- public:
- explicit SPIAccelerometerSim(int index) { m_index = index; }
-
- std::unique_ptr<CallbackStore> RegisterActiveCallback(NotifyCallback callback,
- bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelSPIAccelerometerActiveCallback);
- store->SetUid(HALSIM_RegisterSPIAccelerometerActiveCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- bool GetActive() const { return HALSIM_GetSPIAccelerometerActive(m_index); }
-
- void SetActive(bool active) {
- HALSIM_SetSPIAccelerometerActive(m_index, active);
- }
-
- std::unique_ptr<CallbackStore> RegisterRangeCallback(NotifyCallback callback,
- bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelSPIAccelerometerRangeCallback);
- store->SetUid(HALSIM_RegisterSPIAccelerometerRangeCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- int GetRange() const { return HALSIM_GetSPIAccelerometerRange(m_index); }
-
- void SetRange(int range) { HALSIM_SetSPIAccelerometerRange(m_index, range); }
-
- std::unique_ptr<CallbackStore> RegisterXCallback(NotifyCallback callback,
- bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelSPIAccelerometerXCallback);
- store->SetUid(HALSIM_RegisterSPIAccelerometerXCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- double GetX() const { return HALSIM_GetSPIAccelerometerX(m_index); }
-
- void SetX(double x) { HALSIM_SetSPIAccelerometerX(m_index, x); }
-
- std::unique_ptr<CallbackStore> RegisterYCallback(NotifyCallback callback,
- bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelSPIAccelerometerYCallback);
- store->SetUid(HALSIM_RegisterSPIAccelerometerYCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- double GetY() const { return HALSIM_GetSPIAccelerometerY(m_index); }
-
- void SetY(double y) { HALSIM_SetSPIAccelerometerY(m_index, y); }
-
- std::unique_ptr<CallbackStore> RegisterZCallback(NotifyCallback callback,
- bool initialNotify) {
- auto store = std::make_unique<CallbackStore>(
- m_index, -1, callback, &HALSIM_CancelSPIAccelerometerZCallback);
- store->SetUid(HALSIM_RegisterSPIAccelerometerZCallback(
- m_index, &CallbackStoreThunk, store.get(), initialNotify));
- return store;
- }
-
- double GetZ() const { return HALSIM_GetSPIAccelerometerZ(m_index); }
-
- void SetZ(double z) { HALSIM_SetSPIAccelerometerZ(m_index, z); }
-
- void ResetData() { HALSIM_ResetSPIAccelerometerData(m_index); }
-
- private:
- int m_index;
-};
-} // namespace sim
-} // namespace frc
diff --git a/hal/src/main/native/include/simulation/SimDeviceSim.h b/hal/src/main/native/include/simulation/SimDeviceSim.h
deleted file mode 100644
index 5705a08..0000000
--- a/hal/src/main/native/include/simulation/SimDeviceSim.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 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
-
-#include <functional>
-#include <memory>
-#include <string>
-#include <utility>
-#include <vector>
-
-#include "CallbackStore.h"
-#include "hal/SimDevice.h"
-#include "mockdata/SimDeviceData.h"
-
-namespace frc {
-namespace sim {
-class SimDeviceSim {
- public:
- explicit SimDeviceSim(const char* name)
- : m_handle{HALSIM_GetSimDeviceHandle(name)} {}
-
- hal::SimValue GetValue(const char* name) const {
- return HALSIM_GetSimValueHandle(m_handle, name);
- }
-
- hal::SimDouble GetDouble(const char* name) const {
- return HALSIM_GetSimValueHandle(m_handle, name);
- }
-
- hal::SimEnum GetEnum(const char* name) const {
- return HALSIM_GetSimValueHandle(m_handle, name);
- }
-
- hal::SimBoolean GetBoolean(const char* name) const {
- return HALSIM_GetSimValueHandle(m_handle, name);
- }
-
- static std::vector<std::string> GetEnumOptions(hal::SimEnum val) {
- int32_t numOptions;
- const char** options = HALSIM_GetSimValueEnumOptions(val, &numOptions);
- std::vector<std::string> rv;
- rv.reserve(numOptions);
- for (int32_t i = 0; i < numOptions; ++i) rv.emplace_back(options[i]);
- return rv;
- }
-
- template <typename F>
- void EnumerateValues(F callback) const {
- return HALSIM_EnumerateSimValues(
- m_handle, &callback,
- [](const char* name, void* param, HAL_SimValueHandle handle,
- HAL_Bool readonly, const struct HAL_Value* value) {
- std::invoke(*static_cast<F*>(param), name, handle, readonly, value);
- });
- }
-
- operator HAL_SimDeviceHandle() const { return m_handle; }
-
- template <typename F>
- static void EnumerateDevices(const char* prefix, F callback) {
- return HALSIM_EnumerateSimDevices(
- prefix, &callback,
- [](const char* name, void* param, HAL_SimDeviceHandle handle) {
- std::invoke(*static_cast<F*>(param), name, handle);
- });
- }
-
- static void ResetData() { HALSIM_ResetSimDeviceData(); }
-
- private:
- HAL_SimDeviceHandle m_handle;
-};
-} // namespace sim
-} // namespace frc
diff --git a/hal/src/main/native/include/simulation/SimHooks.h b/hal/src/main/native/include/simulation/SimHooks.h
deleted file mode 100644
index 537cef3..0000000
--- a/hal/src/main/native/include/simulation/SimHooks.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 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
-
-#include "mockdata/MockHooks.h"
-
-namespace frc {
-namespace sim {
-
-void WaitForProgramStart() { HALSIM_WaitForProgramStart(); }
-
-void SetProgramStarted() { HALSIM_SetProgramStarted(); }
-
-bool GetProgramStarted() { return HALSIM_GetProgramStarted(); }
-
-void RestartTiming() { HALSIM_RestartTiming(); }
-
-} // namespace sim
-} // namespace frc
diff --git a/hal/src/main/native/sim/AnalogGyro.cpp b/hal/src/main/native/sim/AnalogGyro.cpp
index b7d84d9..9666f4a 100644
--- a/hal/src/main/native/sim/AnalogGyro.cpp
+++ b/hal/src/main/native/sim/AnalogGyro.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -7,13 +7,10 @@
#include "hal/AnalogGyro.h"
-#include <chrono>
-#include <thread>
-
-#include "AnalogInternal.h"
#include "HALInitializer.h"
+#include "PortsInternal.h"
#include "hal/AnalogAccumulator.h"
-#include "hal/AnalogInput.h"
+#include "hal/Errors.h"
#include "hal/handles/IndexedHandleResource.h"
#include "mockdata/AnalogGyroDataInternal.h"
diff --git a/hal/src/main/native/sim/AnalogInternal.cpp b/hal/src/main/native/sim/AnalogInternal.cpp
index 1e6a755..820dc97 100644
--- a/hal/src/main/native/sim/AnalogInternal.cpp
+++ b/hal/src/main/native/sim/AnalogInternal.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -8,7 +8,7 @@
#include "AnalogInternal.h"
#include "PortsInternal.h"
-#include "hal/AnalogInput.h"
+#include "hal/handles/IndexedHandleResource.h"
namespace hal {
IndexedHandleResource<HAL_AnalogInputHandle, hal::AnalogPort, kNumAnalogInputs,
diff --git a/hal/src/main/native/sim/AnalogInternal.h b/hal/src/main/native/sim/AnalogInternal.h
index bcc5c95..f4633f9 100644
--- a/hal/src/main/native/sim/AnalogInternal.h
+++ b/hal/src/main/native/sim/AnalogInternal.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -9,10 +9,8 @@
#include <stdint.h>
-#include <memory>
-
#include "PortsInternal.h"
-#include "hal/Ports.h"
+#include "hal/handles/HandlesInternal.h"
#include "hal/handles/IndexedHandleResource.h"
namespace hal {
diff --git a/hal/src/main/native/sim/AnalogTrigger.cpp b/hal/src/main/native/sim/AnalogTrigger.cpp
index 3ddacee..62bfebc 100644
--- a/hal/src/main/native/sim/AnalogTrigger.cpp
+++ b/hal/src/main/native/sim/AnalogTrigger.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -85,6 +85,7 @@
trigger->index = static_cast<uint8_t>(getHandleIndex(handle));
SimAnalogTriggerData[trigger->index].initialized = true;
+ SimAnalogTriggerData[trigger->index].inputPort = analog_port->channel;
trigger->trigState = false;
diff --git a/hal/src/main/native/sim/CANAPI.cpp b/hal/src/main/native/sim/CANAPI.cpp
index 08b0989..c410dea 100644
--- a/hal/src/main/native/sim/CANAPI.cpp
+++ b/hal/src/main/native/sim/CANAPI.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -7,16 +7,13 @@
#include "hal/CANAPI.h"
-#include <atomic>
-#include <ctime>
-
#include <wpi/DenseMap.h>
#include "CANAPIInternal.h"
#include "HALInitializer.h"
#include "hal/CAN.h"
#include "hal/Errors.h"
-#include "hal/HAL.h"
+#include "hal/HALBase.h"
#include "hal/handles/UnlimitedHandleResource.h"
using namespace hal;
diff --git a/hal/src/main/native/sim/CallbackStore.cpp b/hal/src/main/native/sim/CallbackStore.cpp
deleted file mode 100644
index d278b93..0000000
--- a/hal/src/main/native/sim/CallbackStore.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* 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. */
-/*----------------------------------------------------------------------------*/
-
-#include "simulation/CallbackStore.h"
-
-void frc::sim::CallbackStoreThunk(const char* name, void* param,
- const HAL_Value* value) {
- reinterpret_cast<CallbackStore*>(param)->callback(name, value);
-}
diff --git a/hal/src/main/native/sim/Counter.cpp b/hal/src/main/native/sim/Counter.cpp
index 37454d0..f0ea1c4 100644
--- a/hal/src/main/native/sim/Counter.cpp
+++ b/hal/src/main/native/sim/Counter.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -10,7 +10,6 @@
#include "CounterInternal.h"
#include "HALInitializer.h"
#include "PortsInternal.h"
-#include "hal/Errors.h"
#include "hal/handles/HandlesInternal.h"
#include "hal/handles/LimitedHandleResource.h"
diff --git a/hal/src/main/native/sim/DIO.cpp b/hal/src/main/native/sim/DIO.cpp
index 2158136..f6347d9 100644
--- a/hal/src/main/native/sim/DIO.cpp
+++ b/hal/src/main/native/sim/DIO.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -7,8 +7,6 @@
#include "hal/DIO.h"
-#include <cmath>
-
#include "DigitalInternal.h"
#include "HALInitializer.h"
#include "PortsInternal.h"
diff --git a/hal/src/main/native/sim/DigitalInternal.cpp b/hal/src/main/native/sim/DigitalInternal.cpp
index 070754a..db6455a 100644
--- a/hal/src/main/native/sim/DigitalInternal.cpp
+++ b/hal/src/main/native/sim/DigitalInternal.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -7,11 +7,11 @@
#include "DigitalInternal.h"
-#include "ConstantsInternal.h"
#include "PortsInternal.h"
#include "hal/AnalogTrigger.h"
-#include "hal/HAL.h"
-#include "hal/Ports.h"
+#include "hal/Errors.h"
+#include "hal/handles/DigitalHandleResource.h"
+#include "hal/handles/HandlesInternal.h"
namespace hal {
diff --git a/hal/src/main/native/sim/DigitalInternal.h b/hal/src/main/native/sim/DigitalInternal.h
index 9df4c51..d169c8a 100644
--- a/hal/src/main/native/sim/DigitalInternal.h
+++ b/hal/src/main/native/sim/DigitalInternal.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -9,14 +9,9 @@
#include <stdint.h>
-#include <memory>
-
#include "PortsInternal.h"
#include "hal/AnalogTrigger.h"
-#include "hal/Ports.h"
-#include "hal/Types.h"
#include "hal/handles/DigitalHandleResource.h"
-#include "hal/handles/HandlesInternal.h"
namespace hal {
/**
diff --git a/hal/src/main/native/sim/DriverStation.cpp b/hal/src/main/native/sim/DriverStation.cpp
index e8404cf..aef8556 100644
--- a/hal/src/main/native/sim/DriverStation.cpp
+++ b/hal/src/main/native/sim/DriverStation.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -18,10 +18,12 @@
#include <wpi/condition_variable.h>
#include <wpi/mutex.h>
+#include <wpi/raw_ostream.h>
#include "HALInitializer.h"
+#include "hal/cpp/fpga_clock.h"
+#include "hal/simulation/MockHooks.h"
#include "mockdata/DriverStationDataInternal.h"
-#include "mockdata/MockHooks.h"
static wpi::mutex msgMutex;
static wpi::condition_variable* newDSDataAvailableCond;
@@ -29,6 +31,8 @@
static int newDSDataAvailableCounter{0};
static std::atomic_bool isFinalized{false};
static std::atomic<HALSIM_SendErrorHandler> sendErrorHandler{nullptr};
+static std::atomic<HALSIM_SendConsoleLineHandler> sendConsoleLineHandler{
+ nullptr};
namespace hal {
namespace init {
@@ -47,6 +51,10 @@
sendErrorHandler.store(handler);
}
+void HALSIM_SetSendConsoleLine(HALSIM_SendConsoleLineHandler handler) {
+ sendConsoleLineHandler.store(handler);
+}
+
int32_t HAL_SendError(HAL_Bool isError, int32_t errorCode, HAL_Bool isLVCode,
const char* details, const char* location,
const char* callStack, HAL_Bool printMsg) {
@@ -59,18 +67,16 @@
static constexpr int KEEP_MSGS = 5;
std::scoped_lock lock(msgMutex);
static std::string prevMsg[KEEP_MSGS];
- static std::chrono::time_point<std::chrono::steady_clock>
- prevMsgTime[KEEP_MSGS];
+ static fpga_clock::time_point prevMsgTime[KEEP_MSGS];
static bool initialized = false;
if (!initialized) {
for (int i = 0; i < KEEP_MSGS; i++) {
- prevMsgTime[i] =
- std::chrono::steady_clock::now() - std::chrono::seconds(2);
+ prevMsgTime[i] = fpga_clock::now() - std::chrono::seconds(2);
}
initialized = true;
}
- auto curTime = std::chrono::steady_clock::now();
+ auto curTime = fpga_clock::now();
int i;
for (i = 0; i < KEEP_MSGS; ++i) {
if (prevMsg[i] == details) break;
@@ -105,6 +111,16 @@
return retval;
}
+int32_t HAL_SendConsoleLine(const char* line) {
+ auto handler = sendConsoleLineHandler.load();
+ if (handler) {
+ return handler(line);
+ }
+ wpi::outs() << line << "\n";
+ wpi::outs().flush();
+ return 0;
+}
+
int32_t HAL_GetControlWord(HAL_ControlWord* controlWord) {
controlWord->enabled = SimDriverStationData->enabled;
controlWord->autonomous = SimDriverStationData->autonomous;
@@ -201,38 +217,29 @@
// TODO
}
-#ifdef __APPLE__
-static pthread_key_t lastCountKey;
-static pthread_once_t lastCountKeyOnce = PTHREAD_ONCE_INIT;
-
-static void InitLastCountKey(void) {
- pthread_key_create(&lastCountKey, std::free);
-}
-#endif
-
static int& GetThreadLocalLastCount() {
// There is a rollover error condition here. At Packet# = n * (uintmax), this
// will return false when instead it should return true. However, this at a
// 20ms rate occurs once every 2.7 years of DS connected runtime, so not
// worth the cycles to check.
-#ifdef __APPLE__
- pthread_once(&lastCountKeyOnce, InitLastCountKey);
- int* lastCountPtr = static_cast<int*>(pthread_getspecific(lastCountKey));
- if (!lastCountPtr) {
- lastCountPtr = static_cast<int*>(std::malloc(sizeof(int)));
- *lastCountPtr = -1;
- pthread_setspecific(lastCountKey, lastCountPtr);
- }
- int& lastCount = *lastCountPtr;
-#else
- thread_local int lastCount{-1};
-#endif
+ thread_local int lastCount{0};
return lastCount;
}
-HAL_Bool HAL_WaitForCachedControlDataTimeout(double timeout) {
+HAL_Bool HAL_IsNewControlData(void) {
+ std::scoped_lock lock(newDSDataAvailableMutex);
int& lastCount = GetThreadLocalLastCount();
+ int currentCount = newDSDataAvailableCounter;
+ if (lastCount == currentCount) return false;
+ lastCount = currentCount;
+ return true;
+}
+
+void HAL_WaitForDSData(void) { HAL_WaitForDSDataTimeout(0); }
+
+HAL_Bool HAL_WaitForDSDataTimeout(double timeout) {
std::unique_lock lock(newDSDataAvailableMutex);
+ int& lastCount = GetThreadLocalLastCount();
int currentCount = newDSDataAvailableCounter;
if (lastCount != currentCount) {
lastCount = currentCount;
@@ -242,7 +249,6 @@
if (isFinalized.load()) {
return false;
}
-
auto timeoutTime =
std::chrono::steady_clock::now() + std::chrono::duration<double>(timeout);
@@ -256,42 +262,7 @@
newDSDataAvailableCond->wait(lock);
}
}
- return true;
-}
-
-HAL_Bool HAL_IsNewControlData(void) {
- int& lastCount = GetThreadLocalLastCount();
- int currentCount = 0;
- {
- std::scoped_lock lock(newDSDataAvailableMutex);
- currentCount = newDSDataAvailableCounter;
- }
- if (lastCount == currentCount) return false;
- lastCount = currentCount;
- return true;
-}
-
-void HAL_WaitForDSData(void) { HAL_WaitForDSDataTimeout(0); }
-
-HAL_Bool HAL_WaitForDSDataTimeout(double timeout) {
- if (isFinalized.load()) {
- return false;
- }
- auto timeoutTime =
- std::chrono::steady_clock::now() + std::chrono::duration<double>(timeout);
-
- std::unique_lock lock(newDSDataAvailableMutex);
- int currentCount = newDSDataAvailableCounter;
- while (newDSDataAvailableCounter == currentCount) {
- if (timeout > 0) {
- auto timedOut = newDSDataAvailableCond->wait_until(lock, timeoutTime);
- if (timedOut == std::cv_status::timeout) {
- return false;
- }
- } else {
- newDSDataAvailableCond->wait(lock);
- }
- }
+ lastCount = newDSDataAvailableCounter;
return true;
}
@@ -302,6 +273,7 @@
// Since we could get other values, require our specific handle
// to signal our threads
if (refNum != refNumber) return 0;
+ SimDriverStationData->CallNewDataCallbacks();
std::scoped_lock lock(newDSDataAvailableMutex);
// Nofify all threads
newDSDataAvailableCounter++;
diff --git a/hal/src/main/native/sim/Encoder.cpp b/hal/src/main/native/sim/Encoder.cpp
index 36122bf..32416f0 100644
--- a/hal/src/main/native/sim/Encoder.cpp
+++ b/hal/src/main/native/sim/Encoder.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -10,7 +10,6 @@
#include "CounterInternal.h"
#include "HALInitializer.h"
#include "PortsInternal.h"
-#include "hal/Counter.h"
#include "hal/Errors.h"
#include "hal/handles/HandlesInternal.h"
#include "hal/handles/LimitedHandleResource.h"
diff --git a/hal/src/main/native/sim/Extensions.cpp b/hal/src/main/native/sim/Extensions.cpp
index 951ad10..e638d6a 100644
--- a/hal/src/main/native/sim/Extensions.cpp
+++ b/hal/src/main/native/sim/Extensions.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,12 +7,13 @@
#include "hal/Extensions.h"
+#include <vector>
+
#include <wpi/Path.h>
#include <wpi/SmallString.h>
#include <wpi/StringRef.h>
#include <wpi/raw_ostream.h>
-
-#include "hal/HAL.h"
+#include <wpi/spinlock.h>
#if defined(WIN32) || defined(_WIN32)
#include <windows.h>
@@ -23,9 +24,10 @@
#if defined(WIN32) || defined(_WIN32)
#define DELIM ';'
#define HTYPE HMODULE
-#define DLOPEN(a) LoadLibrary(a)
+#define DLOPEN(a) LoadLibraryA(a)
#define DLSYM GetProcAddress
#define DLCLOSE FreeLibrary
+#define DLERROR "error #" << GetLastError()
#else
#define DELIM ':'
#define HTYPE void*
@@ -33,8 +35,14 @@
#define DLOPEN(a) dlopen(a, RTLD_LAZY)
#define DLSYM dlsym
#define DLCLOSE dlclose
+#define DLERROR dlerror()
#endif
+static wpi::recursive_spinlock gExtensionRegistryMutex;
+static std::vector<std::pair<const char*, void*>> gExtensionRegistry;
+static std::vector<std::pair<void*, void (*)(void*, const char*, void*)>>
+ gExtensionListeners;
+
namespace hal {
namespace init {
void InitializeExtensions() {}
@@ -63,14 +71,16 @@
#else
libraryName += ".so";
#endif
- wpi::outs() << "HAL Extensions: Trying modified name: "
- << wpi::sys::path::stem(libraryName);
+ wpi::outs() << "HAL Extensions: Load failed: " << DLERROR
+ << "\nTrying modified name: "
+ << wpi::sys::path::stem(libraryName) << "\n";
wpi::outs().flush();
handle = DLOPEN(libraryName.c_str());
}
#endif
if (!handle) {
- wpi::outs() << "HAL Extensions: Failed to load library\n";
+ wpi::outs() << "HAL Extensions: Failed to load library: " << DLERROR
+ << '\n';
wpi::outs().flush();
return rc;
}
@@ -112,6 +122,22 @@
return rc;
}
+void HAL_RegisterExtension(const char* name, void* data) {
+ std::scoped_lock lock(gExtensionRegistryMutex);
+ gExtensionRegistry.emplace_back(name, data);
+ for (auto&& listener : gExtensionListeners)
+ listener.second(listener.first, name, data);
+}
+
+void HAL_RegisterExtensionListener(void* param,
+ void (*func)(void*, const char* name,
+ void* data)) {
+ std::scoped_lock lock(gExtensionRegistryMutex);
+ gExtensionListeners.emplace_back(param, func);
+ for (auto&& extension : gExtensionRegistry)
+ func(param, extension.first, extension.second);
+}
+
void HAL_SetShowExtensionsNotFoundMessages(HAL_Bool showMessage) {
GetShowNotFoundMessage() = showMessage;
}
diff --git a/hal/src/main/native/sim/HAL.cpp b/hal/src/main/native/sim/HAL.cpp
index 0dda617..64c4a10 100644
--- a/hal/src/main/native/sim/HAL.cpp
+++ b/hal/src/main/native/sim/HAL.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -7,8 +7,16 @@
#include "hal/HAL.h"
+#include <vector>
+
#include <wpi/mutex.h>
#include <wpi/raw_ostream.h>
+#include <wpi/spinlock.h>
+
+#ifdef _WIN32
+#include <Windows.h>
+#pragma comment(lib, "Winmm.lib")
+#endif // _WIN32
#include "ErrorsInternal.h"
#include "HALInitializer.h"
@@ -17,10 +25,15 @@
#include "hal/Errors.h"
#include "hal/Extensions.h"
#include "hal/handles/HandlesInternal.h"
+#include "hal/simulation/DriverStationData.h"
#include "mockdata/RoboRioDataInternal.h"
using namespace hal;
+static HAL_RuntimeType runtimeType{HAL_Mock};
+static wpi::spinlock gOnShutdownMutex;
+static std::vector<std::pair<void*, void (*)(void*)>> gOnShutdown;
+
namespace hal {
namespace init {
void InitializeHAL() {
@@ -53,6 +66,7 @@
InitializeAnalogInput();
InitializeAnalogInternal();
InitializeAnalogOutput();
+ InitializeAnalogTrigger();
InitializeCAN();
InitializeCompressor();
InitializeConstants();
@@ -214,7 +228,9 @@
}
}
-HAL_RuntimeType HAL_GetRuntimeType(void) { return HAL_Mock; }
+HAL_RuntimeType HAL_GetRuntimeType(void) { return runtimeType; }
+
+void HALSIM_SetRuntimeType(HAL_RuntimeType type) { runtimeType = type; }
int32_t HAL_GetFPGAVersion(int32_t* status) {
return 2018; // Automatically script this at some point
@@ -253,7 +269,7 @@
}
HAL_Bool HAL_GetSystemActive(int32_t* status) {
- return true; // Figure out if we need to handle this
+ return HALSIM_GetDriverStationEnabled();
}
HAL_Bool HAL_GetBrownedOut(int32_t* status) {
@@ -274,15 +290,49 @@
hal::init::HAL_IsInitialized.store(true);
- wpi::outs().SetUnbuffered();
- if (HAL_LoadExtensions() < 0) return false;
hal::RestartTiming();
HAL_InitializeDriverStation();
initialized = true;
+
+// Set Timer Precision to 1ms on Windows
+#ifdef _WIN32
+ TIMECAPS tc;
+ if (timeGetDevCaps(&tc, sizeof(tc)) == TIMERR_NOERROR) {
+ UINT target = min(1, tc.wPeriodMin);
+ timeBeginPeriod(target);
+ std::atexit([]() {
+ TIMECAPS tc;
+ if (timeGetDevCaps(&tc, sizeof(tc)) == TIMERR_NOERROR) {
+ UINT target = min(1, tc.wPeriodMin);
+ timeEndPeriod(target);
+ }
+ });
+ }
+#endif // _WIN32
+
+ wpi::outs().SetUnbuffered();
+ if (HAL_LoadExtensions() < 0) return false;
+
return true; // Add initialization if we need to at a later point
}
+void HAL_Shutdown(void) {
+ std::vector<std::pair<void*, void (*)(void*)>> funcs;
+ {
+ std::scoped_lock lock(gOnShutdownMutex);
+ funcs.swap(gOnShutdown);
+ }
+ for (auto&& func : funcs) {
+ func.second(func.first);
+ }
+}
+
+void HAL_OnShutdown(void* param, void (*func)(void*)) {
+ std::scoped_lock lock(gOnShutdownMutex);
+ gOnShutdown.emplace_back(param, func);
+}
+
int64_t HAL_Report(int32_t resource, int32_t instanceNumber, int32_t context,
const char* feature) {
return 0; // Do nothing for now
diff --git a/hal/src/main/native/sim/HALInitializer.cpp b/hal/src/main/native/sim/HALInitializer.cpp
index a0456d4..5c2242b 100644
--- a/hal/src/main/native/sim/HALInitializer.cpp
+++ b/hal/src/main/native/sim/HALInitializer.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2018-2020 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. */
@@ -7,7 +7,7 @@
#include "HALInitializer.h"
-#include "hal/HAL.h"
+#include "hal/HALBase.h"
namespace hal {
namespace init {
diff --git a/hal/src/main/native/sim/HALInitializer.h b/hal/src/main/native/sim/HALInitializer.h
index c08df73..29efac5 100644
--- a/hal/src/main/native/sim/HALInitializer.h
+++ b/hal/src/main/native/sim/HALInitializer.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -48,6 +48,7 @@
extern void InitializeAnalogInput();
extern void InitializeAnalogInternal();
extern void InitializeAnalogOutput();
+extern void InitializeAnalogTrigger();
extern void InitializeCAN();
extern void InitializeCompressor();
extern void InitializeConstants();
diff --git a/hal/src/main/native/sim/Interrupts.cpp b/hal/src/main/native/sim/Interrupts.cpp
index a7dd285..7760f06 100644
--- a/hal/src/main/native/sim/Interrupts.cpp
+++ b/hal/src/main/native/sim/Interrupts.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -566,4 +566,9 @@
interrupt->fireOnDown = fallingEdge;
interrupt->fireOnUp = risingEdge;
}
+
+void HAL_ReleaseWaitingInterrupt(HAL_InterruptHandle interruptHandle,
+ int32_t* status) {
+ // Requires a fairly large rewrite to get working
+}
} // extern "C"
diff --git a/hal/src/main/native/sim/MockHooks.cpp b/hal/src/main/native/sim/MockHooks.cpp
index 59086ae..8fe387f 100644
--- a/hal/src/main/native/sim/MockHooks.cpp
+++ b/hal/src/main/native/sim/MockHooks.cpp
@@ -1,10 +1,11 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
/*----------------------------------------------------------------------------*/
+#include <algorithm>
#include <atomic>
#include <chrono>
#include <cstdio>
@@ -14,45 +15,46 @@
#include "MockHooksInternal.h"
#include "NotifierInternal.h"
+#include "hal/simulation/NotifierData.h"
static std::atomic<bool> programStarted{false};
static std::atomic<uint64_t> programStartTime{0};
static std::atomic<uint64_t> programPauseTime{0};
+static std::atomic<uint64_t> programStepTime{0};
namespace hal {
namespace init {
-void InitializeMockHooks() {}
+void InitializeMockHooks() { wpi::SetNowImpl(GetFPGATime); }
} // namespace init
} // namespace hal
namespace hal {
void RestartTiming() {
- programStartTime = wpi::Now();
+ programStartTime = wpi::NowDefault();
+ programStepTime = 0;
if (programPauseTime != 0) programPauseTime = programStartTime.load();
}
void PauseTiming() {
- if (programPauseTime == 0) programPauseTime = wpi::Now();
+ if (programPauseTime == 0) programPauseTime = wpi::NowDefault();
}
void ResumeTiming() {
if (programPauseTime != 0) {
- programStartTime += wpi::Now() - programPauseTime;
+ programStartTime += wpi::NowDefault() - programPauseTime;
programPauseTime = 0;
}
}
bool IsTimingPaused() { return programPauseTime != 0; }
-void StepTiming(uint64_t delta) {
- if (programPauseTime != 0) programPauseTime += delta;
-}
+void StepTiming(uint64_t delta) { programStepTime += delta; }
-int64_t GetFPGATime() {
+uint64_t GetFPGATime() {
uint64_t curTime = programPauseTime;
- if (curTime == 0) curTime = wpi::Now();
- return curTime - programStartTime;
+ if (curTime == 0) curTime = wpi::NowDefault();
+ return curTime + programStepTime - programStartTime;
}
double GetFPGATimestamp() { return GetFPGATime() * 1.0e-6; }
@@ -92,6 +94,22 @@
HAL_Bool HALSIM_IsTimingPaused(void) { return IsTimingPaused(); }
void HALSIM_StepTiming(uint64_t delta) {
+ WaitNotifiers();
+
+ while (delta > 0) {
+ int32_t status = 0;
+ uint64_t curTime = HAL_GetFPGATime(&status);
+ uint64_t nextTimeout = HALSIM_GetNextNotifierTimeout();
+ uint64_t step = std::min(delta, nextTimeout - curTime);
+
+ StepTiming(step);
+ delta -= step;
+
+ WakeupWaitNotifiers();
+ }
+}
+
+void HALSIM_StepTimingAsync(uint64_t delta) {
StepTiming(delta);
WakeupNotifiers();
}
diff --git a/hal/src/main/native/sim/MockHooksInternal.h b/hal/src/main/native/sim/MockHooksInternal.h
index a69e9bf..c53f120 100644
--- a/hal/src/main/native/sim/MockHooksInternal.h
+++ b/hal/src/main/native/sim/MockHooksInternal.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -9,7 +9,7 @@
#include <stdint.h>
-#include "mockdata/MockHooks.h"
+#include "hal/simulation/MockHooks.h"
namespace hal {
void RestartTiming();
@@ -22,7 +22,7 @@
void StepTiming(uint64_t delta);
-int64_t GetFPGATime();
+uint64_t GetFPGATime();
double GetFPGATimestamp();
diff --git a/hal/src/main/native/sim/Notifier.cpp b/hal/src/main/native/sim/Notifier.cpp
index 211f7b2..a697275 100644
--- a/hal/src/main/native/sim/Notifier.cpp
+++ b/hal/src/main/native/sim/Notifier.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -13,23 +13,26 @@
#include <cstring>
#include <string>
+#include <wpi/SmallVector.h>
#include <wpi/condition_variable.h>
#include <wpi/mutex.h>
-#include <wpi/timestamp.h>
#include "HALInitializer.h"
#include "NotifierInternal.h"
-#include "hal/HAL.h"
+#include "hal/Errors.h"
+#include "hal/HALBase.h"
#include "hal/cpp/fpga_clock.h"
#include "hal/handles/UnlimitedHandleResource.h"
-#include "mockdata/NotifierData.h"
+#include "hal/simulation/NotifierData.h"
namespace {
struct Notifier {
std::string name;
- uint64_t waitTime;
+ uint64_t waitTime = UINT64_MAX;
bool active = true;
- bool running = false;
+ bool waitTimeValid = false; // True if waitTime is set and in the future
+ bool waitingForAlarm = false; // True if in HAL_WaitForNotifierAlarm()
+ uint64_t waitCount = 0; // Counts calls to HAL_WaitForNotifierAlarm()
wpi::mutex mutex;
wpi::condition_variable cond;
};
@@ -37,6 +40,9 @@
using namespace hal;
+static wpi::mutex notifiersWaiterMutex;
+static wpi::condition_variable notifiersWaiterCond;
+
class NotifierHandleContainer
: public UnlimitedHandleResource<HAL_NotifierHandle, Notifier,
HAL_HandleEnum::Notifier> {
@@ -46,10 +52,11 @@
{
std::scoped_lock lock(notifier->mutex);
notifier->active = false;
- notifier->running = false;
+ notifier->waitTimeValid = false;
}
notifier->cond.notify_all(); // wake up any waiting threads
});
+ notifiersWaiterCond.notify_all();
}
};
@@ -76,6 +83,79 @@
notifier->cond.notify_all();
});
}
+
+void WaitNotifiers() {
+ std::unique_lock ulock(notifiersWaiterMutex);
+ wpi::SmallVector<HAL_NotifierHandle, 8> waiters;
+
+ // Wait for all Notifiers to hit HAL_WaitForNotifierAlarm()
+ notifierHandles->ForEach([&](HAL_NotifierHandle handle, Notifier* notifier) {
+ std::scoped_lock lock(notifier->mutex);
+ if (notifier->active && !notifier->waitingForAlarm) {
+ waiters.emplace_back(handle);
+ }
+ });
+ for (;;) {
+ int count = 0;
+ int end = waiters.size();
+ while (count < end) {
+ auto& it = waiters[count];
+ if (auto notifier = notifierHandles->Get(it)) {
+ std::scoped_lock lock(notifier->mutex);
+ if (notifier->active && !notifier->waitingForAlarm) {
+ ++count;
+ continue;
+ }
+ }
+ // No longer need to wait for it, put at end so it can be erased
+ std::swap(it, waiters[--end]);
+ }
+ if (count == 0) break;
+ waiters.resize(count);
+ notifiersWaiterCond.wait_for(ulock, std::chrono::duration<double>(1));
+ }
+}
+
+void WakeupWaitNotifiers() {
+ std::unique_lock ulock(notifiersWaiterMutex);
+ int32_t status = 0;
+ uint64_t curTime = HAL_GetFPGATime(&status);
+ wpi::SmallVector<std::pair<HAL_NotifierHandle, uint64_t>, 8> waiters;
+
+ // Wake up Notifiers that have expired timeouts
+ notifierHandles->ForEach([&](HAL_NotifierHandle handle, Notifier* notifier) {
+ std::scoped_lock lock(notifier->mutex);
+
+ // Only wait for the Notifier if it has a valid timeout that's expired
+ if (notifier->active && notifier->waitTimeValid &&
+ curTime >= notifier->waitTime) {
+ waiters.emplace_back(handle, notifier->waitCount);
+ notifier->cond.notify_all();
+ }
+ });
+ for (;;) {
+ int count = 0;
+ int end = waiters.size();
+ while (count < end) {
+ auto& it = waiters[count];
+ if (auto notifier = notifierHandles->Get(it.first)) {
+ std::scoped_lock lock(notifier->mutex);
+
+ // waitCount is used here instead of waitingForAlarm because we want to
+ // wait until HAL_WaitForNotifierAlarm() is exited, then reentered
+ if (notifier->active && notifier->waitCount == it.second) {
+ ++count;
+ continue;
+ }
+ }
+ // No longer need to wait for it, put at end so it can be erased
+ it.swap(waiters[--end]);
+ }
+ if (count == 0) break;
+ waiters.resize(count);
+ notifiersWaiterCond.wait_for(ulock, std::chrono::duration<double>(1));
+ }
+}
} // namespace hal
extern "C" {
@@ -106,7 +186,7 @@
{
std::scoped_lock lock(notifier->mutex);
notifier->active = false;
- notifier->running = false;
+ notifier->waitTimeValid = false;
}
notifier->cond.notify_all();
}
@@ -119,7 +199,7 @@
{
std::scoped_lock lock(notifier->mutex);
notifier->active = false;
- notifier->running = false;
+ notifier->waitTimeValid = false;
}
notifier->cond.notify_all();
}
@@ -132,7 +212,7 @@
{
std::scoped_lock lock(notifier->mutex);
notifier->waitTime = triggerTime;
- notifier->running = true;
+ notifier->waitTimeValid = (triggerTime != UINT64_MAX);
}
// We wake up any waiters to change how long they're sleeping for
@@ -146,7 +226,7 @@
{
std::scoped_lock lock(notifier->mutex);
- notifier->running = false;
+ notifier->waitTimeValid = false;
}
}
@@ -155,26 +235,31 @@
auto notifier = notifierHandles->Get(notifierHandle);
if (!notifier) return 0;
+ std::unique_lock ulock(notifiersWaiterMutex);
std::unique_lock lock(notifier->mutex);
+ notifier->waitingForAlarm = true;
+ ++notifier->waitCount;
+ ulock.unlock();
+ notifiersWaiterCond.notify_all();
while (notifier->active) {
- double waitTime;
- if (!notifier->running || notifiersPaused) {
- waitTime = (HAL_GetFPGATime(status) * 1e-6) + 1000.0;
- // If not running, wait 1000 seconds
- } else {
- waitTime = notifier->waitTime * 1e-6;
+ uint64_t curTime = HAL_GetFPGATime(status);
+ if (notifier->waitTimeValid && curTime >= notifier->waitTime) {
+ notifier->waitTimeValid = false;
+ notifier->waitingForAlarm = false;
+ return curTime;
}
- auto timeoutTime =
- hal::fpga_clock::epoch() + std::chrono::duration<double>(waitTime);
- notifier->cond.wait_until(lock, timeoutTime);
- if (!notifier->running) continue;
- if (!notifier->active) break;
- uint64_t curTime = HAL_GetFPGATime(status);
- if (curTime < notifier->waitTime) continue;
- notifier->running = false;
- return curTime;
+ double waitDuration;
+ if (!notifier->waitTimeValid || notifiersPaused) {
+ // If not running, wait 1000 seconds
+ waitDuration = 1000.0;
+ } else {
+ waitDuration = (notifier->waitTime - curTime) * 1e-6;
+ }
+
+ notifier->cond.wait_for(lock, std::chrono::duration<double>(waitDuration));
}
+ notifier->waitingForAlarm = false;
return 0;
}
@@ -182,7 +267,8 @@
uint64_t timeout = UINT64_MAX;
notifierHandles->ForEach([&](HAL_NotifierHandle, Notifier* notifier) {
std::scoped_lock lock(notifier->mutex);
- if (notifier->active && notifier->running && timeout > notifier->waitTime)
+ if (notifier->active && notifier->waitTimeValid &&
+ timeout > notifier->waitTime)
timeout = notifier->waitTime;
});
return timeout;
@@ -213,7 +299,7 @@
arr[num].name[sizeof(arr[num].name) - 1] = '\0';
}
arr[num].timeout = notifier->waitTime;
- arr[num].running = notifier->running;
+ arr[num].waitTimeValid = notifier->waitTimeValid;
}
++num;
});
diff --git a/hal/src/main/native/sim/NotifierInternal.h b/hal/src/main/native/sim/NotifierInternal.h
index 84232d2..e6692ca 100644
--- a/hal/src/main/native/sim/NotifierInternal.h
+++ b/hal/src/main/native/sim/NotifierInternal.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2019-2020 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. */
@@ -11,4 +11,6 @@
void PauseNotifiers();
void ResumeNotifiers();
void WakeupNotifiers();
+void WaitNotifiers();
+void WakeupWaitNotifiers();
} // namespace hal
diff --git a/hal/src/main/native/sim/PDP.cpp b/hal/src/main/native/sim/PDP.cpp
index dbe09d4..cc095d0 100644
--- a/hal/src/main/native/sim/PDP.cpp
+++ b/hal/src/main/native/sim/PDP.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -11,7 +11,7 @@
#include "HALInitializer.h"
#include "PortsInternal.h"
#include "hal/CANAPI.h"
-#include "hal/handles/IndexedHandleResource.h"
+#include "hal/Errors.h"
#include "mockdata/PDPDataInternal.h"
using namespace hal;
diff --git a/hal/src/main/native/sim/PortsInternal.h b/hal/src/main/native/sim/PortsInternal.h
index cfbf1e7..d143aca 100644
--- a/hal/src/main/native/sim/PortsInternal.h
+++ b/hal/src/main/native/sim/PortsInternal.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -17,7 +17,7 @@
constexpr int32_t kNumCounters = 8;
constexpr int32_t kNumDigitalHeaders = 10;
constexpr int32_t kNumPWMHeaders = 10;
-constexpr int32_t kNumDigitalChannels = 26;
+constexpr int32_t kNumDigitalChannels = 31;
constexpr int32_t kNumPWMChannels = 20;
constexpr int32_t kNumDigitalPWMOutputs = 6;
constexpr int32_t kNumEncoders = 8;
diff --git a/hal/src/main/native/sim/Power.cpp b/hal/src/main/native/sim/Power.cpp
index 95bb3dd..e8ce710 100644
--- a/hal/src/main/native/sim/Power.cpp
+++ b/hal/src/main/native/sim/Power.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -19,46 +19,42 @@
// TODO: Fix the naming in here
extern "C" {
-double HAL_GetVinVoltage(int32_t* status) {
- return SimRoboRioData[0].vInVoltage;
-}
-double HAL_GetVinCurrent(int32_t* status) {
- return SimRoboRioData[0].vInCurrent;
-}
+double HAL_GetVinVoltage(int32_t* status) { return SimRoboRioData->vInVoltage; }
+double HAL_GetVinCurrent(int32_t* status) { return SimRoboRioData->vInCurrent; }
double HAL_GetUserVoltage6V(int32_t* status) {
- return SimRoboRioData[0].userVoltage6V;
+ return SimRoboRioData->userVoltage6V;
}
double HAL_GetUserCurrent6V(int32_t* status) {
- return SimRoboRioData[0].userCurrent6V;
+ return SimRoboRioData->userCurrent6V;
}
HAL_Bool HAL_GetUserActive6V(int32_t* status) {
- return SimRoboRioData[0].userActive6V;
+ return SimRoboRioData->userActive6V;
}
int32_t HAL_GetUserCurrentFaults6V(int32_t* status) {
- return SimRoboRioData[0].userFaults6V;
+ return SimRoboRioData->userFaults6V;
}
double HAL_GetUserVoltage5V(int32_t* status) {
- return SimRoboRioData[0].userVoltage5V;
+ return SimRoboRioData->userVoltage5V;
}
double HAL_GetUserCurrent5V(int32_t* status) {
- return SimRoboRioData[0].userCurrent5V;
+ return SimRoboRioData->userCurrent5V;
}
HAL_Bool HAL_GetUserActive5V(int32_t* status) {
- return SimRoboRioData[0].userActive5V;
+ return SimRoboRioData->userActive5V;
}
int32_t HAL_GetUserCurrentFaults5V(int32_t* status) {
- return SimRoboRioData[0].userFaults5V;
+ return SimRoboRioData->userFaults5V;
}
double HAL_GetUserVoltage3V3(int32_t* status) {
- return SimRoboRioData[0].userVoltage3V3;
+ return SimRoboRioData->userVoltage3V3;
}
double HAL_GetUserCurrent3V3(int32_t* status) {
- return SimRoboRioData[0].userCurrent3V3;
+ return SimRoboRioData->userCurrent3V3;
}
HAL_Bool HAL_GetUserActive3V3(int32_t* status) {
- return SimRoboRioData[0].userActive3V3;
+ return SimRoboRioData->userActive3V3;
}
int32_t HAL_GetUserCurrentFaults3V3(int32_t* status) {
- return SimRoboRioData[0].userFaults3V3;
+ return SimRoboRioData->userFaults3V3;
}
} // extern "C"
diff --git a/hal/src/main/native/sim/Relay.cpp b/hal/src/main/native/sim/Relay.cpp
index bd1c8a8..acecec4 100644
--- a/hal/src/main/native/sim/Relay.cpp
+++ b/hal/src/main/native/sim/Relay.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -89,8 +89,8 @@
HAL_Bool HAL_CheckRelayChannel(int32_t channel) {
// roboRIO only has 4 headers, and the FPGA has
- // seperate functions for forward and reverse,
- // instead of seperate channel IDs
+ // separate functions for forward and reverse,
+ // instead of separate channel IDs
return channel < kNumRelayHeaders && channel >= 0;
}
diff --git a/hal/src/main/native/sim/Solenoid.cpp b/hal/src/main/native/sim/Solenoid.cpp
index 46bd285..1881a32 100644
--- a/hal/src/main/native/sim/Solenoid.cpp
+++ b/hal/src/main/native/sim/Solenoid.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2016-2020 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. */
@@ -12,7 +12,7 @@
#include "hal/Errors.h"
#include "hal/handles/HandlesInternal.h"
#include "hal/handles/IndexedHandleResource.h"
-#include "mockdata/PCMDataInternal.h"
+#include "hal/simulation/PCMData.h"
namespace {
struct Solenoid {
diff --git a/hal/src/main/native/sim/jni/DriverStationDataJNI.cpp b/hal/src/main/native/sim/jni/DriverStationDataJNI.cpp
deleted file mode 100644
index 82433b3..0000000
--- a/hal/src/main/native/sim/jni/DriverStationDataJNI.cpp
+++ /dev/null
@@ -1,481 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2018-2019 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. */
-/*----------------------------------------------------------------------------*/
-
-#include <jni.h>
-
-#include <cstring>
-
-#include <wpi/jni_util.h>
-
-#include "CallbackStore.h"
-#include "edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI.h"
-#include "mockdata/DriverStationData.h"
-#include "mockdata/MockHooks.h"
-
-using namespace wpi::java;
-
-extern "C" {
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: registerEnabledCallback
- * Signature: (Ljava/lang/Object;Z)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_registerEnabledCallback
- (JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
-{
- return sim::AllocateCallbackNoIndex(
- env, callback, initialNotify,
- &HALSIM_RegisterDriverStationEnabledCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: cancelEnabledCallback
- * Signature: (I)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_cancelEnabledCallback
- (JNIEnv* env, jclass, jint handle)
-{
- return sim::FreeCallbackNoIndex(env, handle,
- &HALSIM_CancelDriverStationEnabledCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: getEnabled
- * Signature: ()Z
- */
-JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_getEnabled
- (JNIEnv*, jclass)
-{
- return HALSIM_GetDriverStationEnabled();
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: setEnabled
- * Signature: (Z)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_setEnabled
- (JNIEnv*, jclass, jboolean value)
-{
- HALSIM_SetDriverStationEnabled(value);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: registerAutonomousCallback
- * Signature: (Ljava/lang/Object;Z)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_registerAutonomousCallback
- (JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
-{
- return sim::AllocateCallbackNoIndex(
- env, callback, initialNotify,
- &HALSIM_RegisterDriverStationAutonomousCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: cancelAutonomousCallback
- * Signature: (I)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_cancelAutonomousCallback
- (JNIEnv* env, jclass, jint handle)
-{
- return sim::FreeCallbackNoIndex(
- env, handle, &HALSIM_CancelDriverStationAutonomousCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: getAutonomous
- * Signature: ()Z
- */
-JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_getAutonomous
- (JNIEnv*, jclass)
-{
- return HALSIM_GetDriverStationAutonomous();
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: setAutonomous
- * Signature: (Z)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_setAutonomous
- (JNIEnv*, jclass, jboolean value)
-{
- HALSIM_SetDriverStationAutonomous(value);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: registerTestCallback
- * Signature: (Ljava/lang/Object;Z)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_registerTestCallback
- (JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
-{
- return sim::AllocateCallbackNoIndex(
- env, callback, initialNotify, &HALSIM_RegisterDriverStationTestCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: cancelTestCallback
- * Signature: (I)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_cancelTestCallback
- (JNIEnv* env, jclass, jint handle)
-{
- return sim::FreeCallbackNoIndex(env, handle,
- &HALSIM_CancelDriverStationTestCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: getTest
- * Signature: ()Z
- */
-JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_getTest
- (JNIEnv*, jclass)
-{
- return HALSIM_GetDriverStationTest();
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: setTest
- * Signature: (Z)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_setTest
- (JNIEnv*, jclass, jboolean value)
-{
- HALSIM_SetDriverStationTest(value);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: registerEStopCallback
- * Signature: (Ljava/lang/Object;Z)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_registerEStopCallback
- (JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
-{
- return sim::AllocateCallbackNoIndex(
- env, callback, initialNotify, &HALSIM_RegisterDriverStationEStopCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: cancelEStopCallback
- * Signature: (I)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_cancelEStopCallback
- (JNIEnv* env, jclass, jint handle)
-{
- return sim::FreeCallbackNoIndex(env, handle,
- &HALSIM_CancelDriverStationEStopCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: getEStop
- * Signature: ()Z
- */
-JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_getEStop
- (JNIEnv*, jclass)
-{
- return HALSIM_GetDriverStationEStop();
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: setEStop
- * Signature: (Z)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_setEStop
- (JNIEnv*, jclass, jboolean value)
-{
- HALSIM_SetDriverStationEStop(value);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: registerFmsAttachedCallback
- * Signature: (Ljava/lang/Object;Z)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_registerFmsAttachedCallback
- (JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
-{
- return sim::AllocateCallbackNoIndex(
- env, callback, initialNotify,
- &HALSIM_RegisterDriverStationFmsAttachedCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: cancelFmsAttachedCallback
- * Signature: (I)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_cancelFmsAttachedCallback
- (JNIEnv* env, jclass, jint handle)
-{
- return sim::FreeCallbackNoIndex(
- env, handle, &HALSIM_CancelDriverStationFmsAttachedCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: getFmsAttached
- * Signature: ()Z
- */
-JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_getFmsAttached
- (JNIEnv*, jclass)
-{
- return HALSIM_GetDriverStationFmsAttached();
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: setFmsAttached
- * Signature: (Z)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_setFmsAttached
- (JNIEnv*, jclass, jboolean value)
-{
- HALSIM_SetDriverStationFmsAttached(value);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: registerDsAttachedCallback
- * Signature: (Ljava/lang/Object;Z)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_registerDsAttachedCallback
- (JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
-{
- return sim::AllocateCallbackNoIndex(
- env, callback, initialNotify,
- &HALSIM_RegisterDriverStationDsAttachedCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: cancelDsAttachedCallback
- * Signature: (I)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_cancelDsAttachedCallback
- (JNIEnv* env, jclass, jint handle)
-{
- return sim::FreeCallbackNoIndex(
- env, handle, &HALSIM_CancelDriverStationDsAttachedCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: getDsAttached
- * Signature: ()Z
- */
-JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_getDsAttached
- (JNIEnv*, jclass)
-{
- return HALSIM_GetDriverStationDsAttached();
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: setDsAttached
- * Signature: (Z)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_setDsAttached
- (JNIEnv*, jclass, jboolean value)
-{
- HALSIM_SetDriverStationDsAttached(value);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: setJoystickAxes
- * Signature: (B[F)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_setJoystickAxes
- (JNIEnv* env, jclass, jbyte joystickNum, jfloatArray axesArray)
-{
- HAL_JoystickAxes axes;
- {
- wpi::java::JFloatArrayRef jArrayRef(env, axesArray);
- auto arrayRef = jArrayRef.array();
- auto arraySize = arrayRef.size();
- int maxCount =
- arraySize < HAL_kMaxJoystickAxes ? arraySize : HAL_kMaxJoystickAxes;
- axes.count = maxCount;
- for (int i = 0; i < maxCount; i++) {
- axes.axes[i] = arrayRef[i];
- }
- }
- HALSIM_SetJoystickAxes(joystickNum, &axes);
- return;
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: setJoystickPOVs
- * Signature: (B[S)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_setJoystickPOVs
- (JNIEnv* env, jclass, jbyte joystickNum, jshortArray povsArray)
-{
- HAL_JoystickPOVs povs;
- {
- wpi::java::JShortArrayRef jArrayRef(env, povsArray);
- auto arrayRef = jArrayRef.array();
- auto arraySize = arrayRef.size();
- int maxCount =
- arraySize < HAL_kMaxJoystickPOVs ? arraySize : HAL_kMaxJoystickPOVs;
- povs.count = maxCount;
- for (int i = 0; i < maxCount; i++) {
- povs.povs[i] = arrayRef[i];
- }
- }
- HALSIM_SetJoystickPOVs(joystickNum, &povs);
- return;
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: setJoystickButtons
- * Signature: (BII)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_setJoystickButtons
- (JNIEnv* env, jclass, jbyte joystickNum, jint buttons, jint count)
-{
- if (count > 32) {
- count = 32;
- }
- HAL_JoystickButtons joystickButtons;
- joystickButtons.count = count;
- joystickButtons.buttons = buttons;
- HALSIM_SetJoystickButtons(joystickNum, &joystickButtons);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: setMatchInfo
- * Signature: (Ljava/lang/String;Ljava/lang/String;III)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_setMatchInfo
- (JNIEnv* env, jclass, jstring eventName, jstring gameSpecificMessage,
- jint matchNumber, jint replayNumber, jint matchType)
-{
- JStringRef eventNameRef{env, eventName};
- JStringRef gameSpecificMessageRef{env, gameSpecificMessage};
-
- HAL_MatchInfo halMatchInfo;
- std::snprintf(halMatchInfo.eventName, sizeof(halMatchInfo.eventName), "%s",
- eventNameRef.c_str());
- std::snprintf(reinterpret_cast<char*>(halMatchInfo.gameSpecificMessage),
- sizeof(halMatchInfo.gameSpecificMessage), "%s",
- gameSpecificMessageRef.c_str());
- halMatchInfo.gameSpecificMessageSize = gameSpecificMessageRef.size();
- halMatchInfo.matchType = (HAL_MatchType)matchType;
- halMatchInfo.matchNumber = matchNumber;
- halMatchInfo.replayNumber = replayNumber;
- HALSIM_SetMatchInfo(&halMatchInfo);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: registerAllCallbacks
- * Signature: (Ljava/lang/Object;Z)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_registerAllCallbacks
- (JNIEnv* env, jclass, jobject callback, jboolean initialNotify)
-{
- sim::AllocateCallbackNoIndex(
- env, callback, initialNotify,
- [](HAL_NotifyCallback cb, void* param, HAL_Bool in) {
- HALSIM_RegisterDriverStationAllCallbacks(cb, param, in);
- return 0;
- });
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: notifyNewData
- * Signature: ()V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_notifyNewData
- (JNIEnv*, jclass)
-{
- HALSIM_NotifyDriverStationNewData();
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: setSendError
- * Signature: (Z)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_setSendError
- (JNIEnv*, jclass, jboolean shouldSend)
-{
- if (shouldSend) {
- HALSIM_SetSendError(nullptr);
- } else {
- HALSIM_SetSendError([](HAL_Bool isError, int32_t errorCode,
- HAL_Bool isLVCode, const char* details,
- const char* location, const char* callStack,
- HAL_Bool printMsg) { return 1; });
- }
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
- * Method: resetData
- * Signature: ()V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_resetData
- (JNIEnv*, jclass)
-{
- HALSIM_ResetDriverStationData();
-}
-
-} // extern "C"
diff --git a/hal/src/main/native/sim/jni/EncoderDataJNI.cpp b/hal/src/main/native/sim/jni/EncoderDataJNI.cpp
deleted file mode 100644
index 8992b0c..0000000
--- a/hal/src/main/native/sim/jni/EncoderDataJNI.cpp
+++ /dev/null
@@ -1,428 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* 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. */
-/*----------------------------------------------------------------------------*/
-
-#include <jni.h>
-
-#include "CallbackStore.h"
-#include "edu_wpi_first_hal_sim_mockdata_EncoderDataJNI.h"
-#include "mockdata/EncoderData.h"
-
-extern "C" {
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: registerInitializedCallback
- * Signature: (ILjava/lang/Object;Z)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_registerInitializedCallback
- (JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
-{
- return sim::AllocateCallback(env, index, callback, initialNotify,
- &HALSIM_RegisterEncoderInitializedCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: cancelInitializedCallback
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_cancelInitializedCallback
- (JNIEnv* env, jclass, jint index, jint handle)
-{
- return sim::FreeCallback(env, handle, index,
- &HALSIM_CancelEncoderInitializedCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: getInitialized
- * Signature: (I)Z
- */
-JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_getInitialized
- (JNIEnv*, jclass, jint index)
-{
- return HALSIM_GetEncoderInitialized(index);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: setInitialized
- * Signature: (IZ)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_setInitialized
- (JNIEnv*, jclass, jint index, jboolean value)
-{
- HALSIM_SetEncoderInitialized(index, value);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: registerCountCallback
- * Signature: (ILjava/lang/Object;Z)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_registerCountCallback
- (JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
-{
- return sim::AllocateCallback(env, index, callback, initialNotify,
- &HALSIM_RegisterEncoderCountCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: cancelCountCallback
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_cancelCountCallback
- (JNIEnv* env, jclass, jint index, jint handle)
-{
- return sim::FreeCallback(env, handle, index,
- &HALSIM_CancelEncoderCountCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: getCount
- * Signature: (I)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_getCount
- (JNIEnv*, jclass, jint index)
-{
- return HALSIM_GetEncoderCount(index);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: setCount
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_setCount
- (JNIEnv*, jclass, jint index, jint value)
-{
- HALSIM_SetEncoderCount(index, value);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: registerPeriodCallback
- * Signature: (ILjava/lang/Object;Z)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_registerPeriodCallback
- (JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
-{
- return sim::AllocateCallback(env, index, callback, initialNotify,
- &HALSIM_RegisterEncoderPeriodCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: cancelPeriodCallback
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_cancelPeriodCallback
- (JNIEnv* env, jclass, jint index, jint handle)
-{
- return sim::FreeCallback(env, handle, index,
- &HALSIM_CancelEncoderPeriodCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: getPeriod
- * Signature: (I)D
- */
-JNIEXPORT jdouble JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_getPeriod
- (JNIEnv*, jclass, jint index)
-{
- return HALSIM_GetEncoderPeriod(index);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: setPeriod
- * Signature: (ID)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_setPeriod
- (JNIEnv*, jclass, jint index, jdouble value)
-{
- HALSIM_SetEncoderPeriod(index, value);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: registerResetCallback
- * Signature: (ILjava/lang/Object;Z)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_registerResetCallback
- (JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
-{
- return sim::AllocateCallback(env, index, callback, initialNotify,
- &HALSIM_RegisterEncoderResetCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: cancelResetCallback
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_cancelResetCallback
- (JNIEnv* env, jclass, jint index, jint handle)
-{
- return sim::FreeCallback(env, handle, index,
- &HALSIM_CancelEncoderResetCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: getReset
- * Signature: (I)Z
- */
-JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_getReset
- (JNIEnv*, jclass, jint index)
-{
- return HALSIM_GetEncoderReset(index);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: setReset
- * Signature: (IZ)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_setReset
- (JNIEnv*, jclass, jint index, jboolean value)
-{
- HALSIM_SetEncoderReset(index, value);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: registerMaxPeriodCallback
- * Signature: (ILjava/lang/Object;Z)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_registerMaxPeriodCallback
- (JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
-{
- return sim::AllocateCallback(env, index, callback, initialNotify,
- &HALSIM_RegisterEncoderMaxPeriodCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: cancelMaxPeriodCallback
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_cancelMaxPeriodCallback
- (JNIEnv* env, jclass, jint index, jint handle)
-{
- return sim::FreeCallback(env, handle, index,
- &HALSIM_CancelEncoderMaxPeriodCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: getMaxPeriod
- * Signature: (I)D
- */
-JNIEXPORT jdouble JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_getMaxPeriod
- (JNIEnv*, jclass, jint index)
-{
- return HALSIM_GetEncoderMaxPeriod(index);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: setMaxPeriod
- * Signature: (ID)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_setMaxPeriod
- (JNIEnv*, jclass, jint index, jdouble value)
-{
- HALSIM_SetEncoderMaxPeriod(index, value);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: registerDirectionCallback
- * Signature: (ILjava/lang/Object;Z)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_registerDirectionCallback
- (JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
-{
- return sim::AllocateCallback(env, index, callback, initialNotify,
- &HALSIM_RegisterEncoderDirectionCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: cancelDirectionCallback
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_cancelDirectionCallback
- (JNIEnv* env, jclass, jint index, jint handle)
-{
- return sim::FreeCallback(env, handle, index,
- &HALSIM_CancelEncoderDirectionCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: getDirection
- * Signature: (I)Z
- */
-JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_getDirection
- (JNIEnv*, jclass, jint index)
-{
- return HALSIM_GetEncoderDirection(index);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: setDirection
- * Signature: (IZ)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_setDirection
- (JNIEnv*, jclass, jint index, jboolean value)
-{
- HALSIM_SetEncoderDirection(index, value);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: registerReverseDirectionCallback
- * Signature: (ILjava/lang/Object;Z)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_registerReverseDirectionCallback
- (JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
-{
- return sim::AllocateCallback(env, index, callback, initialNotify,
- &HALSIM_RegisterEncoderReverseDirectionCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: cancelReverseDirectionCallback
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_cancelReverseDirectionCallback
- (JNIEnv* env, jclass, jint index, jint handle)
-{
- return sim::FreeCallback(env, handle, index,
- &HALSIM_CancelEncoderReverseDirectionCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: getReverseDirection
- * Signature: (I)Z
- */
-JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_getReverseDirection
- (JNIEnv*, jclass, jint index)
-{
- return HALSIM_GetEncoderReverseDirection(index);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: setReverseDirection
- * Signature: (IZ)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_setReverseDirection
- (JNIEnv*, jclass, jint index, jboolean value)
-{
- HALSIM_SetEncoderReverseDirection(index, value);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: registerSamplesToAverageCallback
- * Signature: (ILjava/lang/Object;Z)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_registerSamplesToAverageCallback
- (JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
-{
- return sim::AllocateCallback(env, index, callback, initialNotify,
- &HALSIM_RegisterEncoderSamplesToAverageCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: cancelSamplesToAverageCallback
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_cancelSamplesToAverageCallback
- (JNIEnv* env, jclass, jint index, jint handle)
-{
- return sim::FreeCallback(env, handle, index,
- &HALSIM_CancelEncoderSamplesToAverageCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: getSamplesToAverage
- * Signature: (I)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_getSamplesToAverage
- (JNIEnv*, jclass, jint index)
-{
- return HALSIM_GetEncoderSamplesToAverage(index);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: setSamplesToAverage
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_setSamplesToAverage
- (JNIEnv*, jclass, jint index, jint value)
-{
- HALSIM_SetEncoderSamplesToAverage(index, value);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_EncoderDataJNI
- * Method: resetData
- * Signature: (I)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_resetData
- (JNIEnv*, jclass, jint index)
-{
- HALSIM_ResetEncoderData(index);
-}
-
-} // extern "C"
diff --git a/hal/src/main/native/sim/jni/RoboRioDataJNI.cpp b/hal/src/main/native/sim/jni/RoboRioDataJNI.cpp
deleted file mode 100644
index d69e895..0000000
--- a/hal/src/main/native/sim/jni/RoboRioDataJNI.cpp
+++ /dev/null
@@ -1,778 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* 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. */
-/*----------------------------------------------------------------------------*/
-
-#include <jni.h>
-
-#include "CallbackStore.h"
-#include "edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI.h"
-#include "mockdata/RoboRioData.h"
-
-extern "C" {
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: registerFPGAButtonCallback
- * Signature: (ILjava/lang/Object;Z)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_registerFPGAButtonCallback
- (JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
-{
- return sim::AllocateCallback(env, index, callback, initialNotify,
- &HALSIM_RegisterRoboRioFPGAButtonCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: cancelFPGAButtonCallback
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_cancelFPGAButtonCallback
- (JNIEnv* env, jclass, jint index, jint handle)
-{
- return sim::FreeCallback(env, handle, index,
- &HALSIM_CancelRoboRioFPGAButtonCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: getFPGAButton
- * Signature: (I)Z
- */
-JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_getFPGAButton
- (JNIEnv*, jclass, jint index)
-{
- return HALSIM_GetRoboRioFPGAButton(index);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: setFPGAButton
- * Signature: (IZ)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_setFPGAButton
- (JNIEnv*, jclass, jint index, jboolean value)
-{
- HALSIM_SetRoboRioFPGAButton(index, value);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: registerVInVoltageCallback
- * Signature: (ILjava/lang/Object;Z)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_registerVInVoltageCallback
- (JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
-{
- return sim::AllocateCallback(env, index, callback, initialNotify,
- &HALSIM_RegisterRoboRioVInVoltageCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: cancelVInVoltageCallback
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_cancelVInVoltageCallback
- (JNIEnv* env, jclass, jint index, jint handle)
-{
- return sim::FreeCallback(env, handle, index,
- &HALSIM_CancelRoboRioVInVoltageCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: getVInVoltage
- * Signature: (I)D
- */
-JNIEXPORT jdouble JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_getVInVoltage
- (JNIEnv*, jclass, jint index)
-{
- return HALSIM_GetRoboRioVInVoltage(index);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: setVInVoltage
- * Signature: (ID)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_setVInVoltage
- (JNIEnv*, jclass, jint index, jdouble value)
-{
- HALSIM_SetRoboRioVInVoltage(index, value);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: registerVInCurrentCallback
- * Signature: (ILjava/lang/Object;Z)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_registerVInCurrentCallback
- (JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
-{
- return sim::AllocateCallback(env, index, callback, initialNotify,
- &HALSIM_RegisterRoboRioVInCurrentCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: cancelVInCurrentCallback
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_cancelVInCurrentCallback
- (JNIEnv* env, jclass, jint index, jint handle)
-{
- return sim::FreeCallback(env, handle, index,
- &HALSIM_CancelRoboRioVInCurrentCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: getVInCurrent
- * Signature: (I)D
- */
-JNIEXPORT jdouble JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_getVInCurrent
- (JNIEnv*, jclass, jint index)
-{
- return HALSIM_GetRoboRioVInCurrent(index);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: setVInCurrent
- * Signature: (ID)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_setVInCurrent
- (JNIEnv*, jclass, jint index, jdouble value)
-{
- HALSIM_SetRoboRioVInCurrent(index, value);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: registerUserVoltage6VCallback
- * Signature: (ILjava/lang/Object;Z)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_registerUserVoltage6VCallback
- (JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
-{
- return sim::AllocateCallback(env, index, callback, initialNotify,
- &HALSIM_RegisterRoboRioUserVoltage6VCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: cancelUserVoltage6VCallback
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_cancelUserVoltage6VCallback
- (JNIEnv* env, jclass, jint index, jint handle)
-{
- return sim::FreeCallback(env, handle, index,
- &HALSIM_CancelRoboRioUserVoltage6VCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: getUserVoltage6V
- * Signature: (I)D
- */
-JNIEXPORT jdouble JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_getUserVoltage6V
- (JNIEnv*, jclass, jint index)
-{
- return HALSIM_GetRoboRioUserVoltage6V(index);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: setUserVoltage6V
- * Signature: (ID)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_setUserVoltage6V
- (JNIEnv*, jclass, jint index, jdouble value)
-{
- HALSIM_SetRoboRioUserVoltage6V(index, value);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: registerUserCurrent6VCallback
- * Signature: (ILjava/lang/Object;Z)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_registerUserCurrent6VCallback
- (JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
-{
- return sim::AllocateCallback(env, index, callback, initialNotify,
- &HALSIM_RegisterRoboRioUserCurrent6VCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: cancelUserCurrent6VCallback
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_cancelUserCurrent6VCallback
- (JNIEnv* env, jclass, jint index, jint handle)
-{
- return sim::FreeCallback(env, handle, index,
- &HALSIM_CancelRoboRioUserCurrent6VCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: getUserCurrent6V
- * Signature: (I)D
- */
-JNIEXPORT jdouble JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_getUserCurrent6V
- (JNIEnv*, jclass, jint index)
-{
- return HALSIM_GetRoboRioUserCurrent6V(index);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: setUserCurrent6V
- * Signature: (ID)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_setUserCurrent6V
- (JNIEnv*, jclass, jint index, jdouble value)
-{
- HALSIM_SetRoboRioUserCurrent6V(index, value);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: registerUserActive6VCallback
- * Signature: (ILjava/lang/Object;Z)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_registerUserActive6VCallback
- (JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
-{
- return sim::AllocateCallback(env, index, callback, initialNotify,
- &HALSIM_RegisterRoboRioUserActive6VCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: cancelUserActive6VCallback
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_cancelUserActive6VCallback
- (JNIEnv* env, jclass, jint index, jint handle)
-{
- return sim::FreeCallback(env, handle, index,
- &HALSIM_CancelRoboRioUserActive6VCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: getUserActive6V
- * Signature: (I)Z
- */
-JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_getUserActive6V
- (JNIEnv*, jclass, jint index)
-{
- return HALSIM_GetRoboRioUserActive6V(index);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: setUserActive6V
- * Signature: (IZ)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_setUserActive6V
- (JNIEnv*, jclass, jint index, jboolean value)
-{
- HALSIM_SetRoboRioUserActive6V(index, value);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: registerUserVoltage5VCallback
- * Signature: (ILjava/lang/Object;Z)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_registerUserVoltage5VCallback
- (JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
-{
- return sim::AllocateCallback(env, index, callback, initialNotify,
- &HALSIM_RegisterRoboRioUserVoltage5VCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: cancelUserVoltage5VCallback
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_cancelUserVoltage5VCallback
- (JNIEnv* env, jclass, jint index, jint handle)
-{
- return sim::FreeCallback(env, handle, index,
- &HALSIM_CancelRoboRioUserVoltage5VCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: getUserVoltage5V
- * Signature: (I)D
- */
-JNIEXPORT jdouble JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_getUserVoltage5V
- (JNIEnv*, jclass, jint index)
-{
- return HALSIM_GetRoboRioUserVoltage5V(index);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: setUserVoltage5V
- * Signature: (ID)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_setUserVoltage5V
- (JNIEnv*, jclass, jint index, jdouble value)
-{
- HALSIM_SetRoboRioUserVoltage5V(index, value);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: registerUserCurrent5VCallback
- * Signature: (ILjava/lang/Object;Z)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_registerUserCurrent5VCallback
- (JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
-{
- return sim::AllocateCallback(env, index, callback, initialNotify,
- &HALSIM_RegisterRoboRioUserCurrent5VCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: cancelUserCurrent5VCallback
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_cancelUserCurrent5VCallback
- (JNIEnv* env, jclass, jint index, jint handle)
-{
- return sim::FreeCallback(env, handle, index,
- &HALSIM_CancelRoboRioUserCurrent5VCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: getUserCurrent5V
- * Signature: (I)D
- */
-JNIEXPORT jdouble JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_getUserCurrent5V
- (JNIEnv*, jclass, jint index)
-{
- return HALSIM_GetRoboRioUserCurrent5V(index);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: setUserCurrent5V
- * Signature: (ID)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_setUserCurrent5V
- (JNIEnv*, jclass, jint index, jdouble value)
-{
- HALSIM_SetRoboRioUserCurrent5V(index, value);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: registerUserActive5VCallback
- * Signature: (ILjava/lang/Object;Z)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_registerUserActive5VCallback
- (JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
-{
- return sim::AllocateCallback(env, index, callback, initialNotify,
- &HALSIM_RegisterRoboRioUserActive5VCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: cancelUserActive5VCallback
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_cancelUserActive5VCallback
- (JNIEnv* env, jclass, jint index, jint handle)
-{
- return sim::FreeCallback(env, handle, index,
- &HALSIM_CancelRoboRioUserActive5VCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: getUserActive5V
- * Signature: (I)Z
- */
-JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_getUserActive5V
- (JNIEnv*, jclass, jint index)
-{
- return HALSIM_GetRoboRioUserActive5V(index);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: setUserActive5V
- * Signature: (IZ)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_setUserActive5V
- (JNIEnv*, jclass, jint index, jboolean value)
-{
- HALSIM_SetRoboRioUserActive5V(index, value);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: registerUserVoltage3V3Callback
- * Signature: (ILjava/lang/Object;Z)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_registerUserVoltage3V3Callback
- (JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
-{
- return sim::AllocateCallback(env, index, callback, initialNotify,
- &HALSIM_RegisterRoboRioUserVoltage3V3Callback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: cancelUserVoltage3V3Callback
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_cancelUserVoltage3V3Callback
- (JNIEnv* env, jclass, jint index, jint handle)
-{
- return sim::FreeCallback(env, handle, index,
- &HALSIM_CancelRoboRioUserVoltage3V3Callback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: getUserVoltage3V3
- * Signature: (I)D
- */
-JNIEXPORT jdouble JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_getUserVoltage3V3
- (JNIEnv*, jclass, jint index)
-{
- return HALSIM_GetRoboRioUserVoltage3V3(index);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: setUserVoltage3V3
- * Signature: (ID)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_setUserVoltage3V3
- (JNIEnv*, jclass, jint index, jdouble value)
-{
- HALSIM_SetRoboRioUserVoltage3V3(index, value);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: registerUserCurrent3V3Callback
- * Signature: (ILjava/lang/Object;Z)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_registerUserCurrent3V3Callback
- (JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
-{
- return sim::AllocateCallback(env, index, callback, initialNotify,
- &HALSIM_RegisterRoboRioUserCurrent3V3Callback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: cancelUserCurrent3V3Callback
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_cancelUserCurrent3V3Callback
- (JNIEnv* env, jclass, jint index, jint handle)
-{
- return sim::FreeCallback(env, handle, index,
- &HALSIM_CancelRoboRioUserCurrent3V3Callback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: getUserCurrent3V3
- * Signature: (I)D
- */
-JNIEXPORT jdouble JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_getUserCurrent3V3
- (JNIEnv*, jclass, jint index)
-{
- return HALSIM_GetRoboRioUserCurrent3V3(index);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: setUserCurrent3V3
- * Signature: (ID)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_setUserCurrent3V3
- (JNIEnv*, jclass, jint index, jdouble value)
-{
- HALSIM_SetRoboRioUserCurrent3V3(index, value);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: registerUserActive3V3Callback
- * Signature: (ILjava/lang/Object;Z)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_registerUserActive3V3Callback
- (JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
-{
- return sim::AllocateCallback(env, index, callback, initialNotify,
- &HALSIM_RegisterRoboRioUserActive3V3Callback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: cancelUserActive3V3Callback
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_cancelUserActive3V3Callback
- (JNIEnv* env, jclass, jint index, jint handle)
-{
- return sim::FreeCallback(env, handle, index,
- &HALSIM_CancelRoboRioUserActive3V3Callback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: getUserActive3V3
- * Signature: (I)Z
- */
-JNIEXPORT jboolean JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_getUserActive3V3
- (JNIEnv*, jclass, jint index)
-{
- return HALSIM_GetRoboRioUserActive3V3(index);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: setUserActive3V3
- * Signature: (IZ)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_setUserActive3V3
- (JNIEnv*, jclass, jint index, jboolean value)
-{
- HALSIM_SetRoboRioUserActive3V3(index, value);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: registerUserFaults6VCallback
- * Signature: (ILjava/lang/Object;Z)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_registerUserFaults6VCallback
- (JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
-{
- return sim::AllocateCallback(env, index, callback, initialNotify,
- &HALSIM_RegisterRoboRioUserFaults6VCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: cancelUserFaults6VCallback
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_cancelUserFaults6VCallback
- (JNIEnv* env, jclass, jint index, jint handle)
-{
- return sim::FreeCallback(env, handle, index,
- &HALSIM_CancelRoboRioUserFaults6VCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: getUserFaults6V
- * Signature: (I)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_getUserFaults6V
- (JNIEnv*, jclass, jint index)
-{
- return HALSIM_GetRoboRioUserFaults6V(index);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: setUserFaults6V
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_setUserFaults6V
- (JNIEnv*, jclass, jint index, jint value)
-{
- HALSIM_SetRoboRioUserFaults6V(index, value);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: registerUserFaults5VCallback
- * Signature: (ILjava/lang/Object;Z)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_registerUserFaults5VCallback
- (JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
-{
- return sim::AllocateCallback(env, index, callback, initialNotify,
- &HALSIM_RegisterRoboRioUserFaults5VCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: cancelUserFaults5VCallback
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_cancelUserFaults5VCallback
- (JNIEnv* env, jclass, jint index, jint handle)
-{
- return sim::FreeCallback(env, handle, index,
- &HALSIM_CancelRoboRioUserFaults5VCallback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: getUserFaults5V
- * Signature: (I)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_getUserFaults5V
- (JNIEnv*, jclass, jint index)
-{
- return HALSIM_GetRoboRioUserFaults5V(index);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: setUserFaults5V
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_setUserFaults5V
- (JNIEnv*, jclass, jint index, jint value)
-{
- HALSIM_SetRoboRioUserFaults5V(index, value);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: registerUserFaults3V3Callback
- * Signature: (ILjava/lang/Object;Z)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_registerUserFaults3V3Callback
- (JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
-{
- return sim::AllocateCallback(env, index, callback, initialNotify,
- &HALSIM_RegisterRoboRioUserFaults3V3Callback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: cancelUserFaults3V3Callback
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_cancelUserFaults3V3Callback
- (JNIEnv* env, jclass, jint index, jint handle)
-{
- return sim::FreeCallback(env, handle, index,
- &HALSIM_CancelRoboRioUserFaults3V3Callback);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: getUserFaults3V3
- * Signature: (I)I
- */
-JNIEXPORT jint JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_getUserFaults3V3
- (JNIEnv*, jclass, jint index)
-{
- return HALSIM_GetRoboRioUserFaults3V3(index);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: setUserFaults3V3
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_setUserFaults3V3
- (JNIEnv*, jclass, jint index, jint value)
-{
- HALSIM_SetRoboRioUserFaults3V3(index, value);
-}
-
-/*
- * Class: edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI
- * Method: resetData
- * Signature: (I)V
- */
-JNIEXPORT void JNICALL
-Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_resetData
- (JNIEnv*, jclass, jint index)
-{
- HALSIM_ResetRoboRioData(index);
-}
-
-} // extern "C"
diff --git a/hal/src/main/native/sim/mockdata/AccelerometerDataInternal.h b/hal/src/main/native/sim/mockdata/AccelerometerDataInternal.h
index 9db0875..e2e0a80 100644
--- a/hal/src/main/native/sim/mockdata/AccelerometerDataInternal.h
+++ b/hal/src/main/native/sim/mockdata/AccelerometerDataInternal.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,8 +7,8 @@
#pragma once
-#include "mockdata/AccelerometerData.h"
-#include "mockdata/SimDataValue.h"
+#include "hal/simulation/AccelerometerData.h"
+#include "hal/simulation/SimDataValue.h"
namespace hal {
class AccelerometerData {
diff --git a/hal/src/main/native/sim/mockdata/AddressableLEDData.cpp b/hal/src/main/native/sim/mockdata/AddressableLEDData.cpp
index 5b44eaf..fe4611e 100644
--- a/hal/src/main/native/sim/mockdata/AddressableLEDData.cpp
+++ b/hal/src/main/native/sim/mockdata/AddressableLEDData.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2019-2020 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. */
@@ -49,6 +49,16 @@
}
extern "C" {
+
+int32_t HALSIM_FindAddressableLEDForChannel(int32_t channel) {
+ for (int i = 0; i < kNumAddressableLEDs; ++i) {
+ if (SimAddressableLEDData[i].initialized &&
+ SimAddressableLEDData[i].outputPort == channel)
+ return i;
+ }
+ return -1;
+}
+
void HALSIM_ResetAddressableLEDData(int32_t index) {
SimAddressableLEDData[index].ResetData();
}
diff --git a/hal/src/main/native/sim/mockdata/AddressableLEDDataInternal.h b/hal/src/main/native/sim/mockdata/AddressableLEDDataInternal.h
index 9d6e215..f0b7998 100644
--- a/hal/src/main/native/sim/mockdata/AddressableLEDDataInternal.h
+++ b/hal/src/main/native/sim/mockdata/AddressableLEDDataInternal.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2019-2020 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. */
@@ -11,9 +11,9 @@
#include <wpi/spinlock.h>
-#include "mockdata/AddressableLEDData.h"
-#include "mockdata/SimCallbackRegistry.h"
-#include "mockdata/SimDataValue.h"
+#include "hal/simulation/AddressableLEDData.h"
+#include "hal/simulation/SimCallbackRegistry.h"
+#include "hal/simulation/SimDataValue.h"
namespace hal {
class AddressableLEDData {
diff --git a/hal/src/main/native/sim/mockdata/AnalogGyroDataInternal.h b/hal/src/main/native/sim/mockdata/AnalogGyroDataInternal.h
index 427d2fb..ff12b60 100644
--- a/hal/src/main/native/sim/mockdata/AnalogGyroDataInternal.h
+++ b/hal/src/main/native/sim/mockdata/AnalogGyroDataInternal.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,8 +7,8 @@
#pragma once
-#include "mockdata/AnalogGyroData.h"
-#include "mockdata/SimDataValue.h"
+#include "hal/simulation/AnalogGyroData.h"
+#include "hal/simulation/SimDataValue.h"
namespace hal {
class AnalogGyroData {
diff --git a/hal/src/main/native/sim/mockdata/AnalogInDataInternal.h b/hal/src/main/native/sim/mockdata/AnalogInDataInternal.h
index cd8348d..90d707c 100644
--- a/hal/src/main/native/sim/mockdata/AnalogInDataInternal.h
+++ b/hal/src/main/native/sim/mockdata/AnalogInDataInternal.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,8 +7,8 @@
#pragma once
-#include "mockdata/AnalogInData.h"
-#include "mockdata/SimDataValue.h"
+#include "hal/simulation/AnalogInData.h"
+#include "hal/simulation/SimDataValue.h"
namespace hal {
class AnalogInData {
diff --git a/hal/src/main/native/sim/mockdata/AnalogOutDataInternal.h b/hal/src/main/native/sim/mockdata/AnalogOutDataInternal.h
index da7d49f..779ee96 100644
--- a/hal/src/main/native/sim/mockdata/AnalogOutDataInternal.h
+++ b/hal/src/main/native/sim/mockdata/AnalogOutDataInternal.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,8 +7,8 @@
#pragma once
-#include "mockdata/AnalogOutData.h"
-#include "mockdata/SimDataValue.h"
+#include "hal/simulation/AnalogOutData.h"
+#include "hal/simulation/SimDataValue.h"
namespace hal {
class AnalogOutData {
diff --git a/hal/src/main/native/sim/mockdata/AnalogTriggerData.cpp b/hal/src/main/native/sim/mockdata/AnalogTriggerData.cpp
index 64d1a97..ba33522 100644
--- a/hal/src/main/native/sim/mockdata/AnalogTriggerData.cpp
+++ b/hal/src/main/native/sim/mockdata/AnalogTriggerData.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -28,6 +28,16 @@
}
extern "C" {
+
+int32_t HALSIM_FindAnalogTriggerForChannel(int32_t channel) {
+ for (int i = 0; i < kNumAnalogTriggers; ++i) {
+ if (SimAnalogTriggerData[i].initialized &&
+ SimAnalogTriggerData[i].inputPort == channel)
+ return i;
+ }
+ return -1;
+}
+
void HALSIM_ResetAnalogTriggerData(int32_t index) {
SimAnalogTriggerData[index].ResetData();
}
diff --git a/hal/src/main/native/sim/mockdata/AnalogTriggerDataInternal.h b/hal/src/main/native/sim/mockdata/AnalogTriggerDataInternal.h
index 61b3c19..74fe5f8 100644
--- a/hal/src/main/native/sim/mockdata/AnalogTriggerDataInternal.h
+++ b/hal/src/main/native/sim/mockdata/AnalogTriggerDataInternal.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,8 +7,8 @@
#pragma once
-#include "mockdata/AnalogTriggerData.h"
-#include "mockdata/SimDataValue.h"
+#include "hal/simulation/AnalogTriggerData.h"
+#include "hal/simulation/SimDataValue.h"
namespace hal {
class AnalogTriggerData {
@@ -31,6 +31,7 @@
SimDataValue<HALSIM_AnalogTriggerMode, MakeTriggerModeValue,
GetTriggerModeName>
triggerMode{static_cast<HALSIM_AnalogTriggerMode>(0)};
+ std::atomic<int32_t> inputPort;
virtual void ResetData();
};
diff --git a/hal/src/main/native/sim/mockdata/CanDataInternal.h b/hal/src/main/native/sim/mockdata/CanDataInternal.h
index ffdd351..df5b290 100644
--- a/hal/src/main/native/sim/mockdata/CanDataInternal.h
+++ b/hal/src/main/native/sim/mockdata/CanDataInternal.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,8 +7,8 @@
#pragma once
-#include "mockdata/CanData.h"
-#include "mockdata/SimCallbackRegistry.h"
+#include "hal/simulation/CanData.h"
+#include "hal/simulation/SimCallbackRegistry.h"
namespace hal {
diff --git a/hal/src/main/native/sim/mockdata/DIODataInternal.h b/hal/src/main/native/sim/mockdata/DIODataInternal.h
index 49e0f75..c3266d5 100644
--- a/hal/src/main/native/sim/mockdata/DIODataInternal.h
+++ b/hal/src/main/native/sim/mockdata/DIODataInternal.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,8 +7,8 @@
#pragma once
-#include "mockdata/DIOData.h"
-#include "mockdata/SimDataValue.h"
+#include "hal/simulation/DIOData.h"
+#include "hal/simulation/SimDataValue.h"
namespace hal {
class DIOData {
diff --git a/hal/src/main/native/sim/mockdata/DigitalPWMData.cpp b/hal/src/main/native/sim/mockdata/DigitalPWMData.cpp
index 78ee749..541d7cf 100644
--- a/hal/src/main/native/sim/mockdata/DigitalPWMData.cpp
+++ b/hal/src/main/native/sim/mockdata/DigitalPWMData.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -27,6 +27,14 @@
}
extern "C" {
+int32_t HALSIM_FindDigitalPWMForChannel(int32_t channel) {
+ for (int i = 0; i < kNumDigitalPWMOutputs; ++i) {
+ if (SimDigitalPWMData[i].initialized && SimDigitalPWMData[i].pin == channel)
+ return i;
+ }
+ return -1;
+}
+
void HALSIM_ResetDigitalPWMData(int32_t index) {
SimDigitalPWMData[index].ResetData();
}
diff --git a/hal/src/main/native/sim/mockdata/DigitalPWMDataInternal.h b/hal/src/main/native/sim/mockdata/DigitalPWMDataInternal.h
index 09d5903..f2c7a5e 100644
--- a/hal/src/main/native/sim/mockdata/DigitalPWMDataInternal.h
+++ b/hal/src/main/native/sim/mockdata/DigitalPWMDataInternal.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,8 +7,8 @@
#pragma once
-#include "mockdata/DigitalPWMData.h"
-#include "mockdata/SimDataValue.h"
+#include "hal/simulation/DigitalPWMData.h"
+#include "hal/simulation/SimDataValue.h"
namespace hal {
class DigitalPWMData {
diff --git a/hal/src/main/native/sim/mockdata/DriverStationData.cpp b/hal/src/main/native/sim/mockdata/DriverStationData.cpp
index ece98c8..dae1dd4 100644
--- a/hal/src/main/native/sim/mockdata/DriverStationData.cpp
+++ b/hal/src/main/native/sim/mockdata/DriverStationData.cpp
@@ -1,25 +1,15 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
/*----------------------------------------------------------------------------*/
-#include <cstdlib>
#include <cstring>
-#include <string>
#include "DriverStationDataInternal.h"
#include "hal/DriverStation.h"
-namespace hal {
-struct JoystickOutputStore {
- int64_t outputs = 0;
- int32_t leftRumble = 0;
- int32_t rightRumble = 0;
-};
-} // namespace hal
-
using namespace hal;
namespace hal {
@@ -47,103 +37,322 @@
{
std::scoped_lock lock(m_joystickDataMutex);
- m_joystickAxes = std::make_unique<HAL_JoystickAxes[]>(6);
- m_joystickPOVs = std::make_unique<HAL_JoystickPOVs[]>(6);
- m_joystickButtons = std::make_unique<HAL_JoystickButtons[]>(6);
- m_joystickOutputs = std::make_unique<JoystickOutputStore[]>(6);
- m_joystickDescriptor = std::make_unique<HAL_JoystickDescriptor[]>(6);
-
- for (int i = 0; i < 6; i++) {
- m_joystickAxes[i].count = 0;
- m_joystickPOVs[i].count = 0;
- m_joystickButtons[i].count = 0;
- m_joystickDescriptor[i].isXbox = 0;
- m_joystickDescriptor[i].type = -1;
- m_joystickDescriptor[i].name[0] = '\0';
+ m_joystickAxesCallbacks.Reset();
+ m_joystickPOVsCallbacks.Reset();
+ m_joystickButtonsCallbacks.Reset();
+ m_joystickOutputsCallbacks.Reset();
+ m_joystickDescriptorCallbacks.Reset();
+ for (int i = 0; i < kNumJoysticks; i++) {
+ m_joystickData[i].axes = HAL_JoystickAxes{};
+ m_joystickData[i].povs = HAL_JoystickPOVs{};
+ m_joystickData[i].buttons = HAL_JoystickButtons{};
+ m_joystickData[i].descriptor = HAL_JoystickDescriptor{};
+ m_joystickData[i].descriptor.type = -1;
+ m_joystickData[i].descriptor.name[0] = '\0';
}
}
{
std::scoped_lock lock(m_matchInfoMutex);
-
- m_matchInfo = std::make_unique<HAL_MatchInfo>();
+ m_matchInfoCallbacks.Reset();
+ m_matchInfo = HAL_MatchInfo{};
}
+ m_newDataCallbacks.Reset();
}
-void DriverStationData::GetJoystickAxes(int32_t joystickNum,
- HAL_JoystickAxes* axes) {
- std::scoped_lock lock(m_joystickDataMutex);
- *axes = m_joystickAxes[joystickNum];
-}
-void DriverStationData::GetJoystickPOVs(int32_t joystickNum,
- HAL_JoystickPOVs* povs) {
- std::scoped_lock lock(m_joystickDataMutex);
- *povs = m_joystickPOVs[joystickNum];
-}
-void DriverStationData::GetJoystickButtons(int32_t joystickNum,
- HAL_JoystickButtons* buttons) {
- std::scoped_lock lock(m_joystickDataMutex);
- *buttons = m_joystickButtons[joystickNum];
-}
+#define DEFINE_CPPAPI_CALLBACKS(name, data, data2) \
+ int32_t DriverStationData::RegisterJoystick##name##Callback( \
+ int32_t joystickNum, HAL_Joystick##name##Callback callback, void* param, \
+ HAL_Bool initialNotify) { \
+ if (joystickNum < 0 || joystickNum >= kNumJoysticks) return 0; \
+ std::scoped_lock lock(m_joystickDataMutex); \
+ int32_t uid = m_joystick##name##Callbacks.Register(callback, param); \
+ if (initialNotify) { \
+ callback(GetJoystick##name##Name(), param, joystickNum, \
+ &m_joystickData[joystickNum].data##data2); \
+ } \
+ return uid; \
+ } \
+ \
+ void DriverStationData::CancelJoystick##name##Callback(int32_t uid) { \
+ m_joystick##name##Callbacks.Cancel(uid); \
+ }
+
+#define DEFINE_CPPAPI(name, data, data2) \
+ DEFINE_CPPAPI_CALLBACKS(name, data, data2) \
+ \
+ void DriverStationData::GetJoystick##name(int32_t joystickNum, \
+ HAL_Joystick##name* d) { \
+ if (joystickNum < 0 || joystickNum >= kNumJoysticks) return; \
+ std::scoped_lock lock(m_joystickDataMutex); \
+ *d = m_joystickData[joystickNum].data##data2; \
+ } \
+ \
+ void DriverStationData::SetJoystick##name(int32_t joystickNum, \
+ const HAL_Joystick##name* d) { \
+ if (joystickNum < 0 || joystickNum >= kNumJoysticks) return; \
+ std::scoped_lock lock(m_joystickDataMutex); \
+ m_joystickData[joystickNum].data##data2 = *d; \
+ m_joystick##name##Callbacks(joystickNum, d); \
+ }
+
+DEFINE_CPPAPI(Axes, axes, )
+DEFINE_CPPAPI(POVs, povs, )
+DEFINE_CPPAPI(Buttons, buttons, )
+
+DEFINE_CPPAPI_CALLBACKS(Descriptor, descriptor, )
+
void DriverStationData::GetJoystickDescriptor(
int32_t joystickNum, HAL_JoystickDescriptor* descriptor) {
+ if (joystickNum < 0 || joystickNum >= kNumJoysticks) return;
std::scoped_lock lock(m_joystickDataMutex);
- *descriptor = m_joystickDescriptor[joystickNum];
- // Always ensure name is null terminated
- descriptor->name[255] = '\0';
-}
-void DriverStationData::GetJoystickOutputs(int32_t joystickNum,
- int64_t* outputs,
- int32_t* leftRumble,
- int32_t* rightRumble) {
- std::scoped_lock lock(m_joystickDataMutex);
- *leftRumble = m_joystickOutputs[joystickNum].leftRumble;
- *outputs = m_joystickOutputs[joystickNum].outputs;
- *rightRumble = m_joystickOutputs[joystickNum].rightRumble;
-}
-void DriverStationData::GetMatchInfo(HAL_MatchInfo* info) {
- std::scoped_lock lock(m_matchInfoMutex);
- *info = *m_matchInfo;
-}
-
-void DriverStationData::SetJoystickAxes(int32_t joystickNum,
- const HAL_JoystickAxes* axes) {
- std::scoped_lock lock(m_joystickDataMutex);
- m_joystickAxes[joystickNum] = *axes;
-}
-void DriverStationData::SetJoystickPOVs(int32_t joystickNum,
- const HAL_JoystickPOVs* povs) {
- std::scoped_lock lock(m_joystickDataMutex);
- m_joystickPOVs[joystickNum] = *povs;
-}
-void DriverStationData::SetJoystickButtons(int32_t joystickNum,
- const HAL_JoystickButtons* buttons) {
- std::scoped_lock lock(m_joystickDataMutex);
- m_joystickButtons[joystickNum] = *buttons;
+ *descriptor = m_joystickData[joystickNum].descriptor;
}
void DriverStationData::SetJoystickDescriptor(
int32_t joystickNum, const HAL_JoystickDescriptor* descriptor) {
+ if (joystickNum < 0 || joystickNum >= kNumJoysticks) return;
std::scoped_lock lock(m_joystickDataMutex);
- m_joystickDescriptor[joystickNum] = *descriptor;
+ m_joystickData[joystickNum].descriptor = *descriptor;
+ // Always ensure name is null terminated
+ m_joystickData[joystickNum].descriptor.name[255] = '\0';
+ m_joystickDescriptorCallbacks(joystickNum, descriptor);
+}
+
+int32_t DriverStationData::RegisterJoystickOutputsCallback(
+ int32_t joystickNum, HAL_JoystickOutputsCallback callback, void* param,
+ HAL_Bool initialNotify) {
+ if (joystickNum < 0 || joystickNum >= DriverStationData::kNumJoysticks)
+ return 0;
+ std::scoped_lock lock(m_joystickDataMutex);
+ int32_t uid = m_joystickOutputsCallbacks.Register(callback, param);
+ if (initialNotify) {
+ const auto& outputs = m_joystickData[joystickNum].outputs;
+ callback(DriverStationData::GetJoystickOutputsName(), param, joystickNum,
+ outputs.outputs, outputs.leftRumble, outputs.rightRumble);
+ }
+ return uid;
+}
+
+void DriverStationData::CancelJoystickOutputsCallback(int32_t uid) {
+ m_joystickOutputsCallbacks.Cancel(uid);
+}
+
+void DriverStationData::GetJoystickOutputs(int32_t joystickNum,
+ int64_t* outputs,
+ int32_t* leftRumble,
+ int32_t* rightRumble) {
+ if (joystickNum < 0 || joystickNum >= kNumJoysticks) return;
+ std::scoped_lock lock(m_joystickDataMutex);
+ *leftRumble = m_joystickData[joystickNum].outputs.leftRumble;
+ *outputs = m_joystickData[joystickNum].outputs.outputs;
+ *rightRumble = m_joystickData[joystickNum].outputs.rightRumble;
}
void DriverStationData::SetJoystickOutputs(int32_t joystickNum, int64_t outputs,
int32_t leftRumble,
int32_t rightRumble) {
+ if (joystickNum < 0 || joystickNum >= kNumJoysticks) return;
std::scoped_lock lock(m_joystickDataMutex);
- m_joystickOutputs[joystickNum].leftRumble = leftRumble;
- m_joystickOutputs[joystickNum].outputs = outputs;
- m_joystickOutputs[joystickNum].rightRumble = rightRumble;
+ m_joystickData[joystickNum].outputs.leftRumble = leftRumble;
+ m_joystickData[joystickNum].outputs.outputs = outputs;
+ m_joystickData[joystickNum].outputs.rightRumble = rightRumble;
+ m_joystickOutputsCallbacks(joystickNum, outputs, leftRumble, rightRumble);
+}
+
+int32_t DriverStationData::RegisterMatchInfoCallback(
+ HAL_MatchInfoCallback callback, void* param, HAL_Bool initialNotify) {
+ std::scoped_lock lock(m_matchInfoMutex);
+ int32_t uid = m_matchInfoCallbacks.Register(callback, param);
+ if (initialNotify) {
+ callback(GetMatchInfoName(), param, &m_matchInfo);
+ }
+ return uid;
+}
+
+void DriverStationData::CancelMatchInfoCallback(int32_t uid) {
+ m_matchInfoCallbacks.Cancel(uid);
+}
+
+void DriverStationData::GetMatchInfo(HAL_MatchInfo* info) {
+ std::scoped_lock lock(m_matchInfoMutex);
+ *info = m_matchInfo;
}
void DriverStationData::SetMatchInfo(const HAL_MatchInfo* info) {
std::scoped_lock lock(m_matchInfoMutex);
- *m_matchInfo = *info;
- *(std::end(m_matchInfo->eventName) - 1) = '\0';
+ m_matchInfo = *info;
+ *(std::end(m_matchInfo.eventName) - 1) = '\0';
+ m_matchInfoCallbacks(info);
+}
+
+int32_t DriverStationData::RegisterNewDataCallback(HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify) {
+ int32_t uid = m_newDataCallbacks.Register(callback, param);
+ if (initialNotify) {
+ HAL_Value empty;
+ empty.type = HAL_UNASSIGNED;
+ callback(GetNewDataName(), param, &empty);
+ }
+ return uid;
+}
+
+void DriverStationData::CancelNewDataCallback(int32_t uid) {
+ m_newDataCallbacks.Cancel(uid);
+}
+
+void DriverStationData::CallNewDataCallbacks() {
+ HAL_Value empty;
+ empty.type = HAL_UNASSIGNED;
+ m_newDataCallbacks(&empty);
}
void DriverStationData::NotifyNewData() { HAL_ReleaseDSMutex(); }
+void DriverStationData::SetJoystickButton(int32_t stick, int32_t button,
+ HAL_Bool state) {
+ if (stick < 0 || stick >= kNumJoysticks) return;
+ std::scoped_lock lock(m_joystickDataMutex);
+ if (state)
+ m_joystickData[stick].buttons.buttons |= 1 << (button - 1);
+ else
+ m_joystickData[stick].buttons.buttons &= ~(1 << (button - 1));
+ m_joystickButtonsCallbacks(stick, &m_joystickData[stick].buttons);
+}
+
+void DriverStationData::SetJoystickAxis(int32_t stick, int32_t axis,
+ double value) {
+ if (stick < 0 || stick >= kNumJoysticks) return;
+ if (axis < 0 || axis >= HAL_kMaxJoystickAxes) return;
+ std::scoped_lock lock(m_joystickDataMutex);
+ m_joystickData[stick].axes.axes[axis] = value;
+ m_joystickAxesCallbacks(stick, &m_joystickData[stick].axes);
+}
+
+void DriverStationData::SetJoystickPOV(int32_t stick, int32_t pov,
+ int32_t value) {
+ if (stick < 0 || stick >= kNumJoysticks) return;
+ if (pov < 0 || pov >= HAL_kMaxJoystickPOVs) return;
+ std::scoped_lock lock(m_joystickDataMutex);
+ m_joystickData[stick].povs.povs[pov] = value;
+ m_joystickPOVsCallbacks(stick, &m_joystickData[stick].povs);
+}
+
+void DriverStationData::SetJoystickButtons(int32_t stick, uint32_t buttons) {
+ if (stick < 0 || stick >= kNumJoysticks) return;
+ std::scoped_lock lock(m_joystickDataMutex);
+ m_joystickData[stick].buttons.buttons = buttons;
+ m_joystickButtonsCallbacks(stick, &m_joystickData[stick].buttons);
+}
+
+void DriverStationData::SetJoystickAxisCount(int32_t stick, int32_t count) {
+ if (stick < 0 || stick >= kNumJoysticks) return;
+ std::scoped_lock lock(m_joystickDataMutex);
+ m_joystickData[stick].axes.count = count;
+ m_joystickData[stick].descriptor.axisCount = count;
+ m_joystickAxesCallbacks(stick, &m_joystickData[stick].axes);
+ m_joystickDescriptorCallbacks(stick, &m_joystickData[stick].descriptor);
+}
+
+void DriverStationData::SetJoystickPOVCount(int32_t stick, int32_t count) {
+ if (stick < 0 || stick >= kNumJoysticks) return;
+ std::scoped_lock lock(m_joystickDataMutex);
+ m_joystickData[stick].povs.count = count;
+ m_joystickData[stick].descriptor.povCount = count;
+ m_joystickPOVsCallbacks(stick, &m_joystickData[stick].povs);
+ m_joystickDescriptorCallbacks(stick, &m_joystickData[stick].descriptor);
+}
+
+void DriverStationData::SetJoystickButtonCount(int32_t stick, int32_t count) {
+ if (stick < 0 || stick >= kNumJoysticks) return;
+ std::scoped_lock lock(m_joystickDataMutex);
+ m_joystickData[stick].buttons.count = count;
+ m_joystickData[stick].descriptor.buttonCount = count;
+ m_joystickButtonsCallbacks(stick, &m_joystickData[stick].buttons);
+ m_joystickDescriptorCallbacks(stick, &m_joystickData[stick].descriptor);
+}
+
+void DriverStationData::GetJoystickCounts(int32_t stick, int32_t* axisCount,
+ int32_t* buttonCount,
+ int32_t* povCount) {
+ if (stick < 0 || stick >= kNumJoysticks) {
+ *axisCount = 0;
+ *buttonCount = 0;
+ *povCount = 0;
+ return;
+ }
+ std::scoped_lock lock(m_joystickDataMutex);
+ *axisCount = m_joystickData[stick].axes.count;
+ *buttonCount = m_joystickData[stick].buttons.count;
+ *povCount = m_joystickData[stick].povs.count;
+}
+
+void DriverStationData::SetJoystickIsXbox(int32_t stick, HAL_Bool isXbox) {
+ if (stick < 0 || stick >= kNumJoysticks) return;
+ std::scoped_lock lock(m_joystickDataMutex);
+ m_joystickData[stick].descriptor.isXbox = isXbox;
+ m_joystickDescriptorCallbacks(stick, &m_joystickData[stick].descriptor);
+}
+
+void DriverStationData::SetJoystickType(int32_t stick, int32_t type) {
+ if (stick < 0 || stick >= kNumJoysticks) return;
+ std::scoped_lock lock(m_joystickDataMutex);
+ m_joystickData[stick].descriptor.type = type;
+ m_joystickDescriptorCallbacks(stick, &m_joystickData[stick].descriptor);
+}
+
+void DriverStationData::SetJoystickName(int32_t stick, const char* name) {
+ if (stick < 0 || stick >= kNumJoysticks) return;
+ std::scoped_lock lock(m_joystickDataMutex);
+ std::strncpy(m_joystickData[stick].descriptor.name, name,
+ sizeof(m_joystickData[stick].descriptor.name) - 1);
+ *(std::end(m_joystickData[stick].descriptor.name) - 1) = '\0';
+ m_joystickDescriptorCallbacks(stick, &m_joystickData[stick].descriptor);
+}
+
+void DriverStationData::SetJoystickAxisType(int32_t stick, int32_t axis,
+ int32_t type) {
+ if (stick < 0 || stick >= kNumJoysticks) return;
+ if (axis < 0 || axis >= HAL_kMaxJoystickAxes) return;
+ std::scoped_lock lock(m_joystickDataMutex);
+ m_joystickData[stick].descriptor.axisTypes[axis] = type;
+ m_joystickDescriptorCallbacks(stick, &m_joystickData[stick].descriptor);
+}
+
+void DriverStationData::SetGameSpecificMessage(const char* message) {
+ std::scoped_lock lock(m_matchInfoMutex);
+ std::strncpy(reinterpret_cast<char*>(m_matchInfo.gameSpecificMessage),
+ message, sizeof(m_matchInfo.gameSpecificMessage) - 1);
+ *(std::end(m_matchInfo.gameSpecificMessage) - 1) = '\0';
+ m_matchInfo.gameSpecificMessageSize = std::strlen(message);
+ m_matchInfoCallbacks(&m_matchInfo);
+}
+
+void DriverStationData::SetEventName(const char* name) {
+ std::scoped_lock lock(m_matchInfoMutex);
+ std::strncpy(m_matchInfo.eventName, name, sizeof(m_matchInfo.eventName) - 1);
+ *(std::end(m_matchInfo.eventName) - 1) = '\0';
+ m_matchInfoCallbacks(&m_matchInfo);
+}
+
+void DriverStationData::SetMatchType(HAL_MatchType type) {
+ std::scoped_lock lock(m_matchInfoMutex);
+ m_matchInfo.matchType = type;
+ m_matchInfoCallbacks(&m_matchInfo);
+}
+
+void DriverStationData::SetMatchNumber(int32_t matchNumber) {
+ std::scoped_lock lock(m_matchInfoMutex);
+ m_matchInfo.matchNumber = matchNumber;
+ m_matchInfoCallbacks(&m_matchInfo);
+}
+
+void DriverStationData::SetReplayNumber(int32_t replayNumber) {
+ std::scoped_lock lock(m_matchInfoMutex);
+ m_matchInfo.replayNumber = replayNumber;
+ m_matchInfoCallbacks(&m_matchInfo);
+}
+
extern "C" {
void HALSIM_ResetDriverStationData(void) { SimDriverStationData->ResetData(); }
@@ -160,21 +369,42 @@
DEFINE_CAPI(HAL_AllianceStationID, AllianceStationId, allianceStationId)
DEFINE_CAPI(double, MatchTime, matchTime)
-void HALSIM_SetJoystickAxes(int32_t joystickNum, const HAL_JoystickAxes* axes) {
- SimDriverStationData->SetJoystickAxes(joystickNum, axes);
+#undef DEFINE_CAPI
+#define DEFINE_CAPI(name, data) \
+ int32_t HALSIM_RegisterJoystick##name##Callback( \
+ int32_t joystickNum, HAL_Joystick##name##Callback callback, void* param, \
+ HAL_Bool initialNotify) { \
+ return SimDriverStationData->RegisterJoystick##name##Callback( \
+ joystickNum, callback, param, initialNotify); \
+ } \
+ \
+ void HALSIM_CancelJoystick##name##Callback(int32_t uid) { \
+ SimDriverStationData->CancelJoystick##name##Callback(uid); \
+ } \
+ \
+ void HALSIM_GetJoystick##name(int32_t joystickNum, HAL_Joystick##name* d) { \
+ SimDriverStationData->GetJoystick##name(joystickNum, d); \
+ } \
+ \
+ void HALSIM_SetJoystick##name(int32_t joystickNum, \
+ const HAL_Joystick##name* d) { \
+ SimDriverStationData->SetJoystick##name(joystickNum, d); \
+ }
+
+DEFINE_CAPI(Axes, axes)
+DEFINE_CAPI(POVs, povs)
+DEFINE_CAPI(Buttons, buttons)
+DEFINE_CAPI(Descriptor, descriptor)
+
+int32_t HALSIM_RegisterJoystickOutputsCallback(
+ int32_t joystickNum, HAL_JoystickOutputsCallback callback, void* param,
+ HAL_Bool initialNotify) {
+ return SimDriverStationData->RegisterJoystickOutputsCallback(
+ joystickNum, callback, param, initialNotify);
}
-void HALSIM_SetJoystickPOVs(int32_t joystickNum, const HAL_JoystickPOVs* povs) {
- SimDriverStationData->SetJoystickPOVs(joystickNum, povs);
-}
-
-void HALSIM_SetJoystickButtons(int32_t joystickNum,
- const HAL_JoystickButtons* buttons) {
- SimDriverStationData->SetJoystickButtons(joystickNum, buttons);
-}
-void HALSIM_SetJoystickDescriptor(int32_t joystickNum,
- const HAL_JoystickDescriptor* descriptor) {
- SimDriverStationData->SetJoystickDescriptor(joystickNum, descriptor);
+void HALSIM_CancelJoystickOutputsCallback(int32_t uid) {
+ SimDriverStationData->CancelJoystickOutputsCallback(uid);
}
void HALSIM_GetJoystickOutputs(int32_t joystickNum, int64_t* outputs,
@@ -183,14 +413,115 @@
rightRumble);
}
+void HALSIM_SetJoystickOutputs(int32_t joystickNum, int64_t outputs,
+ int32_t leftRumble, int32_t rightRumble) {
+ SimDriverStationData->SetJoystickOutputs(joystickNum, outputs, leftRumble,
+ rightRumble);
+}
+
+int32_t HALSIM_RegisterMatchInfoCallback(HAL_MatchInfoCallback callback,
+ void* param, HAL_Bool initialNotify) {
+ return SimDriverStationData->RegisterMatchInfoCallback(callback, param,
+ initialNotify);
+}
+
+void HALSIM_CancelMatchInfoCallback(int32_t uid) {
+ SimDriverStationData->CancelMatchInfoCallback(uid);
+}
+
+void HALSIM_GetMatchInfo(HAL_MatchInfo* info) {
+ SimDriverStationData->GetMatchInfo(info);
+}
+
void HALSIM_SetMatchInfo(const HAL_MatchInfo* info) {
SimDriverStationData->SetMatchInfo(info);
}
+int32_t HALSIM_RegisterDriverStationNewDataCallback(HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify) {
+ return SimDriverStationData->RegisterNewDataCallback(callback, param,
+ initialNotify);
+}
+
+void HALSIM_CancelDriverStationNewDataCallback(int32_t uid) {
+ SimDriverStationData->CancelNewDataCallback(uid);
+}
+
void HALSIM_NotifyDriverStationNewData(void) {
SimDriverStationData->NotifyNewData();
}
+void HALSIM_SetJoystickButton(int32_t stick, int32_t button, HAL_Bool state) {
+ SimDriverStationData->SetJoystickButton(stick, button, state);
+}
+
+void HALSIM_SetJoystickAxis(int32_t stick, int32_t axis, double value) {
+ SimDriverStationData->SetJoystickAxis(stick, axis, value);
+}
+
+void HALSIM_SetJoystickPOV(int32_t stick, int32_t pov, int32_t value) {
+ SimDriverStationData->SetJoystickPOV(stick, pov, value);
+}
+
+void HALSIM_SetJoystickButtonsValue(int32_t stick, uint32_t buttons) {
+ SimDriverStationData->SetJoystickButtons(stick, buttons);
+}
+
+void HALSIM_SetJoystickAxisCount(int32_t stick, int32_t count) {
+ SimDriverStationData->SetJoystickAxisCount(stick, count);
+}
+
+void HALSIM_SetJoystickPOVCount(int32_t stick, int32_t count) {
+ SimDriverStationData->SetJoystickPOVCount(stick, count);
+}
+
+void HALSIM_SetJoystickButtonCount(int32_t stick, int32_t count) {
+ SimDriverStationData->SetJoystickButtonCount(stick, count);
+}
+
+void HALSIM_GetJoystickCounts(int32_t stick, int32_t* axisCount,
+ int32_t* buttonCount, int32_t* povCount) {
+ SimDriverStationData->GetJoystickCounts(stick, axisCount, buttonCount,
+ povCount);
+}
+
+void HALSIM_SetJoystickIsXbox(int32_t stick, HAL_Bool isXbox) {
+ SimDriverStationData->SetJoystickIsXbox(stick, isXbox);
+}
+
+void HALSIM_SetJoystickType(int32_t stick, int32_t type) {
+ SimDriverStationData->SetJoystickType(stick, type);
+}
+
+void HALSIM_SetJoystickName(int32_t stick, const char* name) {
+ SimDriverStationData->SetJoystickName(stick, name);
+}
+
+void HALSIM_SetJoystickAxisType(int32_t stick, int32_t axis, int32_t type) {
+ SimDriverStationData->SetJoystickAxisType(stick, axis, type);
+}
+
+void HALSIM_SetGameSpecificMessage(const char* message) {
+ SimDriverStationData->SetGameSpecificMessage(message);
+}
+
+void HALSIM_SetEventName(const char* name) {
+ SimDriverStationData->SetEventName(name);
+}
+
+void HALSIM_SetMatchType(HAL_MatchType type) {
+ SimDriverStationData->SetMatchType(type);
+}
+
+void HALSIM_SetMatchNumber(int32_t matchNumber) {
+ SimDriverStationData->SetMatchNumber(matchNumber);
+}
+
+void HALSIM_SetReplayNumber(int32_t replayNumber) {
+ SimDriverStationData->SetReplayNumber(replayNumber);
+}
+
#define REGISTER(NAME) \
SimDriverStationData->NAME.RegisterCallback(callback, param, initialNotify)
diff --git a/hal/src/main/native/sim/mockdata/DriverStationDataInternal.h b/hal/src/main/native/sim/mockdata/DriverStationDataInternal.h
index fdeb3c6..2a50742 100644
--- a/hal/src/main/native/sim/mockdata/DriverStationDataInternal.h
+++ b/hal/src/main/native/sim/mockdata/DriverStationDataInternal.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -11,11 +11,11 @@
#include <wpi/spinlock.h>
-#include "mockdata/DriverStationData.h"
-#include "mockdata/SimDataValue.h"
+#include "hal/simulation/DriverStationData.h"
+#include "hal/simulation/SimCallbackRegistry.h"
+#include "hal/simulation/SimDataValue.h"
namespace hal {
-struct JoystickOutputStore;
class DriverStationData {
HAL_SIMDATAVALUE_DEFINE_NAME(Enabled)
@@ -26,6 +26,13 @@
HAL_SIMDATAVALUE_DEFINE_NAME(DsAttached)
HAL_SIMDATAVALUE_DEFINE_NAME(AllianceStationId)
HAL_SIMDATAVALUE_DEFINE_NAME(MatchTime)
+ HAL_SIMCALLBACKREGISTRY_DEFINE_NAME(JoystickAxes)
+ HAL_SIMCALLBACKREGISTRY_DEFINE_NAME(JoystickPOVs)
+ HAL_SIMCALLBACKREGISTRY_DEFINE_NAME(JoystickButtons)
+ HAL_SIMCALLBACKREGISTRY_DEFINE_NAME(JoystickDescriptor)
+ HAL_SIMCALLBACKREGISTRY_DEFINE_NAME(JoystickOutputs)
+ HAL_SIMCALLBACKREGISTRY_DEFINE_NAME(MatchInfo)
+ HAL_SIMCALLBACKREGISTRY_DEFINE_NAME(NewData)
static LLVM_ATTRIBUTE_ALWAYS_INLINE HAL_Value
MakeAllianceStationIdValue(HAL_AllianceStationID value) {
@@ -36,28 +43,82 @@
DriverStationData();
void ResetData();
+ int32_t RegisterJoystickAxesCallback(int32_t joystickNum,
+ HAL_JoystickAxesCallback callback,
+ void* param, HAL_Bool initialNotify);
+ void CancelJoystickAxesCallback(int32_t uid);
void GetJoystickAxes(int32_t joystickNum, HAL_JoystickAxes* axes);
- void GetJoystickPOVs(int32_t joystickNum, HAL_JoystickPOVs* povs);
- void GetJoystickButtons(int32_t joystickNum, HAL_JoystickButtons* buttons);
- void GetJoystickDescriptor(int32_t joystickNum,
- HAL_JoystickDescriptor* descriptor);
- void GetJoystickOutputs(int32_t joystickNum, int64_t* outputs,
- int32_t* leftRumble, int32_t* rightRumble);
- void GetMatchInfo(HAL_MatchInfo* info);
- void FreeMatchInfo(const HAL_MatchInfo* info);
-
void SetJoystickAxes(int32_t joystickNum, const HAL_JoystickAxes* axes);
+
+ int32_t RegisterJoystickPOVsCallback(int32_t joystickNum,
+ HAL_JoystickPOVsCallback callback,
+ void* param, HAL_Bool initialNotify);
+ void CancelJoystickPOVsCallback(int32_t uid);
+ void GetJoystickPOVs(int32_t joystickNum, HAL_JoystickPOVs* povs);
void SetJoystickPOVs(int32_t joystickNum, const HAL_JoystickPOVs* povs);
+
+ int32_t RegisterJoystickButtonsCallback(int32_t joystickNum,
+ HAL_JoystickButtonsCallback callback,
+ void* param, HAL_Bool initialNotify);
+ void CancelJoystickButtonsCallback(int32_t uid);
+ void GetJoystickButtons(int32_t joystickNum, HAL_JoystickButtons* buttons);
void SetJoystickButtons(int32_t joystickNum,
const HAL_JoystickButtons* buttons);
+
+ int32_t RegisterJoystickDescriptorCallback(
+ int32_t joystickNum, HAL_JoystickDescriptorCallback callback, void* param,
+ HAL_Bool initialNotify);
+ void CancelJoystickDescriptorCallback(int32_t uid);
+ void GetJoystickDescriptor(int32_t joystickNum,
+ HAL_JoystickDescriptor* descriptor);
void SetJoystickDescriptor(int32_t joystickNum,
const HAL_JoystickDescriptor* descriptor);
+
+ int32_t RegisterJoystickOutputsCallback(int32_t joystickNum,
+ HAL_JoystickOutputsCallback callback,
+ void* param, HAL_Bool initialNotify);
+ void CancelJoystickOutputsCallback(int32_t uid);
+ void GetJoystickOutputs(int32_t joystickNum, int64_t* outputs,
+ int32_t* leftRumble, int32_t* rightRumble);
void SetJoystickOutputs(int32_t joystickNum, int64_t outputs,
int32_t leftRumble, int32_t rightRumble);
+
+ int32_t RegisterMatchInfoCallback(HAL_MatchInfoCallback callback, void* param,
+ HAL_Bool initialNotify);
+ void CancelMatchInfoCallback(int32_t uid);
+ void GetMatchInfo(HAL_MatchInfo* info);
void SetMatchInfo(const HAL_MatchInfo* info);
+ void FreeMatchInfo(const HAL_MatchInfo* info);
+
+ int32_t RegisterNewDataCallback(HAL_NotifyCallback callback, void* param,
+ HAL_Bool initialNotify);
+ void CancelNewDataCallback(int32_t uid);
+ void CallNewDataCallbacks();
+
void NotifyNewData();
+ void SetJoystickButton(int32_t stick, int32_t button, HAL_Bool state);
+ void SetJoystickAxis(int32_t stick, int32_t axis, double value);
+ void SetJoystickPOV(int32_t stick, int32_t pov, int32_t value);
+ void SetJoystickButtons(int32_t stick, uint32_t buttons);
+ void SetJoystickAxisCount(int32_t stick, int32_t count);
+ void SetJoystickPOVCount(int32_t stick, int32_t count);
+ void SetJoystickButtonCount(int32_t stick, int32_t count);
+ void GetJoystickCounts(int32_t stick, int32_t* axisCount,
+ int32_t* buttonCount, int32_t* povCount);
+
+ void SetJoystickIsXbox(int32_t stick, HAL_Bool isXbox);
+ void SetJoystickType(int32_t stick, int32_t type);
+ void SetJoystickName(int32_t stick, const char* name);
+ void SetJoystickAxisType(int32_t stick, int32_t axis, int32_t type);
+
+ void SetGameSpecificMessage(const char* message);
+ void SetEventName(const char* name);
+ void SetMatchType(HAL_MatchType type);
+ void SetMatchNumber(int32_t matchNumber);
+ void SetReplayNumber(int32_t replayNumber);
+
SimDataValue<HAL_Bool, HAL_MakeBoolean, GetEnabledName> enabled{false};
SimDataValue<HAL_Bool, HAL_MakeBoolean, GetAutonomousName> autonomous{false};
SimDataValue<HAL_Bool, HAL_MakeBoolean, GetTestName> test{false};
@@ -71,16 +132,40 @@
SimDataValue<double, HAL_MakeDouble, GetMatchTimeName> matchTime{0.0};
private:
+ SimCallbackRegistry<HAL_JoystickAxesCallback, GetJoystickAxesName>
+ m_joystickAxesCallbacks;
+ SimCallbackRegistry<HAL_JoystickPOVsCallback, GetJoystickPOVsName>
+ m_joystickPOVsCallbacks;
+ SimCallbackRegistry<HAL_JoystickButtonsCallback, GetJoystickButtonsName>
+ m_joystickButtonsCallbacks;
+ SimCallbackRegistry<HAL_JoystickOutputsCallback, GetJoystickOutputsName>
+ m_joystickOutputsCallbacks;
+ SimCallbackRegistry<HAL_JoystickDescriptorCallback, GetJoystickDescriptorName>
+ m_joystickDescriptorCallbacks;
+ SimCallbackRegistry<HAL_MatchInfoCallback, GetMatchInfoName>
+ m_matchInfoCallbacks;
+ SimCallbackRegistry<HAL_NotifyCallback, GetNewDataName> m_newDataCallbacks;
+
+ struct JoystickOutputStore {
+ int64_t outputs = 0;
+ int32_t leftRumble = 0;
+ int32_t rightRumble = 0;
+ };
+
+ struct JoystickData {
+ HAL_JoystickAxes axes;
+ HAL_JoystickPOVs povs;
+ HAL_JoystickButtons buttons;
+ JoystickOutputStore outputs;
+ HAL_JoystickDescriptor descriptor;
+ };
+
+ static constexpr int kNumJoysticks = 6;
wpi::spinlock m_joystickDataMutex;
+ JoystickData m_joystickData[kNumJoysticks];
+
wpi::spinlock m_matchInfoMutex;
-
- std::unique_ptr<HAL_JoystickAxes[]> m_joystickAxes;
- std::unique_ptr<HAL_JoystickPOVs[]> m_joystickPOVs;
- std::unique_ptr<HAL_JoystickButtons[]> m_joystickButtons;
-
- std::unique_ptr<JoystickOutputStore[]> m_joystickOutputs;
- std::unique_ptr<HAL_JoystickDescriptor[]> m_joystickDescriptor;
- std::unique_ptr<HAL_MatchInfo> m_matchInfo;
+ HAL_MatchInfo m_matchInfo;
};
extern DriverStationData* SimDriverStationData;
} // namespace hal
diff --git a/hal/src/main/native/sim/mockdata/DutyCycleData.cpp b/hal/src/main/native/sim/mockdata/DutyCycleData.cpp
index 04806e0..660522d 100644
--- a/hal/src/main/native/sim/mockdata/DutyCycleData.cpp
+++ b/hal/src/main/native/sim/mockdata/DutyCycleData.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2019-2020 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. */
@@ -30,6 +30,15 @@
}
extern "C" {
+int32_t HALSIM_FindDutyCycleForChannel(int32_t channel) {
+ for (int i = 0; i < kNumDutyCycles; ++i) {
+ if (SimDutyCycleData[i].initialized &&
+ SimDutyCycleData[i].digitalChannel == channel)
+ return i;
+ }
+ return -1;
+}
+
void HALSIM_ResetDutyCycleData(int32_t index) {
SimDutyCycleData[index].ResetData();
}
diff --git a/hal/src/main/native/sim/mockdata/DutyCycleDataInternal.h b/hal/src/main/native/sim/mockdata/DutyCycleDataInternal.h
index 2f98b07..e69f9aa 100644
--- a/hal/src/main/native/sim/mockdata/DutyCycleDataInternal.h
+++ b/hal/src/main/native/sim/mockdata/DutyCycleDataInternal.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2019-2020 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. */
@@ -10,8 +10,8 @@
#include <atomic>
#include <limits>
-#include "mockdata/DutyCycleData.h"
-#include "mockdata/SimDataValue.h"
+#include "hal/simulation/DutyCycleData.h"
+#include "hal/simulation/SimDataValue.h"
namespace hal {
class DutyCycleData {
diff --git a/hal/src/main/native/sim/mockdata/EncoderData.cpp b/hal/src/main/native/sim/mockdata/EncoderData.cpp
index 33bd073..0b17ac3 100644
--- a/hal/src/main/native/sim/mockdata/EncoderData.cpp
+++ b/hal/src/main/native/sim/mockdata/EncoderData.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -36,6 +36,16 @@
}
extern "C" {
+int32_t HALSIM_FindEncoderForChannel(int32_t channel) {
+ for (int i = 0; i < kNumEncoders; ++i) {
+ if (!SimEncoderData[i].initialized) continue;
+ if (SimEncoderData[i].digitalChannelA == channel ||
+ SimEncoderData[i].digitalChannelB == channel)
+ return i;
+ }
+ return -1;
+}
+
void HALSIM_ResetEncoderData(int32_t index) {
SimEncoderData[index].ResetData();
}
@@ -57,7 +67,6 @@
SimEncoderData, LOWERNAME)
DEFINE_CAPI(HAL_Bool, Initialized, initialized)
-DEFINE_CAPI(int32_t, Count, count)
DEFINE_CAPI(double, Period, period)
DEFINE_CAPI(HAL_Bool, Reset, reset)
DEFINE_CAPI(double, MaxPeriod, maxPeriod)
@@ -66,6 +75,54 @@
DEFINE_CAPI(int32_t, SamplesToAverage, samplesToAverage)
DEFINE_CAPI(double, DistancePerPulse, distancePerPulse)
+int32_t HALSIM_RegisterEncoderCountCallback(int32_t index,
+ HAL_NotifyCallback callback,
+ void* param,
+ HAL_Bool initialNotify) {
+ return SimEncoderData[index].count.RegisterCallback(callback, param,
+ initialNotify);
+}
+
+void HALSIM_CancelEncoderCountCallback(int32_t index, int32_t uid) {
+ SimEncoderData[index].count.CancelCallback(uid);
+}
+
+int32_t HALSIM_GetEncoderCount(int32_t index) {
+ return SimEncoderData[index].count;
+}
+
+void HALSIM_SetEncoderCount(int32_t index, int32_t count) {
+ SimEncoderData[index].count = count;
+ SimEncoderData[index].reset = false;
+}
+
+void HALSIM_SetEncoderDistance(int32_t index, double distance) {
+ auto& simData = SimEncoderData[index];
+ simData.count = distance / simData.distancePerPulse;
+ simData.reset = false;
+}
+
+double HALSIM_GetEncoderDistance(int32_t index) {
+ auto& simData = SimEncoderData[index];
+ return simData.count * simData.distancePerPulse;
+}
+
+void HALSIM_SetEncoderRate(int32_t index, double rate) {
+ auto& simData = SimEncoderData[index];
+ if (rate == 0) {
+ simData.period = std::numeric_limits<double>::infinity();
+ return;
+ }
+
+ simData.period = simData.distancePerPulse / rate;
+}
+
+double HALSIM_GetEncoderRate(int32_t index) {
+ auto& simData = SimEncoderData[index];
+
+ return simData.distancePerPulse / simData.period;
+}
+
#define REGISTER(NAME) \
SimEncoderData[index].NAME.RegisterCallback(callback, param, initialNotify)
diff --git a/hal/src/main/native/sim/mockdata/EncoderDataInternal.h b/hal/src/main/native/sim/mockdata/EncoderDataInternal.h
index 389289c..3848f1d 100644
--- a/hal/src/main/native/sim/mockdata/EncoderDataInternal.h
+++ b/hal/src/main/native/sim/mockdata/EncoderDataInternal.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -10,8 +10,8 @@
#include <atomic>
#include <limits>
-#include "mockdata/EncoderData.h"
-#include "mockdata/SimDataValue.h"
+#include "hal/simulation/EncoderData.h"
+#include "hal/simulation/SimDataValue.h"
namespace hal {
class EncoderData {
diff --git a/hal/src/main/native/sim/mockdata/I2CData.cpp b/hal/src/main/native/sim/mockdata/I2CData.cpp
index b228c3b..713064e 100644
--- a/hal/src/main/native/sim/mockdata/I2CData.cpp
+++ b/hal/src/main/native/sim/mockdata/I2CData.cpp
@@ -1,12 +1,10 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
/*----------------------------------------------------------------------------*/
-#include <iostream>
-
#include "../PortsInternal.h"
#include "I2CDataInternal.h"
diff --git a/hal/src/main/native/sim/mockdata/I2CDataInternal.h b/hal/src/main/native/sim/mockdata/I2CDataInternal.h
index c799bb7..4822222 100644
--- a/hal/src/main/native/sim/mockdata/I2CDataInternal.h
+++ b/hal/src/main/native/sim/mockdata/I2CDataInternal.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,9 +7,9 @@
#pragma once
-#include "mockdata/I2CData.h"
-#include "mockdata/SimCallbackRegistry.h"
-#include "mockdata/SimDataValue.h"
+#include "hal/simulation/I2CData.h"
+#include "hal/simulation/SimCallbackRegistry.h"
+#include "hal/simulation/SimDataValue.h"
namespace hal {
class I2CData {
diff --git a/hal/src/main/native/sim/mockdata/PCMDataInternal.h b/hal/src/main/native/sim/mockdata/PCMDataInternal.h
index 0c7b99b..0d3752e 100644
--- a/hal/src/main/native/sim/mockdata/PCMDataInternal.h
+++ b/hal/src/main/native/sim/mockdata/PCMDataInternal.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -8,8 +8,8 @@
#pragma once
#include "../PortsInternal.h"
-#include "mockdata/PCMData.h"
-#include "mockdata/SimDataValue.h"
+#include "hal/simulation/PCMData.h"
+#include "hal/simulation/SimDataValue.h"
namespace hal {
class PCMData {
diff --git a/hal/src/main/native/sim/mockdata/PDPDataInternal.h b/hal/src/main/native/sim/mockdata/PDPDataInternal.h
index 8d45416..3392eaa 100644
--- a/hal/src/main/native/sim/mockdata/PDPDataInternal.h
+++ b/hal/src/main/native/sim/mockdata/PDPDataInternal.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -8,8 +8,8 @@
#pragma once
#include "../PortsInternal.h"
-#include "mockdata/PDPData.h"
-#include "mockdata/SimDataValue.h"
+#include "hal/simulation/PDPData.h"
+#include "hal/simulation/SimDataValue.h"
namespace hal {
class PDPData {
diff --git a/hal/src/main/native/sim/mockdata/PWMDataInternal.h b/hal/src/main/native/sim/mockdata/PWMDataInternal.h
index 248b7b3..028e25a 100644
--- a/hal/src/main/native/sim/mockdata/PWMDataInternal.h
+++ b/hal/src/main/native/sim/mockdata/PWMDataInternal.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,8 +7,8 @@
#pragma once
-#include "mockdata/PWMData.h"
-#include "mockdata/SimDataValue.h"
+#include "hal/simulation/PWMData.h"
+#include "hal/simulation/SimDataValue.h"
namespace hal {
class PWMData {
diff --git a/hal/src/main/native/sim/mockdata/RelayDataInternal.h b/hal/src/main/native/sim/mockdata/RelayDataInternal.h
index cb38388..d62ea2f 100644
--- a/hal/src/main/native/sim/mockdata/RelayDataInternal.h
+++ b/hal/src/main/native/sim/mockdata/RelayDataInternal.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,8 +7,8 @@
#pragma once
-#include "mockdata/RelayData.h"
-#include "mockdata/SimDataValue.h"
+#include "hal/simulation/RelayData.h"
+#include "hal/simulation/SimDataValue.h"
namespace hal {
class RelayData {
diff --git a/hal/src/main/native/sim/mockdata/RoboRioData.cpp b/hal/src/main/native/sim/mockdata/RoboRioData.cpp
index 5cff1d9..76406f5 100644
--- a/hal/src/main/native/sim/mockdata/RoboRioData.cpp
+++ b/hal/src/main/native/sim/mockdata/RoboRioData.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -13,8 +13,8 @@
namespace hal {
namespace init {
void InitializeRoboRioData() {
- static RoboRioData srrd[1];
- ::hal::SimRoboRioData = srrd;
+ static RoboRioData srrd;
+ ::hal::SimRoboRioData = &srrd;
}
} // namespace init
} // namespace hal
@@ -22,30 +22,28 @@
RoboRioData* hal::SimRoboRioData;
void RoboRioData::ResetData() {
fpgaButton.Reset(false);
- vInVoltage.Reset(0.0);
+ vInVoltage.Reset(12.0);
vInCurrent.Reset(0.0);
userVoltage6V.Reset(6.0);
userCurrent6V.Reset(0.0);
- userActive6V.Reset(false);
+ userActive6V.Reset(true);
userVoltage5V.Reset(5.0);
userCurrent5V.Reset(0.0);
- userActive5V.Reset(false);
+ userActive5V.Reset(true);
userVoltage3V3.Reset(3.3);
userCurrent3V3.Reset(0.0);
- userActive3V3.Reset(false);
+ userActive3V3.Reset(true);
userFaults6V.Reset(0);
userFaults5V.Reset(0);
userFaults3V3.Reset(0);
}
extern "C" {
-void HALSIM_ResetRoboRioData(int32_t index) {
- SimRoboRioData[index].ResetData();
-}
+void HALSIM_ResetRoboRioData(void) { SimRoboRioData->ResetData(); }
-#define DEFINE_CAPI(TYPE, CAPINAME, LOWERNAME) \
- HAL_SIMDATAVALUE_DEFINE_CAPI(TYPE, HALSIM, RoboRio##CAPINAME, \
- SimRoboRioData, LOWERNAME)
+#define DEFINE_CAPI(TYPE, CAPINAME, LOWERNAME) \
+ HAL_SIMDATAVALUE_DEFINE_CAPI_NOINDEX(TYPE, HALSIM, RoboRio##CAPINAME, \
+ SimRoboRioData, LOWERNAME)
DEFINE_CAPI(HAL_Bool, FPGAButton, fpgaButton)
DEFINE_CAPI(double, VInVoltage, vInVoltage)
@@ -64,10 +62,9 @@
DEFINE_CAPI(int32_t, UserFaults3V3, userFaults3V3)
#define REGISTER(NAME) \
- SimRoboRioData[index].NAME.RegisterCallback(callback, param, initialNotify)
+ SimRoboRioData->NAME.RegisterCallback(callback, param, initialNotify)
-void HALSIM_RegisterRoboRioAllCallbacks(int32_t index,
- HAL_NotifyCallback callback,
+void HALSIM_RegisterRoboRioAllCallbacks(HAL_NotifyCallback callback,
void* param, HAL_Bool initialNotify) {
REGISTER(fpgaButton);
REGISTER(vInVoltage);
diff --git a/hal/src/main/native/sim/mockdata/RoboRioDataInternal.h b/hal/src/main/native/sim/mockdata/RoboRioDataInternal.h
index cc74fa2..2fb3456 100644
--- a/hal/src/main/native/sim/mockdata/RoboRioDataInternal.h
+++ b/hal/src/main/native/sim/mockdata/RoboRioDataInternal.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,8 +7,8 @@
#pragma once
-#include "mockdata/RoboRioData.h"
-#include "mockdata/SimDataValue.h"
+#include "hal/simulation/RoboRioData.h"
+#include "hal/simulation/SimDataValue.h"
namespace hal {
class RoboRioData {
@@ -30,22 +30,22 @@
public:
SimDataValue<HAL_Bool, HAL_MakeBoolean, GetFPGAButtonName> fpgaButton{false};
- SimDataValue<double, HAL_MakeDouble, GetVInVoltageName> vInVoltage{0.0};
+ SimDataValue<double, HAL_MakeDouble, GetVInVoltageName> vInVoltage{12.0};
SimDataValue<double, HAL_MakeDouble, GetVInCurrentName> vInCurrent{0.0};
SimDataValue<double, HAL_MakeDouble, GetUserVoltage6VName> userVoltage6V{6.0};
SimDataValue<double, HAL_MakeDouble, GetUserCurrent6VName> userCurrent6V{0.0};
SimDataValue<HAL_Bool, HAL_MakeBoolean, GetUserActive6VName> userActive6V{
- false};
+ true};
SimDataValue<double, HAL_MakeDouble, GetUserVoltage5VName> userVoltage5V{5.0};
SimDataValue<double, HAL_MakeDouble, GetUserCurrent5VName> userCurrent5V{0.0};
SimDataValue<HAL_Bool, HAL_MakeBoolean, GetUserActive5VName> userActive5V{
- false};
+ true};
SimDataValue<double, HAL_MakeDouble, GetUserVoltage3V3Name> userVoltage3V3{
3.3};
SimDataValue<double, HAL_MakeDouble, GetUserCurrent3V3Name> userCurrent3V3{
0.0};
SimDataValue<HAL_Bool, HAL_MakeBoolean, GetUserActive3V3Name> userActive3V3{
- false};
+ true};
SimDataValue<int32_t, HAL_MakeInt, GetUserFaults6VName> userFaults6V{0};
SimDataValue<int32_t, HAL_MakeInt, GetUserFaults5VName> userFaults5V{0};
SimDataValue<int32_t, HAL_MakeInt, GetUserFaults3V3Name> userFaults3V3{0};
diff --git a/hal/src/main/native/sim/mockdata/SPIAccelerometerDataInternal.h b/hal/src/main/native/sim/mockdata/SPIAccelerometerDataInternal.h
index 661e01b..59c6685 100644
--- a/hal/src/main/native/sim/mockdata/SPIAccelerometerDataInternal.h
+++ b/hal/src/main/native/sim/mockdata/SPIAccelerometerDataInternal.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,8 +7,8 @@
#pragma once
-#include "mockdata/SPIAccelerometerData.h"
-#include "mockdata/SimDataValue.h"
+#include "hal/simulation/SPIAccelerometerData.h"
+#include "hal/simulation/SimDataValue.h"
namespace hal {
class SPIAccelerometerData {
diff --git a/hal/src/main/native/sim/mockdata/SPIData.cpp b/hal/src/main/native/sim/mockdata/SPIData.cpp
index 3afc606..106ab7f 100644
--- a/hal/src/main/native/sim/mockdata/SPIData.cpp
+++ b/hal/src/main/native/sim/mockdata/SPIData.cpp
@@ -1,12 +1,10 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
/*----------------------------------------------------------------------------*/
-#include <iostream>
-
#include "../PortsInternal.h"
#include "SPIDataInternal.h"
diff --git a/hal/src/main/native/sim/mockdata/SPIDataInternal.h b/hal/src/main/native/sim/mockdata/SPIDataInternal.h
index 44868d2..ff0a6c9 100644
--- a/hal/src/main/native/sim/mockdata/SPIDataInternal.h
+++ b/hal/src/main/native/sim/mockdata/SPIDataInternal.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2017-2020 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. */
@@ -7,9 +7,9 @@
#pragma once
-#include "mockdata/SPIData.h"
-#include "mockdata/SimCallbackRegistry.h"
-#include "mockdata/SimDataValue.h"
+#include "hal/simulation/SPIData.h"
+#include "hal/simulation/SimCallbackRegistry.h"
+#include "hal/simulation/SimDataValue.h"
namespace hal {
diff --git a/hal/src/main/native/sim/mockdata/SimDeviceData.cpp b/hal/src/main/native/sim/mockdata/SimDeviceData.cpp
index a703257..6c0a7f2 100644
--- a/hal/src/main/native/sim/mockdata/SimDeviceData.cpp
+++ b/hal/src/main/native/sim/mockdata/SimDeviceData.cpp
@@ -1,11 +1,11 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2019-2020 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. */
/*----------------------------------------------------------------------------*/
-#include "mockdata/SimDeviceData.h" // NOLINT(build/include_order)
+#include "hal/simulation/SimDeviceData.h" // NOLINT(build/include_order)
#include <algorithm>
@@ -49,12 +49,43 @@
return deviceImpl->values[handle].get();
}
+void SimDeviceData::SetDeviceEnabled(const char* prefix, bool enabled) {
+ std::scoped_lock lock(m_mutex);
+ auto it =
+ std::find_if(m_prefixEnabled.begin(), m_prefixEnabled.end(),
+ [=](const auto& elem) { return elem.first == prefix; });
+ if (it != m_prefixEnabled.end()) {
+ it->second = enabled;
+ return;
+ }
+ m_prefixEnabled.emplace_back(prefix, enabled);
+ // keep it sorted by name
+ // string comparison sorts shorter before longer, so reverse the sort
+ std::sort(m_prefixEnabled.begin(), m_prefixEnabled.end(),
+ [](const auto& l, const auto& r) { return l.first >= r.first; });
+}
+
+bool SimDeviceData::IsDeviceEnabled(const char* name) {
+ std::scoped_lock lock(m_mutex);
+ for (const auto& elem : m_prefixEnabled) {
+ if (wpi::StringRef{name}.startswith(elem.first)) return elem.second;
+ }
+ return true;
+}
+
HAL_SimDeviceHandle SimDeviceData::CreateDevice(const char* name) {
std::scoped_lock lock(m_mutex);
+ // don't create if disabled
+ for (const auto& elem : m_prefixEnabled) {
+ if (wpi::StringRef{name}.startswith(elem.first)) {
+ if (elem.second) break; // enabled
+ return 0; // disabled
+ }
+ }
+
// check for duplicates and don't overwrite them
- auto it = m_deviceMap.find(name);
- if (it != m_deviceMap.end()) return 0;
+ if (m_deviceMap.count(name) > 0) return 0;
// don't allow more than 4096 devices (limit driven by 12-bit allocation in
// value changed callback uid)
@@ -326,12 +357,21 @@
std::scoped_lock lock(m_mutex);
m_devices.clear();
m_deviceMap.clear();
+ m_prefixEnabled.clear();
m_deviceCreated.Reset();
m_deviceFreed.Reset();
}
extern "C" {
+void HALSIM_SetSimDeviceEnabled(const char* prefix, HAL_Bool enabled) {
+ SimSimDeviceData->SetDeviceEnabled(prefix, enabled);
+}
+
+HAL_Bool HALSIM_IsSimDeviceEnabled(const char* name) {
+ return SimSimDeviceData->IsDeviceEnabled(name);
+}
+
int32_t HALSIM_RegisterSimDeviceCreatedCallback(
const char* prefix, void* param, HALSIM_SimDeviceCallback callback,
HAL_Bool initialNotify) {
diff --git a/hal/src/main/native/sim/mockdata/SimDeviceDataInternal.h b/hal/src/main/native/sim/mockdata/SimDeviceDataInternal.h
index 2582eca..63c2288 100644
--- a/hal/src/main/native/sim/mockdata/SimDeviceDataInternal.h
+++ b/hal/src/main/native/sim/mockdata/SimDeviceDataInternal.h
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2019-2020 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. */
@@ -19,8 +19,8 @@
#include <wpi/spinlock.h>
#include "hal/Value.h"
-#include "mockdata/SimCallbackRegistry.h"
-#include "mockdata/SimDeviceData.h"
+#include "hal/simulation/SimCallbackRegistry.h"
+#include "hal/simulation/SimDeviceData.h"
namespace hal {
@@ -150,6 +150,7 @@
wpi::UidVector<std::shared_ptr<Device>, 4> m_devices;
wpi::StringMap<std::weak_ptr<Device>> m_deviceMap;
+ std::vector<std::pair<std::string, bool>> m_prefixEnabled;
wpi::recursive_spinlock m_mutex;
@@ -161,6 +162,9 @@
Value* LookupValue(HAL_SimValueHandle handle);
public:
+ void SetDeviceEnabled(const char* prefix, bool enabled);
+ bool IsDeviceEnabled(const char* name);
+
HAL_SimDeviceHandle CreateDevice(const char* name);
void FreeDevice(HAL_SimDeviceHandle handle);
HAL_SimValueHandle CreateValue(HAL_SimDeviceHandle device, const char* name,
diff --git a/hal/src/test/java/edu/wpi/first/hal/sim/AccelerometerSimTest.java b/hal/src/test/java/edu/wpi/first/hal/sim/AccelerometerSimTest.java
deleted file mode 100644
index 383165c..0000000
--- a/hal/src/test/java/edu/wpi/first/hal/sim/AccelerometerSimTest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* 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. */
-/*----------------------------------------------------------------------------*/
-
-package edu.wpi.first.hal.sim;
-
-import org.junit.jupiter.api.Test;
-
-import edu.wpi.first.hal.AccelerometerJNI;
-import edu.wpi.first.hal.HAL;
-
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-class AccelerometerSimTest {
- static class TriggeredStore {
- public boolean m_wasTriggered;
- public boolean m_setValue = true;
- }
-
- @Test
- void testCallbacks() {
- HAL.initialize(500, 0);
- AccelerometerSim sim = new AccelerometerSim();
- sim.resetData();
-
- TriggeredStore store = new TriggeredStore();
-
- try (CallbackStore cb = sim.registerActiveCallback((s, v) -> {
- store.m_wasTriggered = true;
- store.m_setValue = v.getBoolean();
- }, false)) {
- assertFalse(store.m_wasTriggered);
- AccelerometerJNI.setAccelerometerActive(true);
- assertTrue(store.m_wasTriggered);
- assertTrue(store.m_setValue);
- }
- }
-}
diff --git a/hal/src/test/java/edu/wpi/first/hal/sim/SimDeviceSimTest.java b/hal/src/test/java/edu/wpi/first/hal/sim/SimDeviceSimTest.java
deleted file mode 100644
index 29452a0..0000000
--- a/hal/src/test/java/edu/wpi/first/hal/sim/SimDeviceSimTest.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 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. */
-/*----------------------------------------------------------------------------*/
-
-package edu.wpi.first.hal.sim;
-
-import org.junit.jupiter.api.Test;
-
-import edu.wpi.first.hal.SimBoolean;
-import edu.wpi.first.hal.SimDevice;
-
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-class SimDeviceSimTest {
- @Test
- void testBasic() {
- SimDevice dev = SimDevice.create("test");
- SimBoolean devBool = dev.createBoolean("bool", false, false);
-
- SimDeviceSim sim = new SimDeviceSim("test");
- SimBoolean simBool = sim.getBoolean("bool");
-
- assertFalse(simBool.get());
- simBool.set(true);
- assertTrue(devBool.get());
- }
-}
diff --git a/hal/src/test/native/cpp/can/CANTest.cpp b/hal/src/test/native/cpp/can/CANTest.cpp
index 6f5549c..427bb54 100644
--- a/hal/src/test/native/cpp/can/CANTest.cpp
+++ b/hal/src/test/native/cpp/can/CANTest.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2015-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2015-2020 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. */
@@ -8,7 +8,7 @@
#include "gtest/gtest.h"
#include "hal/CANAPI.h"
#include "hal/HAL.h"
-#include "mockdata/CanData.h"
+#include "hal/simulation/CanData.h"
namespace hal {
struct CANTestStore {
diff --git a/hal/src/test/native/cpp/mockdata/AnalogInDataTests.cpp b/hal/src/test/native/cpp/mockdata/AnalogInDataTests.cpp
index 791be79..c102480 100644
--- a/hal/src/test/native/cpp/mockdata/AnalogInDataTests.cpp
+++ b/hal/src/test/native/cpp/mockdata/AnalogInDataTests.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2015-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2015-2020 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. */
@@ -9,7 +9,7 @@
#include "hal/AnalogInput.h"
#include "hal/HAL.h"
#include "hal/handles/HandlesInternal.h"
-#include "mockdata/AnalogInData.h"
+#include "hal/simulation/AnalogInData.h"
namespace hal {
diff --git a/hal/src/test/native/cpp/mockdata/AnalogOutDataTests.cpp b/hal/src/test/native/cpp/mockdata/AnalogOutDataTests.cpp
index 8f6d6f0..d6c9f70 100644
--- a/hal/src/test/native/cpp/mockdata/AnalogOutDataTests.cpp
+++ b/hal/src/test/native/cpp/mockdata/AnalogOutDataTests.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2015-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2015-2020 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. */
@@ -9,7 +9,7 @@
#include "hal/AnalogOutput.h"
#include "hal/HAL.h"
#include "hal/handles/HandlesInternal.h"
-#include "mockdata/AnalogOutData.h"
+#include "hal/simulation/AnalogOutData.h"
namespace hal {
diff --git a/hal/src/test/native/cpp/mockdata/DIODataTests.cpp b/hal/src/test/native/cpp/mockdata/DIODataTests.cpp
index 19fe994..248f841 100644
--- a/hal/src/test/native/cpp/mockdata/DIODataTests.cpp
+++ b/hal/src/test/native/cpp/mockdata/DIODataTests.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2015-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2015-2020 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. */
@@ -9,7 +9,7 @@
#include "hal/DIO.h"
#include "hal/HAL.h"
#include "hal/handles/HandlesInternal.h"
-#include "mockdata/DIOData.h"
+#include "hal/simulation/DIOData.h"
namespace hal {
diff --git a/hal/src/test/native/cpp/mockdata/DriverStationDataTests.cpp b/hal/src/test/native/cpp/mockdata/DriverStationDataTests.cpp
index 5505c06..5cb28c4 100644
--- a/hal/src/test/native/cpp/mockdata/DriverStationDataTests.cpp
+++ b/hal/src/test/native/cpp/mockdata/DriverStationDataTests.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2015-2019 FIRST. All Rights Reserved. */
+/* Copyright (c) 2015-2020 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. */
@@ -10,7 +10,7 @@
#include "gtest/gtest.h"
#include "hal/HAL.h"
#include "hal/Solenoid.h"
-#include "mockdata/DriverStationData.h"
+#include "hal/simulation/DriverStationData.h"
namespace hal {
diff --git a/hal/src/test/native/cpp/mockdata/I2CDataTests.cpp b/hal/src/test/native/cpp/mockdata/I2CDataTests.cpp
index 3a8e01c..b78564b 100644
--- a/hal/src/test/native/cpp/mockdata/I2CDataTests.cpp
+++ b/hal/src/test/native/cpp/mockdata/I2CDataTests.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2015-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2015-2020 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. */
@@ -9,7 +9,7 @@
#include "hal/HAL.h"
#include "hal/I2C.h"
#include "hal/handles/HandlesInternal.h"
-#include "mockdata/I2CData.h"
+#include "hal/simulation/I2CData.h"
namespace hal {
diff --git a/hal/src/test/native/cpp/mockdata/PCMDataTests.cpp b/hal/src/test/native/cpp/mockdata/PCMDataTests.cpp
index 50a8ae3..5fc19aa 100644
--- a/hal/src/test/native/cpp/mockdata/PCMDataTests.cpp
+++ b/hal/src/test/native/cpp/mockdata/PCMDataTests.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2015-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2015-2020 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. */
@@ -9,7 +9,7 @@
#include "hal/HAL.h"
#include "hal/Solenoid.h"
#include "hal/handles/HandlesInternal.h"
-#include "mockdata/PCMData.h"
+#include "hal/simulation/PCMData.h"
namespace hal {
diff --git a/hal/src/test/native/cpp/mockdata/PDPDataTests.cpp b/hal/src/test/native/cpp/mockdata/PDPDataTests.cpp
index a46454f..f980c7c 100644
--- a/hal/src/test/native/cpp/mockdata/PDPDataTests.cpp
+++ b/hal/src/test/native/cpp/mockdata/PDPDataTests.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2015-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2015-2020 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. */
@@ -9,7 +9,7 @@
#include "hal/HAL.h"
#include "hal/PDP.h"
#include "hal/handles/HandlesInternal.h"
-#include "mockdata/PDPData.h"
+#include "hal/simulation/PDPData.h"
namespace hal {
diff --git a/hal/src/test/native/cpp/mockdata/PWMDataTests.cpp b/hal/src/test/native/cpp/mockdata/PWMDataTests.cpp
index 447a510..daca364 100644
--- a/hal/src/test/native/cpp/mockdata/PWMDataTests.cpp
+++ b/hal/src/test/native/cpp/mockdata/PWMDataTests.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2015-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2015-2020 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. */
@@ -9,7 +9,7 @@
#include "hal/HAL.h"
#include "hal/PWM.h"
#include "hal/handles/HandlesInternal.h"
-#include "mockdata/PWMData.h"
+#include "hal/simulation/PWMData.h"
namespace hal {
diff --git a/hal/src/test/native/cpp/mockdata/RelayDataTests.cpp b/hal/src/test/native/cpp/mockdata/RelayDataTests.cpp
index 408657a..edc0fb4 100644
--- a/hal/src/test/native/cpp/mockdata/RelayDataTests.cpp
+++ b/hal/src/test/native/cpp/mockdata/RelayDataTests.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2015-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2015-2020 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. */
@@ -9,7 +9,7 @@
#include "hal/HAL.h"
#include "hal/Relay.h"
#include "hal/handles/HandlesInternal.h"
-#include "mockdata/RelayData.h"
+#include "hal/simulation/RelayData.h"
namespace hal {
diff --git a/hal/src/test/native/cpp/mockdata/SPIDataTests.cpp b/hal/src/test/native/cpp/mockdata/SPIDataTests.cpp
index 64c8555..423db6d 100644
--- a/hal/src/test/native/cpp/mockdata/SPIDataTests.cpp
+++ b/hal/src/test/native/cpp/mockdata/SPIDataTests.cpp
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2015-2018 FIRST. All Rights Reserved. */
+/* Copyright (c) 2015-2020 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. */
@@ -9,7 +9,7 @@
#include "hal/HAL.h"
#include "hal/SPI.h"
#include "hal/handles/HandlesInternal.h"
-#include "mockdata/SPIData.h"
+#include "hal/simulation/SPIData.h"
namespace hal {
diff --git a/hal/src/test/native/cpp/mockdata/SimDeviceDataTests.cpp b/hal/src/test/native/cpp/mockdata/SimDeviceDataTests.cpp
new file mode 100644
index 0000000..8f65f5c
--- /dev/null
+++ b/hal/src/test/native/cpp/mockdata/SimDeviceDataTests.cpp
@@ -0,0 +1,25 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2020 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. */
+/*----------------------------------------------------------------------------*/
+
+#include "gtest/gtest.h"
+#include "hal/SimDevice.h"
+#include "hal/simulation/SimDeviceData.h"
+
+namespace hal {
+
+TEST(SimDeviceSimTests, TestEnabled) {
+ ASSERT_TRUE(HALSIM_IsSimDeviceEnabled("foo"));
+ HALSIM_SetSimDeviceEnabled("f", false);
+ HALSIM_SetSimDeviceEnabled("foob", true);
+ ASSERT_FALSE(HALSIM_IsSimDeviceEnabled("foo"));
+ ASSERT_TRUE(HALSIM_IsSimDeviceEnabled("foobar"));
+ ASSERT_TRUE(HALSIM_IsSimDeviceEnabled("bar"));
+
+ ASSERT_EQ(HAL_CreateSimDevice("foo"), 0);
+}
+
+} // namespace hal
diff --git a/hal/src/test/native/cpp/sim/AccelerometerSimTest.cpp b/hal/src/test/native/cpp/sim/AccelerometerSimTest.cpp
deleted file mode 100644
index 54be6e3..0000000
--- a/hal/src/test/native/cpp/sim/AccelerometerSimTest.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* 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. */
-/*----------------------------------------------------------------------------*/
-
-#include "gtest/gtest.h"
-#include "hal/Accelerometer.h"
-#include "hal/HAL.h"
-#include "simulation/AccelerometerSim.h"
-
-using namespace frc::sim;
-
-namespace hal {
-
-TEST(AcclerometerSimTests, TestActiveCallback) {
- HAL_Initialize(500, 0);
-
- AccelerometerSim sim{0};
-
- sim.ResetData();
-
- bool wasTriggered = false;
- bool lastValue = false;
-
- auto cb = sim.RegisterActiveCallback(
- [&](wpi::StringRef name, const HAL_Value* value) {
- wasTriggered = true;
- lastValue = value->data.v_boolean;
- },
- false);
-
- EXPECT_FALSE(wasTriggered);
-
- HAL_SetAccelerometerActive(true);
-
- EXPECT_TRUE(wasTriggered);
- EXPECT_TRUE(lastValue);
-}
-
-} // namespace hal
diff --git a/hal/src/test/native/cpp/sim/SimDeviceSimTest.cpp b/hal/src/test/native/cpp/sim/SimDeviceSimTest.cpp
deleted file mode 100644
index ba0646d..0000000
--- a/hal/src/test/native/cpp/sim/SimDeviceSimTest.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* Copyright (c) 2019 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. */
-/*----------------------------------------------------------------------------*/
-
-#include <wpi/StringRef.h>
-
-#include "gtest/gtest.h"
-#include "hal/SimDevice.h"
-#include "simulation/SimDeviceSim.h"
-
-using namespace frc::sim;
-
-namespace hal {
-
-TEST(SimDeviceSimTests, TestBasic) {
- SimDevice dev{"test"};
- SimBoolean devBool = dev.CreateBoolean("bool", false, false);
-
- SimDeviceSim sim{"test"};
- SimBoolean simBool = sim.GetBoolean("bool");
- EXPECT_FALSE(simBool.Get());
- simBool.Set(true);
- EXPECT_TRUE(devBool.Get());
-}
-
-TEST(SimDeviceSimTests, TestEnumerateDevices) {
- SimDevice dev{"test"};
-
- bool foundit = false;
- SimDeviceSim::EnumerateDevices(
- "te", [&](const char* name, HAL_SimDeviceHandle handle) {
- if (wpi::StringRef(name) == "test") foundit = true;
- });
- EXPECT_TRUE(foundit);
-}
-
-} // namespace hal
diff --git a/hal/src/test/native/cpp/sim/SimInitializationTest.cpp b/hal/src/test/native/cpp/sim/SimInitializationTest.cpp
deleted file mode 100644
index fdd34cd..0000000
--- a/hal/src/test/native/cpp/sim/SimInitializationTest.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/* 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. */
-/*----------------------------------------------------------------------------*/
-
-#include "gtest/gtest.h"
-#include "hal/HAL.h"
-#include "simulation/AccelerometerSim.h"
-#include "simulation/AnalogGyroSim.h"
-#include "simulation/AnalogInSim.h"
-#include "simulation/AnalogOutSim.h"
-#include "simulation/AnalogTriggerSim.h"
-#include "simulation/DIOSim.h"
-#include "simulation/DigitalPWMSim.h"
-#include "simulation/DriverStationSim.h"
-#include "simulation/EncoderSim.h"
-#include "simulation/PCMSim.h"
-#include "simulation/PDPSim.h"
-#include "simulation/PWMSim.h"
-#include "simulation/RelaySim.h"
-#include "simulation/RoboRioSim.h"
-#include "simulation/SPIAccelerometerSim.h"
-
-using namespace frc::sim;
-
-namespace hal {
-
-TEST(SimInitializationTests, TestAllInitialize) {
- HAL_Initialize(500, 0);
- AccelerometerSim acsim{0};
- AnalogGyroSim agsim{0};
- AnalogInSim aisim{0};
- AnalogOutSim aosim{0};
- AnalogTriggerSim atsim{0};
- DigitalPWMSim dpsim{0};
- DIOSim diosim{0};
- DriverStationSim dssim;
- (void)dssim;
- EncoderSim esim{0};
- PCMSim pcmsim{0};
- PDPSim pdpsim{0};
- PWMSim pwmsim{0};
- RelaySim rsim{0};
- RoboRioSim rrsim{0};
- SPIAccelerometerSim sasim{0};
-}
-} // namespace hal