mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Run wpiformat on merged repo (#1021)
This commit is contained in:
committed by
Peter Johnson
parent
0babbf317c
commit
6729a7d6b1
22
.styleguide
22
.styleguide
@@ -9,33 +9,25 @@ cppSrcFileInclude {
|
||||
}
|
||||
|
||||
generatedFileExclude {
|
||||
gmock/
|
||||
gtest/
|
||||
ni-libraries/include/
|
||||
ni-libraries/lib/
|
||||
hal/src/main/native/athena/ctre/
|
||||
hal/src/main/native/athena/frccansae/
|
||||
hal/src/main/native/athena/visa/
|
||||
hal/src/main/native/include/ctre/
|
||||
UsageReporting\.h$
|
||||
}
|
||||
|
||||
modifiableFileExclude {
|
||||
wpilibj/src/arm-linux-jni/
|
||||
wpilibj/src/main/native/cpp/
|
||||
\.patch$
|
||||
\.png$
|
||||
shared/arm-linux-jni/
|
||||
\.py$
|
||||
\.so$
|
||||
}
|
||||
|
||||
repoRootNameOverride {
|
||||
wpilib
|
||||
}
|
||||
|
||||
includeOtherLibs {
|
||||
^HAL/
|
||||
^llvm/
|
||||
^networktables/
|
||||
^opencv2/
|
||||
^support/
|
||||
}
|
||||
|
||||
includeProject {
|
||||
^ctre/
|
||||
^wpi/
|
||||
}
|
||||
|
||||
@@ -37,4 +37,4 @@ cache:
|
||||
script:
|
||||
- python3.5 -m wpiformat -y 2018 -clang 5.0
|
||||
- git --no-pager diff --exit-code HEAD # Ensure formatter made no changes
|
||||
- ./gradlew --no-daemon --console=plain -PskipAthena :hal:halSimSharedLibrary :wpilibc:wpilibcSharedLibrary :wpilibj:wpilibJNISharedSharedLibrary :wpilibj:jar
|
||||
- ./gradlew --no-daemon --console=plain -PskipAthena :hal:halSharedLibrary :hal:halJNISharedLibrary :wpilibc:wpilibcSharedLibrary :wpilibj:jar
|
||||
|
||||
@@ -37,7 +37,7 @@ So you want to contribute your changes back to WPILib. Great! We have a few cont
|
||||
|
||||
## Coding Guidelines
|
||||
|
||||
WPILib uses modified Google style guides for both C++ and Java, which can be found in the [styleguide repository](https://github.com/wpilibsuite/styleguide). Autoformatters are available for many popular editors at https://github.com/google/styleguide. Running wpiformat is required for all contributions and is enforced by our continuous integration system.
|
||||
WPILib uses modified Google style guides for both C++ and Java, which can be found in the [styleguide repository](https://github.com/wpilibsuite/styleguide). Autoformatters are available for many popular editors at https://github.com/google/styleguide. Running wpiformat is required for all contributions and is enforced by our continuous integration system. We currently use clang-format 5.0 with wpiformat.
|
||||
|
||||
While the library should be fully formatted according to the styles, additional elements of the style guide were not followed when the library was initially created. All new code should follow the guidelines. If you are looking for some easy ramp-up tasks, finding areas that don't follow the style guide and fixing them is very welcome.
|
||||
|
||||
|
||||
28
cameraserver/.styleguide
Normal file
28
cameraserver/.styleguide
Normal file
@@ -0,0 +1,28 @@
|
||||
cppHeaderFileInclude {
|
||||
\.h$
|
||||
\.inc$
|
||||
}
|
||||
|
||||
cppSrcFileInclude {
|
||||
\.cpp$
|
||||
}
|
||||
|
||||
modifiableFileExclude {
|
||||
\.so$
|
||||
}
|
||||
|
||||
repoRootNameOverride {
|
||||
cameraserver
|
||||
}
|
||||
|
||||
includeOtherLibs {
|
||||
^HAL/
|
||||
^networktables/
|
||||
^opencv2/
|
||||
^support/
|
||||
^wpi/
|
||||
}
|
||||
|
||||
includeGuardRoots {
|
||||
cameraserver/src/main/native/include/
|
||||
}
|
||||
@@ -193,8 +193,7 @@ static std::vector<std::string> GetSourceModeValues(int source) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
static inline wpi::StringRef Concatenate(wpi::StringRef lhs,
|
||||
wpi::StringRef rhs,
|
||||
static inline wpi::StringRef Concatenate(wpi::StringRef lhs, wpi::StringRef rhs,
|
||||
wpi::SmallVectorImpl<char>& buf) {
|
||||
buf.clear();
|
||||
wpi::raw_svector_ostream oss{buf};
|
||||
|
||||
@@ -80,8 +80,7 @@ class CameraServer {
|
||||
* @param name The name to give the camera
|
||||
* @param path The device path (e.g. "/dev/video0") of the camera
|
||||
*/
|
||||
cs::UsbCamera StartAutomaticCapture(wpi::StringRef name,
|
||||
wpi::StringRef path);
|
||||
cs::UsbCamera StartAutomaticCapture(wpi::StringRef name, wpi::StringRef path);
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
cHeaderFileInclude {
|
||||
_c\.h$
|
||||
}
|
||||
|
||||
cppHeaderFileInclude {
|
||||
\.h$
|
||||
(?<!_c)\.h$
|
||||
\.hpp$
|
||||
\.inc$
|
||||
}
|
||||
@@ -8,12 +12,6 @@ cppSrcFileInclude {
|
||||
\.cpp$
|
||||
}
|
||||
|
||||
generatedFileExclude {
|
||||
gmock/
|
||||
src/arm-linux-jni/
|
||||
src/main/native/cpp/jni/CameraServerJNI\.cpp$
|
||||
}
|
||||
|
||||
licenseUpdateExclude {
|
||||
src/main/native/cpp/default_init_allocator\.h$
|
||||
}
|
||||
@@ -21,11 +19,16 @@ licenseUpdateExclude {
|
||||
includeGuardRoots {
|
||||
cscore/src/main/native/cpp/
|
||||
cscore/src/main/native/include/
|
||||
cscore/src/main/test/native/cpp/
|
||||
}
|
||||
|
||||
repoRootNameOverride {
|
||||
cscore
|
||||
}
|
||||
|
||||
includeOtherLibs {
|
||||
^llvm/
|
||||
^opencv2/
|
||||
^support/
|
||||
^tcpsockets/
|
||||
^wpi/
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ std::string GetSinkError(CS_Sink sink, CS_Status* status) {
|
||||
}
|
||||
|
||||
wpi::StringRef GetSinkError(CS_Sink sink, wpi::SmallVectorImpl<char>& buf,
|
||||
CS_Status* status) {
|
||||
CS_Status* status) {
|
||||
auto data = Sinks::GetInstance().Get(sink);
|
||||
if (!data || data->kind != CS_SINK_CV) {
|
||||
*status = CS_INVALID_HANDLE;
|
||||
|
||||
@@ -494,8 +494,7 @@ CS_Source CreateHttpCamera(wpi::StringRef name, wpi::StringRef url,
|
||||
return handle;
|
||||
}
|
||||
|
||||
CS_Source CreateHttpCamera(wpi::StringRef name,
|
||||
wpi::ArrayRef<std::string> urls,
|
||||
CS_Source CreateHttpCamera(wpi::StringRef name, wpi::ArrayRef<std::string> urls,
|
||||
CS_HttpCameraKind kind, CS_Status* status) {
|
||||
if (urls.empty()) {
|
||||
*status = CS_EMPTY_VALUE;
|
||||
|
||||
@@ -93,9 +93,9 @@ bool JpegNeedsDHT(const char* data, size_t* size, size_t* locSOF) {
|
||||
for (;;) {
|
||||
if (sdata.size() < 4) return false; // EOF
|
||||
bytes = sdata.bytes_begin();
|
||||
if (bytes[0] != 0xff) return false; // not a tag
|
||||
if (bytes[1] == 0xda) break; // SOS
|
||||
if (bytes[1] == 0xc4) return false; // DHT
|
||||
if (bytes[0] != 0xff) return false; // not a tag
|
||||
if (bytes[1] == 0xda) break; // SOS
|
||||
if (bytes[1] == 0xc4) return false; // DHT
|
||||
if (bytes[1] == 0xc0) *locSOF = sdata.data() - data; // SOF
|
||||
// Go to the next block
|
||||
sdata = sdata.substr(bytes[2] * 256 + bytes[3] + 2);
|
||||
@@ -111,7 +111,7 @@ bool JpegNeedsDHT(const char* data, size_t* size, size_t* locSOF) {
|
||||
|
||||
wpi::StringRef JpegGetDHT() {
|
||||
return wpi::StringRef(reinterpret_cast<const char*>(dhtData),
|
||||
sizeof(dhtData));
|
||||
sizeof(dhtData));
|
||||
}
|
||||
|
||||
static inline void ReadInto(wpi::raw_istream& is, std::string& buf,
|
||||
|
||||
@@ -124,8 +124,8 @@ class MjpegServerImpl::ConnThread : public wpi::SafeThread {
|
||||
// A browser should connect for each file and not serve files from its cache.
|
||||
// Using cached pictures would lead to showing old/outdated pictures.
|
||||
// Many browsers seem to ignore, or at least not always obey, those headers.
|
||||
static void SendHeader(wpi::raw_ostream& os, int code,
|
||||
wpi::StringRef codeText, wpi::StringRef contentType,
|
||||
static void SendHeader(wpi::raw_ostream& os, int code, wpi::StringRef codeText,
|
||||
wpi::StringRef contentType,
|
||||
wpi::StringRef extra = wpi::StringRef{}) {
|
||||
os << "HTTP/1.0 " << code << ' ' << codeText << "\r\n";
|
||||
os << "Connection: close\r\n"
|
||||
@@ -143,8 +143,7 @@ static void SendHeader(wpi::raw_ostream& os, int code,
|
||||
// Send error header and message
|
||||
// @param code HTTP error code (e.g. 404)
|
||||
// @param message Additional message text
|
||||
static void SendError(wpi::raw_ostream& os, int code,
|
||||
wpi::StringRef message) {
|
||||
static void SendError(wpi::raw_ostream& os, int code, wpi::StringRef message) {
|
||||
wpi::StringRef codeText, extra, baseMessage;
|
||||
switch (code) {
|
||||
case 401:
|
||||
@@ -733,8 +732,7 @@ void MjpegServerImpl::ConnThread::ProcessRequest() {
|
||||
} else if (req.find("GET /output") != wpi::StringRef::npos &&
|
||||
req.find(".json") != wpi::StringRef::npos) {
|
||||
kind = kGetSettings;
|
||||
} else if ((pos = req.find("GET /?action=command")) !=
|
||||
wpi::StringRef::npos) {
|
||||
} else if ((pos = req.find("GET /?action=command")) != wpi::StringRef::npos) {
|
||||
kind = kCommand;
|
||||
parameters = req.substr(req.find('&', pos + 20)).substr(1);
|
||||
} else if (req.find("GET / ") != wpi::StringRef::npos || req == "GET /\n") {
|
||||
|
||||
@@ -26,8 +26,7 @@ void SinkImpl::SetDescription(wpi::StringRef description) {
|
||||
m_description = description;
|
||||
}
|
||||
|
||||
wpi::StringRef SinkImpl::GetDescription(
|
||||
wpi::SmallVectorImpl<char>& buf) const {
|
||||
wpi::StringRef SinkImpl::GetDescription(wpi::SmallVectorImpl<char>& buf) const {
|
||||
std::lock_guard<wpi::mutex> lock(m_mutex);
|
||||
buf.append(m_description.begin(), m_description.end());
|
||||
return wpi::StringRef{buf.data(), buf.size()};
|
||||
|
||||
@@ -131,8 +131,7 @@ CS_PropertyKind SourceImpl::GetPropertyKind(int property) const {
|
||||
wpi::StringRef SourceImpl::GetPropertyName(int property,
|
||||
wpi::SmallVectorImpl<char>& buf,
|
||||
CS_Status* status) const {
|
||||
if (!m_properties_cached && !CacheProperties(status))
|
||||
return wpi::StringRef{};
|
||||
if (!m_properties_cached && !CacheProperties(status)) return wpi::StringRef{};
|
||||
std::lock_guard<wpi::mutex> lock(m_mutex);
|
||||
auto prop = GetProperty(property);
|
||||
if (!prop) {
|
||||
@@ -206,8 +205,7 @@ int SourceImpl::GetPropertyDefault(int property, CS_Status* status) const {
|
||||
wpi::StringRef SourceImpl::GetStringProperty(int property,
|
||||
wpi::SmallVectorImpl<char>& buf,
|
||||
CS_Status* status) const {
|
||||
if (!m_properties_cached && !CacheProperties(status))
|
||||
return wpi::StringRef{};
|
||||
if (!m_properties_cached && !CacheProperties(status)) return wpi::StringRef{};
|
||||
std::lock_guard<wpi::mutex> lock(m_mutex);
|
||||
auto prop = GetProperty(property);
|
||||
if (!prop) {
|
||||
|
||||
@@ -94,8 +94,7 @@ class SourceImpl {
|
||||
wpi::ArrayRef<int> EnumerateProperties(wpi::SmallVectorImpl<int>& vec,
|
||||
CS_Status* status) const;
|
||||
CS_PropertyKind GetPropertyKind(int property) const;
|
||||
wpi::StringRef GetPropertyName(int property,
|
||||
wpi::SmallVectorImpl<char>& buf,
|
||||
wpi::StringRef GetPropertyName(int property, wpi::SmallVectorImpl<char>& buf,
|
||||
CS_Status* status) const;
|
||||
int GetProperty(int property, CS_Status* status) const;
|
||||
virtual void SetProperty(int property, int value, CS_Status* status) = 0;
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
#include <algorithm>
|
||||
|
||||
#include <wpi/SmallString.h>
|
||||
#include <wpi/raw_ostream.h>
|
||||
#include <wpi/memory.h>
|
||||
#include <wpi/raw_ostream.h>
|
||||
#include <wpi/timestamp.h>
|
||||
|
||||
#include "Handle.h"
|
||||
@@ -389,7 +389,7 @@ void UsbCameraImpl::CameraThreadMain() {
|
||||
DeviceStreamOff();
|
||||
DeviceDisconnect();
|
||||
notified = true; // device wasn't deleted, just error'ed
|
||||
continue; // will reconnect
|
||||
continue; // will reconnect
|
||||
}
|
||||
|
||||
if ((buf.flags & V4L2_BUF_FLAG_ERROR) == 0) {
|
||||
@@ -415,7 +415,7 @@ void UsbCameraImpl::CameraThreadMain() {
|
||||
DeviceStreamOff();
|
||||
DeviceDisconnect();
|
||||
notified = true; // device wasn't deleted, just error'ed
|
||||
continue; // will reconnect
|
||||
continue; // will reconnect
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ class UsbCameraImpl : public SourceImpl {
|
||||
kCmdSetFPS,
|
||||
kCmdSetProperty,
|
||||
kCmdSetPropertyStr,
|
||||
kNumSinksChanged, // no response
|
||||
kNumSinksChanged, // no response
|
||||
kNumSinksEnabledChanged, // no response
|
||||
// Responses
|
||||
kOk,
|
||||
|
||||
@@ -62,7 +62,7 @@ class UsbCameraProperty : public PropertyImpl {
|
||||
int propPair{0};
|
||||
|
||||
unsigned id{0}; // implementation-level id
|
||||
int type{0}; // implementation type, not CS_PropertyKind!
|
||||
int type{0}; // implementation type, not CS_PropertyKind!
|
||||
};
|
||||
|
||||
} // namespace cs
|
||||
|
||||
@@ -171,8 +171,7 @@ std::string GetSourceName(CS_Source source, CS_Status* status) {
|
||||
return data->source->GetName();
|
||||
}
|
||||
|
||||
wpi::StringRef GetSourceName(CS_Source source,
|
||||
wpi::SmallVectorImpl<char>& buf,
|
||||
wpi::StringRef GetSourceName(CS_Source source, wpi::SmallVectorImpl<char>& buf,
|
||||
CS_Status* status) {
|
||||
auto data = Sources::GetInstance().Get(source);
|
||||
if (!data) {
|
||||
@@ -309,8 +308,9 @@ std::vector<VideoMode> EnumerateSourceVideoModes(CS_Source source,
|
||||
return data->source->EnumerateVideoModes(status);
|
||||
}
|
||||
|
||||
wpi::ArrayRef<CS_Sink> EnumerateSourceSinks(
|
||||
CS_Source source, wpi::SmallVectorImpl<CS_Sink>& vec, CS_Status* status) {
|
||||
wpi::ArrayRef<CS_Sink> EnumerateSourceSinks(CS_Source source,
|
||||
wpi::SmallVectorImpl<CS_Sink>& vec,
|
||||
CS_Status* status) {
|
||||
auto data = Sources::GetInstance().Get(source);
|
||||
if (!data) {
|
||||
*status = CS_INVALID_HANDLE;
|
||||
@@ -468,8 +468,7 @@ std::string GetSinkDescription(CS_Sink sink, CS_Status* status) {
|
||||
return data->sink->GetDescription(buf);
|
||||
}
|
||||
|
||||
wpi::StringRef GetSinkDescription(CS_Sink sink,
|
||||
wpi::SmallVectorImpl<char>& buf,
|
||||
wpi::StringRef GetSinkDescription(CS_Sink sink, wpi::SmallVectorImpl<char>& buf,
|
||||
CS_Status* status) {
|
||||
auto data = Sinks::GetInstance().Get(sink);
|
||||
if (!data) {
|
||||
@@ -630,8 +629,8 @@ wpi::ArrayRef<CS_Source> EnumerateSourceHandles(
|
||||
return Sources::GetInstance().GetAll(vec);
|
||||
}
|
||||
|
||||
wpi::ArrayRef<CS_Sink> EnumerateSinkHandles(
|
||||
wpi::SmallVectorImpl<CS_Sink>& vec, CS_Status* status) {
|
||||
wpi::ArrayRef<CS_Sink> EnumerateSinkHandles(wpi::SmallVectorImpl<CS_Sink>& vec,
|
||||
CS_Status* status) {
|
||||
return Sinks::GetInstance().GetAll(vec);
|
||||
}
|
||||
|
||||
@@ -642,7 +641,7 @@ std::string GetHostname() {
|
||||
name[255] = '\0'; // Per POSIX, may not be null terminated if too long
|
||||
return name;
|
||||
#else
|
||||
return ""; // TODO
|
||||
return ""; // TODO
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -654,7 +653,7 @@ std::vector<std::string> GetNetworkInterfaces() {
|
||||
std::vector<std::string> rv;
|
||||
char buf[256];
|
||||
for (struct ifaddrs* i = ifa; i; i = i->ifa_next) {
|
||||
if (!i->ifa_addr) continue; // no address
|
||||
if (!i->ifa_addr) continue; // no address
|
||||
if (i->ifa_addr->sa_family != AF_INET) continue; // only return IPv4
|
||||
struct sockaddr_in* addr_in = reinterpret_cast<sockaddr_in*>(i->ifa_addr);
|
||||
const char* addr =
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2016-2017 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-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. */
|
||||
@@ -106,7 +106,8 @@ JNIEXPORT void JNICALL JNI_OnUnload(JavaVM* vm, void* reserved) {
|
||||
template <typename T>
|
||||
class JCSGlobal {
|
||||
public:
|
||||
JCSGlobal(JNIEnv* env, T obj) : m_obj(static_cast<T>(env->NewGlobalRef(obj))) {}
|
||||
JCSGlobal(JNIEnv* env, T obj)
|
||||
: m_obj(static_cast<T>(env->NewGlobalRef(obj))) {}
|
||||
~JCSGlobal() {
|
||||
if (!jvm || cs::NotifierDestroyed()) return;
|
||||
JNIEnv* env;
|
||||
@@ -179,7 +180,7 @@ static inline bool CheckStatus(JNIEnv* env, CS_Status status) {
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
static jobject MakeJObject(JNIEnv* env, const cs::UsbCameraInfo &info) {
|
||||
static jobject MakeJObject(JNIEnv* env, const cs::UsbCameraInfo& info) {
|
||||
static jmethodID constructor = env->GetMethodID(
|
||||
usbCameraInfoCls, "<init>", "(ILjava/lang/String;Ljava/lang/String;)V");
|
||||
JLocal<jstring> path(env, MakeJString(env, info.path));
|
||||
@@ -230,7 +231,8 @@ extern "C" {
|
||||
* Method: getPropertyKind
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_getPropertyKind
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getPropertyKind
|
||||
(JNIEnv* env, jclass, jint property)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -244,7 +246,8 @@ JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_getPropertyKind
|
||||
* Method: getPropertyName
|
||||
* Signature: (I)Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL Java_edu_wpi_cscore_CameraServerJNI_getPropertyName
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getPropertyName
|
||||
(JNIEnv* env, jclass, jint property)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -259,7 +262,8 @@ JNIEXPORT jstring JNICALL Java_edu_wpi_cscore_CameraServerJNI_getPropertyName
|
||||
* Method: getProperty
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_getProperty
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getProperty
|
||||
(JNIEnv* env, jclass, jint property)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -273,7 +277,8 @@ JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_getProperty
|
||||
* Method: setProperty
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setProperty
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_setProperty
|
||||
(JNIEnv* env, jclass, jint property, jint value)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -286,7 +291,8 @@ JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setProperty
|
||||
* Method: getPropertyMin
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_getPropertyMin
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getPropertyMin
|
||||
(JNIEnv* env, jclass, jint property)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -300,7 +306,8 @@ JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_getPropertyMin
|
||||
* Method: getPropertyMax
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_getPropertyMax
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getPropertyMax
|
||||
(JNIEnv* env, jclass, jint property)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -314,7 +321,8 @@ JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_getPropertyMax
|
||||
* Method: getPropertyStep
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_getPropertyStep
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getPropertyStep
|
||||
(JNIEnv* env, jclass, jint property)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -328,7 +336,8 @@ JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_getPropertyStep
|
||||
* Method: getPropertyDefault
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_getPropertyDefault
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getPropertyDefault
|
||||
(JNIEnv* env, jclass, jint property)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -342,7 +351,8 @@ JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_getPropertyDefault
|
||||
* Method: getStringProperty
|
||||
* Signature: (I)Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL Java_edu_wpi_cscore_CameraServerJNI_getStringProperty
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getStringProperty
|
||||
(JNIEnv* env, jclass, jint property)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -357,7 +367,8 @@ JNIEXPORT jstring JNICALL Java_edu_wpi_cscore_CameraServerJNI_getStringProperty
|
||||
* Method: setStringProperty
|
||||
* Signature: (ILjava/lang/String;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setStringProperty
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_setStringProperty
|
||||
(JNIEnv* env, jclass, jint property, jstring value)
|
||||
{
|
||||
if (!value) {
|
||||
@@ -372,9 +383,10 @@ JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setStringProperty
|
||||
/*
|
||||
* Class: edu_wpi_cscore_CameraServerJNI
|
||||
* Method: getEnumPropertyChoices
|
||||
* Signature: (I)[Ljava/lang/String;
|
||||
* Signature: (I)[Ljava/lang/Object;
|
||||
*/
|
||||
JNIEXPORT jobjectArray JNICALL Java_edu_wpi_cscore_CameraServerJNI_getEnumPropertyChoices
|
||||
JNIEXPORT jobjectArray JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getEnumPropertyChoices
|
||||
(JNIEnv* env, jclass, jint property)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -388,7 +400,8 @@ JNIEXPORT jobjectArray JNICALL Java_edu_wpi_cscore_CameraServerJNI_getEnumProper
|
||||
* Method: createUsbCameraDev
|
||||
* Signature: (Ljava/lang/String;I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_createUsbCameraDev
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_createUsbCameraDev
|
||||
(JNIEnv* env, jclass, jstring name, jint dev)
|
||||
{
|
||||
#ifndef __linux__
|
||||
@@ -411,7 +424,8 @@ JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_createUsbCameraDev
|
||||
* Method: createUsbCameraPath
|
||||
* Signature: (Ljava/lang/String;Ljava/lang/String;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_createUsbCameraPath
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_createUsbCameraPath
|
||||
(JNIEnv* env, jclass, jstring name, jstring path)
|
||||
{
|
||||
#ifndef __linux__
|
||||
@@ -439,7 +453,8 @@ JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_createUsbCameraPath
|
||||
* Method: createHttpCamera
|
||||
* Signature: (Ljava/lang/String;Ljava/lang/String;I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_createHttpCamera
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_createHttpCamera
|
||||
(JNIEnv* env, jclass, jstring name, jstring url, jint kind)
|
||||
{
|
||||
if (!name) {
|
||||
@@ -461,9 +476,10 @@ JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_createHttpCamera
|
||||
/*
|
||||
* Class: edu_wpi_cscore_CameraServerJNI
|
||||
* Method: createHttpCameraMulti
|
||||
* Signature: (Ljava/lang/String;[Ljava/lang/String;I)I
|
||||
* Signature: (Ljava/lang/String;[Ljava/lang/Object;I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_createHttpCameraMulti
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_createHttpCameraMulti
|
||||
(JNIEnv* env, jclass, jstring name, jobjectArray urls, jint kind)
|
||||
{
|
||||
if (!name) {
|
||||
@@ -499,9 +515,10 @@ JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_createHttpCameraMulti
|
||||
* Method: createCvSource
|
||||
* Signature: (Ljava/lang/String;IIII)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_createCvSource
|
||||
(JNIEnv* env, jclass, jstring name, jint pixelFormat, jint width,
|
||||
jint height, jint fps)
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_createCvSource
|
||||
(JNIEnv* env, jclass, jstring name, jint pixelFormat, jint width, jint height,
|
||||
jint fps)
|
||||
{
|
||||
if (!name) {
|
||||
nullPointerEx.Throw(env, "name cannot be null");
|
||||
@@ -523,7 +540,8 @@ JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_createCvSource
|
||||
* Method: getSourceKind
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_getSourceKind
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getSourceKind
|
||||
(JNIEnv* env, jclass, jint source)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -537,7 +555,8 @@ JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_getSourceKind
|
||||
* Method: getSourceName
|
||||
* Signature: (I)Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL Java_edu_wpi_cscore_CameraServerJNI_getSourceName
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getSourceName
|
||||
(JNIEnv* env, jclass, jint source)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -552,7 +571,8 @@ JNIEXPORT jstring JNICALL Java_edu_wpi_cscore_CameraServerJNI_getSourceName
|
||||
* Method: getSourceDescription
|
||||
* Signature: (I)Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL Java_edu_wpi_cscore_CameraServerJNI_getSourceDescription
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getSourceDescription
|
||||
(JNIEnv* env, jclass, jint source)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -567,7 +587,8 @@ JNIEXPORT jstring JNICALL Java_edu_wpi_cscore_CameraServerJNI_getSourceDescripti
|
||||
* Method: getSourceLastFrameTime
|
||||
* Signature: (I)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL Java_edu_wpi_cscore_CameraServerJNI_getSourceLastFrameTime
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getSourceLastFrameTime
|
||||
(JNIEnv* env, jclass, jint source)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -581,7 +602,8 @@ JNIEXPORT jlong JNICALL Java_edu_wpi_cscore_CameraServerJNI_getSourceLastFrameTi
|
||||
* Method: isSourceConnected
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL Java_edu_wpi_cscore_CameraServerJNI_isSourceConnected
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_isSourceConnected
|
||||
(JNIEnv* env, jclass, jint source)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -595,7 +617,8 @@ JNIEXPORT jboolean JNICALL Java_edu_wpi_cscore_CameraServerJNI_isSourceConnected
|
||||
* Method: getSourceProperty
|
||||
* Signature: (ILjava/lang/String;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_getSourceProperty
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getSourceProperty
|
||||
(JNIEnv* env, jclass, jint source, jstring name)
|
||||
{
|
||||
if (!name) {
|
||||
@@ -613,7 +636,8 @@ JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_getSourceProperty
|
||||
* Method: enumerateSourceProperties
|
||||
* Signature: (I)[I
|
||||
*/
|
||||
JNIEXPORT jintArray JNICALL Java_edu_wpi_cscore_CameraServerJNI_enumerateSourceProperties
|
||||
JNIEXPORT jintArray JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_enumerateSourceProperties
|
||||
(JNIEnv* env, jclass, jint source)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -626,9 +650,10 @@ JNIEXPORT jintArray JNICALL Java_edu_wpi_cscore_CameraServerJNI_enumerateSourceP
|
||||
/*
|
||||
* Class: edu_wpi_cscore_CameraServerJNI
|
||||
* Method: getSourceVideoMode
|
||||
* Signature: (I)Ledu/wpi/cameraserver/VideoMode;
|
||||
* Signature: (I)Ljava/lang/Object;
|
||||
*/
|
||||
JNIEXPORT jobject JNICALL Java_edu_wpi_cscore_CameraServerJNI_getSourceVideoMode
|
||||
JNIEXPORT jobject JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getSourceVideoMode
|
||||
(JNIEnv* env, jclass, jint source)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -642,7 +667,8 @@ JNIEXPORT jobject JNICALL Java_edu_wpi_cscore_CameraServerJNI_getSourceVideoMode
|
||||
* Method: setSourceVideoMode
|
||||
* Signature: (IIIII)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL Java_edu_wpi_cscore_CameraServerJNI_setSourceVideoMode
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_setSourceVideoMode
|
||||
(JNIEnv* env, jclass, jint source, jint pixelFormat, jint width, jint height,
|
||||
jint fps)
|
||||
{
|
||||
@@ -661,7 +687,8 @@ JNIEXPORT jboolean JNICALL Java_edu_wpi_cscore_CameraServerJNI_setSourceVideoMod
|
||||
* Method: setSourcePixelFormat
|
||||
* Signature: (II)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL Java_edu_wpi_cscore_CameraServerJNI_setSourcePixelFormat
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_setSourcePixelFormat
|
||||
(JNIEnv* env, jclass, jint source, jint pixelFormat)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -676,7 +703,8 @@ JNIEXPORT jboolean JNICALL Java_edu_wpi_cscore_CameraServerJNI_setSourcePixelFor
|
||||
* Method: setSourceResolution
|
||||
* Signature: (III)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL Java_edu_wpi_cscore_CameraServerJNI_setSourceResolution
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_setSourceResolution
|
||||
(JNIEnv* env, jclass, jint source, jint width, jint height)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -690,7 +718,8 @@ JNIEXPORT jboolean JNICALL Java_edu_wpi_cscore_CameraServerJNI_setSourceResoluti
|
||||
* Method: setSourceFPS
|
||||
* Signature: (II)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL Java_edu_wpi_cscore_CameraServerJNI_setSourceFPS
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_setSourceFPS
|
||||
(JNIEnv* env, jclass, jint source, jint fps)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -702,9 +731,10 @@ JNIEXPORT jboolean JNICALL Java_edu_wpi_cscore_CameraServerJNI_setSourceFPS
|
||||
/*
|
||||
* Class: edu_wpi_cscore_CameraServerJNI
|
||||
* Method: enumerateSourceVideoModes
|
||||
* Signature: (I)[Ledu/wpi/cameraserver/VideoMode;
|
||||
* Signature: (I)[Ljava/lang/Object;
|
||||
*/
|
||||
JNIEXPORT jobjectArray JNICALL Java_edu_wpi_cscore_CameraServerJNI_enumerateSourceVideoModes
|
||||
JNIEXPORT jobjectArray JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_enumerateSourceVideoModes
|
||||
(JNIEnv* env, jclass, jint source)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -724,7 +754,8 @@ JNIEXPORT jobjectArray JNICALL Java_edu_wpi_cscore_CameraServerJNI_enumerateSour
|
||||
* Method: enumerateSourceSinks
|
||||
* Signature: (I)[I
|
||||
*/
|
||||
JNIEXPORT jintArray JNICALL Java_edu_wpi_cscore_CameraServerJNI_enumerateSourceSinks
|
||||
JNIEXPORT jintArray JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_enumerateSourceSinks
|
||||
(JNIEnv* env, jclass, jint source)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -739,7 +770,8 @@ JNIEXPORT jintArray JNICALL Java_edu_wpi_cscore_CameraServerJNI_enumerateSourceS
|
||||
* Method: copySource
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_copySource
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_copySource
|
||||
(JNIEnv* env, jclass, jint source)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -753,7 +785,8 @@ JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_copySource
|
||||
* Method: releaseSource
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_releaseSource
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_releaseSource
|
||||
(JNIEnv* env, jclass, jint source)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -766,7 +799,8 @@ JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_releaseSource
|
||||
* Method: setCameraBrightness
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setCameraBrightness
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_setCameraBrightness
|
||||
(JNIEnv* env, jclass, jint source, jint brightness)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -779,7 +813,8 @@ JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setCameraBrightness
|
||||
* Method: getCameraBrightness
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_getCameraBrightness
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getCameraBrightness
|
||||
(JNIEnv* env, jclass, jint source)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -793,7 +828,8 @@ JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_getCameraBrightness
|
||||
* Method: setCameraWhiteBalanceAuto
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setCameraWhiteBalanceAuto
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_setCameraWhiteBalanceAuto
|
||||
(JNIEnv* env, jclass, jint source)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -806,7 +842,8 @@ JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setCameraWhiteBalance
|
||||
* Method: setCameraWhiteBalanceHoldCurrent
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setCameraWhiteBalanceHoldCurrent
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_setCameraWhiteBalanceHoldCurrent
|
||||
(JNIEnv* env, jclass, jint source)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -819,7 +856,8 @@ JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setCameraWhiteBalance
|
||||
* Method: setCameraWhiteBalanceManual
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setCameraWhiteBalanceManual
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_setCameraWhiteBalanceManual
|
||||
(JNIEnv* env, jclass, jint source, jint value)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -832,7 +870,8 @@ JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setCameraWhiteBalance
|
||||
* Method: setCameraExposureAuto
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setCameraExposureAuto
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_setCameraExposureAuto
|
||||
(JNIEnv* env, jclass, jint source)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -845,7 +884,8 @@ JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setCameraExposureAuto
|
||||
* Method: setCameraExposureHoldCurrent
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setCameraExposureHoldCurrent
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_setCameraExposureHoldCurrent
|
||||
(JNIEnv* env, jclass, jint source)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -858,7 +898,8 @@ JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setCameraExposureHold
|
||||
* Method: setCameraExposureManual
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setCameraExposureManual
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_setCameraExposureManual
|
||||
(JNIEnv* env, jclass, jint source, jint value)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -871,7 +912,8 @@ JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setCameraExposureManu
|
||||
* Method: getUsbCameraPath
|
||||
* Signature: (I)Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL Java_edu_wpi_cscore_CameraServerJNI_getUsbCameraPath
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getUsbCameraPath
|
||||
(JNIEnv* env, jclass, jint source)
|
||||
{
|
||||
#ifndef __linux__
|
||||
@@ -890,7 +932,8 @@ JNIEXPORT jstring JNICALL Java_edu_wpi_cscore_CameraServerJNI_getUsbCameraPath
|
||||
* Method: getHttpCameraKind
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_getHttpCameraKind
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getHttpCameraKind
|
||||
(JNIEnv* env, jclass, jint source)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -902,9 +945,10 @@ JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_getHttpCameraKind
|
||||
/*
|
||||
* Class: edu_wpi_cscore_CameraServerJNI
|
||||
* Method: setHttpCameraUrls
|
||||
* Signature: (I[Ljava/lang/String;)V
|
||||
* Signature: (I[Ljava/lang/Object;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setHttpCameraUrls
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_setHttpCameraUrls
|
||||
(JNIEnv* env, jclass, jint source, jobjectArray urls)
|
||||
{
|
||||
if (!urls) {
|
||||
@@ -931,9 +975,10 @@ JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setHttpCameraUrls
|
||||
/*
|
||||
* Class: edu_wpi_cscore_CameraServerJNI
|
||||
* Method: getHttpCameraUrls
|
||||
* Signature: (I)[Ljava/lang/String;
|
||||
* Signature: (I)[Ljava/lang/Object;
|
||||
*/
|
||||
JNIEXPORT jobjectArray JNICALL Java_edu_wpi_cscore_CameraServerJNI_getHttpCameraUrls
|
||||
JNIEXPORT jobjectArray JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getHttpCameraUrls
|
||||
(JNIEnv* env, jclass, jint source)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -947,7 +992,8 @@ JNIEXPORT jobjectArray JNICALL Java_edu_wpi_cscore_CameraServerJNI_getHttpCamera
|
||||
* Method: putSourceFrame
|
||||
* Signature: (IJ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_putSourceFrame
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_putSourceFrame
|
||||
(JNIEnv* env, jclass, jint source, jlong imageNativeObj)
|
||||
{
|
||||
cv::Mat& image = *((cv::Mat*)imageNativeObj);
|
||||
@@ -961,7 +1007,8 @@ JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_putSourceFrame
|
||||
* Method: notifySourceError
|
||||
* Signature: (ILjava/lang/String;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_notifySourceError
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_notifySourceError
|
||||
(JNIEnv* env, jclass, jint source, jstring msg)
|
||||
{
|
||||
if (!msg) {
|
||||
@@ -978,7 +1025,8 @@ JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_notifySourceError
|
||||
* Method: setSourceConnected
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setSourceConnected
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_setSourceConnected
|
||||
(JNIEnv* env, jclass, jint source, jboolean connected)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -991,7 +1039,8 @@ JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setSourceConnected
|
||||
* Method: setSourceDescription
|
||||
* Signature: (ILjava/lang/String;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setSourceDescription
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_setSourceDescription
|
||||
(JNIEnv* env, jclass, jint source, jstring description)
|
||||
{
|
||||
if (!description) {
|
||||
@@ -1008,7 +1057,8 @@ JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setSourceDescription
|
||||
* Method: createSourceProperty
|
||||
* Signature: (ILjava/lang/String;IIIIII)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_createSourceProperty
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_createSourceProperty
|
||||
(JNIEnv* env, jclass, jint source, jstring name, jint kind, jint minimum,
|
||||
jint maximum, jint step, jint defaultValue, jint value)
|
||||
{
|
||||
@@ -1023,9 +1073,10 @@ JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_createSourceProperty
|
||||
/*
|
||||
* Class: edu_wpi_cscore_CameraServerJNI
|
||||
* Method: setSourceEnumPropertyChoices
|
||||
* Signature: (II[Ljava/lang/String;)V
|
||||
* Signature: (II[Ljava/lang/Object;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setSourceEnumPropertyChoices
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_setSourceEnumPropertyChoices
|
||||
(JNIEnv* env, jclass, jint source, jint property, jobjectArray choices)
|
||||
{
|
||||
if (!choices) {
|
||||
@@ -1054,7 +1105,8 @@ JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setSourceEnumProperty
|
||||
* Method: createMjpegServer
|
||||
* Signature: (Ljava/lang/String;Ljava/lang/String;I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_createMjpegServer
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_createMjpegServer
|
||||
(JNIEnv* env, jclass, jstring name, jstring listenAddress, jint port)
|
||||
{
|
||||
if (!name) {
|
||||
@@ -1077,7 +1129,8 @@ JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_createMjpegServer
|
||||
* Method: createCvSink
|
||||
* Signature: (Ljava/lang/String;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_createCvSink
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_createCvSink
|
||||
(JNIEnv* env, jclass, jstring name)
|
||||
{
|
||||
if (!name) {
|
||||
@@ -1095,7 +1148,8 @@ JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_createCvSink
|
||||
* Method: getSinkKind
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_getSinkKind
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getSinkKind
|
||||
(JNIEnv* env, jclass, jint sink)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -1109,7 +1163,8 @@ JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_getSinkKind
|
||||
* Method: getSinkName
|
||||
* Signature: (I)Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL Java_edu_wpi_cscore_CameraServerJNI_getSinkName
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getSinkName
|
||||
(JNIEnv* env, jclass, jint sink)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -1124,7 +1179,8 @@ JNIEXPORT jstring JNICALL Java_edu_wpi_cscore_CameraServerJNI_getSinkName
|
||||
* Method: getSinkDescription
|
||||
* Signature: (I)Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL Java_edu_wpi_cscore_CameraServerJNI_getSinkDescription
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getSinkDescription
|
||||
(JNIEnv* env, jclass, jint sink)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -1139,7 +1195,8 @@ JNIEXPORT jstring JNICALL Java_edu_wpi_cscore_CameraServerJNI_getSinkDescription
|
||||
* Method: setSinkSource
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setSinkSource
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_setSinkSource
|
||||
(JNIEnv* env, jclass, jint sink, jint source)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -1152,7 +1209,8 @@ JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setSinkSource
|
||||
* Method: getSinkSourceProperty
|
||||
* Signature: (ILjava/lang/String;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_getSinkSourceProperty
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getSinkSourceProperty
|
||||
(JNIEnv* env, jclass, jint sink, jstring name)
|
||||
{
|
||||
if (!name) {
|
||||
@@ -1170,7 +1228,8 @@ JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_getSinkSourceProperty
|
||||
* Method: getSinkSource
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_getSinkSource
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getSinkSource
|
||||
(JNIEnv* env, jclass, jint sink)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -1184,7 +1243,8 @@ JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_getSinkSource
|
||||
* Method: copySink
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_copySink
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_copySink
|
||||
(JNIEnv* env, jclass, jint sink)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -1198,7 +1258,8 @@ JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_copySink
|
||||
* Method: releaseSink
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_releaseSink
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_releaseSink
|
||||
(JNIEnv* env, jclass, jint sink)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -1211,7 +1272,8 @@ JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_releaseSink
|
||||
* Method: getMjpegServerListenAddress
|
||||
* Signature: (I)Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL Java_edu_wpi_cscore_CameraServerJNI_getMjpegServerListenAddress
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getMjpegServerListenAddress
|
||||
(JNIEnv* env, jclass, jint sink)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -1225,7 +1287,8 @@ JNIEXPORT jstring JNICALL Java_edu_wpi_cscore_CameraServerJNI_getMjpegServerList
|
||||
* Method: getMjpegServerPort
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_getMjpegServerPort
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getMjpegServerPort
|
||||
(JNIEnv* env, jclass, jint sink)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -1239,7 +1302,8 @@ JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_getMjpegServerPort
|
||||
* Method: setSinkDescription
|
||||
* Signature: (ILjava/lang/String;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setSinkDescription
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_setSinkDescription
|
||||
(JNIEnv* env, jclass, jint sink, jstring description)
|
||||
{
|
||||
if (!description) {
|
||||
@@ -1256,7 +1320,8 @@ JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setSinkDescription
|
||||
* Method: grabSinkFrame
|
||||
* Signature: (IJ)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL Java_edu_wpi_cscore_CameraServerJNI_grabSinkFrame
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_grabSinkFrame
|
||||
(JNIEnv* env, jclass, jint sink, jlong imageNativeObj)
|
||||
{
|
||||
cv::Mat& image = *((cv::Mat*)imageNativeObj);
|
||||
@@ -1271,7 +1336,8 @@ JNIEXPORT jlong JNICALL Java_edu_wpi_cscore_CameraServerJNI_grabSinkFrame
|
||||
* Method: grabSinkFrameTimeout
|
||||
* Signature: (IJD)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL Java_edu_wpi_cscore_CameraServerJNI_grabSinkFrameTimeout
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_grabSinkFrameTimeout
|
||||
(JNIEnv* env, jclass, jint sink, jlong imageNativeObj, jdouble timeout)
|
||||
{
|
||||
cv::Mat& image = *((cv::Mat*)imageNativeObj);
|
||||
@@ -1286,7 +1352,8 @@ JNIEXPORT jlong JNICALL Java_edu_wpi_cscore_CameraServerJNI_grabSinkFrameTimeout
|
||||
* Method: getSinkError
|
||||
* Signature: (I)Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL Java_edu_wpi_cscore_CameraServerJNI_getSinkError
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getSinkError
|
||||
(JNIEnv* env, jclass, jint sink)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -1301,7 +1368,8 @@ JNIEXPORT jstring JNICALL Java_edu_wpi_cscore_CameraServerJNI_getSinkError
|
||||
* Method: setSinkEnabled
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setSinkEnabled
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_setSinkEnabled
|
||||
(JNIEnv* env, jclass, jint sink, jboolean enabled)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -1312,9 +1380,10 @@ JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setSinkEnabled
|
||||
/*
|
||||
* Class: edu_wpi_cscore_CameraServerJNI
|
||||
* Method: addListener
|
||||
* Signature: (Ljava/util/function/Consumer;IZ)I
|
||||
* Signature: (Ljava/lang/Object;IZ)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_addListener
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_addListener
|
||||
(JNIEnv* envouter, jclass, jobject listener, jint eventMask,
|
||||
jboolean immediateNotify)
|
||||
{
|
||||
@@ -1324,7 +1393,8 @@ JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_addListener
|
||||
}
|
||||
// the shared pointer to the weak global will keep it around until the
|
||||
// entry listener is destroyed
|
||||
auto listener_global = std::make_shared<JCSGlobal<jobject>>(envouter, listener);
|
||||
auto listener_global =
|
||||
std::make_shared<JCSGlobal<jobject>>(envouter, listener);
|
||||
|
||||
// cls is a temporary here; cannot be used within callback functor
|
||||
jclass cls = envouter->GetObjectClass(listener);
|
||||
@@ -1368,7 +1438,8 @@ JNIEXPORT jint JNICALL Java_edu_wpi_cscore_CameraServerJNI_addListener
|
||||
* Method: removeListener
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_removeListener
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_removeListener
|
||||
(JNIEnv* env, jclass, jint handle)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -1381,7 +1452,8 @@ JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_removeListener
|
||||
* Method: setTelemetryPeriod
|
||||
* Signature: (D)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setTelemetryPeriod
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_setTelemetryPeriod
|
||||
(JNIEnv* env, jclass, jdouble seconds)
|
||||
{
|
||||
cs::SetTelemetryPeriod(seconds);
|
||||
@@ -1392,7 +1464,8 @@ JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setTelemetryPeriod
|
||||
* Method: getTelemetryElapsedTime
|
||||
* Signature: ()D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_edu_wpi_cscore_CameraServerJNI_getTelemetryElapsedTime
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getTelemetryElapsedTime
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
return cs::GetTelemetryElapsedTime();
|
||||
@@ -1403,7 +1476,8 @@ JNIEXPORT jdouble JNICALL Java_edu_wpi_cscore_CameraServerJNI_getTelemetryElapse
|
||||
* Method: getTelemetryValue
|
||||
* Signature: (II)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL Java_edu_wpi_cscore_CameraServerJNI_getTelemetryValue
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getTelemetryValue
|
||||
(JNIEnv* env, jclass, jint handle, jint kind)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -1418,13 +1492,13 @@ JNIEXPORT jlong JNICALL Java_edu_wpi_cscore_CameraServerJNI_getTelemetryValue
|
||||
* Method: getTelemetryAverageValue
|
||||
* Signature: (II)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_edu_wpi_cscore_CameraServerJNI_getTelemetryAverageValue
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getTelemetryAverageValue
|
||||
(JNIEnv* env, jclass, jint handle, jint kind)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
auto val = cs::GetTelemetryAverageValue(handle,
|
||||
static_cast<CS_TelemetryKind>(kind),
|
||||
&status);
|
||||
auto val = cs::GetTelemetryAverageValue(
|
||||
handle, static_cast<CS_TelemetryKind>(kind), &status);
|
||||
CheckStatus(env, status);
|
||||
return val;
|
||||
}
|
||||
@@ -1432,9 +1506,10 @@ JNIEXPORT jdouble JNICALL Java_edu_wpi_cscore_CameraServerJNI_getTelemetryAverag
|
||||
/*
|
||||
* Class: edu_wpi_cscore_CameraServerJNI
|
||||
* Method: enumerateUsbCameras
|
||||
* Signature: ()[Ledu/wpi/cameraserver/UsbCameraInfo;
|
||||
* Signature: ()[Ljava/lang/Object;
|
||||
*/
|
||||
JNIEXPORT jobjectArray JNICALL Java_edu_wpi_cscore_CameraServerJNI_enumerateUsbCameras
|
||||
JNIEXPORT jobjectArray JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_enumerateUsbCameras
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
#ifndef __linux__
|
||||
@@ -1460,7 +1535,8 @@ JNIEXPORT jobjectArray JNICALL Java_edu_wpi_cscore_CameraServerJNI_enumerateUsbC
|
||||
* Method: enumerateSources
|
||||
* Signature: ()[I
|
||||
*/
|
||||
JNIEXPORT jintArray JNICALL Java_edu_wpi_cscore_CameraServerJNI_enumerateSources
|
||||
JNIEXPORT jintArray JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_enumerateSources
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -1475,7 +1551,8 @@ JNIEXPORT jintArray JNICALL Java_edu_wpi_cscore_CameraServerJNI_enumerateSources
|
||||
* Method: enumerateSinks
|
||||
* Signature: ()[I
|
||||
*/
|
||||
JNIEXPORT jintArray JNICALL Java_edu_wpi_cscore_CameraServerJNI_enumerateSinks
|
||||
JNIEXPORT jintArray JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_enumerateSinks
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
@@ -1490,7 +1567,8 @@ JNIEXPORT jintArray JNICALL Java_edu_wpi_cscore_CameraServerJNI_enumerateSinks
|
||||
* Method: getHostname
|
||||
* Signature: ()Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL Java_edu_wpi_cscore_CameraServerJNI_getHostname
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getHostname
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
return MakeJString(env, cs::GetHostname());
|
||||
@@ -1499,9 +1577,10 @@ JNIEXPORT jstring JNICALL Java_edu_wpi_cscore_CameraServerJNI_getHostname
|
||||
/*
|
||||
* Class: edu_wpi_cscore_CameraServerJNI
|
||||
* Method: getNetworkInterfaces
|
||||
* Signature: ()[Ljava/lang/String;
|
||||
* Signature: ()[Ljava/lang/Object;
|
||||
*/
|
||||
JNIEXPORT jobjectArray JNICALL Java_edu_wpi_cscore_CameraServerJNI_getNetworkInterfaces
|
||||
JNIEXPORT jobjectArray JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_getNetworkInterfaces
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
return MakeJStringArray(env, cs::GetNetworkInterfaces());
|
||||
@@ -1536,16 +1615,17 @@ struct LogMessage {
|
||||
|
||||
typedef JSingletonCallbackManager<LogMessage> LoggerJNI;
|
||||
|
||||
} // anonymous namespace
|
||||
} // namespace
|
||||
|
||||
extern "C" {
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_cscore_CameraServerJNI
|
||||
* Method: setLogger
|
||||
* Signature: (Ledu/wpi/cscore/CameraServerJNI/LoggerFunction;I)V
|
||||
* Signature: (Ljava/lang/Object;I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_cscore_CameraServerJNI_setLogger
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_cscore_CameraServerJNI_setLogger
|
||||
(JNIEnv* env, jclass, jobject func, jint minLevel)
|
||||
{
|
||||
if (!func) {
|
||||
|
||||
@@ -164,8 +164,7 @@ CS_Source CreateUsbCameraPath(wpi::StringRef name, wpi::StringRef path,
|
||||
CS_Status* status);
|
||||
CS_Source CreateHttpCamera(wpi::StringRef name, wpi::StringRef url,
|
||||
CS_HttpCameraKind kind, CS_Status* status);
|
||||
CS_Source CreateHttpCamera(wpi::StringRef name,
|
||||
wpi::ArrayRef<std::string> urls,
|
||||
CS_Source CreateHttpCamera(wpi::StringRef name, wpi::ArrayRef<std::string> urls,
|
||||
CS_HttpCameraKind kind, CS_Status* status);
|
||||
CS_Source CreateCvSource(wpi::StringRef name, const VideoMode& mode,
|
||||
CS_Status* status);
|
||||
@@ -175,8 +174,7 @@ CS_Source CreateCvSource(wpi::StringRef name, const VideoMode& mode,
|
||||
//
|
||||
CS_SourceKind GetSourceKind(CS_Source source, CS_Status* status);
|
||||
std::string GetSourceName(CS_Source source, CS_Status* status);
|
||||
wpi::StringRef GetSourceName(CS_Source source,
|
||||
wpi::SmallVectorImpl<char>& buf,
|
||||
wpi::StringRef GetSourceName(CS_Source source, wpi::SmallVectorImpl<char>& buf,
|
||||
CS_Status* status);
|
||||
std::string GetSourceDescription(CS_Source source, CS_Status* status);
|
||||
wpi::StringRef GetSourceDescription(CS_Source source,
|
||||
@@ -199,8 +197,9 @@ bool SetSourceResolution(CS_Source source, int width, int height,
|
||||
bool SetSourceFPS(CS_Source source, int fps, CS_Status* status);
|
||||
std::vector<VideoMode> EnumerateSourceVideoModes(CS_Source source,
|
||||
CS_Status* status);
|
||||
wpi::ArrayRef<CS_Sink> EnumerateSourceSinks(
|
||||
CS_Source source, wpi::SmallVectorImpl<CS_Sink>& vec, CS_Status* status);
|
||||
wpi::ArrayRef<CS_Sink> EnumerateSourceSinks(CS_Source source,
|
||||
wpi::SmallVectorImpl<CS_Sink>& vec,
|
||||
CS_Status* status);
|
||||
CS_Source CopySource(CS_Source source, CS_Status* status);
|
||||
void ReleaseSource(CS_Source source, CS_Status* status);
|
||||
|
||||
@@ -234,8 +233,7 @@ std::vector<std::string> GetHttpCameraUrls(CS_Source source, CS_Status* status);
|
||||
// OpenCV Source Functions
|
||||
//
|
||||
void PutSourceFrame(CS_Source source, cv::Mat& image, CS_Status* status);
|
||||
void NotifySourceError(CS_Source source, wpi::StringRef msg,
|
||||
CS_Status* status);
|
||||
void NotifySourceError(CS_Source source, wpi::StringRef msg, CS_Status* status);
|
||||
void SetSourceConnected(CS_Source source, bool connected, CS_Status* status);
|
||||
void SetSourceDescription(CS_Source source, wpi::StringRef description,
|
||||
CS_Status* status);
|
||||
@@ -265,8 +263,7 @@ std::string GetSinkName(CS_Sink sink, CS_Status* status);
|
||||
wpi::StringRef GetSinkName(CS_Sink sink, wpi::SmallVectorImpl<char>& buf,
|
||||
CS_Status* status);
|
||||
std::string GetSinkDescription(CS_Sink sink, CS_Status* status);
|
||||
wpi::StringRef GetSinkDescription(CS_Sink sink,
|
||||
wpi::SmallVectorImpl<char>& buf,
|
||||
wpi::StringRef GetSinkDescription(CS_Sink sink, wpi::SmallVectorImpl<char>& buf,
|
||||
CS_Status* status);
|
||||
void SetSinkSource(CS_Sink sink, CS_Source source, CS_Status* status);
|
||||
CS_Property GetSinkSourceProperty(CS_Sink sink, wpi::StringRef name,
|
||||
@@ -333,8 +330,8 @@ std::vector<UsbCameraInfo> EnumerateUsbCameras(CS_Status* status);
|
||||
|
||||
wpi::ArrayRef<CS_Source> EnumerateSourceHandles(
|
||||
wpi::SmallVectorImpl<CS_Source>& vec, CS_Status* status);
|
||||
wpi::ArrayRef<CS_Sink> EnumerateSinkHandles(
|
||||
wpi::SmallVectorImpl<CS_Sink>& vec, CS_Status* status);
|
||||
wpi::ArrayRef<CS_Sink> EnumerateSinkHandles(wpi::SmallVectorImpl<CS_Sink>& vec,
|
||||
CS_Status* status);
|
||||
|
||||
std::string GetHostname();
|
||||
|
||||
|
||||
@@ -448,8 +448,7 @@ class CvSource : public VideoSource {
|
||||
/// @param defaultValue Default value
|
||||
/// @param value Current value
|
||||
/// @return Property
|
||||
VideoProperty CreateStringProperty(wpi::StringRef name,
|
||||
wpi::StringRef value);
|
||||
VideoProperty CreateStringProperty(wpi::StringRef name, wpi::StringRef value);
|
||||
|
||||
/// Configure enum property choices.
|
||||
/// @param property Property
|
||||
|
||||
@@ -9,9 +9,6 @@ cppSrcFileInclude {
|
||||
}
|
||||
|
||||
generatedFileExclude {
|
||||
gtest/
|
||||
ni-libraries/include/
|
||||
ni-libraries/lib/
|
||||
hal/src/main/native/athena/ctre/
|
||||
hal/src/main/native/athena/frccansae/
|
||||
hal/src/main/native/athena/visa/
|
||||
@@ -20,13 +17,16 @@ generatedFileExclude {
|
||||
}
|
||||
|
||||
modifiableFileExclude {
|
||||
src/main/native/cpp/jni/
|
||||
\.patch$
|
||||
\.png$
|
||||
\.py$
|
||||
\.so$
|
||||
}
|
||||
|
||||
repoRootNameOverride {
|
||||
hal
|
||||
}
|
||||
|
||||
includeOtherLibs {
|
||||
^FRC_FPGA_ChipObject/
|
||||
^FRC_NetworkCommunication/
|
||||
@@ -35,6 +35,7 @@ includeOtherLibs {
|
||||
^opencv2/
|
||||
^spilib/
|
||||
^support/
|
||||
^wpi/
|
||||
}
|
||||
|
||||
includeProject {
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
|
||||
#include "HAL/DIO.h"
|
||||
|
||||
#include <wpi/raw_ostream.h>
|
||||
|
||||
#include <cmath>
|
||||
#include <thread>
|
||||
|
||||
#include <wpi/raw_ostream.h>
|
||||
|
||||
#include "DigitalInternal.h"
|
||||
#include "HAL/cpp/fpga_clock.h"
|
||||
#include "HAL/handles/HandlesInternal.h"
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
|
||||
#include "HAL/PWM.h"
|
||||
|
||||
#include <wpi/raw_ostream.h>
|
||||
|
||||
#include <cmath>
|
||||
#include <thread>
|
||||
|
||||
#include <wpi/raw_ostream.h>
|
||||
|
||||
#include "ConstantsInternal.h"
|
||||
#include "DigitalInternal.h"
|
||||
#include "HAL/cpp/fpga_clock.h"
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
#include <atomic>
|
||||
#include <cstring>
|
||||
|
||||
#include <wpi/raw_ostream.h>
|
||||
#include <wpi/mutex.h>
|
||||
#include <wpi/raw_ostream.h>
|
||||
|
||||
#include "DigitalInternal.h"
|
||||
#include "HAL/DIO.h"
|
||||
|
||||
@@ -151,7 +151,7 @@ void SerialHelper::CoiteratedSort(
|
||||
for (auto& str : m_sortedHubPath) {
|
||||
for (size_t i = 0; i < m_unsortedHubPath.size(); i++) {
|
||||
if (wpi::StringRef{m_unsortedHubPath[i].begin(),
|
||||
m_unsortedHubPath[i].size()}
|
||||
m_unsortedHubPath[i].size()}
|
||||
.equals(wpi::StringRef{str.begin(), str.size()})) {
|
||||
sortedVec.push_back(vec[i]);
|
||||
break;
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-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 "HAL/Accelerometer.h"
|
||||
#include <jni.h>
|
||||
|
||||
#include "HAL/Accelerometer.h"
|
||||
#include "edu_wpi_first_wpilibj_hal_AccelerometerJNI.h"
|
||||
|
||||
extern "C" {
|
||||
@@ -17,8 +18,9 @@ extern "C" {
|
||||
* Signature: (Z)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AccelerometerJNI_setAccelerometerActive(
|
||||
JNIEnv *, jclass, jboolean active) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AccelerometerJNI_setAccelerometerActive
|
||||
(JNIEnv*, jclass, jboolean active)
|
||||
{
|
||||
HAL_SetAccelerometerActive(active);
|
||||
}
|
||||
|
||||
@@ -28,8 +30,9 @@ Java_edu_wpi_first_wpilibj_hal_AccelerometerJNI_setAccelerometerActive(
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AccelerometerJNI_setAccelerometerRange(
|
||||
JNIEnv *, jclass, jint range) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AccelerometerJNI_setAccelerometerRange
|
||||
(JNIEnv*, jclass, jint range)
|
||||
{
|
||||
HAL_SetAccelerometerRange((HAL_AccelerometerRange)range);
|
||||
}
|
||||
|
||||
@@ -39,8 +42,9 @@ Java_edu_wpi_first_wpilibj_hal_AccelerometerJNI_setAccelerometerRange(
|
||||
* Signature: ()D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AccelerometerJNI_getAccelerometerX(
|
||||
JNIEnv *, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AccelerometerJNI_getAccelerometerX
|
||||
(JNIEnv*, jclass)
|
||||
{
|
||||
return HAL_GetAccelerometerX();
|
||||
}
|
||||
|
||||
@@ -50,8 +54,9 @@ Java_edu_wpi_first_wpilibj_hal_AccelerometerJNI_getAccelerometerX(
|
||||
* Signature: ()D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AccelerometerJNI_getAccelerometerY(
|
||||
JNIEnv *, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AccelerometerJNI_getAccelerometerY
|
||||
(JNIEnv*, jclass)
|
||||
{
|
||||
return HAL_GetAccelerometerY();
|
||||
}
|
||||
|
||||
@@ -61,8 +66,9 @@ Java_edu_wpi_first_wpilibj_hal_AccelerometerJNI_getAccelerometerY(
|
||||
* Signature: ()D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AccelerometerJNI_getAccelerometerZ(
|
||||
JNIEnv *, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AccelerometerJNI_getAccelerometerZ
|
||||
(JNIEnv*, jclass)
|
||||
{
|
||||
return HAL_GetAccelerometerZ();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-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 <assert.h>
|
||||
#include <jni.h>
|
||||
#include "HAL/cpp/Log.h"
|
||||
|
||||
#include "edu_wpi_first_wpilibj_hal_AnalogGyroJNI.h"
|
||||
#include <cassert>
|
||||
|
||||
#include "HAL/AnalogGyro.h"
|
||||
#include "HALUtil.h"
|
||||
#include "HAL/cpp/Log.h"
|
||||
#include "HAL/handles/HandlesInternal.h"
|
||||
#include "HALUtil.h"
|
||||
#include "edu_wpi_first_wpilibj_hal_AnalogGyroJNI.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
@@ -22,9 +22,9 @@ TLogLevel analogGyroJNILogLevel = logWARNING;
|
||||
|
||||
#define ANALOGGYROJNI_LOG(level) \
|
||||
if (level > analogGyroJNILogLevel) \
|
||||
; \
|
||||
else \
|
||||
Log().Get(level)
|
||||
; \
|
||||
else \
|
||||
Log().Get(level)
|
||||
|
||||
extern "C" {
|
||||
/*
|
||||
@@ -32,17 +32,21 @@ extern "C" {
|
||||
* Method: initializeAnalogGyro
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_initializeAnalogGyro(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_initializeAnalogGyro
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ANALOGGYROJNI_LOG(logDEBUG) << "Calling ANALOGGYROJNI initializeAnalogGyro";
|
||||
ANALOGGYROJNI_LOG(logDEBUG) << "Analog Input Handle = " << (HAL_AnalogInputHandle)id;
|
||||
ANALOGGYROJNI_LOG(logDEBUG)
|
||||
<< "Analog Input Handle = " << (HAL_AnalogInputHandle)id;
|
||||
int32_t status = 0;
|
||||
HAL_GyroHandle handle = HAL_InitializeAnalogGyro((HAL_AnalogInputHandle)id, &status);
|
||||
HAL_GyroHandle handle =
|
||||
HAL_InitializeAnalogGyro((HAL_AnalogInputHandle)id, &status);
|
||||
ANALOGGYROJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
ANALOGGYROJNI_LOG(logDEBUG) << "Gyro Handle = " << handle;
|
||||
// Analog input does range checking, so we don't need to do so.
|
||||
CheckStatusForceThrow(env, status);
|
||||
return (jint) handle;
|
||||
return (jint)handle;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -50,8 +54,10 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_initializeAn
|
||||
* Method: setupAnalogGyro
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_setupAnalogGyro(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_setupAnalogGyro
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ANALOGGYROJNI_LOG(logDEBUG) << "Calling ANALOGGYROJNI setupAnalogGyro";
|
||||
ANALOGGYROJNI_LOG(logDEBUG) << "Gyro Handle = " << (HAL_GyroHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -65,8 +71,10 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_setupAnalogG
|
||||
* Method: freeAnalogGyro
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_freeAnalogGyro(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_freeAnalogGyro
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ANALOGGYROJNI_LOG(logDEBUG) << "Calling ANALOGGYROJNI freeAnalogGyro";
|
||||
ANALOGGYROJNI_LOG(logDEBUG) << "Gyro Handle = " << (HAL_GyroHandle)id;
|
||||
HAL_FreeAnalogGyro((HAL_GyroHandle)id);
|
||||
@@ -77,12 +85,16 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_freeAnalogGy
|
||||
* Method: setAnalogGyroParameters
|
||||
* Signature: (IDDI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_setAnalogGyroParameters(
|
||||
JNIEnv* env, jclass, jint id, jdouble vPDPS, jdouble offset, jint center) {
|
||||
ANALOGGYROJNI_LOG(logDEBUG) << "Calling ANALOGGYROJNI setAnalogGyroParameters";
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_setAnalogGyroParameters
|
||||
(JNIEnv* env, jclass, jint id, jdouble vPDPS, jdouble offset, jint center)
|
||||
{
|
||||
ANALOGGYROJNI_LOG(logDEBUG)
|
||||
<< "Calling ANALOGGYROJNI setAnalogGyroParameters";
|
||||
ANALOGGYROJNI_LOG(logDEBUG) << "Gyro Handle = " << (HAL_GyroHandle)id;
|
||||
int32_t status = 0;
|
||||
HAL_SetAnalogGyroParameters((HAL_GyroHandle)id, vPDPS, offset, center, &status);
|
||||
HAL_SetAnalogGyroParameters((HAL_GyroHandle)id, vPDPS, offset, center,
|
||||
&status);
|
||||
ANALOGGYROJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
@@ -92,9 +104,12 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_setAnalogGyr
|
||||
* Method: setAnalogGyroVoltsPerDegreePerSecond
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_setAnalogGyroVoltsPerDegreePerSecond(
|
||||
JNIEnv* env, jclass, jint id, jdouble vPDPS) {
|
||||
ANALOGGYROJNI_LOG(logDEBUG) << "Calling ANALOGGYROJNI setAnalogGyroVoltsPerDegreePerSecond";
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_setAnalogGyroVoltsPerDegreePerSecond
|
||||
(JNIEnv* env, jclass, jint id, jdouble vPDPS)
|
||||
{
|
||||
ANALOGGYROJNI_LOG(logDEBUG)
|
||||
<< "Calling ANALOGGYROJNI setAnalogGyroVoltsPerDegreePerSecond";
|
||||
ANALOGGYROJNI_LOG(logDEBUG) << "Gyro Handle = " << (HAL_GyroHandle)id;
|
||||
ANALOGGYROJNI_LOG(logDEBUG) << "vPDPS = " << vPDPS;
|
||||
int32_t status = 0;
|
||||
@@ -108,8 +123,10 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_setAnalogGyr
|
||||
* Method: resetAnalogGyro
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_resetAnalogGyro(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_resetAnalogGyro
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ANALOGGYROJNI_LOG(logDEBUG) << "Calling ANALOGGYROJNI resetAnalogGyro";
|
||||
ANALOGGYROJNI_LOG(logDEBUG) << "Gyro Handle = " << (HAL_GyroHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -123,8 +140,10 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_resetAnalogG
|
||||
* Method: calibrateAnalogGyro
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_calibrateAnalogGyro(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_calibrateAnalogGyro
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ANALOGGYROJNI_LOG(logDEBUG) << "Calling ANALOGGYROJNI calibrateAnalogGyro";
|
||||
ANALOGGYROJNI_LOG(logDEBUG) << "Gyro Handle = " << (HAL_GyroHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -138,8 +157,10 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_calibrateAna
|
||||
* Method: setAnalogGyroDeadband
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_setAnalogGyroDeadband(
|
||||
JNIEnv* env, jclass, jint id, jdouble deadband) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_setAnalogGyroDeadband
|
||||
(JNIEnv* env, jclass, jint id, jdouble deadband)
|
||||
{
|
||||
ANALOGGYROJNI_LOG(logDEBUG) << "Calling ANALOGGYROJNI setAnalogGyroDeadband";
|
||||
ANALOGGYROJNI_LOG(logDEBUG) << "Gyro Handle = " << (HAL_GyroHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -153,8 +174,10 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_setAnalogGyr
|
||||
* Method: getAnalogGyroAngle
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_getAnalogGyroAngle(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_getAnalogGyroAngle
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ANALOGGYROJNI_LOG(logDEBUG) << "Calling ANALOGGYROJNI getAnalogGyroAngle";
|
||||
ANALOGGYROJNI_LOG(logDEBUG) << "Gyro Handle = " << (HAL_GyroHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -170,8 +193,10 @@ JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_getAnalog
|
||||
* Method: getAnalogGyroRate
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_getAnalogGyroRate(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_getAnalogGyroRate
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ANALOGGYROJNI_LOG(logDEBUG) << "Calling ANALOGGYROJNI getAnalogGyroRate";
|
||||
ANALOGGYROJNI_LOG(logDEBUG) << "Gyro Handle = " << (HAL_GyroHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -187,8 +212,10 @@ JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_getAnalog
|
||||
* Method: getAnalogGyroOffset
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_getAnalogGyroOffset(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_getAnalogGyroOffset
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ANALOGGYROJNI_LOG(logDEBUG) << "Calling ANALOGGYROJNI getAnalogGyroOffset";
|
||||
ANALOGGYROJNI_LOG(logDEBUG) << "Gyro Handle = " << (HAL_GyroHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -204,8 +231,10 @@ JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_getAnalog
|
||||
* Method: getAnalogGyroCenter
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_getAnalogGyroCenter(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_getAnalogGyroCenter
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ANALOGGYROJNI_LOG(logDEBUG) << "Calling ANALOGGYROJNI getAnalogGyroCenter";
|
||||
ANALOGGYROJNI_LOG(logDEBUG) << "Gyro Handle = " << (HAL_GyroHandle)id;
|
||||
int32_t status = 0;
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-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 <assert.h>
|
||||
#include <jni.h>
|
||||
#include "HAL/cpp/Log.h"
|
||||
|
||||
#include "edu_wpi_first_wpilibj_hal_AnalogJNI.h"
|
||||
#include <cassert>
|
||||
|
||||
#include "HAL/AnalogAccumulator.h"
|
||||
#include "HAL/AnalogInput.h"
|
||||
#include "HAL/AnalogOutput.h"
|
||||
#include "HAL/AnalogAccumulator.h"
|
||||
#include "HAL/AnalogTrigger.h"
|
||||
#include "HAL/Ports.h"
|
||||
#include "HALUtil.h"
|
||||
#include "HAL/cpp/Log.h"
|
||||
#include "HAL/handles/HandlesInternal.h"
|
||||
#include "HALUtil.h"
|
||||
#include "edu_wpi_first_wpilibj_hal_AnalogJNI.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
@@ -28,7 +28,7 @@ TLogLevel analogJNILogLevel = logWARNING;
|
||||
if (level > analogJNILogLevel) \
|
||||
; \
|
||||
else \
|
||||
Log().Get(level)
|
||||
Log().Get(level)
|
||||
|
||||
extern "C" {
|
||||
|
||||
@@ -38,14 +38,15 @@ extern "C" {
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_initializeAnalogInputPort(
|
||||
JNIEnv *env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_initializeAnalogInputPort
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_PortHandle)id;
|
||||
int32_t status = 0;
|
||||
auto analog = HAL_InitializeAnalogInputPort((HAL_PortHandle)id, &status);
|
||||
ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << analog;
|
||||
CheckStatusRange(env, status, 0, HAL_GetNumAnalogInputs(),
|
||||
CheckStatusRange(env, status, 0, HAL_GetNumAnalogInputs(),
|
||||
hal::getPortHandleChannel((HAL_PortHandle)id));
|
||||
return (jint)analog;
|
||||
}
|
||||
@@ -56,8 +57,9 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_initializeAnalogInputPort(
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_freeAnalogInputPort(
|
||||
JNIEnv *env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_freeAnalogInputPort
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_AnalogInputHandle)id;
|
||||
HAL_FreeAnalogInputPort((HAL_AnalogInputHandle)id);
|
||||
}
|
||||
@@ -68,14 +70,16 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_freeAnalogInputPort(
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_initializeAnalogOutputPort(
|
||||
JNIEnv *env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_initializeAnalogOutputPort
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_PortHandle)id;
|
||||
int32_t status = 0;
|
||||
HAL_AnalogOutputHandle analog = HAL_InitializeAnalogOutputPort((HAL_PortHandle)id, &status);
|
||||
HAL_AnalogOutputHandle analog =
|
||||
HAL_InitializeAnalogOutputPort((HAL_PortHandle)id, &status);
|
||||
ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << analog;
|
||||
CheckStatusRange(env, status, 0, HAL_GetNumAnalogOutputs(),
|
||||
CheckStatusRange(env, status, 0, HAL_GetNumAnalogOutputs(),
|
||||
hal::getPortHandleChannel((HAL_PortHandle)id));
|
||||
return (jlong)analog;
|
||||
}
|
||||
@@ -86,8 +90,9 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_initializeAnalogOutputPort(
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_freeAnalogOutputPort(
|
||||
JNIEnv *env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_freeAnalogOutputPort
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "Port Handle = " << id;
|
||||
HAL_FreeAnalogOutputPort((HAL_AnalogOutputHandle)id);
|
||||
}
|
||||
@@ -98,8 +103,9 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_freeAnalogOutputPort(
|
||||
* Signature: (B)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_checkAnalogModule(
|
||||
JNIEnv *, jclass, jbyte value) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_checkAnalogModule
|
||||
(JNIEnv*, jclass, jbyte value)
|
||||
{
|
||||
// ANALOGJNI_LOG(logDEBUG) << "Module = " << (jint)value;
|
||||
jboolean returnValue = HAL_CheckAnalogModule(value);
|
||||
// ANALOGJNI_LOG(logDEBUG) << "checkAnalogModuleResult = " <<
|
||||
@@ -113,8 +119,9 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_checkAnalogModule(
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_checkAnalogInputChannel(
|
||||
JNIEnv *, jclass, jint value) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_checkAnalogInputChannel
|
||||
(JNIEnv*, jclass, jint value)
|
||||
{
|
||||
// ANALOGJNI_LOG(logDEBUG) << "Channel = " << value;
|
||||
jboolean returnValue = HAL_CheckAnalogInputChannel(value);
|
||||
// ANALOGJNI_LOG(logDEBUG) << "checkAnalogChannelResult = " <<
|
||||
@@ -128,8 +135,9 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_checkAnalogInputChannel(
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_checkAnalogOutputChannel(
|
||||
JNIEnv *, jclass, jint value) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_checkAnalogOutputChannel
|
||||
(JNIEnv*, jclass, jint value)
|
||||
{
|
||||
// ANALOGJNI_LOG(logDEBUG) << "Channel = " << value;
|
||||
jboolean returnValue = HAL_CheckAnalogOutputChannel(value);
|
||||
// ANALOGJNI_LOG(logDEBUG) << "checkAnalogChannelResult = " <<
|
||||
@@ -142,8 +150,10 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_checkAnalogOutputChannel(
|
||||
* Method: setAnalogOutput
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogOutput(
|
||||
JNIEnv *env, jclass, jint id, jdouble voltage) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogOutput
|
||||
(JNIEnv* env, jclass, jint id, jdouble voltage)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "Calling setAnalogOutput";
|
||||
ANALOGJNI_LOG(logDEBUG) << "Voltage = " << voltage;
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << id;
|
||||
@@ -158,8 +168,9 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogOutput(
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogOutput(
|
||||
JNIEnv *env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogOutput
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
int32_t status = 0;
|
||||
double val = HAL_GetAnalogOutput((HAL_AnalogOutputHandle)id, &status);
|
||||
CheckStatus(env, status);
|
||||
@@ -172,8 +183,9 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogOutput(
|
||||
* Signature: (D)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogSampleRate(
|
||||
JNIEnv *env, jclass, jdouble value) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogSampleRate
|
||||
(JNIEnv* env, jclass, jdouble value)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "SampleRate = " << value;
|
||||
int32_t status = 0;
|
||||
HAL_SetAnalogSampleRate(value, &status);
|
||||
@@ -187,8 +199,9 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogSampleRate(
|
||||
* Signature: ()D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogSampleRate(
|
||||
JNIEnv *env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogSampleRate
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
double returnValue = HAL_GetAnalogSampleRate(&status);
|
||||
ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
@@ -203,8 +216,9 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogSampleRate(
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogAverageBits(
|
||||
JNIEnv *env, jclass, jint id, jint value) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogAverageBits
|
||||
(JNIEnv* env, jclass, jint id, jint value)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "AverageBits = " << value;
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -219,11 +233,13 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogAverageBits(
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogAverageBits(
|
||||
JNIEnv *env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogAverageBits
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
|
||||
int32_t status = 0;
|
||||
jint returnValue = HAL_GetAnalogAverageBits((HAL_AnalogInputHandle)id, &status);
|
||||
jint returnValue =
|
||||
HAL_GetAnalogAverageBits((HAL_AnalogInputHandle)id, &status);
|
||||
ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
ANALOGJNI_LOG(logDEBUG) << "AverageBits = " << returnValue;
|
||||
CheckStatus(env, status);
|
||||
@@ -236,8 +252,9 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogAverageBits(
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogOversampleBits(
|
||||
JNIEnv *env, jclass, jint id, jint value) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogOversampleBits
|
||||
(JNIEnv* env, jclass, jint id, jint value)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "OversampleBits = " << value;
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -252,11 +269,13 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogOversampleBits(
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogOversampleBits(
|
||||
JNIEnv *env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogOversampleBits
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
|
||||
int32_t status = 0;
|
||||
jint returnValue = HAL_GetAnalogOversampleBits((HAL_AnalogInputHandle)id, &status);
|
||||
jint returnValue =
|
||||
HAL_GetAnalogOversampleBits((HAL_AnalogInputHandle)id, &status);
|
||||
ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
ANALOGJNI_LOG(logDEBUG) << "OversampleBits = " << returnValue;
|
||||
CheckStatus(env, status);
|
||||
@@ -269,8 +288,9 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogOversampleBits(
|
||||
* Signature: (I)S
|
||||
*/
|
||||
JNIEXPORT jshort JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogValue(
|
||||
JNIEnv *env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogValue
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
// ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (void*)id;
|
||||
int32_t status = 0;
|
||||
jshort returnValue = HAL_GetAnalogValue((HAL_AnalogInputHandle)id, &status);
|
||||
@@ -286,11 +306,13 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogValue(
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogAverageValue(
|
||||
JNIEnv *env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogAverageValue
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
|
||||
int32_t status = 0;
|
||||
jint returnValue = HAL_GetAnalogAverageValue((HAL_AnalogInputHandle)id, &status);
|
||||
jint returnValue =
|
||||
HAL_GetAnalogAverageValue((HAL_AnalogInputHandle)id, &status);
|
||||
ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
ANALOGJNI_LOG(logDEBUG) << "AverageValue = " << returnValue;
|
||||
CheckStatus(env, status);
|
||||
@@ -303,12 +325,14 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogAverageValue(
|
||||
* Signature: (ID)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogVoltsToValue(
|
||||
JNIEnv *env, jclass, jint id, jdouble voltageValue) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogVoltsToValue
|
||||
(JNIEnv* env, jclass, jint id, jdouble voltageValue)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
|
||||
ANALOGJNI_LOG(logDEBUG) << "VoltageValue = " << voltageValue;
|
||||
int32_t status = 0;
|
||||
jint returnValue = HAL_GetAnalogVoltsToValue((HAL_AnalogInputHandle)id, voltageValue, &status);
|
||||
jint returnValue = HAL_GetAnalogVoltsToValue((HAL_AnalogInputHandle)id,
|
||||
voltageValue, &status);
|
||||
ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
ANALOGJNI_LOG(logDEBUG) << "Value = " << returnValue;
|
||||
CheckStatus(env, status);
|
||||
@@ -321,11 +345,13 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogVoltsToValue(
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogVoltage(
|
||||
JNIEnv *env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogVoltage
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
// ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (void*)id;
|
||||
int32_t status = 0;
|
||||
jdouble returnValue = HAL_GetAnalogVoltage((HAL_AnalogInputHandle)id, &status);
|
||||
jdouble returnValue =
|
||||
HAL_GetAnalogVoltage((HAL_AnalogInputHandle)id, &status);
|
||||
// ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
// ANALOGJNI_LOG(logDEBUG) << "Voltage = " << returnValue;
|
||||
CheckStatus(env, status);
|
||||
@@ -338,11 +364,13 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogVoltage(
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogAverageVoltage(
|
||||
JNIEnv *env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogAverageVoltage
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
|
||||
int32_t status = 0;
|
||||
jdouble returnValue = HAL_GetAnalogAverageVoltage((HAL_AnalogInputHandle)id, &status);
|
||||
jdouble returnValue =
|
||||
HAL_GetAnalogAverageVoltage((HAL_AnalogInputHandle)id, &status);
|
||||
ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
ANALOGJNI_LOG(logDEBUG) << "AverageVoltage = " << returnValue;
|
||||
CheckStatus(env, status);
|
||||
@@ -355,8 +383,9 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogAverageVoltage(
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogLSBWeight(
|
||||
JNIEnv *env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogLSBWeight
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
|
||||
int32_t status = 0;
|
||||
|
||||
@@ -372,8 +401,10 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogLSBWeight(
|
||||
* Method: getAnalogOffset
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogOffset(
|
||||
JNIEnv *env, jclass, jint id) {
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogOffset
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
|
||||
int32_t status = 0;
|
||||
|
||||
@@ -390,13 +421,15 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogOffset(
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_isAccumulatorChannel(
|
||||
JNIEnv *env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_isAccumulatorChannel
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "isAccumulatorChannel";
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
|
||||
int32_t status = 0;
|
||||
|
||||
jboolean returnValue = HAL_IsAccumulatorChannel((HAL_AnalogInputHandle)id, &status);
|
||||
jboolean returnValue =
|
||||
HAL_IsAccumulatorChannel((HAL_AnalogInputHandle)id, &status);
|
||||
ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
ANALOGJNI_LOG(logDEBUG) << "AnalogOffset = " << returnValue;
|
||||
CheckStatus(env, status);
|
||||
@@ -408,8 +441,10 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_isAccumulatorChannel(
|
||||
* Method: initAccumulator
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogJNI_initAccumulator(
|
||||
JNIEnv *env, jclass, jint id) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_initAccumulator
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
|
||||
int32_t status = 0;
|
||||
HAL_InitAccumulator((HAL_AnalogInputHandle)id, &status);
|
||||
@@ -423,8 +458,9 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogJNI_initAccumulator(
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_resetAccumulator(
|
||||
JNIEnv *env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_resetAccumulator
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
|
||||
int32_t status = 0;
|
||||
HAL_ResetAccumulator((HAL_AnalogInputHandle)id, &status);
|
||||
@@ -438,8 +474,9 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_resetAccumulator(
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAccumulatorCenter(
|
||||
JNIEnv *env, jclass, jint id, jint center) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAccumulatorCenter
|
||||
(JNIEnv* env, jclass, jint id, jint center)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
|
||||
int32_t status = 0;
|
||||
HAL_SetAccumulatorCenter((HAL_AnalogInputHandle)id, center, &status);
|
||||
@@ -453,8 +490,9 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAccumulatorCenter(
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAccumulatorDeadband(
|
||||
JNIEnv *env, jclass, jint id, jint deadband) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAccumulatorDeadband
|
||||
(JNIEnv* env, jclass, jint id, jint deadband)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
|
||||
int32_t status = 0;
|
||||
HAL_SetAccumulatorDeadband((HAL_AnalogInputHandle)id, deadband, &status);
|
||||
@@ -468,11 +506,13 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAccumulatorDeadband(
|
||||
* Signature: (I)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAccumulatorValue(
|
||||
JNIEnv *env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAccumulatorValue
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
|
||||
int32_t status = 0;
|
||||
jlong returnValue = HAL_GetAccumulatorValue((HAL_AnalogInputHandle)id, &status);
|
||||
jlong returnValue =
|
||||
HAL_GetAccumulatorValue((HAL_AnalogInputHandle)id, &status);
|
||||
ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
ANALOGJNI_LOG(logDEBUG) << "AccumulatorValue = " << returnValue;
|
||||
CheckStatus(env, status);
|
||||
@@ -486,11 +526,13 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAccumulatorValue(
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAccumulatorCount(
|
||||
JNIEnv *env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAccumulatorCount
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
|
||||
int32_t status = 0;
|
||||
jint returnValue = HAL_GetAccumulatorCount((HAL_AnalogInputHandle)id, &status);
|
||||
jint returnValue =
|
||||
HAL_GetAccumulatorCount((HAL_AnalogInputHandle)id, &status);
|
||||
ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
ANALOGJNI_LOG(logDEBUG) << "AccumulatorCount = " << returnValue;
|
||||
CheckStatus(env, status);
|
||||
@@ -500,11 +542,12 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAccumulatorCount(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_AnalogJNI
|
||||
* Method: getAccumulatorOutput
|
||||
* Signature: (ILedu/wpi/first/wpilibj/AccumulatorResult;)V
|
||||
* Signature: (ILjava/lang/Object;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAccumulatorOutput(
|
||||
JNIEnv *env, jclass, jint id, jobject accumulatorResult) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAccumulatorOutput
|
||||
(JNIEnv* env, jclass, jint id, jobject accumulatorResult)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
|
||||
int32_t status = 0;
|
||||
int64_t value = 0;
|
||||
@@ -520,17 +563,20 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAccumulatorOutput(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_AnalogJNI
|
||||
* Method: initializeAnalogTrigger
|
||||
* Signature: (ILjava/nio/IntBuffer;)J
|
||||
* Signature: (ILjava/lang/Object;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_initializeAnalogTrigger(
|
||||
JNIEnv *env, jclass, jint id, jobject index) {
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_initializeAnalogTrigger
|
||||
(JNIEnv* env, jclass, jint id, jobject index)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_AnalogInputHandle)id;
|
||||
jint *indexHandle = (jint *)env->GetDirectBufferAddress(index);
|
||||
jint* indexHandle =
|
||||
reinterpret_cast<jint*>(env->GetDirectBufferAddress(index));
|
||||
ANALOGJNI_LOG(logDEBUG) << "Index Ptr = " << indexHandle;
|
||||
int32_t status = 0;
|
||||
HAL_AnalogTriggerHandle analogTrigger =
|
||||
HAL_InitializeAnalogTrigger((HAL_AnalogInputHandle)id, (int32_t *)indexHandle, &status);
|
||||
HAL_AnalogTriggerHandle analogTrigger = HAL_InitializeAnalogTrigger(
|
||||
(HAL_AnalogInputHandle)id, reinterpret_cast<int32_t*>(indexHandle),
|
||||
&status);
|
||||
ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
ANALOGJNI_LOG(logDEBUG) << "AnalogTrigger Handle = " << analogTrigger;
|
||||
CheckStatus(env, status);
|
||||
@@ -543,9 +589,11 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_initializeAnalogTrigger(
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_cleanAnalogTrigger(
|
||||
JNIEnv *env, jclass,jint id) {
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Trigger Handle = " << (HAL_AnalogTriggerHandle)id;
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_cleanAnalogTrigger
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Trigger Handle = "
|
||||
<< (HAL_AnalogTriggerHandle)id;
|
||||
int32_t status = 0;
|
||||
HAL_CleanAnalogTrigger((HAL_AnalogTriggerHandle)id, &status);
|
||||
CheckStatus(env, status);
|
||||
@@ -557,11 +605,14 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_cleanAnalogTrigger(
|
||||
* Signature: (III)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogTriggerLimitsRaw(
|
||||
JNIEnv *env, jclass,jint id, jint lower, jint upper) {
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Trigger Handle = " << (HAL_AnalogTriggerHandle)id;
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogTriggerLimitsRaw
|
||||
(JNIEnv* env, jclass, jint id, jint lower, jint upper)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Trigger Handle = "
|
||||
<< (HAL_AnalogTriggerHandle)id;
|
||||
int32_t status = 0;
|
||||
HAL_SetAnalogTriggerLimitsRaw((HAL_AnalogTriggerHandle)id, lower, upper, &status);
|
||||
HAL_SetAnalogTriggerLimitsRaw((HAL_AnalogTriggerHandle)id, lower, upper,
|
||||
&status);
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
|
||||
@@ -571,11 +622,14 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogTriggerLimitsRaw(
|
||||
* Signature: (IDD)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogTriggerLimitsVoltage(
|
||||
JNIEnv *env, jclass,jint id, jdouble lower, jdouble upper) {
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Trigger Handle = " << (HAL_AnalogTriggerHandle)id;
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogTriggerLimitsVoltage
|
||||
(JNIEnv* env, jclass, jint id, jdouble lower, jdouble upper)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Trigger Handle = "
|
||||
<< (HAL_AnalogTriggerHandle)id;
|
||||
int32_t status = 0;
|
||||
HAL_SetAnalogTriggerLimitsVoltage((HAL_AnalogTriggerHandle)id, lower, upper, &status);
|
||||
HAL_SetAnalogTriggerLimitsVoltage((HAL_AnalogTriggerHandle)id, lower, upper,
|
||||
&status);
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
|
||||
@@ -585,9 +639,11 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogTriggerLimitsVoltage(
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogTriggerAveraged(
|
||||
JNIEnv *env, jclass,jint id, jboolean averaged) {
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Trigger Handle = " << (HAL_AnalogTriggerHandle)id;
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogTriggerAveraged
|
||||
(JNIEnv* env, jclass, jint id, jboolean averaged)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Trigger Handle = "
|
||||
<< (HAL_AnalogTriggerHandle)id;
|
||||
int32_t status = 0;
|
||||
HAL_SetAnalogTriggerAveraged((HAL_AnalogTriggerHandle)id, averaged, &status);
|
||||
CheckStatus(env, status);
|
||||
@@ -599,9 +655,11 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogTriggerAveraged(
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogTriggerFiltered(
|
||||
JNIEnv *env, jclass,jint id, jboolean filtered) {
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Trigger Handle = " << (HAL_AnalogTriggerHandle)id;
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogTriggerFiltered
|
||||
(JNIEnv* env, jclass, jint id, jboolean filtered)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Trigger Handle = "
|
||||
<< (HAL_AnalogTriggerHandle)id;
|
||||
int32_t status = 0;
|
||||
HAL_SetAnalogTriggerFiltered((HAL_AnalogTriggerHandle)id, filtered, &status);
|
||||
CheckStatus(env, status);
|
||||
@@ -613,11 +671,14 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogTriggerFiltered(
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogTriggerInWindow(
|
||||
JNIEnv *env, jclass,jint id) {
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Trigger Handle = " << (HAL_AnalogTriggerHandle)id;
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogTriggerInWindow
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Trigger Handle = "
|
||||
<< (HAL_AnalogTriggerHandle)id;
|
||||
int32_t status = 0;
|
||||
jboolean val = HAL_GetAnalogTriggerInWindow((HAL_AnalogTriggerHandle)id, &status);
|
||||
jboolean val =
|
||||
HAL_GetAnalogTriggerInWindow((HAL_AnalogTriggerHandle)id, &status);
|
||||
CheckStatus(env, status);
|
||||
return val;
|
||||
}
|
||||
@@ -628,11 +689,14 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogTriggerInWindow(
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogTriggerTriggerState(
|
||||
JNIEnv *env, jclass,jint id) {
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Trigger Handle = " << (HAL_AnalogTriggerHandle)id;
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogTriggerTriggerState
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Trigger Handle = "
|
||||
<< (HAL_AnalogTriggerHandle)id;
|
||||
int32_t status = 0;
|
||||
jboolean val = HAL_GetAnalogTriggerTriggerState((HAL_AnalogTriggerHandle)id, &status);
|
||||
jboolean val =
|
||||
HAL_GetAnalogTriggerTriggerState((HAL_AnalogTriggerHandle)id, &status);
|
||||
CheckStatus(env, status);
|
||||
return val;
|
||||
}
|
||||
@@ -643,12 +707,14 @@ Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogTriggerTriggerState(
|
||||
* Signature: (II)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogTriggerOutput(
|
||||
JNIEnv *env, jclass,jint id, jint type) {
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Trigger Handle = " << (HAL_AnalogTriggerHandle)id;
|
||||
Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogTriggerOutput
|
||||
(JNIEnv* env, jclass, jint id, jint type)
|
||||
{
|
||||
ANALOGJNI_LOG(logDEBUG) << "Analog Trigger Handle = "
|
||||
<< (HAL_AnalogTriggerHandle)id;
|
||||
int32_t status = 0;
|
||||
jboolean val =
|
||||
HAL_GetAnalogTriggerOutput((HAL_AnalogTriggerHandle)id, (HAL_AnalogTriggerType)type, &status);
|
||||
jboolean val = HAL_GetAnalogTriggerOutput(
|
||||
(HAL_AnalogTriggerHandle)id, (HAL_AnalogTriggerType)type, &status);
|
||||
CheckStatus(env, status);
|
||||
return val;
|
||||
}
|
||||
|
||||
@@ -1,20 +1,22 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-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 <assert.h>
|
||||
#include <jni.h>
|
||||
|
||||
#include "HAL/cpp/Log.h"
|
||||
#include <cassert>
|
||||
|
||||
#include <wpi/SmallString.h>
|
||||
#include <wpi/jni_util.h>
|
||||
#include <wpi/raw_ostream.h>
|
||||
|
||||
#include "HAL/CAN.h"
|
||||
#include "HAL/cpp/Log.h"
|
||||
#include "HALUtil.h"
|
||||
#include "edu_wpi_first_wpilibj_can_CANJNI.h"
|
||||
#include "wpi/SmallString.h"
|
||||
#include "wpi/jni_util.h"
|
||||
#include "wpi/raw_ostream.h"
|
||||
|
||||
using namespace frc;
|
||||
using namespace wpi::java;
|
||||
@@ -27,7 +29,7 @@ TLogLevel canJNILogLevel = logERROR;
|
||||
if (level > canJNILogLevel) \
|
||||
; \
|
||||
else \
|
||||
Log().Get(level)
|
||||
Log().Get(level)
|
||||
|
||||
extern "C" {
|
||||
|
||||
@@ -37,15 +39,15 @@ extern "C" {
|
||||
* Signature: (I[BI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_can_CANJNI_FRCNetCommCANSessionMuxSendMessage(
|
||||
JNIEnv *env, jclass, jint messageID, jbyteArray data, jint periodMs) {
|
||||
|
||||
CANJNI_LOG(logDEBUG)
|
||||
<< "Calling CANJNI FRCNetCommCANSessionMuxSendMessage";
|
||||
Java_edu_wpi_first_wpilibj_can_CANJNI_FRCNetCommCANSessionMuxSendMessage
|
||||
(JNIEnv* env, jclass, jint messageID, jbyteArray data, jint periodMs)
|
||||
{
|
||||
CANJNI_LOG(logDEBUG) << "Calling CANJNI FRCNetCommCANSessionMuxSendMessage";
|
||||
|
||||
JByteArrayRef dataArray{env, data};
|
||||
|
||||
const uint8_t *dataBuffer = reinterpret_cast<const uint8_t*>(dataArray.array().data());
|
||||
const uint8_t* dataBuffer =
|
||||
reinterpret_cast<const uint8_t*>(dataArray.array().data());
|
||||
uint8_t dataSize = dataArray.array().size();
|
||||
|
||||
CANJNI_LOG(logDEBUG) << "Message ID ";
|
||||
@@ -68,8 +70,7 @@ Java_edu_wpi_first_wpilibj_can_CANJNI_FRCNetCommCANSessionMuxSendMessage(
|
||||
CANJNI_LOG(logDEBUG) << "Period: " << periodMs;
|
||||
|
||||
int32_t status = 0;
|
||||
HAL_CAN_SendMessage(
|
||||
messageID, dataBuffer, dataSize, periodMs, &status);
|
||||
HAL_CAN_SendMessage(messageID, dataBuffer, dataSize, periodMs, &status);
|
||||
|
||||
CANJNI_LOG(logDEBUG) << "Status: " << status;
|
||||
CheckCANStatus(env, status, messageID);
|
||||
@@ -78,25 +79,27 @@ Java_edu_wpi_first_wpilibj_can_CANJNI_FRCNetCommCANSessionMuxSendMessage(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_can_CANJNI
|
||||
* Method: FRCNetCommCANSessionMuxReceiveMessage
|
||||
* Signature: (Ljava/nio/IntBuffer;ILjava/nio/ByteBuffer;)[B
|
||||
* Signature: (Ljava/lang/Object;ILjava/lang/Object;)[B
|
||||
*/
|
||||
JNIEXPORT jbyteArray JNICALL
|
||||
Java_edu_wpi_first_wpilibj_can_CANJNI_FRCNetCommCANSessionMuxReceiveMessage(
|
||||
JNIEnv *env, jclass, jobject messageID, jint messageIDMask,
|
||||
jobject timeStamp) {
|
||||
|
||||
Java_edu_wpi_first_wpilibj_can_CANJNI_FRCNetCommCANSessionMuxReceiveMessage
|
||||
(JNIEnv* env, jclass, jobject messageID, jint messageIDMask,
|
||||
jobject timeStamp)
|
||||
{
|
||||
CANJNI_LOG(logDEBUG)
|
||||
<< "Calling CANJNI FRCNetCommCANSessionMuxReceiveMessage";
|
||||
|
||||
uint32_t *messageIDPtr = (uint32_t *)env->GetDirectBufferAddress(messageID);
|
||||
uint32_t *timeStampPtr = (uint32_t *)env->GetDirectBufferAddress(timeStamp);
|
||||
uint32_t* messageIDPtr =
|
||||
reinterpret_cast<uint32_t*>(env->GetDirectBufferAddress(messageID));
|
||||
uint32_t* timeStampPtr =
|
||||
reinterpret_cast<uint32_t*>(env->GetDirectBufferAddress(timeStamp));
|
||||
|
||||
uint8_t dataSize = 0;
|
||||
uint8_t buffer[8];
|
||||
|
||||
int32_t status = 0;
|
||||
HAL_CAN_ReceiveMessage(
|
||||
messageIDPtr, messageIDMask, buffer, &dataSize, timeStampPtr, &status);
|
||||
HAL_CAN_ReceiveMessage(messageIDPtr, messageIDMask, buffer, &dataSize,
|
||||
timeStampPtr, &status);
|
||||
|
||||
CANJNI_LOG(logDEBUG) << "Message ID ";
|
||||
CANJNI_LOG(logDEBUG).write_hex(*messageIDPtr);
|
||||
@@ -121,19 +124,21 @@ Java_edu_wpi_first_wpilibj_can_CANJNI_FRCNetCommCANSessionMuxReceiveMessage(
|
||||
CANJNI_LOG(logDEBUG) << "Status: " << status;
|
||||
|
||||
if (!CheckCANStatus(env, status, *messageIDPtr)) return nullptr;
|
||||
return MakeJByteArray(env, wpi::StringRef{reinterpret_cast<const char*>(buffer),
|
||||
static_cast<size_t>(dataSize)});
|
||||
return MakeJByteArray(env,
|
||||
wpi::StringRef{reinterpret_cast<const char*>(buffer),
|
||||
static_cast<size_t>(dataSize)});
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_can_CANJNI
|
||||
* Method: GetCANStatus
|
||||
* Signature: (Ledu/wpi/first/wpilibj/can/CANStatus;)V
|
||||
* Signature: (Ljava/lang/Object;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_can_CANJNI_GetCANStatus
|
||||
(JNIEnv *env, jclass, jobject canStatus) {
|
||||
CANJNI_LOG(logDEBUG)
|
||||
<< "Calling CANJNI HAL_CAN_GetCANStatus";
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_can_CANJNI_GetCANStatus
|
||||
(JNIEnv* env, jclass, jobject canStatus)
|
||||
{
|
||||
CANJNI_LOG(logDEBUG) << "Calling CANJNI HAL_CAN_GetCANStatus";
|
||||
|
||||
float percentBusUtilization = 0;
|
||||
uint32_t busOffCount = 0;
|
||||
@@ -143,7 +148,7 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_can_CANJNI_GetCANStatus
|
||||
int32_t status = 0;
|
||||
HAL_CAN_GetCANStatus(&percentBusUtilization, &busOffCount, &txFullCount,
|
||||
&receiveErrorCount, &transmitErrorCount, &status);
|
||||
|
||||
|
||||
if (!CheckStatus(env, status)) return;
|
||||
|
||||
SetCanStatusObject(env, canStatus, percentBusUtilization, busOffCount,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-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. */
|
||||
@@ -8,8 +8,8 @@
|
||||
#include "HAL/Compressor.h"
|
||||
#include "HAL/Ports.h"
|
||||
#include "HAL/Solenoid.h"
|
||||
#include "HALUtil.h"
|
||||
#include "HAL/cpp/Log.h"
|
||||
#include "HALUtil.h"
|
||||
#include "edu_wpi_first_wpilibj_hal_CompressorJNI.h"
|
||||
|
||||
using namespace frc;
|
||||
@@ -22,12 +22,13 @@ extern "C" {
|
||||
* Signature: (B)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CompressorJNI_initializeCompressor(
|
||||
JNIEnv *env, jclass, jbyte module) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CompressorJNI_initializeCompressor
|
||||
(JNIEnv* env, jclass, jbyte module)
|
||||
{
|
||||
int32_t status = 0;
|
||||
auto handle = HAL_InitializeCompressor(module, &status);
|
||||
CheckStatusRange(env, status, 0, HAL_GetNumPCMModules(), module);
|
||||
|
||||
|
||||
return (jint)handle;
|
||||
}
|
||||
|
||||
@@ -37,19 +38,21 @@ Java_edu_wpi_first_wpilibj_hal_CompressorJNI_initializeCompressor(
|
||||
* Signature: (B)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CompressorJNI_checkCompressorModule(
|
||||
JNIEnv *env, jclass, jbyte module) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CompressorJNI_checkCompressorModule
|
||||
(JNIEnv* env, jclass, jbyte module)
|
||||
{
|
||||
return HAL_CheckCompressorModule(module);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CompressorJNI
|
||||
* Method: getCompressor
|
||||
* Signature: (J)Z
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressor(
|
||||
JNIEnv *env, jclass, jint compressorHandle) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressor
|
||||
(JNIEnv* env, jclass, jint compressorHandle)
|
||||
{
|
||||
int32_t status = 0;
|
||||
bool val = HAL_GetCompressor((HAL_CompressorHandle)compressorHandle, &status);
|
||||
CheckStatus(env, status);
|
||||
@@ -59,26 +62,30 @@ Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressor(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CompressorJNI
|
||||
* Method: setCompressorClosedLoopControl
|
||||
* Signature: (JZ)V
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CompressorJNI_setCompressorClosedLoopControl(
|
||||
JNIEnv *env, jclass, jint compressorHandle, jboolean value) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CompressorJNI_setCompressorClosedLoopControl
|
||||
(JNIEnv* env, jclass, jint compressorHandle, jboolean value)
|
||||
{
|
||||
int32_t status = 0;
|
||||
HAL_SetCompressorClosedLoopControl((HAL_CompressorHandle)compressorHandle, value, &status);
|
||||
HAL_SetCompressorClosedLoopControl((HAL_CompressorHandle)compressorHandle,
|
||||
value, &status);
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CompressorJNI
|
||||
* Method: getCompressorClosedLoopControl
|
||||
* Signature: (J)Z
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorClosedLoopControl(
|
||||
JNIEnv *env, jclass, jint compressorHandle) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorClosedLoopControl
|
||||
(JNIEnv* env, jclass, jint compressorHandle)
|
||||
{
|
||||
int32_t status = 0;
|
||||
bool val = HAL_GetCompressorClosedLoopControl((HAL_CompressorHandle)compressorHandle, &status);
|
||||
bool val = HAL_GetCompressorClosedLoopControl(
|
||||
(HAL_CompressorHandle)compressorHandle, &status);
|
||||
CheckStatus(env, status);
|
||||
return val;
|
||||
}
|
||||
@@ -86,13 +93,15 @@ Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorClosedLoopControl(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CompressorJNI
|
||||
* Method: getCompressorPressureSwitch
|
||||
* Signature: (J)Z
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorPressureSwitch(
|
||||
JNIEnv *env, jclass, jint compressorHandle) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorPressureSwitch
|
||||
(JNIEnv* env, jclass, jint compressorHandle)
|
||||
{
|
||||
int32_t status = 0;
|
||||
bool val = HAL_GetCompressorPressureSwitch((HAL_CompressorHandle)compressorHandle, &status);
|
||||
bool val = HAL_GetCompressorPressureSwitch(
|
||||
(HAL_CompressorHandle)compressorHandle, &status);
|
||||
CheckStatus(env, status);
|
||||
return val;
|
||||
}
|
||||
@@ -100,13 +109,15 @@ Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorPressureSwitch(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CompressorJNI
|
||||
* Method: getCompressorCurrent
|
||||
* Signature: (J)D
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorCurrent(
|
||||
JNIEnv *env, jclass, jint compressorHandle) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorCurrent
|
||||
(JNIEnv* env, jclass, jint compressorHandle)
|
||||
{
|
||||
int32_t status = 0;
|
||||
double val = HAL_GetCompressorCurrent((HAL_CompressorHandle)compressorHandle, &status);
|
||||
double val =
|
||||
HAL_GetCompressorCurrent((HAL_CompressorHandle)compressorHandle, &status);
|
||||
CheckStatus(env, status);
|
||||
return val;
|
||||
}
|
||||
@@ -114,13 +125,15 @@ Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorCurrent(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CompressorJNI
|
||||
* Method: getCompressorCurrentTooHighFault
|
||||
* Signature: (J)Z
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorCurrentTooHighFault(
|
||||
JNIEnv *env, jclass, jint compressorHandle) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorCurrentTooHighFault
|
||||
(JNIEnv* env, jclass, jint compressorHandle)
|
||||
{
|
||||
int32_t status = 0;
|
||||
bool val = HAL_GetCompressorCurrentTooHighFault((HAL_CompressorHandle)compressorHandle, &status);
|
||||
bool val = HAL_GetCompressorCurrentTooHighFault(
|
||||
(HAL_CompressorHandle)compressorHandle, &status);
|
||||
CheckStatus(env, status);
|
||||
return val;
|
||||
}
|
||||
@@ -128,14 +141,15 @@ Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorCurrentTooHighFault(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CompressorJNI
|
||||
* Method: getCompressorCurrentTooHighStickyFault
|
||||
* Signature: (J)Z
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorCurrentTooHighStickyFault(
|
||||
JNIEnv *env, jclass, jint compressorHandle) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorCurrentTooHighStickyFault
|
||||
(JNIEnv* env, jclass, jint compressorHandle)
|
||||
{
|
||||
int32_t status = 0;
|
||||
bool val =
|
||||
HAL_GetCompressorCurrentTooHighStickyFault((HAL_CompressorHandle)compressorHandle, &status);
|
||||
bool val = HAL_GetCompressorCurrentTooHighStickyFault(
|
||||
(HAL_CompressorHandle)compressorHandle, &status);
|
||||
CheckStatus(env, status);
|
||||
return val;
|
||||
}
|
||||
@@ -143,13 +157,15 @@ Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorCurrentTooHighStickyFa
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CompressorJNI
|
||||
* Method: getCompressorShortedStickyFault
|
||||
* Signature: (J)Z
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorShortedStickyFault(
|
||||
JNIEnv *env, jclass, jint compressorHandle) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorShortedStickyFault
|
||||
(JNIEnv* env, jclass, jint compressorHandle)
|
||||
{
|
||||
int32_t status = 0;
|
||||
bool val = HAL_GetCompressorShortedStickyFault((HAL_CompressorHandle)compressorHandle, &status);
|
||||
bool val = HAL_GetCompressorShortedStickyFault(
|
||||
(HAL_CompressorHandle)compressorHandle, &status);
|
||||
CheckStatus(env, status);
|
||||
return val;
|
||||
}
|
||||
@@ -157,13 +173,15 @@ Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorShortedStickyFault(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CompressorJNI
|
||||
* Method: getCompressorShortedFault
|
||||
* Signature: (J)Z
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorShortedFault(
|
||||
JNIEnv *env, jclass, jint compressorHandle) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorShortedFault
|
||||
(JNIEnv* env, jclass, jint compressorHandle)
|
||||
{
|
||||
int32_t status = 0;
|
||||
bool val = HAL_GetCompressorShortedFault((HAL_CompressorHandle)compressorHandle, &status);
|
||||
bool val = HAL_GetCompressorShortedFault(
|
||||
(HAL_CompressorHandle)compressorHandle, &status);
|
||||
CheckStatus(env, status);
|
||||
return val;
|
||||
}
|
||||
@@ -171,13 +189,15 @@ Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorShortedFault(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CompressorJNI
|
||||
* Method: getCompressorNotConnectedStickyFault
|
||||
* Signature: (J)Z
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorNotConnectedStickyFault(
|
||||
JNIEnv *env, jclass, jint compressorHandle) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorNotConnectedStickyFault
|
||||
(JNIEnv* env, jclass, jint compressorHandle)
|
||||
{
|
||||
int32_t status = 0;
|
||||
bool val = HAL_GetCompressorNotConnectedStickyFault((HAL_CompressorHandle)compressorHandle, &status);
|
||||
bool val = HAL_GetCompressorNotConnectedStickyFault(
|
||||
(HAL_CompressorHandle)compressorHandle, &status);
|
||||
CheckStatus(env, status);
|
||||
return val;
|
||||
}
|
||||
@@ -185,26 +205,29 @@ Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorNotConnectedStickyFaul
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CompressorJNI
|
||||
* Method: getCompressorNotConnectedFault
|
||||
* Signature: (J)Z
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorNotConnectedFault(
|
||||
JNIEnv *env, jclass, jint compressorHandle) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorNotConnectedFault
|
||||
(JNIEnv* env, jclass, jint compressorHandle)
|
||||
{
|
||||
int32_t status = 0;
|
||||
bool val = HAL_GetCompressorNotConnectedFault((HAL_CompressorHandle)compressorHandle, &status);
|
||||
bool val = HAL_GetCompressorNotConnectedFault(
|
||||
(HAL_CompressorHandle)compressorHandle, &status);
|
||||
CheckStatus(env, status);
|
||||
return val;
|
||||
}
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CompressorJNI
|
||||
* Method: clearAllPCMStickyFaults
|
||||
* Signature: (J)V
|
||||
* Signature: (B)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CompressorJNI_clearAllPCMStickyFaults(
|
||||
JNIEnv *env, jclass, jbyte module) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CompressorJNI_clearAllPCMStickyFaults
|
||||
(JNIEnv* env, jclass, jbyte module)
|
||||
{
|
||||
int32_t status = 0;
|
||||
HAL_ClearAllPCMStickyFaults((uint8_t)module, &status);
|
||||
HAL_ClearAllPCMStickyFaults(static_cast<int32_t>(module), &status);
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-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 <assert.h>
|
||||
#include <jni.h>
|
||||
#include "HAL/cpp/Log.h"
|
||||
|
||||
#include "edu_wpi_first_wpilibj_hal_ConstantsJNI.h"
|
||||
#include <cassert>
|
||||
|
||||
#include "HAL/Constants.h"
|
||||
#include "HAL/cpp/Log.h"
|
||||
#include "HALUtil.h"
|
||||
#include "edu_wpi_first_wpilibj_hal_ConstantsJNI.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
@@ -21,9 +21,9 @@ TLogLevel constantsJNILogLevel = logWARNING;
|
||||
|
||||
#define CONSTANTSJNI_LOG(level) \
|
||||
if (level > constantsJNILogLevel) \
|
||||
; \
|
||||
else \
|
||||
Log().Get(level)
|
||||
; \
|
||||
else \
|
||||
Log().Get(level)
|
||||
|
||||
extern "C" {
|
||||
/*
|
||||
@@ -32,11 +32,13 @@ extern "C" {
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_ConstantsJNI_getSystemClockTicksPerMicrosecond(
|
||||
JNIEnv *env, jclass) {
|
||||
CONSTANTSJNI_LOG(logDEBUG) << "Calling ConstantsJNI getSystemClockTicksPerMicrosecond";
|
||||
Java_edu_wpi_first_wpilibj_hal_ConstantsJNI_getSystemClockTicksPerMicrosecond
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
CONSTANTSJNI_LOG(logDEBUG)
|
||||
<< "Calling ConstantsJNI getSystemClockTicksPerMicrosecond";
|
||||
jint value = HAL_GetSystemClockTicksPerMicrosecond();
|
||||
CONSTANTSJNI_LOG(logDEBUG) << "Value = " << value;
|
||||
return value;
|
||||
}
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-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 <assert.h>
|
||||
#include <jni.h>
|
||||
#include "HAL/cpp/Log.h"
|
||||
|
||||
#include "edu_wpi_first_wpilibj_hal_CounterJNI.h"
|
||||
#include <cassert>
|
||||
|
||||
#include "HAL/Counter.h"
|
||||
#include "HAL/Errors.h"
|
||||
#include "HAL/cpp/Log.h"
|
||||
#include "HALUtil.h"
|
||||
#include "edu_wpi_first_wpilibj_hal_CounterJNI.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
@@ -24,24 +24,27 @@ TLogLevel counterJNILogLevel = logWARNING;
|
||||
if (level > counterJNILogLevel) \
|
||||
; \
|
||||
else \
|
||||
Log().Get(level)
|
||||
Log().Get(level)
|
||||
|
||||
extern "C" {
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CounterJNI
|
||||
* Method: initializeCounter
|
||||
* Signature: (ILjava/nio/IntBuffer;)I
|
||||
* Signature: (ILjava/lang/Object;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_initializeCounter(
|
||||
JNIEnv* env, jclass, jint mode, jobject index) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_initializeCounter
|
||||
(JNIEnv* env, jclass, jint mode, jobject index)
|
||||
{
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI initializeCounter";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Mode = " << mode;
|
||||
jint* indexPtr = (jint*)env->GetDirectBufferAddress(index);
|
||||
COUNTERJNI_LOG(logDEBUG) << "Index Ptr = " << (int32_t*)indexPtr;
|
||||
jint* indexPtr = reinterpret_cast<jint*>(env->GetDirectBufferAddress(index));
|
||||
COUNTERJNI_LOG(logDEBUG) << "Index Ptr = "
|
||||
<< reinterpret_cast<int32_t*>(indexPtr);
|
||||
int32_t status = 0;
|
||||
auto counter = HAL_InitializeCounter((HAL_Counter_Mode)mode, (int32_t*)indexPtr, &status);
|
||||
auto counter = HAL_InitializeCounter(
|
||||
(HAL_Counter_Mode)mode, reinterpret_cast<int32_t*>(indexPtr), &status);
|
||||
COUNTERJNI_LOG(logDEBUG) << "Index = " << *indexPtr;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
COUNTERJNI_LOG(logDEBUG) << "COUNTER Handle = " << counter;
|
||||
@@ -54,8 +57,10 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_initializeCounter(
|
||||
* Method: freeCounter
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CounterJNI_freeCounter(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_freeCounter
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI freeCounter";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -70,8 +75,9 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CounterJNI_freeCounter(
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterAverageSize(
|
||||
JNIEnv* env, jclass, jint id, jint value) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterAverageSize
|
||||
(JNIEnv* env, jclass, jint id, jint value)
|
||||
{
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterAverageSize";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "AverageSize = " << value;
|
||||
@@ -87,16 +93,17 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterAverageSize(
|
||||
* Signature: (III)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterUpSource(
|
||||
JNIEnv* env, jclass, jint id, jint digitalSourceHandle,
|
||||
jint analogTriggerType) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterUpSource
|
||||
(JNIEnv* env, jclass, jint id, jint digitalSourceHandle,
|
||||
jint analogTriggerType)
|
||||
{
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterUpSource";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "digitalSourceHandle = " << digitalSourceHandle;
|
||||
COUNTERJNI_LOG(logDEBUG) << "analogTriggerType = " << analogTriggerType;
|
||||
int32_t status = 0;
|
||||
HAL_SetCounterUpSource((HAL_CounterHandle)id, (HAL_Handle)digitalSourceHandle,
|
||||
(HAL_AnalogTriggerType)analogTriggerType, &status);
|
||||
HAL_SetCounterUpSource((HAL_CounterHandle)id, (HAL_Handle)digitalSourceHandle,
|
||||
(HAL_AnalogTriggerType)analogTriggerType, &status);
|
||||
COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
@@ -107,14 +114,16 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterUpSource(
|
||||
* Signature: (IZZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterUpSourceEdge(
|
||||
JNIEnv* env, jclass, jint id, jboolean valueRise, jboolean valueFall) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterUpSourceEdge
|
||||
(JNIEnv* env, jclass, jint id, jboolean valueRise, jboolean valueFall)
|
||||
{
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterUpSourceEdge";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Rise = " << (jint)valueRise;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Fall = " << (jint)valueFall;
|
||||
int32_t status = 0;
|
||||
HAL_SetCounterUpSourceEdge((HAL_CounterHandle)id, valueRise, valueFall, &status);
|
||||
HAL_SetCounterUpSourceEdge((HAL_CounterHandle)id, valueRise, valueFall,
|
||||
&status);
|
||||
COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
@@ -125,8 +134,9 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterUpSourceEdge(
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_clearCounterUpSource(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_clearCounterUpSource
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI clearCounterUpSource";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -138,19 +148,21 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_clearCounterUpSource(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_CounterJNI
|
||||
* Method: setCounterDownSource
|
||||
* Signature: (IIZ)V
|
||||
* Signature: (III)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterDownSource(
|
||||
JNIEnv* env, jclass, jint id, jint digitalSourceHandle,
|
||||
jint analogTriggerType) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterDownSource
|
||||
(JNIEnv* env, jclass, jint id, jint digitalSourceHandle,
|
||||
jint analogTriggerType)
|
||||
{
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterDownSource";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "digitalSourceHandle = " << digitalSourceHandle;
|
||||
COUNTERJNI_LOG(logDEBUG) << "analogTriggerType = " << analogTriggerType;
|
||||
int32_t status = 0;
|
||||
HAL_SetCounterDownSource((HAL_CounterHandle)id, (HAL_Handle)digitalSourceHandle,
|
||||
(HAL_AnalogTriggerType)analogTriggerType, &status);
|
||||
HAL_SetCounterDownSource((HAL_CounterHandle)id,
|
||||
(HAL_Handle)digitalSourceHandle,
|
||||
(HAL_AnalogTriggerType)analogTriggerType, &status);
|
||||
COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
if (status == PARAMETER_OUT_OF_RANGE) {
|
||||
ThrowIllegalArgumentException(env,
|
||||
@@ -167,14 +179,16 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterDownSource(
|
||||
* Signature: (IZZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterDownSourceEdge(
|
||||
JNIEnv* env, jclass, jint id, jboolean valueRise, jboolean valueFall) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterDownSourceEdge
|
||||
(JNIEnv* env, jclass, jint id, jboolean valueRise, jboolean valueFall)
|
||||
{
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterDownSourceEdge";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Rise = " << (jint)valueRise;
|
||||
COUNTERJNI_LOG(logDEBUG) << "Fall = " << (jint)valueFall;
|
||||
int32_t status = 0;
|
||||
HAL_SetCounterDownSourceEdge((HAL_CounterHandle)id, valueRise, valueFall, &status);
|
||||
HAL_SetCounterDownSourceEdge((HAL_CounterHandle)id, valueRise, valueFall,
|
||||
&status);
|
||||
COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
@@ -185,8 +199,9 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterDownSourceEdge(
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_clearCounterDownSource(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_clearCounterDownSource
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI clearCounterDownSource";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -201,8 +216,9 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_clearCounterDownSource(
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterUpDownMode(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterUpDownMode
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterUpDownMode";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -217,8 +233,9 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterUpDownMode(
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterExternalDirectionMode(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterExternalDirectionMode
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
COUNTERJNI_LOG(logDEBUG)
|
||||
<< "Calling COUNTERJNI setCounterExternalDirectionMode";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
|
||||
@@ -234,8 +251,9 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterExternalDirectionMode(
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterSemiPeriodMode(
|
||||
JNIEnv* env, jclass, jint id, jboolean value) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterSemiPeriodMode
|
||||
(JNIEnv* env, jclass, jint id, jboolean value)
|
||||
{
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterSemiPeriodMode";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "SemiPeriodMode = " << (jint)value;
|
||||
@@ -251,8 +269,9 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterSemiPeriodMode(
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterPulseLengthMode(
|
||||
JNIEnv* env, jclass, jint id, jdouble value) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterPulseLengthMode
|
||||
(JNIEnv* env, jclass, jint id, jdouble value)
|
||||
{
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterPulseLengthMode";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "PulseLengthMode = " << value;
|
||||
@@ -268,12 +287,14 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterPulseLengthMode(
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_getCounterSamplesToAverage(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_getCounterSamplesToAverage
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI getCounterSamplesToAverage";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
|
||||
int32_t status = 0;
|
||||
jint returnValue = HAL_GetCounterSamplesToAverage((HAL_CounterHandle)id, &status);
|
||||
jint returnValue =
|
||||
HAL_GetCounterSamplesToAverage((HAL_CounterHandle)id, &status);
|
||||
COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
COUNTERJNI_LOG(logDEBUG) << "getCounterSamplesToAverageResult = "
|
||||
<< returnValue;
|
||||
@@ -287,8 +308,9 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_getCounterSamplesToAverage(
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterSamplesToAverage(
|
||||
JNIEnv* env, jclass, jint id, jint value) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterSamplesToAverage
|
||||
(JNIEnv* env, jclass, jint id, jint value)
|
||||
{
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterSamplesToAverage";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "SamplesToAverage = " << value;
|
||||
@@ -307,8 +329,10 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterSamplesToAverage(
|
||||
* Method: resetCounter
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CounterJNI_resetCounter(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_resetCounter
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI resetCounter";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -322,8 +346,10 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CounterJNI_resetCounter(
|
||||
* Method: getCounter
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CounterJNI_getCounter(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_getCounter
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
// COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI getCounter";
|
||||
// COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -340,8 +366,9 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CounterJNI_getCounter(
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_getCounterPeriod(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_getCounterPeriod
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI getCounterPeriod";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -358,8 +385,9 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_getCounterPeriod(
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterMaxPeriod(
|
||||
JNIEnv* env, jclass, jint id, jdouble value) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterMaxPeriod
|
||||
(JNIEnv* env, jclass, jint id, jdouble value)
|
||||
{
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterMaxPeriod";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "MaxPeriod = " << value;
|
||||
@@ -375,8 +403,9 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterMaxPeriod(
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterUpdateWhenEmpty(
|
||||
JNIEnv* env, jclass, jint id, jboolean value) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterUpdateWhenEmpty
|
||||
(JNIEnv* env, jclass, jint id, jboolean value)
|
||||
{
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterMaxPeriod";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "UpdateWhenEmpty = " << (jint)value;
|
||||
@@ -392,8 +421,9 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterUpdateWhenEmpty(
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_getCounterStopped(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_getCounterStopped
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI getCounterStopped";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -410,12 +440,14 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_getCounterStopped(
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_getCounterDirection(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_getCounterDirection
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI getCounterDirection";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
|
||||
int32_t status = 0;
|
||||
jboolean returnValue = HAL_GetCounterDirection((HAL_CounterHandle)id, &status);
|
||||
jboolean returnValue =
|
||||
HAL_GetCounterDirection((HAL_CounterHandle)id, &status);
|
||||
COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
COUNTERJNI_LOG(logDEBUG) << "getCounterDirectionResult = "
|
||||
<< (jint)returnValue;
|
||||
@@ -429,8 +461,9 @@ Java_edu_wpi_first_wpilibj_hal_CounterJNI_getCounterDirection(
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterReverseDirection(
|
||||
JNIEnv* env, jclass, jint id, jboolean value) {
|
||||
Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterReverseDirection
|
||||
(JNIEnv* env, jclass, jint id, jboolean value)
|
||||
{
|
||||
COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterReverseDirection";
|
||||
COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
|
||||
COUNTERJNI_LOG(logDEBUG) << "ReverseDirection = " << (jint)value;
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-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 <assert.h>
|
||||
#include <jni.h>
|
||||
#include "HAL/cpp/Log.h"
|
||||
|
||||
#include "edu_wpi_first_wpilibj_hal_DIOJNI.h"
|
||||
#include <cassert>
|
||||
|
||||
#include "HAL/DIO.h"
|
||||
#include "HAL/PWM.h"
|
||||
#include "HALUtil.h"
|
||||
#include "HAL/Ports.h"
|
||||
#include "HAL/cpp/Log.h"
|
||||
#include "HAL/handles/HandlesInternal.h"
|
||||
#include "HALUtil.h"
|
||||
#include "edu_wpi_first_wpilibj_hal_DIOJNI.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
@@ -26,23 +26,25 @@ TLogLevel dioJNILogLevel = logWARNING;
|
||||
if (level > dioJNILogLevel) \
|
||||
; \
|
||||
else \
|
||||
Log().Get(level)
|
||||
Log().Get(level)
|
||||
|
||||
extern "C" {
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_DIOJNI
|
||||
* Method: initializeDIOPort
|
||||
* Signature: (IZ)I;
|
||||
* Signature: (IZ)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_DIOJNI_initializeDIOPort(
|
||||
JNIEnv *env, jclass, jint id, jboolean input) {
|
||||
Java_edu_wpi_first_wpilibj_hal_DIOJNI_initializeDIOPort
|
||||
(JNIEnv* env, jclass, jint id, jboolean input)
|
||||
{
|
||||
DIOJNI_LOG(logDEBUG) << "Calling DIOJNI initializeDIOPort";
|
||||
DIOJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_PortHandle)id;
|
||||
DIOJNI_LOG(logDEBUG) << "Input = " << (jint)input;
|
||||
int32_t status = 0;
|
||||
auto dio = HAL_InitializeDIOPort((HAL_PortHandle)id, (uint8_t)input, &status);
|
||||
auto dio = HAL_InitializeDIOPort((HAL_PortHandle)id,
|
||||
static_cast<uint8_t>(input), &status);
|
||||
DIOJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
DIOJNI_LOG(logDEBUG) << "DIO Handle = " << dio;
|
||||
CheckStatusRange(env, status, 0, HAL_GetNumDigitalChannels(),
|
||||
@@ -53,10 +55,12 @@ Java_edu_wpi_first_wpilibj_hal_DIOJNI_initializeDIOPort(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_DIOJNI
|
||||
* Method: checkDIOChannel
|
||||
* Signature: (I)Z;
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_DIOJNI_checkDIOChannel(
|
||||
JNIEnv *env, jclass, jint channel) {
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_DIOJNI_checkDIOChannel
|
||||
(JNIEnv* env, jclass, jint channel)
|
||||
{
|
||||
DIOJNI_LOG(logDEBUG) << "Calling DIOJNI checkDIOChannel";
|
||||
DIOJNI_LOG(logDEBUG) << "Channel = " << channel;
|
||||
return HAL_CheckDIOChannel(channel);
|
||||
@@ -65,10 +69,12 @@ JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_DIOJNI_checkDIOChannel
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_DIOJNI
|
||||
* Method: freeDIOPort
|
||||
* Signature: (I)V;
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_DIOJNI_freeDIOPort(
|
||||
JNIEnv *env, jclass, jint id) {
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_DIOJNI_freeDIOPort
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
DIOJNI_LOG(logDEBUG) << "Calling DIOJNI freeDIOPort";
|
||||
DIOJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_DigitalHandle)id;
|
||||
HAL_FreeDIOPort((HAL_DigitalHandle)id);
|
||||
@@ -79,8 +85,10 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_DIOJNI_freeDIOPort(
|
||||
* Method: setDIO
|
||||
* Signature: (IS)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_DIOJNI_setDIO(
|
||||
JNIEnv *env, jclass, jint id, jshort value) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_DIOJNI_setDIO
|
||||
(JNIEnv* env, jclass, jint id, jshort value)
|
||||
{
|
||||
// DIOJNI_LOG(logDEBUG) << "Calling DIOJNI setDIO";
|
||||
// DIOJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_DigitalHandle)id;
|
||||
// DIOJNI_LOG(logDEBUG) << "Value = " << value;
|
||||
@@ -95,8 +103,10 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_DIOJNI_setDIO(
|
||||
* Method: setDIODirection
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_DIOJNI_setDIODirection(
|
||||
JNIEnv *env, jclass, jint id, jboolean input) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_DIOJNI_setDIODirection
|
||||
(JNIEnv* env, jclass, jint id, jboolean input)
|
||||
{
|
||||
// DIOJNI_LOG(logDEBUG) << "Calling DIOJNI setDIO";
|
||||
// DIOJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_DigitalHandle)id;
|
||||
// DIOJNI_LOG(logDEBUG) << "IsInput = " << input;
|
||||
@@ -109,10 +119,12 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_DIOJNI_setDIODirection(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_DIOJNI
|
||||
* Method: getDIO
|
||||
* Signature: (J)Z
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_DIOJNI_getDIO(JNIEnv *env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_DIOJNI_getDIO
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
// DIOJNI_LOG(logDEBUG) << "Calling DIOJNI getDIO";
|
||||
// DIOJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_DigitalHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -126,11 +138,12 @@ Java_edu_wpi_first_wpilibj_hal_DIOJNI_getDIO(JNIEnv *env, jclass, jint id) {
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_DIOJNI
|
||||
* Method: getDIODirection
|
||||
* Signature: (J)Z
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_DIOJNI_getDIODirection(
|
||||
JNIEnv *env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_DIOJNI_getDIODirection
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
DIOJNI_LOG(logDEBUG) << "Calling DIOJNI getDIODirection (RR upd)";
|
||||
// DIOJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_DigitalHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -144,10 +157,12 @@ Java_edu_wpi_first_wpilibj_hal_DIOJNI_getDIODirection(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_DIOJNI
|
||||
* Method: pulse
|
||||
* Signature: (JD)V
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_DIOJNI_pulse(
|
||||
JNIEnv *env, jclass, jint id, jdouble value) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_DIOJNI_pulse
|
||||
(JNIEnv* env, jclass, jint id, jdouble value)
|
||||
{
|
||||
DIOJNI_LOG(logDEBUG) << "Calling DIOJNI pulse (RR upd)";
|
||||
// DIOJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_DigitalHandle)id;
|
||||
// DIOJNI_LOG(logDEBUG) << "Value = " << value;
|
||||
@@ -160,10 +175,12 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_DIOJNI_pulse(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_DIOJNI
|
||||
* Method: isPulsing
|
||||
* Signature: (J)Z
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_DIOJNI_isPulsing(JNIEnv *env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_DIOJNI_isPulsing
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
DIOJNI_LOG(logDEBUG) << "Calling DIOJNI isPulsing (RR upd)";
|
||||
// DIOJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_DigitalHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -180,7 +197,9 @@ Java_edu_wpi_first_wpilibj_hal_DIOJNI_isPulsing(JNIEnv *env, jclass, jint id) {
|
||||
* Signature: ()Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_DIOJNI_isAnyPulsing(JNIEnv *env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_DIOJNI_isAnyPulsing
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
DIOJNI_LOG(logDEBUG) << "Calling DIOJNI isAnyPulsing (RR upd)";
|
||||
int32_t status = 0;
|
||||
jboolean returnValue = HAL_IsAnyPulsing(&status);
|
||||
@@ -196,7 +215,9 @@ Java_edu_wpi_first_wpilibj_hal_DIOJNI_isAnyPulsing(JNIEnv *env, jclass) {
|
||||
* Signature: ()S
|
||||
*/
|
||||
JNIEXPORT jshort JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_DIOJNI_getLoopTiming(JNIEnv *env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_DIOJNI_getLoopTiming
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
DIOJNI_LOG(logDEBUG) << "Calling DIOJNI getLoopTimeing";
|
||||
int32_t status = 0;
|
||||
jshort returnValue = HAL_GetPWMLoopTiming(&status);
|
||||
@@ -206,14 +227,15 @@ Java_edu_wpi_first_wpilibj_hal_DIOJNI_getLoopTiming(JNIEnv *env, jclass) {
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_DIOJNI
|
||||
* Method: allocateDigitalPWM
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_DIOJNI_allocateDigitalPWM(JNIEnv* env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_DIOJNI_allocateDigitalPWM
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
DIOJNI_LOG(logDEBUG) << "Calling DIOJNI allocateDigitalPWM";
|
||||
int32_t status = 0;
|
||||
auto pwm = HAL_AllocateDigitalPWM(&status);
|
||||
@@ -229,7 +251,9 @@ Java_edu_wpi_first_wpilibj_hal_DIOJNI_allocateDigitalPWM(JNIEnv* env, jclass) {
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_DIOJNI_freeDigitalPWM(JNIEnv* env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_DIOJNI_freeDigitalPWM
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
DIOJNI_LOG(logDEBUG) << "Calling DIOJNI freeDigitalPWM";
|
||||
DIOJNI_LOG(logDEBUG) << "PWM Handle = " << (HAL_DigitalPWMHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -243,8 +267,10 @@ Java_edu_wpi_first_wpilibj_hal_DIOJNI_freeDigitalPWM(JNIEnv* env, jclass, jint i
|
||||
* Method: setDigitalPWMRate
|
||||
* Signature: (D)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_DIOJNI_setDigitalPWMRate(
|
||||
JNIEnv* env, jclass, jdouble value) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_DIOJNI_setDigitalPWMRate
|
||||
(JNIEnv* env, jclass, jdouble value)
|
||||
{
|
||||
DIOJNI_LOG(logDEBUG) << "Calling DIOJNI setDigitalPWMRate";
|
||||
DIOJNI_LOG(logDEBUG) << "Rate= " << value;
|
||||
int32_t status = 0;
|
||||
@@ -258,8 +284,10 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_DIOJNI_setDigitalPWMRate(
|
||||
* Method: setDigitalPWMDutyCycle
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_DIOJNI_setDigitalPWMDutyCycle(
|
||||
JNIEnv* env, jclass, jint id, jdouble value) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_DIOJNI_setDigitalPWMDutyCycle
|
||||
(JNIEnv* env, jclass, jint id, jdouble value)
|
||||
{
|
||||
DIOJNI_LOG(logDEBUG) << "Calling DIOJNI setDigitalPWMDutyCycle";
|
||||
DIOJNI_LOG(logDEBUG) << "PWM Handle = " << (HAL_DigitalPWMHandle)id;
|
||||
DIOJNI_LOG(logDEBUG) << "DutyCycle= " << value;
|
||||
@@ -275,13 +303,15 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_DIOJNI_setDigitalPWMDutyCy
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_DIOJNI_setDigitalPWMOutputChannel(
|
||||
JNIEnv* env, jclass, jint id, jint value) {
|
||||
Java_edu_wpi_first_wpilibj_hal_DIOJNI_setDigitalPWMOutputChannel
|
||||
(JNIEnv* env, jclass, jint id, jint value)
|
||||
{
|
||||
DIOJNI_LOG(logDEBUG) << "Calling DIOJNI setDigitalPWMOutputChannel";
|
||||
DIOJNI_LOG(logDEBUG) << "PWM Handle = " << (HAL_DigitalPWMHandle)id;
|
||||
DIOJNI_LOG(logDEBUG) << "Channel= " << value;
|
||||
int32_t status = 0;
|
||||
HAL_SetDigitalPWMOutputChannel((HAL_DigitalPWMHandle)id, (uint32_t)value, &status);
|
||||
HAL_SetDigitalPWMOutputChannel((HAL_DigitalPWMHandle)id,
|
||||
static_cast<uint32_t>(value), &status);
|
||||
DIOJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-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 "HAL/DIO.h"
|
||||
#include "HALUtil.h"
|
||||
|
||||
#include "edu_wpi_first_wpilibj_hal_DigitalGlitchFilterJNI.h"
|
||||
|
||||
using namespace frc;
|
||||
@@ -16,10 +16,12 @@ using namespace frc;
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_DigitalGlitchFilterJNI
|
||||
* Method: setFilterSelect
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_DigitalGlitchFilterJNI_setFilterSelect(
|
||||
JNIEnv* env, jclass, jint id, jint filter_index) {
|
||||
Java_edu_wpi_first_wpilibj_hal_DigitalGlitchFilterJNI_setFilterSelect
|
||||
(JNIEnv* env, jclass, jint id, jint filter_index)
|
||||
{
|
||||
int32_t status = 0;
|
||||
|
||||
HAL_SetFilterSelect(static_cast<HAL_DigitalHandle>(id), filter_index,
|
||||
@@ -30,10 +32,12 @@ Java_edu_wpi_first_wpilibj_hal_DigitalGlitchFilterJNI_setFilterSelect(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_DigitalGlitchFilterJNI
|
||||
* Method: getFilterSelect
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_DigitalGlitchFilterJNI_getFilterSelect(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_DigitalGlitchFilterJNI_getFilterSelect
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
int32_t status = 0;
|
||||
|
||||
jint result =
|
||||
@@ -45,10 +49,12 @@ Java_edu_wpi_first_wpilibj_hal_DigitalGlitchFilterJNI_getFilterSelect(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_DigitalGlitchFilterJNI
|
||||
* Method: setFilterPeriod
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_DigitalGlitchFilterJNI_setFilterPeriod(
|
||||
JNIEnv* env, jclass, jint filter_index, jint fpga_cycles) {
|
||||
Java_edu_wpi_first_wpilibj_hal_DigitalGlitchFilterJNI_setFilterPeriod
|
||||
(JNIEnv* env, jclass, jint filter_index, jint fpga_cycles)
|
||||
{
|
||||
int32_t status = 0;
|
||||
|
||||
HAL_SetFilterPeriod(filter_index, fpga_cycles, &status);
|
||||
@@ -58,10 +64,12 @@ Java_edu_wpi_first_wpilibj_hal_DigitalGlitchFilterJNI_setFilterPeriod(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_DigitalGlitchFilterJNI
|
||||
* Method: getFilterPeriod
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_DigitalGlitchFilterJNI_getFilterPeriod(
|
||||
JNIEnv* env, jclass, jint filter_index) {
|
||||
Java_edu_wpi_first_wpilibj_hal_DigitalGlitchFilterJNI_getFilterPeriod
|
||||
(JNIEnv* env, jclass, jint filter_index)
|
||||
{
|
||||
int32_t status = 0;
|
||||
|
||||
jint result = HAL_GetFilterPeriod(filter_index, &status);
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-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 <assert.h>
|
||||
#include <jni.h>
|
||||
#include "HAL/cpp/Log.h"
|
||||
|
||||
#include "edu_wpi_first_wpilibj_hal_EncoderJNI.h"
|
||||
#include <cassert>
|
||||
|
||||
#include "HAL/Encoder.h"
|
||||
#include "HAL/Errors.h"
|
||||
#include "HAL/cpp/Log.h"
|
||||
#include "HALUtil.h"
|
||||
#include "edu_wpi_first_wpilibj_hal_EncoderJNI.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
@@ -24,7 +24,7 @@ TLogLevel encoderJNILogLevel = logWARNING;
|
||||
if (level > encoderJNILogLevel) \
|
||||
; \
|
||||
else \
|
||||
Log().Get(level)
|
||||
Log().Get(level)
|
||||
|
||||
extern "C" {
|
||||
|
||||
@@ -34,24 +34,25 @@ extern "C" {
|
||||
* Signature: (IIIIZI)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_initializeEncoder(
|
||||
JNIEnv* env, jclass, jint digitalSourceHandleA, jint analogTriggerTypeA,
|
||||
jint digitalSourceHandleB, jint analogTriggerTypeB, jboolean reverseDirection,
|
||||
jint encodingType) {
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_initializeEncoder
|
||||
(JNIEnv* env, jclass, jint digitalSourceHandleA, jint analogTriggerTypeA,
|
||||
jint digitalSourceHandleB, jint analogTriggerTypeB,
|
||||
jboolean reverseDirection, jint encodingType)
|
||||
{
|
||||
ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI initializeEncoder";
|
||||
ENCODERJNI_LOG(logDEBUG) << "Source Handle A = " << digitalSourceHandleA;
|
||||
ENCODERJNI_LOG(logDEBUG) << "Analog Trigger Type A = "
|
||||
<< analogTriggerTypeA;
|
||||
ENCODERJNI_LOG(logDEBUG) << "Analog Trigger Type A = " << analogTriggerTypeA;
|
||||
ENCODERJNI_LOG(logDEBUG) << "Source Handle B = " << digitalSourceHandleB;
|
||||
ENCODERJNI_LOG(logDEBUG) << "Analog Trigger Type B = "
|
||||
<< analogTriggerTypeB;
|
||||
ENCODERJNI_LOG(logDEBUG) << "Analog Trigger Type B = " << analogTriggerTypeB;
|
||||
ENCODERJNI_LOG(logDEBUG) << "Reverse direction = " << (jint)reverseDirection;
|
||||
ENCODERJNI_LOG(logDEBUG) << "EncodingType = " << encodingType;
|
||||
int32_t status = 0;
|
||||
auto encoder = HAL_InitializeEncoder(
|
||||
(HAL_Handle)digitalSourceHandleA, (HAL_AnalogTriggerType)analogTriggerTypeA,
|
||||
(HAL_Handle)digitalSourceHandleB, (HAL_AnalogTriggerType)analogTriggerTypeB,
|
||||
reverseDirection, (HAL_EncoderEncodingType)encodingType, &status);
|
||||
(HAL_Handle)digitalSourceHandleA,
|
||||
(HAL_AnalogTriggerType)analogTriggerTypeA,
|
||||
(HAL_Handle)digitalSourceHandleB,
|
||||
(HAL_AnalogTriggerType)analogTriggerTypeB, reverseDirection,
|
||||
(HAL_EncoderEncodingType)encodingType, &status);
|
||||
|
||||
ENCODERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
ENCODERJNI_LOG(logDEBUG) << "ENCODER Handle = " << encoder;
|
||||
@@ -64,8 +65,10 @@ Java_edu_wpi_first_wpilibj_hal_EncoderJNI_initializeEncoder(
|
||||
* Method: freeEncoder
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_EncoderJNI_freeEncoder(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_freeEncoder
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI freeEncoder";
|
||||
ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -79,8 +82,10 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_EncoderJNI_freeEncoder(
|
||||
* Method: getEncoder
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoder(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoder
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI getEncoder";
|
||||
ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -96,8 +101,10 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoder(
|
||||
* Method: getEncoderRaw
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderRaw(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderRaw
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI getEncoderRaw";
|
||||
ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -113,12 +120,15 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderRaw(
|
||||
* Method: getEncodingScaleFactor
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncodingScaleFactor(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncodingScaleFactor
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI getEncodingScaleFactor";
|
||||
ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
|
||||
int32_t status = 0;
|
||||
jint returnValue = HAL_GetEncoderEncodingScale((HAL_EncoderHandle)id, &status);
|
||||
jint returnValue =
|
||||
HAL_GetEncoderEncodingScale((HAL_EncoderHandle)id, &status);
|
||||
ENCODERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
ENCODERJNI_LOG(logDEBUG) << "getEncodingScaleFactorResult = " << returnValue;
|
||||
CheckStatus(env, status);
|
||||
@@ -130,8 +140,10 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncodingScal
|
||||
* Method: resetEncoder
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_EncoderJNI_resetEncoder(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_resetEncoder
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI resetEncoder";
|
||||
ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -146,8 +158,9 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_EncoderJNI_resetEncoder(
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderPeriod(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderPeriod
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI getEncoderPeriod";
|
||||
ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -164,8 +177,9 @@ Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderPeriod(
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_setEncoderMaxPeriod(
|
||||
JNIEnv* env, jclass, jint id, jdouble value) {
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_setEncoderMaxPeriod
|
||||
(JNIEnv* env, jclass, jint id, jdouble value)
|
||||
{
|
||||
ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI setEncoderMaxPeriod";
|
||||
ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -180,8 +194,9 @@ Java_edu_wpi_first_wpilibj_hal_EncoderJNI_setEncoderMaxPeriod(
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderStopped(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderStopped
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI getEncoderStopped";
|
||||
ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -198,12 +213,14 @@ Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderStopped(
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderDirection(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderDirection
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI getEncoderDirection";
|
||||
ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
|
||||
int32_t status = 0;
|
||||
jboolean returnValue = HAL_GetEncoderDirection((HAL_EncoderHandle)id, &status);
|
||||
jboolean returnValue =
|
||||
HAL_GetEncoderDirection((HAL_EncoderHandle)id, &status);
|
||||
ENCODERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
ENCODERJNI_LOG(logDEBUG) << "getDirectionEncoderResult = " << returnValue;
|
||||
CheckStatus(env, status);
|
||||
@@ -216,8 +233,9 @@ Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderDirection(
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderDistance(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderDistance
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI getEncoderDistance";
|
||||
ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -234,8 +252,9 @@ Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderDistance(
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderRate(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderRate
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI getEncoderRate";
|
||||
ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -252,8 +271,9 @@ Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderRate(
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_setEncoderMinRate(
|
||||
JNIEnv* env, jclass, jint id, jdouble value) {
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_setEncoderMinRate
|
||||
(JNIEnv* env, jclass, jint id, jdouble value)
|
||||
{
|
||||
ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI setEncoderMinRate";
|
||||
ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -268,8 +288,9 @@ Java_edu_wpi_first_wpilibj_hal_EncoderJNI_setEncoderMinRate(
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_setEncoderDistancePerPulse(
|
||||
JNIEnv* env, jclass, jint id, jdouble value) {
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_setEncoderDistancePerPulse
|
||||
(JNIEnv* env, jclass, jint id, jdouble value)
|
||||
{
|
||||
ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI setEncoderDistancePerPulse";
|
||||
ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -284,8 +305,9 @@ Java_edu_wpi_first_wpilibj_hal_EncoderJNI_setEncoderDistancePerPulse(
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_setEncoderReverseDirection(
|
||||
JNIEnv* env, jclass, jint id, jboolean value) {
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_setEncoderReverseDirection
|
||||
(JNIEnv* env, jclass, jint id, jboolean value)
|
||||
{
|
||||
ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI setEncoderReverseDirection";
|
||||
ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -300,8 +322,9 @@ Java_edu_wpi_first_wpilibj_hal_EncoderJNI_setEncoderReverseDirection(
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_setEncoderSamplesToAverage(
|
||||
JNIEnv* env, jclass, jint id, jint value) {
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_setEncoderSamplesToAverage
|
||||
(JNIEnv* env, jclass, jint id, jint value)
|
||||
{
|
||||
ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI setEncoderSamplesToAverage";
|
||||
ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -320,12 +343,14 @@ Java_edu_wpi_first_wpilibj_hal_EncoderJNI_setEncoderSamplesToAverage(
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderSamplesToAverage(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderSamplesToAverage
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI getEncoderSamplesToAverage";
|
||||
ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
|
||||
int32_t status = 0;
|
||||
jint returnValue = HAL_GetEncoderSamplesToAverage((HAL_EncoderHandle)id, &status);
|
||||
jint returnValue =
|
||||
HAL_GetEncoderSamplesToAverage((HAL_EncoderHandle)id, &status);
|
||||
ENCODERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
ENCODERJNI_LOG(logDEBUG) << "getEncoderSamplesToAverageResult = "
|
||||
<< returnValue;
|
||||
@@ -339,17 +364,18 @@ Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderSamplesToAverage(
|
||||
* Signature: (IIII)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_setEncoderIndexSource(
|
||||
JNIEnv* env, jclass, jint id, jint digitalSourceHandle,
|
||||
jint analogTriggerType, jint type) {
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_setEncoderIndexSource
|
||||
(JNIEnv* env, jclass, jint id, jint digitalSourceHandle,
|
||||
jint analogTriggerType, jint type)
|
||||
{
|
||||
ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI setEncoderIndexSource";
|
||||
ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
|
||||
ENCODERJNI_LOG(logDEBUG) << "Source Handle = " << digitalSourceHandle;
|
||||
ENCODERJNI_LOG(logDEBUG) << "Analog Trigger Type = "
|
||||
<< analogTriggerType;
|
||||
ENCODERJNI_LOG(logDEBUG) << "Analog Trigger Type = " << analogTriggerType;
|
||||
ENCODERJNI_LOG(logDEBUG) << "IndexingType = " << type;
|
||||
int32_t status = 0;
|
||||
HAL_SetEncoderIndexSource((HAL_EncoderHandle)id, (HAL_Handle)digitalSourceHandle,
|
||||
HAL_SetEncoderIndexSource((HAL_EncoderHandle)id,
|
||||
(HAL_Handle)digitalSourceHandle,
|
||||
(HAL_AnalogTriggerType)analogTriggerType,
|
||||
(HAL_EncoderIndexingType)type, &status);
|
||||
ENCODERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
@@ -362,8 +388,9 @@ Java_edu_wpi_first_wpilibj_hal_EncoderJNI_setEncoderIndexSource(
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderFPGAIndex(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderFPGAIndex
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI getEncoderSamplesToAverage";
|
||||
ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -381,12 +408,14 @@ Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderFPGAIndex(
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderEncodingScale(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderEncodingScale
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI getEncoderSamplesToAverage";
|
||||
ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
|
||||
int32_t status = 0;
|
||||
jint returnValue = HAL_GetEncoderEncodingScale((HAL_EncoderHandle)id, &status);
|
||||
jint returnValue =
|
||||
HAL_GetEncoderEncodingScale((HAL_EncoderHandle)id, &status);
|
||||
ENCODERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
ENCODERJNI_LOG(logDEBUG) << "getEncoderSamplesToAverageResult = "
|
||||
<< returnValue;
|
||||
@@ -400,12 +429,14 @@ Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderEncodingScale(
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderDecodingScaleFactor(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderDecodingScaleFactor
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI getEncoderSamplesToAverage";
|
||||
ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
|
||||
int32_t status = 0;
|
||||
jdouble returnValue = HAL_GetEncoderDecodingScaleFactor((HAL_EncoderHandle)id, &status);
|
||||
jdouble returnValue =
|
||||
HAL_GetEncoderDecodingScaleFactor((HAL_EncoderHandle)id, &status);
|
||||
ENCODERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
ENCODERJNI_LOG(logDEBUG) << "getEncoderSamplesToAverageResult = "
|
||||
<< returnValue;
|
||||
@@ -419,12 +450,14 @@ Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderDecodingScaleFactor(
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderDistancePerPulse(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderDistancePerPulse
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI getEncoderSamplesToAverage";
|
||||
ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
|
||||
int32_t status = 0;
|
||||
jdouble returnValue = HAL_GetEncoderDistancePerPulse((HAL_EncoderHandle)id, &status);
|
||||
jdouble returnValue =
|
||||
HAL_GetEncoderDistancePerPulse((HAL_EncoderHandle)id, &status);
|
||||
ENCODERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
ENCODERJNI_LOG(logDEBUG) << "getEncoderSamplesToAverageResult = "
|
||||
<< returnValue;
|
||||
@@ -438,8 +471,9 @@ Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderDistancePerPulse(
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderEncodingType(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderEncodingType
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI getEncoderSamplesToAverage";
|
||||
ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
|
||||
int32_t status = 0;
|
||||
|
||||
@@ -1,21 +1,23 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-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 "HAL/HAL.h"
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <cstring>
|
||||
|
||||
#include <assert.h>
|
||||
#include <jni.h>
|
||||
#include "HAL/cpp/Log.h"
|
||||
#include <wpi/jni_util.h>
|
||||
|
||||
#include "HAL/HAL.h"
|
||||
#include "HAL/DriverStation.h"
|
||||
#include "edu_wpi_first_wpilibj_hal_HAL.h"
|
||||
#include "HAL/cpp/Log.h"
|
||||
#include "HALUtil.h"
|
||||
#include "wpi/jni_util.h"
|
||||
#include "edu_wpi_first_wpilibj_hal_HAL.h"
|
||||
|
||||
using namespace frc;
|
||||
using namespace wpi::java;
|
||||
@@ -27,101 +29,115 @@ static TLogLevel netCommLogLevel = logWARNING;
|
||||
if (level > netCommLogLevel) \
|
||||
; \
|
||||
else \
|
||||
Log().Get(level)
|
||||
Log().Get(level)
|
||||
|
||||
extern "C" {
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: Initialize
|
||||
* Signature: (Z)II
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: initialize
|
||||
* Signature: (II)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_initialize(JNIEnv*, jclass, jint timeout, jint mode) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_initialize
|
||||
(JNIEnv*, jclass, jint timeout, jint mode)
|
||||
{
|
||||
return HAL_Initialize(timeout, mode);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: observeUserProgramStarting
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_observeUserProgramStarting(JNIEnv*, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_observeUserProgramStarting
|
||||
(JNIEnv*, jclass)
|
||||
{
|
||||
HAL_ObserveUserProgramStarting();
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: observeUserProgramDisabled
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_observeUserProgramDisabled(JNIEnv*, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_observeUserProgramDisabled
|
||||
(JNIEnv*, jclass)
|
||||
{
|
||||
HAL_ObserveUserProgramDisabled();
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: observeUserProgramAutonomous
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_observeUserProgramAutonomous(
|
||||
JNIEnv*, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_observeUserProgramAutonomous
|
||||
(JNIEnv*, jclass)
|
||||
{
|
||||
HAL_ObserveUserProgramAutonomous();
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: observeUserProgramTeleop
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_observeUserProgramTeleop(JNIEnv*, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_observeUserProgramTeleop
|
||||
(JNIEnv*, jclass)
|
||||
{
|
||||
HAL_ObserveUserProgramTeleop();
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: observeUserProgramTest
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_observeUserProgramTest(JNIEnv*, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_observeUserProgramTest
|
||||
(JNIEnv*, jclass)
|
||||
{
|
||||
HAL_ObserveUserProgramTest();
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: HAL_Report
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: report
|
||||
* Signature: (IIILjava/lang/String;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_report(
|
||||
JNIEnv* paramEnv, jclass, jint paramResource, jint paramInstanceNumber,
|
||||
jint paramContext, jstring paramFeature) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_report
|
||||
(JNIEnv* paramEnv, jclass, jint paramResource, jint paramInstanceNumber,
|
||||
jint paramContext, jstring paramFeature)
|
||||
{
|
||||
JStringRef featureStr{paramEnv, paramFeature};
|
||||
NETCOMM_LOG(logDEBUG) << "Calling HAL report "
|
||||
<< "res:" << paramResource
|
||||
<< " instance:" << paramInstanceNumber
|
||||
<< " context:" << paramContext
|
||||
<< " feature:" << featureStr.c_str();
|
||||
jint returnValue =
|
||||
HAL_Report(paramResource, paramInstanceNumber, paramContext, featureStr.c_str());
|
||||
jint returnValue = HAL_Report(paramResource, paramInstanceNumber,
|
||||
paramContext, featureStr.c_str());
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: NativeGetControlWord
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: nativeGetControlWord
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_nativeGetControlWord(JNIEnv*, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_nativeGetControlWord
|
||||
(JNIEnv*, jclass)
|
||||
{
|
||||
NETCOMM_LOG(logDEBUG) << "Calling HAL Control Word";
|
||||
static_assert(sizeof(HAL_ControlWord) == sizeof(jint),
|
||||
"Java int must match the size of control word");
|
||||
"Java int must match the size of control word");
|
||||
HAL_ControlWord controlWord;
|
||||
std::memset(&controlWord, 0, sizeof(HAL_ControlWord));
|
||||
HAL_GetControlWord(&controlWord);
|
||||
@@ -131,12 +147,14 @@ Java_edu_wpi_first_wpilibj_hal_HAL_nativeGetControlWord(JNIEnv*, jclass) {
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: NativeGetAllianceStation
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: nativeGetAllianceStation
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_nativeGetAllianceStation(JNIEnv*, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_nativeGetAllianceStation
|
||||
(JNIEnv*, jclass)
|
||||
{
|
||||
NETCOMM_LOG(logDEBUG) << "Calling HAL Alliance Station";
|
||||
int32_t status = 0;
|
||||
auto allianceStation = HAL_GetAllianceStation(&status);
|
||||
@@ -144,22 +162,22 @@ Java_edu_wpi_first_wpilibj_hal_HAL_nativeGetAllianceStation(JNIEnv*, jclass) {
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: HAL_GetJoystickAxes
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: getJoystickAxes
|
||||
* Signature: (B[F)S
|
||||
*/
|
||||
JNIEXPORT jshort JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_getJoystickAxes(JNIEnv* env, jclass,
|
||||
jbyte joystickNum,
|
||||
jfloatArray axesArray) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_getJoystickAxes
|
||||
(JNIEnv* env, jclass, jbyte joystickNum, jfloatArray axesArray)
|
||||
{
|
||||
NETCOMM_LOG(logDEBUG) << "Calling HALJoystickAxes";
|
||||
HAL_JoystickAxes axes;
|
||||
HAL_GetJoystickAxes(joystickNum, &axes);
|
||||
|
||||
jsize javaSize = env->GetArrayLength(axesArray);
|
||||
if (axes.count > javaSize)
|
||||
{
|
||||
ThrowIllegalArgumentException(env, "Native array size larger then passed in java array size");
|
||||
if (axes.count > javaSize) {
|
||||
ThrowIllegalArgumentException(
|
||||
env, "Native array size larger then passed in java array size");
|
||||
}
|
||||
|
||||
env->SetFloatArrayRegion(axesArray, 0, axes.count, axes.axes);
|
||||
@@ -168,22 +186,22 @@ Java_edu_wpi_first_wpilibj_hal_HAL_getJoystickAxes(JNIEnv* env, jclass,
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: HAL_GetJoystickPOVs
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: getJoystickPOVs
|
||||
* Signature: (B[S)S
|
||||
*/
|
||||
JNIEXPORT jshort JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_getJoystickPOVs(JNIEnv* env, jclass,
|
||||
jbyte joystickNum,
|
||||
jshortArray povsArray) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_getJoystickPOVs
|
||||
(JNIEnv* env, jclass, jbyte joystickNum, jshortArray povsArray)
|
||||
{
|
||||
NETCOMM_LOG(logDEBUG) << "Calling HALJoystickPOVs";
|
||||
HAL_JoystickPOVs povs;
|
||||
HAL_GetJoystickPOVs(joystickNum, &povs);
|
||||
|
||||
jsize javaSize = env->GetArrayLength(povsArray);
|
||||
if (povs.count > javaSize)
|
||||
{
|
||||
ThrowIllegalArgumentException(env, "Native array size larger then passed in java array size");
|
||||
if (povs.count > javaSize) {
|
||||
ThrowIllegalArgumentException(
|
||||
env, "Native array size larger then passed in java array size");
|
||||
}
|
||||
|
||||
env->SetShortArrayRegion(povsArray, 0, povs.count, povs.povs);
|
||||
@@ -192,18 +210,19 @@ Java_edu_wpi_first_wpilibj_hal_HAL_getJoystickPOVs(JNIEnv* env, jclass,
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: HAL_GetJoystickButtons
|
||||
* Signature: (BL)I
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: getJoystickButtons
|
||||
* Signature: (BLjava/lang/Object;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_getJoystickButtons(JNIEnv* env, jclass,
|
||||
jbyte joystickNum,
|
||||
jobject count) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_getJoystickButtons
|
||||
(JNIEnv* env, jclass, jbyte joystickNum, jobject count)
|
||||
{
|
||||
NETCOMM_LOG(logDEBUG) << "Calling HALJoystickButtons";
|
||||
HAL_JoystickButtons joystickButtons;
|
||||
HAL_GetJoystickButtons(joystickNum, &joystickButtons);
|
||||
jbyte *countPtr = (jbyte *)env->GetDirectBufferAddress(count);
|
||||
jbyte* countPtr =
|
||||
reinterpret_cast<jbyte*>(env->GetDirectBufferAddress(count));
|
||||
NETCOMM_LOG(logDEBUG) << "Buttons = " << joystickButtons.buttons;
|
||||
NETCOMM_LOG(logDEBUG) << "Count = " << (jint)joystickButtons.count;
|
||||
*countPtr = joystickButtons.count;
|
||||
@@ -212,15 +231,15 @@ Java_edu_wpi_first_wpilibj_hal_HAL_getJoystickButtons(JNIEnv* env, jclass,
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: HAL_SetJoystickOutputs
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: setJoystickOutputs
|
||||
* Signature: (BISS)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_setJoystickOutputs(JNIEnv*, jclass,
|
||||
jbyte port, jint outputs,
|
||||
jshort leftRumble,
|
||||
jshort rightRumble) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_setJoystickOutputs
|
||||
(JNIEnv*, jclass, jbyte port, jint outputs, jshort leftRumble,
|
||||
jshort rightRumble)
|
||||
{
|
||||
NETCOMM_LOG(logDEBUG) << "Calling HAL_SetJoystickOutputs on port " << port;
|
||||
NETCOMM_LOG(logDEBUG) << "Outputs: " << outputs;
|
||||
NETCOMM_LOG(logDEBUG) << "Left Rumble: " << leftRumble
|
||||
@@ -229,53 +248,56 @@ Java_edu_wpi_first_wpilibj_hal_HAL_setJoystickOutputs(JNIEnv*, jclass,
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: HAL_GetJoystickIsXbox
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: getJoystickIsXbox
|
||||
* Signature: (B)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_getJoystickIsXbox(JNIEnv*, jclass,
|
||||
jbyte port) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_getJoystickIsXbox
|
||||
(JNIEnv*, jclass, jbyte port)
|
||||
{
|
||||
NETCOMM_LOG(logDEBUG) << "Calling HAL_GetJoystickIsXbox";
|
||||
return HAL_GetJoystickIsXbox(port);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: HAL_GetJoystickType
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: getJoystickType
|
||||
* Signature: (B)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_getJoystickType(JNIEnv*, jclass,
|
||||
jbyte port) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_getJoystickType
|
||||
(JNIEnv*, jclass, jbyte port)
|
||||
{
|
||||
NETCOMM_LOG(logDEBUG) << "Calling HAL_GetJoystickType";
|
||||
return HAL_GetJoystickType(port);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: HAL_GetJoystickName
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: getJoystickName
|
||||
* Signature: (B)Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_getJoystickName(JNIEnv* env, jclass,
|
||||
jbyte port) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_getJoystickName
|
||||
(JNIEnv* env, jclass, jbyte port)
|
||||
{
|
||||
NETCOMM_LOG(logDEBUG) << "Calling HAL_GetJoystickName";
|
||||
char *joystickName = HAL_GetJoystickName(port);
|
||||
char* joystickName = HAL_GetJoystickName(port);
|
||||
jstring str = MakeJString(env, joystickName);
|
||||
HAL_FreeJoystickName(joystickName);
|
||||
return str;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: HAL_GetJoystickAxisType
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: getJoystickAxisType
|
||||
* Signature: (BB)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_getJoystickAxisType(JNIEnv*, jclass,
|
||||
jbyte joystickNum,
|
||||
jbyte axis) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_getJoystickAxisType
|
||||
(JNIEnv*, jclass, jbyte joystickNum, jbyte axis)
|
||||
{
|
||||
NETCOMM_LOG(logDEBUG) << "Calling HAL_GetJoystickAxisType";
|
||||
return HAL_GetJoystickAxisType(joystickNum, axis);
|
||||
}
|
||||
@@ -286,27 +308,33 @@ Java_edu_wpi_first_wpilibj_hal_HAL_getJoystickAxisType(JNIEnv*, jclass,
|
||||
* Signature: ()Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_isNewControlData(JNIEnv *, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_isNewControlData
|
||||
(JNIEnv*, jclass)
|
||||
{
|
||||
return static_cast<jboolean>(HAL_IsNewControlData());
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: waitForDSData
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_waitForDSData(JNIEnv* env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_waitForDSData
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
HAL_WaitForDSData();
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: releaseDSMutex
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_releaseDSMutex(JNIEnv* env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_releaseDSMutex
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
HAL_ReleaseDSMutex();
|
||||
}
|
||||
|
||||
@@ -316,29 +344,34 @@ Java_edu_wpi_first_wpilibj_hal_HAL_releaseDSMutex(JNIEnv* env, jclass) {
|
||||
* Signature: (D)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_waitForDSDataTimeout(JNIEnv *, jclass,
|
||||
jdouble timeout) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_waitForDSDataTimeout
|
||||
(JNIEnv*, jclass, jdouble timeout)
|
||||
{
|
||||
return static_cast<jboolean>(HAL_WaitForDSDataTimeout(timeout));
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: HAL_GetMatchTime
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: getMatchTime
|
||||
* Signature: ()D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_getMatchTime(JNIEnv* env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_getMatchTime
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
return HAL_GetMatchTime(&status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: HAL_GetSystemActive
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: getSystemActive
|
||||
* Signature: ()Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_getSystemActive(JNIEnv* env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_getSystemActive
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
bool val = HAL_GetSystemActive(&status);
|
||||
CheckStatus(env, status);
|
||||
@@ -346,12 +379,14 @@ Java_edu_wpi_first_wpilibj_hal_HAL_getSystemActive(JNIEnv* env, jclass) {
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: HAL_GetBrownedOut
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: getBrownedOut
|
||||
* Signature: ()Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_getBrownedOut(JNIEnv* env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_getBrownedOut
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
bool val = HAL_GetBrownedOut(&status);
|
||||
CheckStatus(env, status);
|
||||
@@ -361,11 +396,12 @@ Java_edu_wpi_first_wpilibj_hal_HAL_getBrownedOut(JNIEnv* env, jclass) {
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: getMatchInfo
|
||||
* Signature: (Ledu/wpi/first/wpilibj/hal/MatchInfoData;)I
|
||||
* Signature: (Ljava/lang/Object;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_getMatchInfo
|
||||
(JNIEnv * env, jclass, jobject info) {
|
||||
(JNIEnv* env, jclass, jobject info)
|
||||
{
|
||||
HAL_MatchInfo matchInfo;
|
||||
auto status = HAL_GetMatchInfo(&matchInfo);
|
||||
if (status == 0) {
|
||||
@@ -376,17 +412,15 @@ Java_edu_wpi_first_wpilibj_hal_HAL_getMatchInfo
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: HAL_SendError
|
||||
* Class: edu_wpi_first_wpilibj_hal_HAL
|
||||
* Method: sendError
|
||||
* Signature: (ZIZLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_sendError(JNIEnv* env, jclass,
|
||||
jboolean isError, jint errorCode,
|
||||
jboolean isLVCode, jstring details,
|
||||
jstring location,
|
||||
jstring callStack,
|
||||
jboolean printMsg) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_sendError
|
||||
(JNIEnv* env, jclass, jboolean isError, jint errorCode, jboolean isLVCode,
|
||||
jstring details, jstring location, jstring callStack, jboolean printMsg)
|
||||
{
|
||||
JStringRef detailsStr{env, details};
|
||||
JStringRef locationStr{env, location};
|
||||
JStringRef callStackStr{env, callStack};
|
||||
@@ -394,8 +428,9 @@ Java_edu_wpi_first_wpilibj_hal_HAL_sendError(JNIEnv* env, jclass,
|
||||
NETCOMM_LOG(logDEBUG) << "Send Error: " << detailsStr.c_str();
|
||||
NETCOMM_LOG(logDEBUG) << "Location: " << locationStr.c_str();
|
||||
NETCOMM_LOG(logDEBUG) << "Call Stack: " << callStackStr.c_str();
|
||||
jint returnValue = HAL_SendError(isError, errorCode, isLVCode, detailsStr.c_str(),
|
||||
locationStr.c_str(), callStackStr.c_str(), printMsg);
|
||||
jint returnValue =
|
||||
HAL_SendError(isError, errorCode, isLVCode, detailsStr.c_str(),
|
||||
locationStr.c_str(), callStackStr.c_str(), printMsg);
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
@@ -405,8 +440,9 @@ Java_edu_wpi_first_wpilibj_hal_HAL_sendError(JNIEnv* env, jclass,
|
||||
* Signature: (BB)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_getPortWithModule(
|
||||
JNIEnv* env, jclass, jbyte module, jbyte channel) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_getPortWithModule
|
||||
(JNIEnv* env, jclass, jbyte module, jbyte channel)
|
||||
{
|
||||
// FILE_LOG(logDEBUG) << "Calling HAL getPortWithModlue";
|
||||
// FILE_LOG(logDEBUG) << "Module = " << (jint)module;
|
||||
// FILE_LOG(logDEBUG) << "Channel = " << (jint)channel;
|
||||
@@ -420,8 +456,10 @@ Java_edu_wpi_first_wpilibj_hal_HAL_getPortWithModule(
|
||||
* Method: getPort
|
||||
* Signature: (B)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_HAL_getPort(
|
||||
JNIEnv* env, jclass, jbyte channel) {
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HAL_getPort
|
||||
(JNIEnv* env, jclass, jbyte channel)
|
||||
{
|
||||
// FILE_LOG(logDEBUG) << "Calling HAL getPortWithModlue";
|
||||
// FILE_LOG(logDEBUG) << "Module = " << (jint)module;
|
||||
// FILE_LOG(logDEBUG) << "Channel = " << (jint)channel;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-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. */
|
||||
@@ -7,23 +7,24 @@
|
||||
|
||||
#include "HALUtil.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <jni.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <cerrno>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
|
||||
#include <wpi/SmallString.h>
|
||||
#include <wpi/jni_util.h>
|
||||
#include <wpi/raw_ostream.h>
|
||||
|
||||
#include "HAL/CAN.h"
|
||||
#include "HAL/HAL.h"
|
||||
#include "HAL/DriverStation.h"
|
||||
#include "HAL/Errors.h"
|
||||
#include "HAL/HAL.h"
|
||||
#include "HAL/cpp/Log.h"
|
||||
#include "edu_wpi_first_wpilibj_hal_HALUtil.h"
|
||||
#include "wpi/SmallString.h"
|
||||
#include "wpi/jni_util.h"
|
||||
#include "wpi/raw_ostream.h"
|
||||
|
||||
using namespace wpi::java;
|
||||
|
||||
@@ -34,7 +35,7 @@ TLogLevel halUtilLogLevel = logWARNING;
|
||||
if (level > halUtilLogLevel) \
|
||||
; \
|
||||
else \
|
||||
Log().Get(level)
|
||||
Log().Get(level)
|
||||
|
||||
#define kRioStatusOffset -63000
|
||||
#define kRioStatusSuccess 0
|
||||
@@ -43,7 +44,7 @@ TLogLevel halUtilLogLevel = logWARNING;
|
||||
#define kRIOStatusFeatureNotSupported (kRioStatusOffset - 193)
|
||||
#define kRIOStatusResourceNotInitialized -52010
|
||||
|
||||
static JavaVM *jvm = nullptr;
|
||||
static JavaVM* jvm = nullptr;
|
||||
static JException runtimeExCls;
|
||||
static JException illegalArgExCls;
|
||||
static JException boundaryExCls;
|
||||
@@ -61,32 +62,32 @@ static JClass accumulatorResultCls;
|
||||
|
||||
namespace frc {
|
||||
|
||||
void ThrowAllocationException(JNIEnv *env, int32_t minRange, int32_t maxRange,
|
||||
int32_t requestedValue, int32_t status) {
|
||||
const char *message = HAL_GetErrorMessage(status);
|
||||
void ThrowAllocationException(JNIEnv* env, int32_t minRange, int32_t maxRange,
|
||||
int32_t requestedValue, int32_t status) {
|
||||
const char* message = HAL_GetErrorMessage(status);
|
||||
wpi::SmallString<1024> buf;
|
||||
wpi::raw_svector_ostream oss(buf);
|
||||
oss << " Code: " << status << ". " << message << ", Minimum Value: "
|
||||
<< minRange << ", Maximum Value: " << maxRange << ", Requested Value: "
|
||||
<< requestedValue;
|
||||
oss << " Code: " << status << ". " << message
|
||||
<< ", Minimum Value: " << minRange << ", Maximum Value: " << maxRange
|
||||
<< ", Requested Value: " << requestedValue;
|
||||
env->ThrowNew(allocationExCls, buf.c_str());
|
||||
allocationExCls.Throw(env, buf.c_str());
|
||||
}
|
||||
|
||||
void ThrowHalHandleException(JNIEnv *env, int32_t status) {
|
||||
const char *message = HAL_GetErrorMessage(status);
|
||||
void ThrowHalHandleException(JNIEnv* env, int32_t status) {
|
||||
const char* message = HAL_GetErrorMessage(status);
|
||||
wpi::SmallString<1024> buf;
|
||||
wpi::raw_svector_ostream oss(buf);
|
||||
oss << " Code: " << status << ". " << message;
|
||||
halHandleExCls.Throw(env, buf.c_str());
|
||||
}
|
||||
|
||||
void ReportError(JNIEnv *env, int32_t status, bool doThrow) {
|
||||
void ReportError(JNIEnv* env, int32_t status, bool doThrow) {
|
||||
if (status == 0) return;
|
||||
if (status == HAL_HANDLE_ERROR) {
|
||||
ThrowHalHandleException(env, status);
|
||||
}
|
||||
const char *message = HAL_GetErrorMessage(status);
|
||||
const char* message = HAL_GetErrorMessage(status);
|
||||
if (doThrow && status < 0) {
|
||||
wpi::SmallString<1024> buf;
|
||||
wpi::raw_svector_ostream oss(buf);
|
||||
@@ -99,25 +100,24 @@ void ReportError(JNIEnv *env, int32_t status, bool doThrow) {
|
||||
}
|
||||
}
|
||||
|
||||
void ThrowError(JNIEnv *env, int32_t status, int32_t minRange, int32_t maxRange,
|
||||
void ThrowError(JNIEnv* env, int32_t status, int32_t minRange, int32_t maxRange,
|
||||
int32_t requestedValue) {
|
||||
if (status == 0) return;
|
||||
if (status == NO_AVAILABLE_RESOURCES ||
|
||||
status == RESOURCE_IS_ALLOCATED ||
|
||||
if (status == NO_AVAILABLE_RESOURCES || status == RESOURCE_IS_ALLOCATED ||
|
||||
status == RESOURCE_OUT_OF_RANGE) {
|
||||
ThrowAllocationException(env, minRange, maxRange, requestedValue, status);
|
||||
}
|
||||
if (status == HAL_HANDLE_ERROR) {
|
||||
ThrowHalHandleException(env, status);
|
||||
}
|
||||
const char *message = HAL_GetErrorMessage(status);
|
||||
const char* message = HAL_GetErrorMessage(status);
|
||||
wpi::SmallString<1024> buf;
|
||||
wpi::raw_svector_ostream oss(buf);
|
||||
oss << " Code: " << status << ". " << message;
|
||||
runtimeExCls.Throw(env, buf.c_str());
|
||||
}
|
||||
|
||||
void ReportCANError(JNIEnv *env, int32_t status, int message_id) {
|
||||
void ReportCANError(JNIEnv* env, int32_t status, int message_id) {
|
||||
if (status >= 0) return;
|
||||
switch (status) {
|
||||
case kRioStatusSuccess:
|
||||
@@ -174,11 +174,11 @@ void ReportCANError(JNIEnv *env, int32_t status, int message_id) {
|
||||
}
|
||||
}
|
||||
|
||||
void ThrowIllegalArgumentException(JNIEnv *env, const char *msg) {
|
||||
void ThrowIllegalArgumentException(JNIEnv* env, const char* msg) {
|
||||
illegalArgExCls.Throw(env, msg);
|
||||
}
|
||||
|
||||
void ThrowBoundaryException(JNIEnv *env, double value, double lower,
|
||||
void ThrowBoundaryException(JNIEnv* env, double value, double lower,
|
||||
double upper) {
|
||||
static jmethodID getMessage = nullptr;
|
||||
if (!getMessage)
|
||||
@@ -190,69 +190,61 @@ void ThrowBoundaryException(JNIEnv *env, double value, double lower,
|
||||
constructor =
|
||||
env->GetMethodID(boundaryExCls, "<init>", "(Ljava/lang/String;)V");
|
||||
|
||||
jobject msg =
|
||||
env->CallStaticObjectMethod(boundaryExCls, getMessage,
|
||||
static_cast<jdouble>(value),
|
||||
static_cast<jdouble>(lower),
|
||||
static_cast<jdouble>(upper));
|
||||
jobject msg = env->CallStaticObjectMethod(
|
||||
boundaryExCls, getMessage, static_cast<jdouble>(value),
|
||||
static_cast<jdouble>(lower), static_cast<jdouble>(upper));
|
||||
jobject ex = env->NewObject(boundaryExCls, constructor, msg);
|
||||
env->Throw(static_cast<jthrowable>(ex));
|
||||
}
|
||||
|
||||
jobject CreatePWMConfigDataResult(JNIEnv *env, int32_t maxPwm,
|
||||
int32_t deadbandMaxPwm, int32_t centerPwm,
|
||||
int32_t deadbandMinPwm, int32_t minPwm) {
|
||||
jobject CreatePWMConfigDataResult(JNIEnv* env, int32_t maxPwm,
|
||||
int32_t deadbandMaxPwm, int32_t centerPwm,
|
||||
int32_t deadbandMinPwm, int32_t minPwm) {
|
||||
static jmethodID constructor =
|
||||
env->GetMethodID(pwmConfigDataResultCls, "<init>",
|
||||
"(IIIII)V");
|
||||
env->GetMethodID(pwmConfigDataResultCls, "<init>", "(IIIII)V");
|
||||
return env->NewObject(pwmConfigDataResultCls, constructor, maxPwm,
|
||||
deadbandMaxPwm, centerPwm, deadbandMinPwm,
|
||||
minPwm);
|
||||
deadbandMaxPwm, centerPwm, deadbandMinPwm, minPwm);
|
||||
}
|
||||
|
||||
void SetCanStatusObject(JNIEnv *env, jobject canStatus,
|
||||
float percentBusUtilization,
|
||||
uint32_t busOffCount, uint32_t txFullCount,
|
||||
uint32_t receiveErrorCount,
|
||||
void SetCanStatusObject(JNIEnv* env, jobject canStatus,
|
||||
float percentBusUtilization, uint32_t busOffCount,
|
||||
uint32_t txFullCount, uint32_t receiveErrorCount,
|
||||
uint32_t transmitErrorCount) {
|
||||
static jmethodID func = env->GetMethodID(canStatusCls, "setStatus",
|
||||
"(DIIII)V");
|
||||
static jmethodID func =
|
||||
env->GetMethodID(canStatusCls, "setStatus", "(DIIII)V");
|
||||
env->CallVoidMethod(canStatus, func, (jdouble)percentBusUtilization,
|
||||
(jint)busOffCount, (jint)txFullCount,
|
||||
(jint)receiveErrorCount, (jint)transmitErrorCount);
|
||||
(jint)busOffCount, (jint)txFullCount,
|
||||
(jint)receiveErrorCount, (jint)transmitErrorCount);
|
||||
}
|
||||
|
||||
void SetMatchInfoObject(JNIEnv* env, jobject matchStatus,
|
||||
const HAL_MatchInfo& matchInfo) {
|
||||
static jmethodID func = env->GetMethodID(matchInfoDataCls, "setData",
|
||||
"(Ljava/lang/String;Ljava/lang/String;III)V");
|
||||
static jmethodID func =
|
||||
env->GetMethodID(matchInfoDataCls, "setData",
|
||||
"(Ljava/lang/String;Ljava/lang/String;III)V");
|
||||
|
||||
env->CallVoidMethod(matchStatus, func,
|
||||
MakeJString(env, matchInfo.eventName),
|
||||
MakeJString(env, matchInfo.gameSpecificMessage),
|
||||
(jint)matchInfo.matchNumber,
|
||||
(jint)matchInfo.replayNumber,
|
||||
(jint)matchInfo.matchType);
|
||||
env->CallVoidMethod(matchStatus, func, MakeJString(env, matchInfo.eventName),
|
||||
MakeJString(env, matchInfo.gameSpecificMessage),
|
||||
(jint)matchInfo.matchNumber, (jint)matchInfo.replayNumber,
|
||||
(jint)matchInfo.matchType);
|
||||
}
|
||||
|
||||
void SetAccumulatorResultObject(JNIEnv* env, jobject accumulatorResult,
|
||||
int64_t value, int64_t count) {
|
||||
static jmethodID func = env->GetMethodID(accumulatorResultCls, "set",
|
||||
"(JJ)V");
|
||||
static jmethodID func =
|
||||
env->GetMethodID(accumulatorResultCls, "set", "(JJ)V");
|
||||
|
||||
env->CallVoidMethod(accumulatorResult, func, (jlong)value, (jlong)count);
|
||||
}
|
||||
|
||||
JavaVM* GetJVM() {
|
||||
return jvm;
|
||||
}
|
||||
JavaVM* GetJVM() { return jvm; }
|
||||
|
||||
} // namespace frc
|
||||
|
||||
namespace sim {
|
||||
jint SimOnLoad(JavaVM* vm, void* reserved);
|
||||
void SimOnUnload(JavaVM* vm, void* reserved);
|
||||
}
|
||||
jint SimOnLoad(JavaVM* vm, void* reserved);
|
||||
void SimOnUnload(JavaVM* vm, void* reserved);
|
||||
} // namespace sim
|
||||
|
||||
using namespace frc;
|
||||
|
||||
@@ -261,14 +253,14 @@ extern "C" {
|
||||
//
|
||||
// indicate JNI version support desired and load classes
|
||||
//
|
||||
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
|
||||
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved) {
|
||||
jvm = vm;
|
||||
|
||||
// set our logging level
|
||||
Log::ReportingLevel() = logDEBUG;
|
||||
|
||||
JNIEnv *env;
|
||||
if (vm->GetEnv(reinterpret_cast<void **>(&env), JNI_VERSION_1_6) != JNI_OK)
|
||||
JNIEnv* env;
|
||||
if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK)
|
||||
return JNI_ERR;
|
||||
|
||||
runtimeExCls = JException(env, "java/lang/RuntimeException");
|
||||
@@ -277,31 +269,40 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
|
||||
illegalArgExCls = JException(env, "java/lang/IllegalArgumentException");
|
||||
if (!illegalArgExCls) return JNI_ERR;
|
||||
|
||||
boundaryExCls = JException(env, "edu/wpi/first/wpilibj/util/BoundaryException");
|
||||
boundaryExCls =
|
||||
JException(env, "edu/wpi/first/wpilibj/util/BoundaryException");
|
||||
if (!boundaryExCls) return JNI_ERR;
|
||||
|
||||
allocationExCls = JException(env, "edu/wpi/first/wpilibj/util/AllocationException");
|
||||
allocationExCls =
|
||||
JException(env, "edu/wpi/first/wpilibj/util/AllocationException");
|
||||
if (!allocationExCls) return JNI_ERR;
|
||||
|
||||
halHandleExCls = JException(env, "edu/wpi/first/wpilibj/util/HalHandleException");
|
||||
halHandleExCls =
|
||||
JException(env, "edu/wpi/first/wpilibj/util/HalHandleException");
|
||||
if (!halHandleExCls) return JNI_ERR;
|
||||
|
||||
canInvalidBufferExCls = JException(env, "edu/wpi/first/wpilibj/can/CANInvalidBufferException");
|
||||
canInvalidBufferExCls =
|
||||
JException(env, "edu/wpi/first/wpilibj/can/CANInvalidBufferException");
|
||||
if (!canInvalidBufferExCls) return JNI_ERR;
|
||||
|
||||
canMessageNotFoundExCls = JException(env, "edu/wpi/first/wpilibj/can/CANMessageNotFoundException");
|
||||
canMessageNotFoundExCls =
|
||||
JException(env, "edu/wpi/first/wpilibj/can/CANMessageNotFoundException");
|
||||
if (!canMessageNotFoundExCls) return JNI_ERR;
|
||||
|
||||
canMessageNotAllowedExCls = JException(env, "edu/wpi/first/wpilibj/can/CANMessageNotAllowedException");
|
||||
canMessageNotAllowedExCls = JException(
|
||||
env, "edu/wpi/first/wpilibj/can/CANMessageNotAllowedException");
|
||||
if (!canMessageNotAllowedExCls) return JNI_ERR;
|
||||
|
||||
canNotInitializedExCls = JException(env, "edu/wpi/first/wpilibj/can/CANNotInitializedException");
|
||||
canNotInitializedExCls =
|
||||
JException(env, "edu/wpi/first/wpilibj/can/CANNotInitializedException");
|
||||
if (!canNotInitializedExCls) return JNI_ERR;
|
||||
|
||||
uncleanStatusExCls = JException(env,"edu/wpi/first/wpilibj/util/UncleanStatusException");
|
||||
uncleanStatusExCls =
|
||||
JException(env, "edu/wpi/first/wpilibj/util/UncleanStatusException");
|
||||
if (!uncleanStatusExCls) return JNI_ERR;
|
||||
|
||||
pwmConfigDataResultCls = JClass(env, "edu/wpi/first/wpilibj/PWMConfigDataResult");
|
||||
pwmConfigDataResultCls =
|
||||
JClass(env, "edu/wpi/first/wpilibj/PWMConfigDataResult");
|
||||
if (!pwmConfigDataResultCls) return JNI_ERR;
|
||||
|
||||
canStatusCls = JClass(env, "edu/wpi/first/wpilibj/can/CANStatus");
|
||||
@@ -316,11 +317,11 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
|
||||
return sim::SimOnLoad(vm, reserved);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *vm, void *reserved) {
|
||||
JNIEXPORT void JNICALL JNI_OnUnload(JavaVM* vm, void* reserved) {
|
||||
sim::SimOnUnload(vm, reserved);
|
||||
|
||||
JNIEnv *env;
|
||||
if (vm->GetEnv(reinterpret_cast<void **>(&env), JNI_VERSION_1_6) != JNI_OK)
|
||||
JNIEnv* env;
|
||||
if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK)
|
||||
return;
|
||||
// Delete global references
|
||||
runtimeExCls.free(env);
|
||||
@@ -346,7 +347,9 @@ JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *vm, void *reserved) {
|
||||
* Signature: ()S
|
||||
*/
|
||||
JNIEXPORT jshort JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HALUtil_getFPGAVersion(JNIEnv *env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HALUtil_getFPGAVersion
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
HALUTIL_LOG(logDEBUG) << "Calling HALUtil getFPGAVersion";
|
||||
int32_t status = 0;
|
||||
jshort returnValue = HAL_GetFPGAVersion(&status);
|
||||
@@ -362,7 +365,9 @@ Java_edu_wpi_first_wpilibj_hal_HALUtil_getFPGAVersion(JNIEnv *env, jclass) {
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HALUtil_getFPGARevision(JNIEnv *env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HALUtil_getFPGARevision
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
HALUTIL_LOG(logDEBUG) << "Calling HALUtil getFPGARevision";
|
||||
int32_t status = 0;
|
||||
jint returnValue = HAL_GetFPGARevision(&status);
|
||||
@@ -378,7 +383,9 @@ Java_edu_wpi_first_wpilibj_hal_HALUtil_getFPGARevision(JNIEnv *env, jclass) {
|
||||
* Signature: ()J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HALUtil_getFPGATime(JNIEnv *env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HALUtil_getFPGATime
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
// HALUTIL_LOG(logDEBUG) << "Calling HALUtil getFPGATime";
|
||||
int32_t status = 0;
|
||||
jlong returnValue = HAL_GetFPGATime(&status);
|
||||
@@ -394,7 +401,9 @@ Java_edu_wpi_first_wpilibj_hal_HALUtil_getFPGATime(JNIEnv *env, jclass) {
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HALUtil_getHALRuntimeType(JNIEnv *env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HALUtil_getHALRuntimeType
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
// HALUTIL_LOG(logDEBUG) << "Calling HALUtil getHALRuntimeType";
|
||||
jint returnValue = HAL_GetRuntimeType();
|
||||
// HALUTIL_LOG(logDEBUG) << "RuntimeType = " << returnValue;
|
||||
@@ -404,10 +413,12 @@ Java_edu_wpi_first_wpilibj_hal_HALUtil_getHALRuntimeType(JNIEnv *env, jclass) {
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_HALUtil
|
||||
* Method: getFPGAButton
|
||||
* Signature: ()I
|
||||
* Signature: ()Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HALUtil_getFPGAButton(JNIEnv *env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HALUtil_getFPGAButton
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
// HALUTIL_LOG(logDEBUG) << "Calling HALUtil getFPGATime";
|
||||
int32_t status = 0;
|
||||
jboolean returnValue = HAL_GetFPGAButton(&status);
|
||||
@@ -423,9 +434,10 @@ Java_edu_wpi_first_wpilibj_hal_HALUtil_getFPGAButton(JNIEnv *env, jclass) {
|
||||
* Signature: (I)Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HALUtil_getHALErrorMessage(
|
||||
JNIEnv *paramEnv, jclass, jint paramId) {
|
||||
const char *msg = HAL_GetErrorMessage(paramId);
|
||||
Java_edu_wpi_first_wpilibj_hal_HALUtil_getHALErrorMessage
|
||||
(JNIEnv* paramEnv, jclass, jint paramId)
|
||||
{
|
||||
const char* msg = HAL_GetErrorMessage(paramId);
|
||||
HALUTIL_LOG(logDEBUG) << "Calling HALUtil HAL_GetErrorMessage id=" << paramId
|
||||
<< " msg=" << msg;
|
||||
return MakeJString(paramEnv, msg);
|
||||
@@ -437,7 +449,9 @@ Java_edu_wpi_first_wpilibj_hal_HALUtil_getHALErrorMessage(
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HALUtil_getHALErrno(JNIEnv *, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_HALUtil_getHALErrno
|
||||
(JNIEnv*, jclass)
|
||||
{
|
||||
return errno;
|
||||
}
|
||||
|
||||
@@ -446,9 +460,11 @@ Java_edu_wpi_first_wpilibj_hal_HALUtil_getHALErrno(JNIEnv *, jclass) {
|
||||
* Method: getHALstrerror
|
||||
* Signature: (I)Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL Java_edu_wpi_first_wpilibj_hal_HALUtil_getHALstrerror(
|
||||
JNIEnv *env, jclass, jint errorCode) {
|
||||
const char *msg = strerror(errno);
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_HALUtil_getHALstrerror
|
||||
(JNIEnv* env, jclass, jint errorCode)
|
||||
{
|
||||
const char* msg = std::strerror(errno);
|
||||
HALUTIL_LOG(logDEBUG) << "Calling HALUtil getHALstrerror errorCode="
|
||||
<< errorCode << " msg=" << msg;
|
||||
return MakeJString(env, msg);
|
||||
|
||||
@@ -1,61 +1,59 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-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. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef HALUTIL_H
|
||||
#define HALUTIL_H
|
||||
|
||||
#include <stdint.h>
|
||||
#ifndef HAL_HAL_SRC_MAIN_NATIVE_CPP_JNI_HALUTIL_H_
|
||||
#define HAL_HAL_SRC_MAIN_NATIVE_CPP_JNI_HALUTIL_H_
|
||||
|
||||
#include <jni.h>
|
||||
#include <stdint.h>
|
||||
|
||||
struct HAL_MatchInfo;
|
||||
|
||||
namespace frc {
|
||||
|
||||
void ReportError(JNIEnv *env, int32_t status, bool doThrow = true);
|
||||
void ReportError(JNIEnv* env, int32_t status, bool doThrow = true);
|
||||
|
||||
void ThrowError(JNIEnv *env, int32_t status, int32_t minRange, int32_t maxRange,
|
||||
void ThrowError(JNIEnv* env, int32_t status, int32_t minRange, int32_t maxRange,
|
||||
int32_t requestedValue);
|
||||
|
||||
inline bool CheckStatus(JNIEnv *env, int32_t status, bool doThrow = true) {
|
||||
inline bool CheckStatus(JNIEnv* env, int32_t status, bool doThrow = true) {
|
||||
if (status != 0) ReportError(env, status, doThrow);
|
||||
return status == 0;
|
||||
}
|
||||
|
||||
inline bool CheckStatusRange(JNIEnv *env, int32_t status, int32_t minRange,
|
||||
inline bool CheckStatusRange(JNIEnv* env, int32_t status, int32_t minRange,
|
||||
int32_t maxRange, int32_t requestedValue) {
|
||||
if (status != 0) ThrowError(env, status, minRange, maxRange, requestedValue);
|
||||
return status == 0;
|
||||
}
|
||||
|
||||
inline bool CheckStatusForceThrow(JNIEnv *env, int32_t status) {
|
||||
inline bool CheckStatusForceThrow(JNIEnv* env, int32_t status) {
|
||||
if (status != 0) ThrowError(env, status, 0, 0, 0);
|
||||
return status == 0;
|
||||
}
|
||||
|
||||
void ReportCANError(JNIEnv *env, int32_t status, int32_t message_id);
|
||||
void ReportCANError(JNIEnv* env, int32_t status, int32_t message_id);
|
||||
|
||||
inline bool CheckCANStatus(JNIEnv *env, int32_t status, int32_t message_id) {
|
||||
inline bool CheckCANStatus(JNIEnv* env, int32_t status, int32_t message_id) {
|
||||
if (status != 0) ReportCANError(env, status, message_id);
|
||||
return status == 0;
|
||||
}
|
||||
|
||||
void ThrowIllegalArgumentException(JNIEnv *env, const char *msg);
|
||||
void ThrowBoundaryException(JNIEnv *env, double value, double lower,
|
||||
void ThrowIllegalArgumentException(JNIEnv* env, const char* msg);
|
||||
void ThrowBoundaryException(JNIEnv* env, double value, double lower,
|
||||
double upper);
|
||||
|
||||
jobject CreatePWMConfigDataResult(JNIEnv *env, int32_t maxPwm,
|
||||
int32_t deadbandMaxPwm, int32_t centerPwm,
|
||||
int32_t deadbandMinPwm, int32_t minPwm);
|
||||
jobject CreatePWMConfigDataResult(JNIEnv* env, int32_t maxPwm,
|
||||
int32_t deadbandMaxPwm, int32_t centerPwm,
|
||||
int32_t deadbandMinPwm, int32_t minPwm);
|
||||
|
||||
void SetCanStatusObject(JNIEnv *env, jobject canStatus,
|
||||
float percentBusUtilization,
|
||||
uint32_t busOffCount, uint32_t txFullCount,
|
||||
uint32_t receiveErrorCount,
|
||||
void SetCanStatusObject(JNIEnv* env, jobject canStatus,
|
||||
float percentBusUtilization, uint32_t busOffCount,
|
||||
uint32_t txFullCount, uint32_t receiveErrorCount,
|
||||
uint32_t transmitErrorCount);
|
||||
|
||||
void SetMatchInfoObject(JNIEnv* env, jobject matchStatus,
|
||||
@@ -68,4 +66,4 @@ JavaVM* GetJVM();
|
||||
|
||||
} // namespace frc
|
||||
|
||||
#endif // HALUTIL_H
|
||||
#endif // HAL_HAL_SRC_MAIN_NATIVE_CPP_JNI_HALUTIL_H_
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-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 <assert.h>
|
||||
#include <jni.h>
|
||||
#include "HAL/cpp/Log.h"
|
||||
|
||||
#include "edu_wpi_first_wpilibj_hal_I2CJNI.h"
|
||||
#include <cassert>
|
||||
|
||||
#include <wpi/jni_util.h>
|
||||
|
||||
#include "HAL/I2C.h"
|
||||
#include "HAL/cpp/Log.h"
|
||||
#include "HALUtil.h"
|
||||
#include "wpi/jni_util.h"
|
||||
#include "edu_wpi_first_wpilibj_hal_I2CJNI.h"
|
||||
|
||||
using namespace frc;
|
||||
using namespace wpi::java;
|
||||
@@ -25,17 +26,19 @@ TLogLevel i2cJNILogLevel = logWARNING;
|
||||
if (level > i2cJNILogLevel) \
|
||||
; \
|
||||
else \
|
||||
Log().Get(level)
|
||||
Log().Get(level)
|
||||
|
||||
extern "C" {
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_I2CJNI
|
||||
* Method: i2cInitialize
|
||||
* Method: i2CInitialize
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CInitialize(
|
||||
JNIEnv* env, jclass, jint port) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CInitialize
|
||||
(JNIEnv* env, jclass, jint port)
|
||||
{
|
||||
I2CJNI_LOG(logDEBUG) << "Calling I2CJNI i2CInititalize";
|
||||
I2CJNI_LOG(logDEBUG) << "Port: " << port;
|
||||
int32_t status = 0;
|
||||
@@ -47,26 +50,32 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CInitialize(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_I2CJNI
|
||||
* Method: i2CTransaction
|
||||
* Signature: (IBLjava/nio/ByteBuffer;BLjava/nio/ByteBuffer;B)I
|
||||
* Signature: (IBLjava/lang/Object;BLjava/lang/Object;B)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CTransaction(
|
||||
JNIEnv* env, jclass, jint port, jbyte address, jobject dataToSend,
|
||||
jbyte sendSize, jobject dataReceived, jbyte receiveSize) {
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CTransaction
|
||||
(JNIEnv* env, jclass, jint port, jbyte address, jobject dataToSend,
|
||||
jbyte sendSize, jobject dataReceived, jbyte receiveSize)
|
||||
{
|
||||
I2CJNI_LOG(logDEBUG) << "Calling I2CJNI i2CTransaction";
|
||||
I2CJNI_LOG(logDEBUG) << "Port = " << port;
|
||||
I2CJNI_LOG(logDEBUG) << "Address = " << (jint)address;
|
||||
uint8_t* dataToSendPtr = nullptr;
|
||||
if (dataToSend != 0) {
|
||||
dataToSendPtr = (uint8_t*)env->GetDirectBufferAddress(dataToSend);
|
||||
dataToSendPtr =
|
||||
reinterpret_cast<uint8_t*>(env->GetDirectBufferAddress(dataToSend));
|
||||
}
|
||||
I2CJNI_LOG(logDEBUG) << "DataToSendPtr = " << (jint*)dataToSendPtr;
|
||||
I2CJNI_LOG(logDEBUG) << "DataToSendPtr = "
|
||||
<< reinterpret_cast<jint*>(dataToSendPtr);
|
||||
I2CJNI_LOG(logDEBUG) << "SendSize = " << (jint)sendSize;
|
||||
uint8_t* dataReceivedPtr =
|
||||
(uint8_t*)env->GetDirectBufferAddress(dataReceived);
|
||||
I2CJNI_LOG(logDEBUG) << "DataReceivedPtr = " << (jint*)dataReceivedPtr;
|
||||
reinterpret_cast<uint8_t*>(env->GetDirectBufferAddress(dataReceived));
|
||||
I2CJNI_LOG(logDEBUG) << "DataReceivedPtr = "
|
||||
<< reinterpret_cast<jint*>(dataReceivedPtr);
|
||||
I2CJNI_LOG(logDEBUG) << "ReceiveSize = " << (jint)receiveSize;
|
||||
jint returnValue = HAL_TransactionI2C(static_cast<HAL_I2CPort>(port), address, dataToSendPtr, sendSize,
|
||||
dataReceivedPtr, receiveSize);
|
||||
jint returnValue =
|
||||
HAL_TransactionI2C(static_cast<HAL_I2CPort>(port), address, dataToSendPtr,
|
||||
sendSize, dataReceivedPtr, receiveSize);
|
||||
I2CJNI_LOG(logDEBUG) << "ReturnValue = " << returnValue;
|
||||
return returnValue;
|
||||
}
|
||||
@@ -76,9 +85,11 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CTransaction(
|
||||
* Method: i2CTransactionB
|
||||
* Signature: (IB[BB[BB)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CTransactionB(
|
||||
JNIEnv* env, jclass, jint port, jbyte address, jbyteArray dataToSend,
|
||||
jbyte sendSize, jbyteArray dataReceived, jbyte receiveSize) {
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CTransactionB
|
||||
(JNIEnv* env, jclass, jint port, jbyte address, jbyteArray dataToSend,
|
||||
jbyte sendSize, jbyteArray dataReceived, jbyte receiveSize)
|
||||
{
|
||||
I2CJNI_LOG(logDEBUG) << "Calling I2CJNI i2CTransactionB";
|
||||
I2CJNI_LOG(logDEBUG) << "Port = " << port;
|
||||
I2CJNI_LOG(logDEBUG) << "Address = " << (jint)address;
|
||||
@@ -88,11 +99,11 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CTransactionB(
|
||||
I2CJNI_LOG(logDEBUG) << "ReceiveSize = " << (jint)receiveSize;
|
||||
jint returnValue =
|
||||
HAL_TransactionI2C(static_cast<HAL_I2CPort>(port), address,
|
||||
reinterpret_cast<const uint8_t *>(
|
||||
reinterpret_cast<const uint8_t*>(
|
||||
JByteArrayRef(env, dataToSend).array().data()),
|
||||
sendSize, recvBuf.data(), receiveSize);
|
||||
env->SetByteArrayRegion(dataReceived, 0, receiveSize,
|
||||
reinterpret_cast<const jbyte *>(recvBuf.data()));
|
||||
reinterpret_cast<const jbyte*>(recvBuf.data()));
|
||||
I2CJNI_LOG(logDEBUG) << "ReturnValue = " << returnValue;
|
||||
return returnValue;
|
||||
}
|
||||
@@ -100,22 +111,26 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CTransactionB(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_I2CJNI
|
||||
* Method: i2CWrite
|
||||
* Signature: (IBLjava/nio/ByteBuffer;B)I
|
||||
* Signature: (IBLjava/lang/Object;B)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CWrite(
|
||||
JNIEnv* env, jclass, jint port, jbyte address, jobject dataToSend,
|
||||
jbyte sendSize) {
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CWrite
|
||||
(JNIEnv* env, jclass, jint port, jbyte address, jobject dataToSend,
|
||||
jbyte sendSize)
|
||||
{
|
||||
I2CJNI_LOG(logDEBUG) << "Calling I2CJNI i2CWrite";
|
||||
I2CJNI_LOG(logDEBUG) << "Port = " << port;
|
||||
I2CJNI_LOG(logDEBUG) << "Address = " << (jint)address;
|
||||
uint8_t* dataToSendPtr = nullptr;
|
||||
|
||||
if (dataToSend != 0) {
|
||||
dataToSendPtr = (uint8_t*)env->GetDirectBufferAddress(dataToSend);
|
||||
dataToSendPtr =
|
||||
reinterpret_cast<uint8_t*>(env->GetDirectBufferAddress(dataToSend));
|
||||
}
|
||||
I2CJNI_LOG(logDEBUG) << "DataToSendPtr = " << dataToSendPtr;
|
||||
I2CJNI_LOG(logDEBUG) << "SendSize = " << (jint)sendSize;
|
||||
jint returnValue = HAL_WriteI2C(static_cast<HAL_I2CPort>(port), address, dataToSendPtr, sendSize);
|
||||
jint returnValue = HAL_WriteI2C(static_cast<HAL_I2CPort>(port), address,
|
||||
dataToSendPtr, sendSize);
|
||||
I2CJNI_LOG(logDEBUG) << "ReturnValue = " << (jint)returnValue;
|
||||
return returnValue;
|
||||
}
|
||||
@@ -125,16 +140,18 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CWrite(
|
||||
* Method: i2CWriteB
|
||||
* Signature: (IB[BB)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CWriteB(
|
||||
JNIEnv* env, jclass, jint port, jbyte address, jbyteArray dataToSend,
|
||||
jbyte sendSize) {
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CWriteB
|
||||
(JNIEnv* env, jclass, jint port, jbyte address, jbyteArray dataToSend,
|
||||
jbyte sendSize)
|
||||
{
|
||||
I2CJNI_LOG(logDEBUG) << "Calling I2CJNI i2CWrite";
|
||||
I2CJNI_LOG(logDEBUG) << "Port = " << port;
|
||||
I2CJNI_LOG(logDEBUG) << "Address = " << (jint)address;
|
||||
I2CJNI_LOG(logDEBUG) << "SendSize = " << (jint)sendSize;
|
||||
jint returnValue =
|
||||
HAL_WriteI2C(static_cast<HAL_I2CPort>(port), address,
|
||||
reinterpret_cast<const uint8_t *>(
|
||||
reinterpret_cast<const uint8_t*>(
|
||||
JByteArrayRef(env, dataToSend).array().data()),
|
||||
sendSize);
|
||||
I2CJNI_LOG(logDEBUG) << "ReturnValue = " << (jint)returnValue;
|
||||
@@ -144,19 +161,22 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CWriteB(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_I2CJNI
|
||||
* Method: i2CRead
|
||||
* Signature: (IBLjava/nio/ByteBuffer;B)I
|
||||
* Signature: (IBLjava/lang/Object;B)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CRead(
|
||||
JNIEnv* env, jclass, jint port, jbyte address, jobject dataReceived,
|
||||
jbyte receiveSize) {
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CRead
|
||||
(JNIEnv* env, jclass, jint port, jbyte address, jobject dataReceived,
|
||||
jbyte receiveSize)
|
||||
{
|
||||
I2CJNI_LOG(logDEBUG) << "Calling I2CJNI i2CRead";
|
||||
I2CJNI_LOG(logDEBUG) << "Port = " << port;
|
||||
I2CJNI_LOG(logDEBUG) << "Address = " << address;
|
||||
uint8_t* dataReceivedPtr =
|
||||
(uint8_t*)env->GetDirectBufferAddress(dataReceived);
|
||||
reinterpret_cast<uint8_t*>(env->GetDirectBufferAddress(dataReceived));
|
||||
I2CJNI_LOG(logDEBUG) << "DataReceivedPtr = " << dataReceivedPtr;
|
||||
I2CJNI_LOG(logDEBUG) << "ReceiveSize = " << receiveSize;
|
||||
jint returnValue = HAL_ReadI2C(static_cast<HAL_I2CPort>(port), address, dataReceivedPtr, receiveSize);
|
||||
jint returnValue = HAL_ReadI2C(static_cast<HAL_I2CPort>(port), address,
|
||||
dataReceivedPtr, receiveSize);
|
||||
I2CJNI_LOG(logDEBUG) << "ReturnValue = " << returnValue;
|
||||
return returnValue;
|
||||
}
|
||||
@@ -166,18 +186,21 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CRead(
|
||||
* Method: i2CReadB
|
||||
* Signature: (IB[BB)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CReadB(
|
||||
JNIEnv* env, jclass, jint port, jbyte address, jbyteArray dataReceived,
|
||||
jbyte receiveSize) {
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CReadB
|
||||
(JNIEnv* env, jclass, jint port, jbyte address, jbyteArray dataReceived,
|
||||
jbyte receiveSize)
|
||||
{
|
||||
I2CJNI_LOG(logDEBUG) << "Calling I2CJNI i2CRead";
|
||||
I2CJNI_LOG(logDEBUG) << "Port = " << port;
|
||||
I2CJNI_LOG(logDEBUG) << "Address = " << address;
|
||||
I2CJNI_LOG(logDEBUG) << "ReceiveSize = " << receiveSize;
|
||||
wpi::SmallVector<uint8_t, 128> recvBuf;
|
||||
recvBuf.resize(receiveSize);
|
||||
jint returnValue = HAL_ReadI2C(static_cast<HAL_I2CPort>(port), address, recvBuf.data(), receiveSize);
|
||||
jint returnValue = HAL_ReadI2C(static_cast<HAL_I2CPort>(port), address,
|
||||
recvBuf.data(), receiveSize);
|
||||
env->SetByteArrayRegion(dataReceived, 0, receiveSize,
|
||||
reinterpret_cast<const jbyte *>(recvBuf.data()));
|
||||
reinterpret_cast<const jbyte*>(recvBuf.data()));
|
||||
I2CJNI_LOG(logDEBUG) << "ReturnValue = " << returnValue;
|
||||
return returnValue;
|
||||
}
|
||||
@@ -188,7 +211,9 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CReadB(
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CClose(JNIEnv*, jclass, jint port) {
|
||||
Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CClose
|
||||
(JNIEnv*, jclass, jint port)
|
||||
{
|
||||
I2CJNI_LOG(logDEBUG) << "Calling I2CJNI i2CClose";
|
||||
HAL_CloseI2C(static_cast<HAL_I2CPort>(port));
|
||||
}
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-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 <assert.h>
|
||||
#include <jni.h>
|
||||
|
||||
#include <atomic>
|
||||
#include <cassert>
|
||||
#include <thread>
|
||||
|
||||
#include <wpi/SafeThread.h>
|
||||
#include <wpi/mutex.h>
|
||||
|
||||
#include "HAL/cpp/Log.h"
|
||||
|
||||
#include "HAL/Interrupts.h"
|
||||
#include "HAL/cpp/Log.h"
|
||||
#include "HALUtil.h"
|
||||
#include "edu_wpi_first_wpilibj_hal_InterruptJNI.h"
|
||||
|
||||
@@ -27,7 +27,7 @@ TLogLevel interruptJNILogLevel = logERROR;
|
||||
if (level > interruptJNILogLevel) \
|
||||
; \
|
||||
else \
|
||||
Log().Get(level)
|
||||
Log().Get(level)
|
||||
|
||||
// Thread where callbacks are actually performed.
|
||||
//
|
||||
@@ -84,8 +84,8 @@ void InterruptThreadJNI::Main() {
|
||||
args.version = JNI_VERSION_1_2;
|
||||
args.name = const_cast<char*>("Interrupt");
|
||||
args.group = nullptr;
|
||||
jint rs = GetJVM()->AttachCurrentThreadAsDaemon(reinterpret_cast<void**>(&env),
|
||||
&args);
|
||||
jint rs = GetJVM()->AttachCurrentThreadAsDaemon(
|
||||
reinterpret_cast<void**>(&env), &args);
|
||||
if (rs != JNI_OK) return;
|
||||
|
||||
std::unique_lock<wpi::mutex> lock(m_mutex);
|
||||
@@ -126,10 +126,11 @@ extern "C" {
|
||||
* Signature: (Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_InterruptJNI_initializeInterrupts(
|
||||
JNIEnv* env, jclass, jboolean watcher) {
|
||||
Java_edu_wpi_first_wpilibj_hal_InterruptJNI_initializeInterrupts
|
||||
(JNIEnv* env, jclass, jboolean watcher)
|
||||
{
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "Calling INTERRUPTJNI initializeInterrupts";
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "watcher = " << (bool)watcher;
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "watcher = " << static_cast<bool>(watcher);
|
||||
|
||||
int32_t status = 0;
|
||||
HAL_InterruptHandle interrupt = HAL_InitializeInterrupts(watcher, &status);
|
||||
@@ -144,13 +145,15 @@ Java_edu_wpi_first_wpilibj_hal_InterruptJNI_initializeInterrupts(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_InterruptJNI
|
||||
* Method: cleanInterrupts
|
||||
* Signature: (J)V
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_InterruptJNI_cleanInterrupts(
|
||||
JNIEnv* env, jclass, jint interruptHandle) {
|
||||
Java_edu_wpi_first_wpilibj_hal_InterruptJNI_cleanInterrupts
|
||||
(JNIEnv* env, jclass, jint interruptHandle)
|
||||
{
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "Calling INTERRUPTJNI cleanInterrupts";
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "Interrupt Handle = " << (HAL_InterruptHandle)interruptHandle;
|
||||
INTERRUPTJNI_LOG(logDEBUG)
|
||||
<< "Interrupt Handle = " << (HAL_InterruptHandle)interruptHandle;
|
||||
|
||||
int32_t status = 0;
|
||||
HAL_CleanInterrupts((HAL_InterruptHandle)interruptHandle, &status);
|
||||
@@ -163,14 +166,16 @@ Java_edu_wpi_first_wpilibj_hal_InterruptJNI_cleanInterrupts(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_InterruptJNI
|
||||
* Method: waitForInterrupt
|
||||
* Signature: (JD)V
|
||||
* Signature: (IDZ)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_InterruptJNI_waitForInterrupt(
|
||||
JNIEnv* env, jclass, jint interruptHandle, jdouble timeout,
|
||||
jboolean ignorePrevious) {
|
||||
Java_edu_wpi_first_wpilibj_hal_InterruptJNI_waitForInterrupt
|
||||
(JNIEnv* env, jclass, jint interruptHandle, jdouble timeout,
|
||||
jboolean ignorePrevious)
|
||||
{
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "Calling INTERRUPTJNI waitForInterrupt";
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "Interrupt Handle = " << (HAL_InterruptHandle)interruptHandle;
|
||||
INTERRUPTJNI_LOG(logDEBUG)
|
||||
<< "Interrupt Handle = " << (HAL_InterruptHandle)interruptHandle;
|
||||
|
||||
int32_t status = 0;
|
||||
int32_t result = HAL_WaitForInterrupt((HAL_InterruptHandle)interruptHandle,
|
||||
@@ -185,13 +190,15 @@ Java_edu_wpi_first_wpilibj_hal_InterruptJNI_waitForInterrupt(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_InterruptJNI
|
||||
* Method: enableInterrupts
|
||||
* Signature: (J)V
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_InterruptJNI_enableInterrupts(
|
||||
JNIEnv* env, jclass, jint interruptHandle) {
|
||||
Java_edu_wpi_first_wpilibj_hal_InterruptJNI_enableInterrupts
|
||||
(JNIEnv* env, jclass, jint interruptHandle)
|
||||
{
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "Calling INTERRUPTJNI enableInterrupts";
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "Interrupt Handle = " << (HAL_InterruptHandle)interruptHandle;
|
||||
INTERRUPTJNI_LOG(logDEBUG)
|
||||
<< "Interrupt Handle = " << (HAL_InterruptHandle)interruptHandle;
|
||||
|
||||
int32_t status = 0;
|
||||
HAL_EnableInterrupts((HAL_InterruptHandle)interruptHandle, &status);
|
||||
@@ -204,13 +211,15 @@ Java_edu_wpi_first_wpilibj_hal_InterruptJNI_enableInterrupts(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_InterruptJNI
|
||||
* Method: disableInterrupts
|
||||
* Signature: (J)V
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_InterruptJNI_disableInterrupts(
|
||||
JNIEnv* env, jclass, jint interruptHandle) {
|
||||
Java_edu_wpi_first_wpilibj_hal_InterruptJNI_disableInterrupts
|
||||
(JNIEnv* env, jclass, jint interruptHandle)
|
||||
{
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "Calling INTERRUPTJNI disableInterrupts";
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "Interrupt Handle = " << (HAL_InterruptHandle)interruptHandle;
|
||||
INTERRUPTJNI_LOG(logDEBUG)
|
||||
<< "Interrupt Handle = " << (HAL_InterruptHandle)interruptHandle;
|
||||
|
||||
int32_t status = 0;
|
||||
HAL_DisableInterrupts((HAL_InterruptHandle)interruptHandle, &status);
|
||||
@@ -223,16 +232,20 @@ Java_edu_wpi_first_wpilibj_hal_InterruptJNI_disableInterrupts(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_InterruptJNI
|
||||
* Method: readInterruptRisingTimestamp
|
||||
* Signature: (J)D
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_InterruptJNI_readInterruptRisingTimestamp(
|
||||
JNIEnv* env, jclass, jint interruptHandle) {
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "Calling INTERRUPTJNI readInterruptRisingTimestamp";
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "Interrupt Handle = " << (HAL_InterruptHandle)interruptHandle;
|
||||
Java_edu_wpi_first_wpilibj_hal_InterruptJNI_readInterruptRisingTimestamp
|
||||
(JNIEnv* env, jclass, jint interruptHandle)
|
||||
{
|
||||
INTERRUPTJNI_LOG(logDEBUG)
|
||||
<< "Calling INTERRUPTJNI readInterruptRisingTimestamp";
|
||||
INTERRUPTJNI_LOG(logDEBUG)
|
||||
<< "Interrupt Handle = " << (HAL_InterruptHandle)interruptHandle;
|
||||
|
||||
int32_t status = 0;
|
||||
jdouble timeStamp = HAL_ReadInterruptRisingTimestamp((HAL_InterruptHandle)interruptHandle, &status);
|
||||
jdouble timeStamp = HAL_ReadInterruptRisingTimestamp(
|
||||
(HAL_InterruptHandle)interruptHandle, &status);
|
||||
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
@@ -242,16 +255,20 @@ Java_edu_wpi_first_wpilibj_hal_InterruptJNI_readInterruptRisingTimestamp(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_InterruptJNI
|
||||
* Method: readInterruptFallingTimestamp
|
||||
* Signature: (J)D
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_InterruptJNI_readInterruptFallingTimestamp(
|
||||
JNIEnv* env, jclass, jint interruptHandle) {
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "Calling INTERRUPTJNI readInterruptFallingTimestamp";
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "Interrupt Handle = " << (HAL_InterruptHandle)interruptHandle;
|
||||
Java_edu_wpi_first_wpilibj_hal_InterruptJNI_readInterruptFallingTimestamp
|
||||
(JNIEnv* env, jclass, jint interruptHandle)
|
||||
{
|
||||
INTERRUPTJNI_LOG(logDEBUG)
|
||||
<< "Calling INTERRUPTJNI readInterruptFallingTimestamp";
|
||||
INTERRUPTJNI_LOG(logDEBUG)
|
||||
<< "Interrupt Handle = " << (HAL_InterruptHandle)interruptHandle;
|
||||
|
||||
int32_t status = 0;
|
||||
jdouble timeStamp = HAL_ReadInterruptFallingTimestamp((HAL_InterruptHandle)interruptHandle, &status);
|
||||
jdouble timeStamp = HAL_ReadInterruptFallingTimestamp(
|
||||
(HAL_InterruptHandle)interruptHandle, &status);
|
||||
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
@@ -264,17 +281,20 @@ Java_edu_wpi_first_wpilibj_hal_InterruptJNI_readInterruptFallingTimestamp(
|
||||
* Signature: (III)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_InterruptJNI_requestInterrupts(
|
||||
JNIEnv* env, jclass, jint interruptHandle, jint digitalSourceHandle,
|
||||
jint analogTriggerType) {
|
||||
Java_edu_wpi_first_wpilibj_hal_InterruptJNI_requestInterrupts
|
||||
(JNIEnv* env, jclass, jint interruptHandle, jint digitalSourceHandle,
|
||||
jint analogTriggerType)
|
||||
{
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "Calling INTERRUPTJNI requestInterrupts";
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "Interrupt Handle = " << (HAL_InterruptHandle)interruptHandle;
|
||||
INTERRUPTJNI_LOG(logDEBUG)
|
||||
<< "Interrupt Handle = " << (HAL_InterruptHandle)interruptHandle;
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "digitalSourceHandle = " << digitalSourceHandle;
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "analogTriggerType = " << analogTriggerType;
|
||||
|
||||
int32_t status = 0;
|
||||
HAL_RequestInterrupts((HAL_InterruptHandle)interruptHandle, (HAL_Handle)digitalSourceHandle,
|
||||
(HAL_AnalogTriggerType)analogTriggerType, &status);
|
||||
HAL_RequestInterrupts((HAL_InterruptHandle)interruptHandle,
|
||||
(HAL_Handle)digitalSourceHandle,
|
||||
(HAL_AnalogTriggerType)analogTriggerType, &status);
|
||||
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
@@ -283,15 +303,15 @@ Java_edu_wpi_first_wpilibj_hal_InterruptJNI_requestInterrupts(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_InterruptJNI
|
||||
* Method: attachInterruptHandler
|
||||
* Signature:
|
||||
* (JLedu/wpi/first/wpilibj/hal/InterruptJNI/InterruptHandlerFunction;Ljava/nio/ByteBuffer;)V
|
||||
* Signature: (ILjava/lang/Object;Ljava/lang/Object;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_InterruptJNI_attachInterruptHandler(
|
||||
JNIEnv* env, jclass, jint interruptHandle, jobject handler,
|
||||
jobject param) {
|
||||
Java_edu_wpi_first_wpilibj_hal_InterruptJNI_attachInterruptHandler
|
||||
(JNIEnv* env, jclass, jint interruptHandle, jobject handler, jobject param)
|
||||
{
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "Calling INTERRUPTJNI attachInterruptHandler";
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "Interrupt Handle = " << (HAL_InterruptHandle)interruptHandle;
|
||||
INTERRUPTJNI_LOG(logDEBUG)
|
||||
<< "Interrupt Handle = " << (HAL_InterruptHandle)interruptHandle;
|
||||
|
||||
jclass cls = env->GetObjectClass(handler);
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "class = " << cls;
|
||||
@@ -315,8 +335,8 @@ Java_edu_wpi_first_wpilibj_hal_InterruptJNI_attachInterruptHandler(
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "InterruptThreadJNI Ptr = " << intr;
|
||||
|
||||
int32_t status = 0;
|
||||
HAL_AttachInterruptHandler((HAL_InterruptHandle)interruptHandle, interruptHandler, intr,
|
||||
&status);
|
||||
HAL_AttachInterruptHandler((HAL_InterruptHandle)interruptHandle,
|
||||
interruptHandler, intr, &status);
|
||||
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
@@ -325,20 +345,24 @@ Java_edu_wpi_first_wpilibj_hal_InterruptJNI_attachInterruptHandler(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_InterruptJNI
|
||||
* Method: setInterruptUpSourceEdge
|
||||
* Signature: (JZZ)V
|
||||
* Signature: (IZZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_InterruptJNI_setInterruptUpSourceEdge(
|
||||
JNIEnv* env, jclass, jint interruptHandle, jboolean risingEdge,
|
||||
jboolean fallingEdge) {
|
||||
Java_edu_wpi_first_wpilibj_hal_InterruptJNI_setInterruptUpSourceEdge
|
||||
(JNIEnv* env, jclass, jint interruptHandle, jboolean risingEdge,
|
||||
jboolean fallingEdge)
|
||||
{
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "Calling INTERRUPTJNI setInterruptUpSourceEdge";
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "Interrupt Handle = " << (HAL_InterruptHandle)interruptHandle;
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "Rising Edge = " << (bool)risingEdge;
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "Falling Edge = " << (bool)fallingEdge;
|
||||
INTERRUPTJNI_LOG(logDEBUG)
|
||||
<< "Interrupt Handle = " << (HAL_InterruptHandle)interruptHandle;
|
||||
INTERRUPTJNI_LOG(logDEBUG)
|
||||
<< "Rising Edge = " << static_cast<bool>(risingEdge);
|
||||
INTERRUPTJNI_LOG(logDEBUG)
|
||||
<< "Falling Edge = " << static_cast<bool>(fallingEdge);
|
||||
|
||||
int32_t status = 0;
|
||||
HAL_SetInterruptUpSourceEdge((HAL_InterruptHandle)interruptHandle, risingEdge, fallingEdge,
|
||||
&status);
|
||||
HAL_SetInterruptUpSourceEdge((HAL_InterruptHandle)interruptHandle, risingEdge,
|
||||
fallingEdge, &status);
|
||||
|
||||
INTERRUPTJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-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 "HAL/Notifier.h"
|
||||
#include <assert.h>
|
||||
#include <jni.h>
|
||||
#include <stdio.h>
|
||||
#include "HALUtil.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdio>
|
||||
|
||||
#include "HAL/Notifier.h"
|
||||
#include "HAL/cpp/Log.h"
|
||||
#include "HALUtil.h"
|
||||
#include "edu_wpi_first_wpilibj_hal_NotifierJNI.h"
|
||||
|
||||
using namespace frc;
|
||||
@@ -22,7 +24,7 @@ TLogLevel notifierJNILogLevel = logWARNING;
|
||||
if (level > notifierJNILogLevel) \
|
||||
; \
|
||||
else \
|
||||
Log().Get(level)
|
||||
Log().Get(level)
|
||||
|
||||
extern "C" {
|
||||
|
||||
@@ -32,8 +34,9 @@ extern "C" {
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_NotifierJNI_initializeNotifier(
|
||||
JNIEnv *env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_NotifierJNI_initializeNotifier
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
NOTIFIERJNI_LOG(logDEBUG) << "Calling NOTIFIERJNI initializeNotifier";
|
||||
|
||||
int32_t status = 0;
|
||||
@@ -43,7 +46,7 @@ Java_edu_wpi_first_wpilibj_hal_NotifierJNI_initializeNotifier(
|
||||
NOTIFIERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
|
||||
if (notifierHandle <= 0 || !CheckStatusForceThrow(env, status)) {
|
||||
return 0; // something went wrong in HAL
|
||||
return 0; // something went wrong in HAL
|
||||
}
|
||||
|
||||
return (jint)notifierHandle;
|
||||
@@ -55,8 +58,9 @@ Java_edu_wpi_first_wpilibj_hal_NotifierJNI_initializeNotifier(
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_NotifierJNI_stopNotifier(
|
||||
JNIEnv *env, jclass cls, jint notifierHandle) {
|
||||
Java_edu_wpi_first_wpilibj_hal_NotifierJNI_stopNotifier
|
||||
(JNIEnv* env, jclass cls, jint notifierHandle)
|
||||
{
|
||||
NOTIFIERJNI_LOG(logDEBUG) << "Calling NOTIFIERJNI stopNotifier";
|
||||
|
||||
NOTIFIERJNI_LOG(logDEBUG) << "Notifier Handle = " << notifierHandle;
|
||||
@@ -72,8 +76,10 @@ Java_edu_wpi_first_wpilibj_hal_NotifierJNI_stopNotifier(
|
||||
* Method: cleanNotifier
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_NotifierJNI_cleanNotifier(
|
||||
JNIEnv *env, jclass, jint notifierHandle) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_NotifierJNI_cleanNotifier
|
||||
(JNIEnv* env, jclass, jint notifierHandle)
|
||||
{
|
||||
NOTIFIERJNI_LOG(logDEBUG) << "Calling NOTIFIERJNI cleanNotifier";
|
||||
|
||||
NOTIFIERJNI_LOG(logDEBUG) << "Notifier Handle = " << notifierHandle;
|
||||
@@ -90,8 +96,9 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_NotifierJNI_cleanNotifier(
|
||||
* Signature: (IJ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_NotifierJNI_updateNotifierAlarm(
|
||||
JNIEnv *env, jclass cls, jint notifierHandle, jlong triggerTime) {
|
||||
Java_edu_wpi_first_wpilibj_hal_NotifierJNI_updateNotifierAlarm
|
||||
(JNIEnv* env, jclass cls, jint notifierHandle, jlong triggerTime)
|
||||
{
|
||||
NOTIFIERJNI_LOG(logDEBUG) << "Calling NOTIFIERJNI updateNotifierAlarm";
|
||||
|
||||
NOTIFIERJNI_LOG(logDEBUG) << "Notifier Handle = " << notifierHandle;
|
||||
@@ -99,7 +106,8 @@ Java_edu_wpi_first_wpilibj_hal_NotifierJNI_updateNotifierAlarm(
|
||||
NOTIFIERJNI_LOG(logDEBUG) << "triggerTime = " << triggerTime;
|
||||
|
||||
int32_t status = 0;
|
||||
HAL_UpdateNotifierAlarm((HAL_NotifierHandle)notifierHandle, (uint64_t)triggerTime, &status);
|
||||
HAL_UpdateNotifierAlarm((HAL_NotifierHandle)notifierHandle,
|
||||
static_cast<uint64_t>(triggerTime), &status);
|
||||
NOTIFIERJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
@@ -110,8 +118,9 @@ Java_edu_wpi_first_wpilibj_hal_NotifierJNI_updateNotifierAlarm(
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_NotifierJNI_cancelNotifierAlarm(
|
||||
JNIEnv *env, jclass cls, jint notifierHandle) {
|
||||
Java_edu_wpi_first_wpilibj_hal_NotifierJNI_cancelNotifierAlarm
|
||||
(JNIEnv* env, jclass cls, jint notifierHandle)
|
||||
{
|
||||
NOTIFIERJNI_LOG(logDEBUG) << "Calling NOTIFIERJNI cancelNotifierAlarm";
|
||||
|
||||
NOTIFIERJNI_LOG(logDEBUG) << "Notifier Handle = " << notifierHandle;
|
||||
@@ -128,8 +137,9 @@ Java_edu_wpi_first_wpilibj_hal_NotifierJNI_cancelNotifierAlarm(
|
||||
* Signature: (I)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_NotifierJNI_waitForNotifierAlarm(
|
||||
JNIEnv *env, jclass cls, jint notifierHandle) {
|
||||
Java_edu_wpi_first_wpilibj_hal_NotifierJNI_waitForNotifierAlarm
|
||||
(JNIEnv* env, jclass cls, jint notifierHandle)
|
||||
{
|
||||
NOTIFIERJNI_LOG(logDEBUG) << "Calling NOTIFIERJNI waitForNotifierAlarm";
|
||||
|
||||
NOTIFIERJNI_LOG(logDEBUG) << "Notifier Handle = " << notifierHandle;
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-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 <assert.h>
|
||||
#include <jni.h>
|
||||
#include "HAL/cpp/Log.h"
|
||||
|
||||
#include "edu_wpi_first_wpilibj_hal_OSSerialPortJNI.h"
|
||||
#include <cassert>
|
||||
|
||||
#include <wpi/jni_util.h>
|
||||
|
||||
#include "HAL/OSSerialPort.h"
|
||||
#include "HAL/cpp/Log.h"
|
||||
#include "HALUtil.h"
|
||||
#include "wpi/jni_util.h"
|
||||
#include "edu_wpi_first_wpilibj_hal_OSSerialPortJNI.h"
|
||||
|
||||
using namespace frc;
|
||||
using namespace wpi::java;
|
||||
@@ -25,7 +26,7 @@ TLogLevel osserialJNILogLevel = logWARNING;
|
||||
if (level > osserialJNILogLevel) \
|
||||
; \
|
||||
else \
|
||||
Log().Get(level)
|
||||
Log().Get(level)
|
||||
|
||||
extern "C" {
|
||||
|
||||
@@ -35,8 +36,9 @@ extern "C" {
|
||||
* Signature: (B)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialInitializePort(
|
||||
JNIEnv* env, jclass, jbyte port) {
|
||||
Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialInitializePort
|
||||
(JNIEnv* env, jclass, jbyte port)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Calling Serial Initialize";
|
||||
SERIALJNI_LOG(logDEBUG) << "Port = " << (jint)port;
|
||||
int32_t status = 0;
|
||||
@@ -51,8 +53,9 @@ Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialInitializePort(
|
||||
* Signature: (BI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetBaudRate(
|
||||
JNIEnv* env, jclass, jbyte port, jint rate) {
|
||||
Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetBaudRate
|
||||
(JNIEnv* env, jclass, jbyte port, jint rate)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Setting Serial Baud Rate";
|
||||
SERIALJNI_LOG(logDEBUG) << "Baud: " << rate;
|
||||
int32_t status = 0;
|
||||
@@ -67,8 +70,9 @@ Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetBaudRate(
|
||||
* Signature: (BB)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetDataBits(
|
||||
JNIEnv* env, jclass, jbyte port, jbyte bits) {
|
||||
Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetDataBits
|
||||
(JNIEnv* env, jclass, jbyte port, jbyte bits)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Setting Serial Data Bits";
|
||||
SERIALJNI_LOG(logDEBUG) << "Data Bits: " << bits;
|
||||
int32_t status = 0;
|
||||
@@ -83,8 +87,9 @@ Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetDataBits(
|
||||
* Signature: (BB)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetParity(
|
||||
JNIEnv* env, jclass, jbyte port, jbyte parity) {
|
||||
Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetParity
|
||||
(JNIEnv* env, jclass, jbyte port, jbyte parity)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Setting Serial Parity";
|
||||
SERIALJNI_LOG(logDEBUG) << "Parity: " << parity;
|
||||
int32_t status = 0;
|
||||
@@ -99,8 +104,9 @@ Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetParity(
|
||||
* Signature: (BB)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetStopBits(
|
||||
JNIEnv* env, jclass, jbyte port, jbyte bits) {
|
||||
Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetStopBits
|
||||
(JNIEnv* env, jclass, jbyte port, jbyte bits)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Setting Serial Stop Bits";
|
||||
SERIALJNI_LOG(logDEBUG) << "Stop Bits: " << bits;
|
||||
int32_t status = 0;
|
||||
@@ -115,8 +121,9 @@ Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetStopBits(
|
||||
* Signature: (BB)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetWriteMode(
|
||||
JNIEnv* env, jclass, jbyte port, jbyte mode) {
|
||||
Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetWriteMode
|
||||
(JNIEnv* env, jclass, jbyte port, jbyte mode)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Setting Serial Write Mode";
|
||||
SERIALJNI_LOG(logDEBUG) << "Write mode: " << mode;
|
||||
int32_t status = 0;
|
||||
@@ -131,8 +138,9 @@ Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetWriteMode(
|
||||
* Signature: (BB)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetFlowControl(
|
||||
JNIEnv* env, jclass, jbyte port, jbyte flow) {
|
||||
Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetFlowControl
|
||||
(JNIEnv* env, jclass, jbyte port, jbyte flow)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Setting Serial Flow Control";
|
||||
SERIALJNI_LOG(logDEBUG) << "Flow Control: " << flow;
|
||||
int32_t status = 0;
|
||||
@@ -147,8 +155,9 @@ Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetFlowControl(
|
||||
* Signature: (BD)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetTimeout(
|
||||
JNIEnv* env, jclass, jbyte port, jdouble timeout) {
|
||||
Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetTimeout
|
||||
(JNIEnv* env, jclass, jbyte port, jdouble timeout)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Setting Serial Timeout";
|
||||
SERIALJNI_LOG(logDEBUG) << "Timeout: " << timeout;
|
||||
int32_t status = 0;
|
||||
@@ -163,12 +172,14 @@ Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetTimeout(
|
||||
* Signature: (BC)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialEnableTermination(
|
||||
JNIEnv* env, jclass, jbyte port, jchar terminator) {
|
||||
Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialEnableTermination
|
||||
(JNIEnv* env, jclass, jbyte port, jchar terminator)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Setting Serial Enable Termination";
|
||||
SERIALJNI_LOG(logDEBUG) << "Terminator: " << terminator;
|
||||
int32_t status = 0;
|
||||
HAL_EnableOSSerialTermination(static_cast<HAL_SerialPort>(port), terminator, &status);
|
||||
HAL_EnableOSSerialTermination(static_cast<HAL_SerialPort>(port), terminator,
|
||||
&status);
|
||||
SERIALJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
@@ -179,8 +190,9 @@ Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialEnableTermination(
|
||||
* Signature: (B)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialDisableTermination(
|
||||
JNIEnv* env, jclass, jbyte port) {
|
||||
Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialDisableTermination
|
||||
(JNIEnv* env, jclass, jbyte port)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Setting Serial Disable termination";
|
||||
int32_t status = 0;
|
||||
HAL_DisableOSSerialTermination(static_cast<HAL_SerialPort>(port), &status);
|
||||
@@ -194,12 +206,14 @@ Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialDisableTermination(
|
||||
* Signature: (BI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetReadBufferSize(
|
||||
JNIEnv* env, jclass, jbyte port, jint size) {
|
||||
Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetReadBufferSize
|
||||
(JNIEnv* env, jclass, jbyte port, jint size)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Setting Serial Read Buffer Size";
|
||||
SERIALJNI_LOG(logDEBUG) << "Size: " << size;
|
||||
int32_t status = 0;
|
||||
HAL_SetOSSerialReadBufferSize(static_cast<HAL_SerialPort>(port), size, &status);
|
||||
HAL_SetOSSerialReadBufferSize(static_cast<HAL_SerialPort>(port), size,
|
||||
&status);
|
||||
SERIALJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
@@ -210,12 +224,14 @@ Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetReadBufferSize(
|
||||
* Signature: (BI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetWriteBufferSize(
|
||||
JNIEnv* env, jclass, jbyte port, jint size) {
|
||||
Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetWriteBufferSize
|
||||
(JNIEnv* env, jclass, jbyte port, jint size)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Setting Serial Write Buffer Size";
|
||||
SERIALJNI_LOG(logDEBUG) << "Size: " << size;
|
||||
int32_t status = 0;
|
||||
HAL_SetOSSerialWriteBufferSize(static_cast<HAL_SerialPort>(port), size, &status);
|
||||
HAL_SetOSSerialWriteBufferSize(static_cast<HAL_SerialPort>(port), size,
|
||||
&status);
|
||||
SERIALJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
@@ -226,11 +242,13 @@ Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetWriteBufferSize(
|
||||
* Signature: (B)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialGetBytesReceived(
|
||||
JNIEnv* env, jclass, jbyte port) {
|
||||
Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialGetBytesReceived
|
||||
(JNIEnv* env, jclass, jbyte port)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Serial Get Bytes Received";
|
||||
int32_t status = 0;
|
||||
jint retVal = HAL_GetOSSerialBytesReceived(static_cast<HAL_SerialPort>(port), &status);
|
||||
jint retVal =
|
||||
HAL_GetOSSerialBytesReceived(static_cast<HAL_SerialPort>(port), &status);
|
||||
SERIALJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
return retVal;
|
||||
@@ -241,16 +259,18 @@ Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialGetBytesReceived(
|
||||
* Method: serialRead
|
||||
* Signature: (B[BI)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialRead(
|
||||
JNIEnv* env, jclass, jbyte port, jbyteArray dataReceived, jint size) {
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialRead
|
||||
(JNIEnv* env, jclass, jbyte port, jbyteArray dataReceived, jint size)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Serial Read";
|
||||
wpi::SmallVector<char, 128> recvBuf;
|
||||
recvBuf.resize(size);
|
||||
int32_t status = 0;
|
||||
jint retVal = HAL_ReadOSSerial(static_cast<HAL_SerialPort>(port), recvBuf.data(),
|
||||
size, &status);
|
||||
jint retVal = HAL_ReadOSSerial(static_cast<HAL_SerialPort>(port),
|
||||
recvBuf.data(), size, &status);
|
||||
env->SetByteArrayRegion(dataReceived, 0, size,
|
||||
reinterpret_cast<const jbyte *>(recvBuf.data()));
|
||||
reinterpret_cast<const jbyte*>(recvBuf.data()));
|
||||
SERIALJNI_LOG(logDEBUG) << "ReturnValue = " << retVal;
|
||||
SERIALJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
@@ -262,13 +282,15 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialRead
|
||||
* Method: serialWrite
|
||||
* Signature: (B[BI)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialWrite(
|
||||
JNIEnv* env, jclass, jbyte port, jbyteArray dataToSend, jint size) {
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialWrite
|
||||
(JNIEnv* env, jclass, jbyte port, jbyteArray dataToSend, jint size)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Serial Write";
|
||||
int32_t status = 0;
|
||||
jint retVal =
|
||||
HAL_WriteOSSerial(static_cast<HAL_SerialPort>(port),
|
||||
reinterpret_cast<const char *>(
|
||||
reinterpret_cast<const char*>(
|
||||
JByteArrayRef(env, dataToSend).array().data()),
|
||||
size, &status);
|
||||
SERIALJNI_LOG(logDEBUG) << "ReturnValue = " << retVal;
|
||||
@@ -282,8 +304,10 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialWrit
|
||||
* Method: serialFlush
|
||||
* Signature: (B)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialFlush(
|
||||
JNIEnv* env, jclass, jbyte port) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialFlush
|
||||
(JNIEnv* env, jclass, jbyte port)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Serial Flush";
|
||||
int32_t status = 0;
|
||||
HAL_FlushOSSerial(static_cast<HAL_SerialPort>(port), &status);
|
||||
@@ -296,8 +320,10 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialFlus
|
||||
* Method: serialClear
|
||||
* Signature: (B)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialClear(
|
||||
JNIEnv* env, jclass, jbyte port) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialClear
|
||||
(JNIEnv* env, jclass, jbyte port)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Serial Clear";
|
||||
int32_t status = 0;
|
||||
HAL_ClearOSSerial(static_cast<HAL_SerialPort>(port), &status);
|
||||
@@ -310,8 +336,10 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialClea
|
||||
* Method: serialClose
|
||||
* Signature: (B)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialClose(
|
||||
JNIEnv* env, jclass, jbyte port) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialClose
|
||||
(JNIEnv* env, jclass, jbyte port)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Serial Close";
|
||||
int32_t status = 0;
|
||||
HAL_CloseOSSerial(static_cast<HAL_SerialPort>(port), &status);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-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. */
|
||||
@@ -16,11 +16,13 @@ extern "C" {
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PDPJNI
|
||||
* Method: getPDPTemperature
|
||||
* Method: initializePDP
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PDPJNI_initializePDP(
|
||||
JNIEnv *env, jclass, jint module) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PDPJNI_initializePDP
|
||||
(JNIEnv* env, jclass, jint module)
|
||||
{
|
||||
int32_t status = 0;
|
||||
HAL_InitializePDP(module, &status);
|
||||
CheckStatusRange(env, status, 0, HAL_GetNumPDPModules(), module);
|
||||
@@ -29,20 +31,24 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PDPJNI_initializePDP(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PDPJNI
|
||||
* Method: checkPDPChannel
|
||||
* Signature: (I)Z;
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_PDPJNI_checkPDPChannel(
|
||||
JNIEnv *env, jclass, jint channel) {
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PDPJNI_checkPDPChannel
|
||||
(JNIEnv* env, jclass, jint channel)
|
||||
{
|
||||
return HAL_CheckPDPChannel(channel);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PDPJNI
|
||||
* Method: checkPDPModule
|
||||
* Signature: (I)Z;
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_PDPJNI_checkPDPModule(
|
||||
JNIEnv *env, jclass, jint module) {
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PDPJNI_checkPDPModule
|
||||
(JNIEnv* env, jclass, jint module)
|
||||
{
|
||||
return HAL_CheckPDPModule(module);
|
||||
}
|
||||
|
||||
@@ -52,8 +58,9 @@ JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_PDPJNI_checkPDPModule(
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPTemperature(
|
||||
JNIEnv *env, jclass, jint module) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPTemperature
|
||||
(JNIEnv* env, jclass, jint module)
|
||||
{
|
||||
int32_t status = 0;
|
||||
double temperature = HAL_GetPDPTemperature(module, &status);
|
||||
CheckStatus(env, status, false);
|
||||
@@ -65,8 +72,10 @@ Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPTemperature(
|
||||
* Method: getPDPVoltage
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPVoltage(
|
||||
JNIEnv *env, jclass, jint module) {
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPVoltage
|
||||
(JNIEnv* env, jclass, jint module)
|
||||
{
|
||||
int32_t status = 0;
|
||||
double voltage = HAL_GetPDPVoltage(module, &status);
|
||||
CheckStatus(env, status, false);
|
||||
@@ -79,8 +88,9 @@ JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPVoltage(
|
||||
* Signature: (BI)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPChannelCurrent(
|
||||
JNIEnv *env, jclass, jbyte channel, jint module) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPChannelCurrent
|
||||
(JNIEnv* env, jclass, jbyte channel, jint module)
|
||||
{
|
||||
int32_t status = 0;
|
||||
double current = HAL_GetPDPChannelCurrent(module, channel, &status);
|
||||
CheckStatus(env, status, false);
|
||||
@@ -93,8 +103,9 @@ Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPChannelCurrent(
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPTotalCurrent(
|
||||
JNIEnv *env, jclass, jint module) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPTotalCurrent
|
||||
(JNIEnv* env, jclass, jint module)
|
||||
{
|
||||
int32_t status = 0;
|
||||
double current = HAL_GetPDPTotalCurrent(module, &status);
|
||||
CheckStatus(env, status, false);
|
||||
@@ -107,8 +118,9 @@ Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPTotalCurrent(
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPTotalPower(
|
||||
JNIEnv *env, jclass, jint module) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPTotalPower
|
||||
(JNIEnv* env, jclass, jint module)
|
||||
{
|
||||
int32_t status = 0;
|
||||
double power = HAL_GetPDPTotalPower(module, &status);
|
||||
CheckStatus(env, status, false);
|
||||
@@ -117,12 +129,13 @@ Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPTotalPower(
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PDPJNI
|
||||
* Method: resetPDPTotalEnergy
|
||||
* Method: getPDPTotalEnergy
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPTotalEnergy(
|
||||
JNIEnv *env, jclass, jint module) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPTotalEnergy
|
||||
(JNIEnv* env, jclass, jint module)
|
||||
{
|
||||
int32_t status = 0;
|
||||
double energy = HAL_GetPDPTotalEnergy(module, &status);
|
||||
CheckStatus(env, status, false);
|
||||
@@ -135,8 +148,9 @@ Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPTotalEnergy(
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PDPJNI_resetPDPTotalEnergy(
|
||||
JNIEnv *env, jclass, jint module) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PDPJNI_resetPDPTotalEnergy
|
||||
(JNIEnv* env, jclass, jint module)
|
||||
{
|
||||
int32_t status = 0;
|
||||
HAL_ResetPDPTotalEnergy(module, &status);
|
||||
CheckStatus(env, status, false);
|
||||
@@ -144,12 +158,13 @@ Java_edu_wpi_first_wpilibj_hal_PDPJNI_resetPDPTotalEnergy(
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PDPJNI
|
||||
* Method: clearStickyFaults
|
||||
* Method: clearPDPStickyFaults
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PDPJNI_clearPDPStickyFaults(
|
||||
JNIEnv *env, jclass, jint module) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PDPJNI_clearPDPStickyFaults
|
||||
(JNIEnv* env, jclass, jint module)
|
||||
{
|
||||
int32_t status = 0;
|
||||
HAL_ClearPDPStickyFaults(module, &status);
|
||||
CheckStatus(env, status, false);
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-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 <assert.h>
|
||||
#include <jni.h>
|
||||
#include "HAL/cpp/Log.h"
|
||||
|
||||
#include "edu_wpi_first_wpilibj_hal_PWMJNI.h"
|
||||
#include <cassert>
|
||||
|
||||
#include "HAL/DIO.h"
|
||||
#include "HAL/PWM.h"
|
||||
#include "HAL/Ports.h"
|
||||
#include "HALUtil.h"
|
||||
#include "HAL/cpp/Log.h"
|
||||
#include "HAL/handles/HandlesInternal.h"
|
||||
#include "HALUtil.h"
|
||||
#include "edu_wpi_first_wpilibj_hal_PWMJNI.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
@@ -26,18 +26,19 @@ TLogLevel pwmJNILogLevel = logWARNING;
|
||||
if (level > pwmJNILogLevel) \
|
||||
; \
|
||||
else \
|
||||
Log().Get(level)
|
||||
Log().Get(level)
|
||||
|
||||
extern "C" {
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PWMJNI
|
||||
* Method: initializePWMPort
|
||||
* Signature: (I)I;
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PWMJNI_initializePWMPort(
|
||||
JNIEnv *env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PWMJNI_initializePWMPort
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
PWMJNI_LOG(logDEBUG) << "Calling PWMJNI initializePWMPort";
|
||||
PWMJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_PortHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -52,22 +53,26 @@ Java_edu_wpi_first_wpilibj_hal_PWMJNI_initializePWMPort(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PWMJNI
|
||||
* Method: checkPWMChannel
|
||||
* Signature: (I)Z;
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_checkPWMChannel(
|
||||
JNIEnv *env, jclass, jint channel) {
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PWMJNI_checkPWMChannel
|
||||
(JNIEnv* env, jclass, jint channel)
|
||||
{
|
||||
PWMJNI_LOG(logDEBUG) << "Calling PWMJNI checkPWMChannel";
|
||||
PWMJNI_LOG(logDEBUG) << "Channel = " << channel;
|
||||
return HAL_CheckPWMChannel(channel);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_DIOJNI
|
||||
* Method: freeDIOPort
|
||||
* Signature: (I)V;
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_freePWMPort(
|
||||
JNIEnv *env, jclass, jint id) {
|
||||
* Class: edu_wpi_first_wpilibj_hal_PWMJNI
|
||||
* Method: freePWMPort
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PWMJNI_freePWMPort
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
PWMJNI_LOG(logDEBUG) << "Calling PWMJNI freePWMPort";
|
||||
PWMJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_DigitalHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -76,44 +81,50 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_freePWMPort(
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_DIOJNI
|
||||
* Method: setPWMConfigRaw
|
||||
* Signature: (IIIIII)V;
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_setPWMConfigRaw(
|
||||
JNIEnv *env, jclass, jint id, jint maxPwm, jint deadbandMaxPwm,
|
||||
jint centerPwm, jint deadbandMinPwm, jint minPwm) {
|
||||
* Class: edu_wpi_first_wpilibj_hal_PWMJNI
|
||||
* Method: setPWMConfigRaw
|
||||
* Signature: (IIIIII)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PWMJNI_setPWMConfigRaw
|
||||
(JNIEnv* env, jclass, jint id, jint maxPwm, jint deadbandMaxPwm,
|
||||
jint centerPwm, jint deadbandMinPwm, jint minPwm)
|
||||
{
|
||||
PWMJNI_LOG(logDEBUG) << "Calling PWMJNI setPWMConfigRaw";
|
||||
PWMJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_DigitalHandle)id;
|
||||
int32_t status = 0;
|
||||
HAL_SetPWMConfigRaw((HAL_DigitalHandle)id, maxPwm, deadbandMaxPwm, centerPwm,
|
||||
deadbandMinPwm, minPwm, &status);
|
||||
HAL_SetPWMConfigRaw((HAL_DigitalHandle)id, maxPwm, deadbandMaxPwm, centerPwm,
|
||||
deadbandMinPwm, minPwm, &status);
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_DIOJNI
|
||||
* Method: setPWMConfig
|
||||
* Signature: (IDDDDD)V;
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_setPWMConfig(
|
||||
JNIEnv *env, jclass, jint id, jdouble maxPwm, jdouble deadbandMaxPwm,
|
||||
jdouble centerPwm, jdouble deadbandMinPwm, jdouble minPwm) {
|
||||
* Class: edu_wpi_first_wpilibj_hal_PWMJNI
|
||||
* Method: setPWMConfig
|
||||
* Signature: (IDDDDD)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PWMJNI_setPWMConfig
|
||||
(JNIEnv* env, jclass, jint id, jdouble maxPwm, jdouble deadbandMaxPwm,
|
||||
jdouble centerPwm, jdouble deadbandMinPwm, jdouble minPwm)
|
||||
{
|
||||
PWMJNI_LOG(logDEBUG) << "Calling PWMJNI setPWMConfig";
|
||||
PWMJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_DigitalHandle)id;
|
||||
int32_t status = 0;
|
||||
HAL_SetPWMConfig((HAL_DigitalHandle)id, maxPwm, deadbandMaxPwm, centerPwm,
|
||||
deadbandMinPwm, minPwm, &status);
|
||||
HAL_SetPWMConfig((HAL_DigitalHandle)id, maxPwm, deadbandMaxPwm, centerPwm,
|
||||
deadbandMinPwm, minPwm, &status);
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_DIOJNI
|
||||
* Method: getPWMConfigRaw
|
||||
* Signature: (I)Ledu/wpi/first/wpilibj/PWMConfigDataResult;
|
||||
*/
|
||||
JNIEXPORT jobject JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_getPWMConfigRaw(
|
||||
JNIEnv *env, jclass, jint id) {
|
||||
* Class: edu_wpi_first_wpilibj_hal_PWMJNI
|
||||
* Method: getPWMConfigRaw
|
||||
* Signature: (I)Ljava/lang/Object;
|
||||
*/
|
||||
JNIEXPORT jobject JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PWMJNI_getPWMConfigRaw
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
PWMJNI_LOG(logDEBUG) << "Calling PWMJNI getPWMConfigRaw";
|
||||
PWMJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_DigitalHandle)id;
|
||||
int32_t status = 0;
|
||||
@@ -122,8 +133,8 @@ JNIEXPORT jobject JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_getPWMConfigRaw(
|
||||
int32_t centerPwm = 0;
|
||||
int32_t deadbandMinPwm = 0;
|
||||
int32_t minPwm = 0;
|
||||
HAL_GetPWMConfigRaw((HAL_DigitalHandle)id, &maxPwm, &deadbandMaxPwm, ¢erPwm,
|
||||
&deadbandMinPwm, &minPwm, &status);
|
||||
HAL_GetPWMConfigRaw((HAL_DigitalHandle)id, &maxPwm, &deadbandMaxPwm,
|
||||
¢erPwm, &deadbandMinPwm, &minPwm, &status);
|
||||
CheckStatus(env, status);
|
||||
return CreatePWMConfigDataResult(env, maxPwm, deadbandMaxPwm, centerPwm,
|
||||
deadbandMinPwm, minPwm);
|
||||
@@ -134,8 +145,10 @@ JNIEXPORT jobject JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_getPWMConfigRaw(
|
||||
* Method: setPWMEliminateDeadband
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_setPWMEliminateDeadband(
|
||||
JNIEnv* env, jclass, jint id, jboolean value) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PWMJNI_setPWMEliminateDeadband
|
||||
(JNIEnv* env, jclass, jint id, jboolean value)
|
||||
{
|
||||
PWMJNI_LOG(logDEBUG) << "PWM Handle = " << (HAL_DigitalHandle)id;
|
||||
int32_t status = 0;
|
||||
HAL_SetPWMEliminateDeadband((HAL_DigitalHandle)id, value, &status);
|
||||
@@ -148,8 +161,10 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_setPWMEliminateDead
|
||||
* Method: getPWMEliminateDeadband
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_getPWMEliminateDeadband(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PWMJNI_getPWMEliminateDeadband
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
PWMJNI_LOG(logDEBUG) << "PWM Handle = " << (HAL_DigitalHandle)id;
|
||||
int32_t status = 0;
|
||||
auto val = HAL_GetPWMEliminateDeadband((HAL_DigitalHandle)id, &status);
|
||||
@@ -163,8 +178,10 @@ JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_getPWMEliminate
|
||||
* Method: setPWMRaw
|
||||
* Signature: (IS)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_setPWMRaw(
|
||||
JNIEnv* env, jclass, jint id, jshort value) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PWMJNI_setPWMRaw
|
||||
(JNIEnv* env, jclass, jint id, jshort value)
|
||||
{
|
||||
PWMJNI_LOG(logDEBUG) << "PWM Handle = " << (HAL_DigitalHandle)id;
|
||||
PWMJNI_LOG(logDEBUG) << "PWM Value = " << value;
|
||||
int32_t status = 0;
|
||||
@@ -178,8 +195,10 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_setPWMRaw(
|
||||
* Method: setPWMSpeed
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_setPWMSpeed(
|
||||
JNIEnv* env, jclass, jint id, jdouble value) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PWMJNI_setPWMSpeed
|
||||
(JNIEnv* env, jclass, jint id, jdouble value)
|
||||
{
|
||||
PWMJNI_LOG(logDEBUG) << "PWM Handle = " << (HAL_DigitalHandle)id;
|
||||
PWMJNI_LOG(logDEBUG) << "PWM Value = " << value;
|
||||
int32_t status = 0;
|
||||
@@ -193,8 +212,10 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_setPWMSpeed(
|
||||
* Method: setPWMPosition
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_setPWMPosition(
|
||||
JNIEnv* env, jclass, jint id, jdouble value) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PWMJNI_setPWMPosition
|
||||
(JNIEnv* env, jclass, jint id, jdouble value)
|
||||
{
|
||||
PWMJNI_LOG(logDEBUG) << "PWM Handle = " << (HAL_DigitalHandle)id;
|
||||
PWMJNI_LOG(logDEBUG) << "PWM Value = " << value;
|
||||
int32_t status = 0;
|
||||
@@ -209,8 +230,9 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_setPWMPosition(
|
||||
* Signature: (I)S
|
||||
*/
|
||||
JNIEXPORT jshort JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PWMJNI_getPWMRaw(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PWMJNI_getPWMRaw
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
PWMJNI_LOG(logDEBUG) << "PWM Handle = " << (HAL_DigitalHandle)id;
|
||||
int32_t status = 0;
|
||||
jshort returnValue = HAL_GetPWMRaw((HAL_DigitalHandle)id, &status);
|
||||
@@ -226,8 +248,9 @@ Java_edu_wpi_first_wpilibj_hal_PWMJNI_getPWMRaw(
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PWMJNI_getPWMSpeed(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PWMJNI_getPWMSpeed
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
PWMJNI_LOG(logDEBUG) << "PWM Handle = " << (HAL_DigitalHandle)id;
|
||||
int32_t status = 0;
|
||||
jdouble returnValue = HAL_GetPWMSpeed((HAL_DigitalHandle)id, &status);
|
||||
@@ -243,8 +266,9 @@ Java_edu_wpi_first_wpilibj_hal_PWMJNI_getPWMSpeed(
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PWMJNI_getPWMPosition(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PWMJNI_getPWMPosition
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
PWMJNI_LOG(logDEBUG) << "PWM Handle = " << (HAL_DigitalHandle)id;
|
||||
int32_t status = 0;
|
||||
jdouble returnValue = HAL_GetPWMPosition((HAL_DigitalHandle)id, &status);
|
||||
@@ -259,8 +283,10 @@ Java_edu_wpi_first_wpilibj_hal_PWMJNI_getPWMPosition(
|
||||
* Method: setPWMDisabled
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_setPWMDisabled(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PWMJNI_setPWMDisabled
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
PWMJNI_LOG(logDEBUG) << "PWM Handle = " << (HAL_DigitalHandle)id;
|
||||
int32_t status = 0;
|
||||
HAL_SetPWMDisabled((HAL_DigitalHandle)id, &status);
|
||||
@@ -273,8 +299,10 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_setPWMDisabled(
|
||||
* Method: latchPWMZero
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_latchPWMZero(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PWMJNI_latchPWMZero
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
PWMJNI_LOG(logDEBUG) << "PWM Handle = " << (HAL_DigitalHandle)id;
|
||||
int32_t status = 0;
|
||||
HAL_LatchPWMZero((HAL_DigitalHandle)id, &status);
|
||||
@@ -287,8 +315,10 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_latchPWMZero(
|
||||
* Method: setPWMPeriodScale
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_setPWMPeriodScale(
|
||||
JNIEnv* env, jclass, jint id, jint value) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PWMJNI_setPWMPeriodScale
|
||||
(JNIEnv* env, jclass, jint id, jint value)
|
||||
{
|
||||
PWMJNI_LOG(logDEBUG) << "PWM Handle = " << (HAL_DigitalHandle)id;
|
||||
PWMJNI_LOG(logDEBUG) << "PeriodScale Value = " << value;
|
||||
int32_t status = 0;
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-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 <assert.h>
|
||||
#include <jni.h>
|
||||
#include "HAL/cpp/Log.h"
|
||||
|
||||
#include "edu_wpi_first_wpilibj_hal_PortsJNI.h"
|
||||
#include <cassert>
|
||||
|
||||
#include "HAL/Ports.h"
|
||||
#include "HAL/cpp/Log.h"
|
||||
#include "HALUtil.h"
|
||||
#include "edu_wpi_first_wpilibj_hal_PortsJNI.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
@@ -21,9 +21,9 @@ TLogLevel portsJNILogLevel = logWARNING;
|
||||
|
||||
#define PORTSJNI_LOG(level) \
|
||||
if (level > portsJNILogLevel) \
|
||||
; \
|
||||
else \
|
||||
Log().Get(level)
|
||||
; \
|
||||
else \
|
||||
Log().Get(level)
|
||||
|
||||
extern "C" {
|
||||
/*
|
||||
@@ -32,266 +32,267 @@ extern "C" {
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumAccumulators(
|
||||
JNIEnv *env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumAccumulators
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumAccumulators";
|
||||
jint value = HAL_GetNumAccumulators();
|
||||
PORTSJNI_LOG(logDEBUG) << "Value = " << value;
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PortsJNI
|
||||
* Method: getNumAnalogTriggers
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumAnalogTriggers(
|
||||
JNIEnv *env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumAnalogTriggers
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumAnalogTriggers";
|
||||
jint value = HAL_GetNumAnalogTriggers();
|
||||
PORTSJNI_LOG(logDEBUG) << "Value = " << value;
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PortsJNI
|
||||
* Method: getNumAnalogInputs
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumAnalogInputs(
|
||||
JNIEnv *env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumAnalogInputs
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumAnalogInputs";
|
||||
jint value = HAL_GetNumAnalogInputs();
|
||||
PORTSJNI_LOG(logDEBUG) << "Value = " << value;
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PortsJNI
|
||||
* Method: getNumAnalogOutputs
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumAnalogOutputs(
|
||||
JNIEnv *env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumAnalogOutputs
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumAnalogOutputs";
|
||||
jint value = HAL_GetNumAnalogOutputs();
|
||||
PORTSJNI_LOG(logDEBUG) << "Value = " << value;
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PortsJNI
|
||||
* Method: getNumCounters
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumCounters(
|
||||
JNIEnv *env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumCounters
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumCounters";
|
||||
jint value = HAL_GetNumCounters();
|
||||
PORTSJNI_LOG(logDEBUG) << "Value = " << value;
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PortsJNI
|
||||
* Method: getNumDigitalHeaders
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumDigitalHeaders(
|
||||
JNIEnv *env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumDigitalHeaders
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumDigitalHeaders";
|
||||
jint value = HAL_GetNumDigitalHeaders();
|
||||
PORTSJNI_LOG(logDEBUG) << "Value = " << value;
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PortsJNI
|
||||
* Method: getNumPWMHeaders
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumPWMHeaders(
|
||||
JNIEnv *env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumPWMHeaders
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumPWMHeaders";
|
||||
jint value = HAL_GetNumPWMHeaders();
|
||||
PORTSJNI_LOG(logDEBUG) << "Value = " << value;
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PortsJNI
|
||||
* Method: getNumDigitalChannels
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumDigitalChannels(
|
||||
JNIEnv *env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumDigitalChannels
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumDigitalChannels";
|
||||
jint value = HAL_GetNumDigitalChannels();
|
||||
PORTSJNI_LOG(logDEBUG) << "Value = " << value;
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PortsJNI
|
||||
* Method: getNumPWMChannels
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumPWMChannels(
|
||||
JNIEnv *env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumPWMChannels
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumPWMChannels";
|
||||
jint value = HAL_GetNumPWMChannels();
|
||||
PORTSJNI_LOG(logDEBUG) << "Value = " << value;
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PortsJNI
|
||||
* Method: getNumDigitalPWMOutputs
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumDigitalPWMOutputs(
|
||||
JNIEnv *env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumDigitalPWMOutputs
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumDigitalPWMOutputs";
|
||||
jint value = HAL_GetNumDigitalPWMOutputs();
|
||||
PORTSJNI_LOG(logDEBUG) << "Value = " << value;
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PortsJNI
|
||||
* Method: getNumEncoders
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumEncoders(
|
||||
JNIEnv *env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumEncoders
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumEncoders";
|
||||
jint value = HAL_GetNumEncoders();
|
||||
PORTSJNI_LOG(logDEBUG) << "Value = " << value;
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PortsJNI
|
||||
* Method: getNumInterrupts
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumInterrupts(
|
||||
JNIEnv *env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumInterrupts
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumInterrupts";
|
||||
jint value = HAL_GetNumInterrupts();
|
||||
PORTSJNI_LOG(logDEBUG) << "Value = " << value;
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PortsJNI
|
||||
* Method: getNumRelayChannels
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumRelayChannels(
|
||||
JNIEnv *env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumRelayChannels
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumRelayChannels";
|
||||
jint value = HAL_GetNumRelayChannels();
|
||||
PORTSJNI_LOG(logDEBUG) << "Value = " << value;
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PortsJNI
|
||||
* Method: getNumRelayHeaders
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumRelayHeaders(
|
||||
JNIEnv *env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumRelayHeaders
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumRelayHeaders";
|
||||
jint value = HAL_GetNumRelayHeaders();
|
||||
PORTSJNI_LOG(logDEBUG) << "Value = " << value;
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PortsJNI
|
||||
* Method: getNumPCMModules
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumPCMModules(
|
||||
JNIEnv *env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumPCMModules
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumPCMModules";
|
||||
jint value = HAL_GetNumPCMModules();
|
||||
PORTSJNI_LOG(logDEBUG) << "Value = " << value;
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PortsJNI
|
||||
* Method: getNumSolenoidChannels
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumSolenoidChannels(
|
||||
JNIEnv *env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumSolenoidChannels
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumSolenoidChannels";
|
||||
jint value = HAL_GetNumSolenoidChannels();
|
||||
PORTSJNI_LOG(logDEBUG) << "Value = " << value;
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PortsJNI
|
||||
* Method: getNumPDPModules
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumPDPModules(
|
||||
JNIEnv *env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumPDPModules
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumPDPModules";
|
||||
jint value = HAL_GetNumPDPModules();
|
||||
PORTSJNI_LOG(logDEBUG) << "Value = " << value;
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_PortsJNI
|
||||
* Method: getNumPDPChannels
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumPDPChannels(
|
||||
JNIEnv *env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumPDPChannels
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumPDPChannels";
|
||||
jint value = HAL_GetNumPDPChannels();
|
||||
PORTSJNI_LOG(logDEBUG) << "Value = " << value;
|
||||
return value;
|
||||
}
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-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 "HAL/Power.h"
|
||||
#include <jni.h>
|
||||
|
||||
#include "HAL/Power.h"
|
||||
#include "HALUtil.h"
|
||||
#include "edu_wpi_first_wpilibj_hal_PowerJNI.h"
|
||||
|
||||
@@ -20,7 +21,9 @@ extern "C" {
|
||||
* Signature: ()D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PowerJNI_getVinVoltage(JNIEnv* env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PowerJNI_getVinVoltage
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
double val = HAL_GetVinVoltage(&status);
|
||||
CheckStatus(env, status);
|
||||
@@ -33,7 +36,9 @@ Java_edu_wpi_first_wpilibj_hal_PowerJNI_getVinVoltage(JNIEnv* env, jclass) {
|
||||
* Signature: ()D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PowerJNI_getVinCurrent(JNIEnv* env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PowerJNI_getVinCurrent
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
double val = HAL_GetVinCurrent(&status);
|
||||
CheckStatus(env, status);
|
||||
@@ -46,7 +51,9 @@ Java_edu_wpi_first_wpilibj_hal_PowerJNI_getVinCurrent(JNIEnv* env, jclass) {
|
||||
* Signature: ()D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserVoltage6V(JNIEnv* env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserVoltage6V
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
double val = HAL_GetUserVoltage6V(&status);
|
||||
CheckStatus(env, status);
|
||||
@@ -59,7 +66,9 @@ Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserVoltage6V(JNIEnv* env, jclass) {
|
||||
* Signature: ()D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrent6V(JNIEnv* env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrent6V
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
double val = HAL_GetUserCurrent6V(&status);
|
||||
CheckStatus(env, status);
|
||||
@@ -72,7 +81,9 @@ Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrent6V(JNIEnv* env, jclass) {
|
||||
* Signature: ()Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserActive6V(JNIEnv* env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserActive6V
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
bool val = HAL_GetUserActive6V(&status);
|
||||
CheckStatus(env, status);
|
||||
@@ -85,8 +96,9 @@ Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserActive6V(JNIEnv* env, jclass) {
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrentFaults6V(
|
||||
JNIEnv* env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrentFaults6V
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
int32_t val = HAL_GetUserCurrentFaults6V(&status);
|
||||
CheckStatus(env, status);
|
||||
@@ -99,7 +111,9 @@ Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrentFaults6V(
|
||||
* Signature: ()D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserVoltage5V(JNIEnv* env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserVoltage5V
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
double val = HAL_GetUserVoltage5V(&status);
|
||||
CheckStatus(env, status);
|
||||
@@ -112,7 +126,9 @@ Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserVoltage5V(JNIEnv* env, jclass) {
|
||||
* Signature: ()D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrent5V(JNIEnv* env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrent5V
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
double val = HAL_GetUserCurrent5V(&status);
|
||||
CheckStatus(env, status);
|
||||
@@ -125,7 +141,9 @@ Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrent5V(JNIEnv* env, jclass) {
|
||||
* Signature: ()Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserActive5V(JNIEnv* env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserActive5V
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
bool val = HAL_GetUserActive5V(&status);
|
||||
CheckStatus(env, status);
|
||||
@@ -138,8 +156,9 @@ Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserActive5V(JNIEnv* env, jclass) {
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrentFaults5V(
|
||||
JNIEnv* env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrentFaults5V
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
int32_t val = HAL_GetUserCurrentFaults5V(&status);
|
||||
CheckStatus(env, status);
|
||||
@@ -152,7 +171,9 @@ Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrentFaults5V(
|
||||
* Signature: ()D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserVoltage3V3(JNIEnv* env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserVoltage3V3
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
double val = HAL_GetUserVoltage3V3(&status);
|
||||
CheckStatus(env, status);
|
||||
@@ -165,7 +186,9 @@ Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserVoltage3V3(JNIEnv* env, jclass) {
|
||||
* Signature: ()D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrent3V3(JNIEnv* env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrent3V3
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
double val = HAL_GetUserCurrent3V3(&status);
|
||||
CheckStatus(env, status);
|
||||
@@ -178,7 +201,9 @@ Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrent3V3(JNIEnv* env, jclass) {
|
||||
* Signature: ()Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserActive3V3(JNIEnv* env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserActive3V3
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
bool val = HAL_GetUserActive3V3(&status);
|
||||
CheckStatus(env, status);
|
||||
@@ -191,8 +216,9 @@ Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserActive3V3(JNIEnv* env, jclass) {
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrentFaults3V3(
|
||||
JNIEnv* env, jclass) {
|
||||
Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrentFaults3V3
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
int32_t status = 0;
|
||||
int32_t val = HAL_GetUserCurrentFaults3V3(&status);
|
||||
CheckStatus(env, status);
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-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 <assert.h>
|
||||
#include <jni.h>
|
||||
#include "HAL/cpp/Log.h"
|
||||
|
||||
#include "edu_wpi_first_wpilibj_hal_RelayJNI.h"
|
||||
#include <cassert>
|
||||
|
||||
#include "HAL/Relay.h"
|
||||
#include "HAL/Ports.h"
|
||||
#include "HALUtil.h"
|
||||
#include "HAL/Relay.h"
|
||||
#include "HAL/cpp/Log.h"
|
||||
#include "HAL/handles/HandlesInternal.h"
|
||||
#include "HALUtil.h"
|
||||
#include "edu_wpi_first_wpilibj_hal_RelayJNI.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
@@ -25,51 +25,58 @@ TLogLevel relayJNILogLevel = logWARNING;
|
||||
if (level > relayJNILogLevel) \
|
||||
; \
|
||||
else \
|
||||
Log().Get(level)
|
||||
Log().Get(level)
|
||||
|
||||
extern "C" {
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_RelayJNI
|
||||
* Method: initializeRelayPort
|
||||
* Signature: (IZ)I;
|
||||
* Signature: (IZ)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_RelayJNI_initializeRelayPort(
|
||||
JNIEnv* env, jclass, jint id, jboolean fwd) {
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_RelayJNI_initializeRelayPort
|
||||
(JNIEnv* env, jclass, jint id, jboolean fwd)
|
||||
{
|
||||
RELAYJNI_LOG(logDEBUG) << "Calling RELAYJNI initializeRelayPort";
|
||||
RELAYJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_PortHandle)id;
|
||||
RELAYJNI_LOG(logDEBUG) << "Forward = " << (jint)fwd;
|
||||
int32_t status = 0;
|
||||
HAL_RelayHandle handle = HAL_InitializeRelayPort((HAL_PortHandle)id, (uint8_t) fwd, &status);
|
||||
HAL_RelayHandle handle = HAL_InitializeRelayPort(
|
||||
(HAL_PortHandle)id, static_cast<uint8_t>(fwd), &status);
|
||||
RELAYJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
RELAYJNI_LOG(logDEBUG) << "Relay Handle = " << handle;
|
||||
CheckStatusRange(env, status, 0, HAL_GetNumRelayChannels(),
|
||||
hal::getPortHandleChannel((HAL_PortHandle)id));
|
||||
return (jint) handle;
|
||||
return (jint)handle;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_RelayJNI
|
||||
* Method: freeRelayPort
|
||||
* Signature: (I)V;
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_RelayJNI_freeRelayPort(
|
||||
JNIEnv *env, jclass, jint id) {
|
||||
* Class: edu_wpi_first_wpilibj_hal_RelayJNI
|
||||
* Method: freeRelayPort
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_RelayJNI_freeRelayPort
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
RELAYJNI_LOG(logDEBUG) << "Calling RELAYJNI freeRelayPort";
|
||||
RELAYJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_RelayHandle)id;
|
||||
HAL_FreeRelayPort((HAL_RelayHandle)id);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_RelayJNI
|
||||
* Method: checkRelayChannel
|
||||
* Signature: (I)Z;
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_RelayJNI_checkRelayChannel(
|
||||
JNIEnv *env, jclass, jint channel) {
|
||||
* Class: edu_wpi_first_wpilibj_hal_RelayJNI
|
||||
* Method: checkRelayChannel
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_RelayJNI_checkRelayChannel
|
||||
(JNIEnv* env, jclass, jint channel)
|
||||
{
|
||||
RELAYJNI_LOG(logDEBUG) << "Calling RELAYJNI checkRelayChannel";
|
||||
RELAYJNI_LOG(logDEBUG) << "Channel = " << channel;
|
||||
return (jboolean)HAL_CheckRelayChannel((uint8_t) channel);
|
||||
return (jboolean)HAL_CheckRelayChannel(static_cast<uint8_t>(channel));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -77,8 +84,10 @@ JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_RelayJNI_checkRelayCha
|
||||
* Method: setRelay
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_RelayJNI_setRelay(
|
||||
JNIEnv* env, jclass, jint id, jboolean value) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_RelayJNI_setRelay
|
||||
(JNIEnv* env, jclass, jint id, jboolean value)
|
||||
{
|
||||
RELAYJNI_LOG(logDEBUG) << "Calling RELAYJNI setRelay";
|
||||
RELAYJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_RelayHandle)id;
|
||||
RELAYJNI_LOG(logDEBUG) << "Flag = " << (jint)value;
|
||||
@@ -94,8 +103,9 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_RelayJNI_setRelay(
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_RelayJNI_getRelay(
|
||||
JNIEnv* env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_RelayJNI_getRelay
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
RELAYJNI_LOG(logDEBUG) << "Calling RELAYJNI getRelay";
|
||||
RELAYJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_RelayHandle)id;
|
||||
int32_t status = 0;
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-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 <assert.h>
|
||||
#include <jni.h>
|
||||
#include "HAL/cpp/Log.h"
|
||||
|
||||
#include "edu_wpi_first_wpilibj_hal_SPIJNI.h"
|
||||
#include <cassert>
|
||||
|
||||
#include <wpi/jni_util.h>
|
||||
|
||||
#include "HAL/SPI.h"
|
||||
#include "HAL/cpp/Log.h"
|
||||
#include "HALUtil.h"
|
||||
#include "wpi/jni_util.h"
|
||||
#include "edu_wpi_first_wpilibj_hal_SPIJNI.h"
|
||||
|
||||
using namespace frc;
|
||||
using namespace wpi::java;
|
||||
@@ -25,7 +26,7 @@ TLogLevel spiJNILogLevel = logWARNING;
|
||||
if (level > spiJNILogLevel) \
|
||||
; \
|
||||
else \
|
||||
Log().Get(level)
|
||||
Log().Get(level)
|
||||
|
||||
extern "C" {
|
||||
|
||||
@@ -34,8 +35,10 @@ extern "C" {
|
||||
* Method: spiInitialize
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiInitialize(
|
||||
JNIEnv *env, jclass, jint port) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiInitialize
|
||||
(JNIEnv* env, jclass, jint port)
|
||||
{
|
||||
SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiInitialize";
|
||||
SPIJNI_LOG(logDEBUG) << "Port = " << (jint)port;
|
||||
int32_t status = 0;
|
||||
@@ -47,23 +50,27 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiInitialize(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_SPIJNI
|
||||
* Method: spiTransaction
|
||||
* Signature: (ILjava/nio/ByteBuffer;Ljava/nio/ByteBuffer;B)I
|
||||
* Signature: (ILjava/lang/Object;Ljava/lang/Object;B)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiTransaction(
|
||||
JNIEnv *env, jclass, jint port, jobject dataToSend, jobject dataReceived,
|
||||
jbyte size) {
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiTransaction
|
||||
(JNIEnv* env, jclass, jint port, jobject dataToSend, jobject dataReceived,
|
||||
jbyte size)
|
||||
{
|
||||
SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiTransaction";
|
||||
SPIJNI_LOG(logDEBUG) << "Port = " << (jint)port;
|
||||
uint8_t *dataToSendPtr = nullptr;
|
||||
uint8_t* dataToSendPtr = nullptr;
|
||||
if (dataToSend != 0) {
|
||||
dataToSendPtr = (uint8_t *)env->GetDirectBufferAddress(dataToSend);
|
||||
dataToSendPtr =
|
||||
reinterpret_cast<uint8_t*>(env->GetDirectBufferAddress(dataToSend));
|
||||
}
|
||||
uint8_t *dataReceivedPtr =
|
||||
(uint8_t *)env->GetDirectBufferAddress(dataReceived);
|
||||
uint8_t* dataReceivedPtr =
|
||||
reinterpret_cast<uint8_t*>(env->GetDirectBufferAddress(dataReceived));
|
||||
SPIJNI_LOG(logDEBUG) << "Size = " << (jint)size;
|
||||
SPIJNI_LOG(logDEBUG) << "DataToSendPtr = " << dataToSendPtr;
|
||||
SPIJNI_LOG(logDEBUG) << "DataReceivedPtr = " << dataReceivedPtr;
|
||||
jint retVal = HAL_TransactionSPI(static_cast<HAL_SPIPort>(port), dataToSendPtr, dataReceivedPtr, size);
|
||||
jint retVal = HAL_TransactionSPI(static_cast<HAL_SPIPort>(port),
|
||||
dataToSendPtr, dataReceivedPtr, size);
|
||||
SPIJNI_LOG(logDEBUG) << "ReturnValue = " << (jint)retVal;
|
||||
return retVal;
|
||||
}
|
||||
@@ -73,9 +80,11 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiTransaction(
|
||||
* Method: spiTransactionB
|
||||
* Signature: (I[B[BB)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiTransactionB(
|
||||
JNIEnv *env, jclass, jint port, jbyteArray dataToSend, jbyteArray dataReceived,
|
||||
jbyte size) {
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiTransactionB
|
||||
(JNIEnv* env, jclass, jint port, jbyteArray dataToSend,
|
||||
jbyteArray dataReceived, jbyte size)
|
||||
{
|
||||
SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiTransactionB";
|
||||
SPIJNI_LOG(logDEBUG) << "Port = " << (jint)port;
|
||||
SPIJNI_LOG(logDEBUG) << "Size = " << (jint)size;
|
||||
@@ -83,11 +92,11 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiTransactionB(
|
||||
recvBuf.resize(size);
|
||||
jint retVal =
|
||||
HAL_TransactionSPI(static_cast<HAL_SPIPort>(port),
|
||||
reinterpret_cast<const uint8_t *>(
|
||||
reinterpret_cast<const uint8_t*>(
|
||||
JByteArrayRef(env, dataToSend).array().data()),
|
||||
recvBuf.data(), size);
|
||||
env->SetByteArrayRegion(dataReceived, 0, size,
|
||||
reinterpret_cast<const jbyte *>(recvBuf.data()));
|
||||
reinterpret_cast<const jbyte*>(recvBuf.data()));
|
||||
SPIJNI_LOG(logDEBUG) << "ReturnValue = " << (jint)retVal;
|
||||
return retVal;
|
||||
}
|
||||
@@ -95,19 +104,23 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiTransactionB(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_SPIJNI
|
||||
* Method: spiWrite
|
||||
* Signature: (ILjava/nio/ByteBuffer;B)I
|
||||
* Signature: (ILjava/lang/Object;B)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiWrite(
|
||||
JNIEnv *env, jclass, jint port, jobject dataToSend, jbyte size) {
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiWrite
|
||||
(JNIEnv* env, jclass, jint port, jobject dataToSend, jbyte size)
|
||||
{
|
||||
SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiWrite";
|
||||
SPIJNI_LOG(logDEBUG) << "Port = " << (jint)port;
|
||||
uint8_t *dataToSendPtr = nullptr;
|
||||
uint8_t* dataToSendPtr = nullptr;
|
||||
if (dataToSend != 0) {
|
||||
dataToSendPtr = (uint8_t *)env->GetDirectBufferAddress(dataToSend);
|
||||
dataToSendPtr =
|
||||
reinterpret_cast<uint8_t*>(env->GetDirectBufferAddress(dataToSend));
|
||||
}
|
||||
SPIJNI_LOG(logDEBUG) << "Size = " << (jint)size;
|
||||
SPIJNI_LOG(logDEBUG) << "DataToSendPtr = " << dataToSendPtr;
|
||||
jint retVal = HAL_WriteSPI(static_cast<HAL_SPIPort>(port), dataToSendPtr, size);
|
||||
jint retVal =
|
||||
HAL_WriteSPI(static_cast<HAL_SPIPort>(port), dataToSendPtr, size);
|
||||
SPIJNI_LOG(logDEBUG) << "ReturnValue = " << (jint)retVal;
|
||||
return retVal;
|
||||
}
|
||||
@@ -117,13 +130,15 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiWrite(
|
||||
* Method: spiWriteB
|
||||
* Signature: (I[BB)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiWriteB(
|
||||
JNIEnv *env, jclass, jint port, jbyteArray dataToSend, jbyte size) {
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiWriteB
|
||||
(JNIEnv* env, jclass, jint port, jbyteArray dataToSend, jbyte size)
|
||||
{
|
||||
SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiWriteB";
|
||||
SPIJNI_LOG(logDEBUG) << "Port = " << (jint)port;
|
||||
SPIJNI_LOG(logDEBUG) << "Size = " << (jint)size;
|
||||
jint retVal = HAL_WriteSPI(static_cast<HAL_SPIPort>(port),
|
||||
reinterpret_cast<const uint8_t *>(
|
||||
reinterpret_cast<const uint8_t*>(
|
||||
JByteArrayRef(env, dataToSend).array().data()),
|
||||
size);
|
||||
SPIJNI_LOG(logDEBUG) << "ReturnValue = " << (jint)retVal;
|
||||
@@ -133,24 +148,29 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiWriteB(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_SPIJNI
|
||||
* Method: spiRead
|
||||
* Signature: (IZLjava/nio/ByteBuffer;B)I
|
||||
* Signature: (IZLjava/lang/Object;B)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiRead(
|
||||
JNIEnv *env, jclass, jint port, jboolean initiate, jobject dataReceived, jbyte size) {
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiRead
|
||||
(JNIEnv* env, jclass, jint port, jboolean initiate, jobject dataReceived,
|
||||
jbyte size)
|
||||
{
|
||||
SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiRead";
|
||||
SPIJNI_LOG(logDEBUG) << "Port = " << (jint)port;
|
||||
SPIJNI_LOG(logDEBUG) << "Initiate = " << (jboolean)initiate;
|
||||
uint8_t *dataReceivedPtr =
|
||||
(uint8_t *)env->GetDirectBufferAddress(dataReceived);
|
||||
uint8_t* dataReceivedPtr =
|
||||
reinterpret_cast<uint8_t*>(env->GetDirectBufferAddress(dataReceived));
|
||||
SPIJNI_LOG(logDEBUG) << "Size = " << (jint)size;
|
||||
SPIJNI_LOG(logDEBUG) << "DataReceivedPtr = " << dataReceivedPtr;
|
||||
jint retVal;
|
||||
if (initiate) {
|
||||
wpi::SmallVector<uint8_t, 128> sendBuf;
|
||||
sendBuf.resize(size);
|
||||
retVal = HAL_TransactionSPI(static_cast<HAL_SPIPort>(port), sendBuf.data(), dataReceivedPtr, size);
|
||||
retVal = HAL_TransactionSPI(static_cast<HAL_SPIPort>(port), sendBuf.data(),
|
||||
dataReceivedPtr, size);
|
||||
} else {
|
||||
retVal = HAL_ReadSPI(static_cast<HAL_SPIPort>(port), (uint8_t *)dataReceivedPtr, size);
|
||||
retVal = HAL_ReadSPI(static_cast<HAL_SPIPort>(port),
|
||||
reinterpret_cast<uint8_t*>(dataReceivedPtr), size);
|
||||
}
|
||||
SPIJNI_LOG(logDEBUG) << "ReturnValue = " << (jint)retVal;
|
||||
return retVal;
|
||||
@@ -161,8 +181,11 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiRead(
|
||||
* Method: spiReadB
|
||||
* Signature: (IZ[BB)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiReadB(
|
||||
JNIEnv *env, jclass, jint port, jboolean initiate, jbyteArray dataReceived, jbyte size) {
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiReadB
|
||||
(JNIEnv* env, jclass, jint port, jboolean initiate, jbyteArray dataReceived,
|
||||
jbyte size)
|
||||
{
|
||||
SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiReadB";
|
||||
SPIJNI_LOG(logDEBUG) << "Port = " << (jint)port;
|
||||
SPIJNI_LOG(logDEBUG) << "Initiate = " << (jboolean)initiate;
|
||||
@@ -173,12 +196,13 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiReadB(
|
||||
if (initiate) {
|
||||
wpi::SmallVector<uint8_t, 128> sendBuf;
|
||||
sendBuf.resize(size);
|
||||
retVal = HAL_TransactionSPI(static_cast<HAL_SPIPort>(port), sendBuf.data(), recvBuf.data(), size);
|
||||
retVal = HAL_TransactionSPI(static_cast<HAL_SPIPort>(port), sendBuf.data(),
|
||||
recvBuf.data(), size);
|
||||
} else {
|
||||
retVal = HAL_ReadSPI(static_cast<HAL_SPIPort>(port), recvBuf.data(), size);
|
||||
}
|
||||
env->SetByteArrayRegion(dataReceived, 0, size,
|
||||
reinterpret_cast<const jbyte *>(recvBuf.data()));
|
||||
reinterpret_cast<const jbyte*>(recvBuf.data()));
|
||||
SPIJNI_LOG(logDEBUG) << "ReturnValue = " << (jint)retVal;
|
||||
return retVal;
|
||||
}
|
||||
@@ -189,7 +213,9 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiReadB(
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiClose(JNIEnv *, jclass, jint port) {
|
||||
Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiClose
|
||||
(JNIEnv*, jclass, jint port)
|
||||
{
|
||||
SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiClose";
|
||||
SPIJNI_LOG(logDEBUG) << "Port = " << (jint)port;
|
||||
HAL_CloseSPI(static_cast<HAL_SPIPort>(port));
|
||||
@@ -200,8 +226,10 @@ Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiClose(JNIEnv *, jclass, jint port) {
|
||||
* Method: spiSetSpeed
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiSetSpeed(
|
||||
JNIEnv *, jclass, jint port, jint speed) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiSetSpeed
|
||||
(JNIEnv*, jclass, jint port, jint speed)
|
||||
{
|
||||
SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiSetSpeed";
|
||||
SPIJNI_LOG(logDEBUG) << "Port = " << (jint)port;
|
||||
SPIJNI_LOG(logDEBUG) << "Speed = " << (jint)speed;
|
||||
@@ -213,15 +241,18 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiSetSpeed(
|
||||
* Method: spiSetOpts
|
||||
* Signature: (IIII)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiSetOpts(
|
||||
JNIEnv *, jclass, jint port, jint msb_first, jint sample_on_trailing,
|
||||
jint clk_idle_high) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiSetOpts
|
||||
(JNIEnv*, jclass, jint port, jint msb_first, jint sample_on_trailing,
|
||||
jint clk_idle_high)
|
||||
{
|
||||
SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiSetOpts";
|
||||
SPIJNI_LOG(logDEBUG) << "Port = " << (jint)port;
|
||||
SPIJNI_LOG(logDEBUG) << "msb_first = " << msb_first;
|
||||
SPIJNI_LOG(logDEBUG) << "sample_on_trailing = " << sample_on_trailing;
|
||||
SPIJNI_LOG(logDEBUG) << "clk_idle_high = " << clk_idle_high;
|
||||
HAL_SetSPIOpts(static_cast<HAL_SPIPort>(port), msb_first, sample_on_trailing, clk_idle_high);
|
||||
HAL_SetSPIOpts(static_cast<HAL_SPIPort>(port), msb_first, sample_on_trailing,
|
||||
clk_idle_high);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -230,8 +261,9 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiSetOpts(
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiSetChipSelectActiveHigh(
|
||||
JNIEnv *env, jclass, jint port) {
|
||||
Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiSetChipSelectActiveHigh
|
||||
(JNIEnv* env, jclass, jint port)
|
||||
{
|
||||
SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiSetCSActiveHigh";
|
||||
SPIJNI_LOG(logDEBUG) << "Port = " << (jint)port;
|
||||
int32_t status = 0;
|
||||
@@ -246,8 +278,9 @@ Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiSetChipSelectActiveHigh(
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiSetChipSelectActiveLow(
|
||||
JNIEnv *env, jclass, jint port) {
|
||||
Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiSetChipSelectActiveLow
|
||||
(JNIEnv* env, jclass, jint port)
|
||||
{
|
||||
SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiSetCSActiveLow";
|
||||
SPIJNI_LOG(logDEBUG) << "Port = " << (jint)port;
|
||||
int32_t status = 0;
|
||||
@@ -261,8 +294,10 @@ Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiSetChipSelectActiveLow(
|
||||
* Method: spiInitAuto
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiInitAuto
|
||||
(JNIEnv *env, jclass, jint port, jint bufferSize) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiInitAuto
|
||||
(JNIEnv* env, jclass, jint port, jint bufferSize)
|
||||
{
|
||||
SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiInitAuto";
|
||||
SPIJNI_LOG(logDEBUG) << "Port = " << port;
|
||||
SPIJNI_LOG(logDEBUG) << "BufferSize = " << bufferSize;
|
||||
@@ -277,8 +312,10 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiInitAuto
|
||||
* Method: spiFreeAuto
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiFreeAuto
|
||||
(JNIEnv *env, jclass, jint port) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiFreeAuto
|
||||
(JNIEnv* env, jclass, jint port)
|
||||
{
|
||||
SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiFreeAuto";
|
||||
SPIJNI_LOG(logDEBUG) << "Port = " << port;
|
||||
int32_t status = 0;
|
||||
@@ -292,8 +329,10 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiFreeAuto
|
||||
* Method: spiStartAutoRate
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiStartAutoRate
|
||||
(JNIEnv *env, jclass, jint port, jdouble period) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiStartAutoRate
|
||||
(JNIEnv* env, jclass, jint port, jdouble period)
|
||||
{
|
||||
SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiStartAutoRate";
|
||||
SPIJNI_LOG(logDEBUG) << "Port = " << port;
|
||||
SPIJNI_LOG(logDEBUG) << "Period = " << period;
|
||||
@@ -308,8 +347,11 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiStartAutoRate
|
||||
* Method: spiStartAutoTrigger
|
||||
* Signature: (IIIZZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiStartAutoTrigger
|
||||
(JNIEnv *env, jclass, jint port, jint digitalSourceHandle, jint analogTriggerType, jboolean triggerRising, jboolean triggerFalling) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiStartAutoTrigger
|
||||
(JNIEnv* env, jclass, jint port, jint digitalSourceHandle,
|
||||
jint analogTriggerType, jboolean triggerRising, jboolean triggerFalling)
|
||||
{
|
||||
SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiStartAutoTrigger";
|
||||
SPIJNI_LOG(logDEBUG) << "Port = " << port;
|
||||
SPIJNI_LOG(logDEBUG) << "DigitalSourceHandle = " << digitalSourceHandle;
|
||||
@@ -318,8 +360,8 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiStartAutoTrigger
|
||||
SPIJNI_LOG(logDEBUG) << "TriggerFalling = " << (jint)triggerFalling;
|
||||
int32_t status = 0;
|
||||
HAL_StartSPIAutoTrigger(static_cast<HAL_SPIPort>(port), digitalSourceHandle,
|
||||
static_cast<HAL_AnalogTriggerType>(analogTriggerType), triggerRising,
|
||||
triggerFalling, &status);
|
||||
static_cast<HAL_AnalogTriggerType>(analogTriggerType),
|
||||
triggerRising, triggerFalling, &status);
|
||||
SPIJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
@@ -329,8 +371,10 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiStartAutoTrigger
|
||||
* Method: spiStopAuto
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiStopAuto
|
||||
(JNIEnv *env, jclass, jint port) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiStopAuto
|
||||
(JNIEnv* env, jclass, jint port)
|
||||
{
|
||||
SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiStopAuto";
|
||||
SPIJNI_LOG(logDEBUG) << "Port = " << port;
|
||||
int32_t status = 0;
|
||||
@@ -344,14 +388,17 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiStopAuto
|
||||
* Method: spiSetAutoTransmitData
|
||||
* Signature: (I[BI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiSetAutoTransmitData
|
||||
(JNIEnv *env, jclass, jint port, jbyteArray dataToSend, jint zeroSize) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiSetAutoTransmitData
|
||||
(JNIEnv* env, jclass, jint port, jbyteArray dataToSend, jint zeroSize)
|
||||
{
|
||||
SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiSetAutoTransmitData";
|
||||
SPIJNI_LOG(logDEBUG) << "Port = " << port;
|
||||
SPIJNI_LOG(logDEBUG) << "ZeroSize = " << zeroSize;
|
||||
JByteArrayRef jarr(env, dataToSend);
|
||||
int32_t status = 0;
|
||||
HAL_SetSPIAutoTransmitData(static_cast<HAL_SPIPort>(port),
|
||||
HAL_SetSPIAutoTransmitData(
|
||||
static_cast<HAL_SPIPort>(port),
|
||||
reinterpret_cast<const uint8_t*>(jarr.array().data()),
|
||||
jarr.array().size(), zeroSize, &status);
|
||||
SPIJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
@@ -363,8 +410,10 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiSetAutoTransmitD
|
||||
* Method: spiForceAutoRead
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiForceAutoRead
|
||||
(JNIEnv *env, jclass, jint port) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiForceAutoRead
|
||||
(JNIEnv* env, jclass, jint port)
|
||||
{
|
||||
SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiForceAutoRead";
|
||||
SPIJNI_LOG(logDEBUG) << "Port = " << port;
|
||||
int32_t status = 0;
|
||||
@@ -376,17 +425,22 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiForceAutoRead
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_SPIJNI
|
||||
* Method: spiReadAutoReceivedData
|
||||
* Signature: (ILjava/nio/ByteBuffer;ID)I
|
||||
* Signature: (ILjava/lang/Object;ID)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiReadAutoReceivedData__ILjava_nio_ByteBuffer_2ID
|
||||
(JNIEnv *env, jclass, jint port, jobject buffer, jint numToRead, jdouble timeout) {
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiReadAutoReceivedData__ILjava_nio_ByteBuffer_2ID
|
||||
(JNIEnv* env, jclass, jint port, jobject buffer, jint numToRead,
|
||||
jdouble timeout)
|
||||
{
|
||||
SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiReadAutoReceivedData";
|
||||
SPIJNI_LOG(logDEBUG) << "Port = " << port;
|
||||
SPIJNI_LOG(logDEBUG) << "NumToRead = " << numToRead;
|
||||
SPIJNI_LOG(logDEBUG) << "Timeout = " << timeout;
|
||||
uint8_t *recvBuf = (uint8_t *)env->GetDirectBufferAddress(buffer);
|
||||
uint8_t* recvBuf =
|
||||
reinterpret_cast<uint8_t*>(env->GetDirectBufferAddress(buffer));
|
||||
int32_t status = 0;
|
||||
jint retval = HAL_ReadSPIAutoReceivedData(static_cast<HAL_SPIPort>(port), recvBuf, numToRead, timeout, &status);
|
||||
jint retval = HAL_ReadSPIAutoReceivedData(
|
||||
static_cast<HAL_SPIPort>(port), recvBuf, numToRead, timeout, &status);
|
||||
SPIJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
SPIJNI_LOG(logDEBUG) << "Return = " << retval;
|
||||
CheckStatus(env, status);
|
||||
@@ -398,8 +452,11 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiReadAutoReceived
|
||||
* Method: spiReadAutoReceivedData
|
||||
* Signature: (I[BID)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiReadAutoReceivedData__I_3BID
|
||||
(JNIEnv *env, jclass, jint port, jbyteArray buffer, jint numToRead, jdouble timeout) {
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiReadAutoReceivedData__I_3BID
|
||||
(JNIEnv* env, jclass, jint port, jbyteArray buffer, jint numToRead,
|
||||
jdouble timeout)
|
||||
{
|
||||
SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiReadAutoReceivedData";
|
||||
SPIJNI_LOG(logDEBUG) << "Port = " << port;
|
||||
SPIJNI_LOG(logDEBUG) << "NumToRead = " << numToRead;
|
||||
@@ -407,13 +464,15 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiReadAutoReceived
|
||||
wpi::SmallVector<uint8_t, 128> recvBuf;
|
||||
recvBuf.resize(numToRead);
|
||||
int32_t status = 0;
|
||||
jint retval = HAL_ReadSPIAutoReceivedData(static_cast<HAL_SPIPort>(port), recvBuf.data(), numToRead, timeout, &status);
|
||||
jint retval =
|
||||
HAL_ReadSPIAutoReceivedData(static_cast<HAL_SPIPort>(port),
|
||||
recvBuf.data(), numToRead, timeout, &status);
|
||||
SPIJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
SPIJNI_LOG(logDEBUG) << "Return = " << retval;
|
||||
if (!CheckStatus(env, status)) return retval;
|
||||
if (numToRead > 0) {
|
||||
env->SetByteArrayRegion(buffer, 0, numToRead,
|
||||
reinterpret_cast<const jbyte *>(recvBuf.data()));
|
||||
reinterpret_cast<const jbyte*>(recvBuf.data()));
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
@@ -423,12 +482,15 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiReadAutoReceived
|
||||
* Method: spiGetAutoDroppedCount
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiGetAutoDroppedCount
|
||||
(JNIEnv *env, jclass, jint port) {
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiGetAutoDroppedCount
|
||||
(JNIEnv* env, jclass, jint port)
|
||||
{
|
||||
SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiGetAutoDroppedCount";
|
||||
SPIJNI_LOG(logDEBUG) << "Port = " << port;
|
||||
int32_t status = 0;
|
||||
auto retval = HAL_GetSPIAutoDroppedCount(static_cast<HAL_SPIPort>(port), &status);
|
||||
auto retval =
|
||||
HAL_GetSPIAutoDroppedCount(static_cast<HAL_SPIPort>(port), &status);
|
||||
SPIJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
SPIJNI_LOG(logDEBUG) << "Return = " << retval;
|
||||
CheckStatus(env, status);
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-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 <assert.h>
|
||||
#include <jni.h>
|
||||
#include "HAL/cpp/Log.h"
|
||||
|
||||
#include "edu_wpi_first_wpilibj_hal_SerialPortJNI.h"
|
||||
#include <cassert>
|
||||
|
||||
#include <wpi/jni_util.h>
|
||||
|
||||
#include "HAL/SerialPort.h"
|
||||
#include "HAL/cpp/Log.h"
|
||||
#include "HALUtil.h"
|
||||
#include "wpi/jni_util.h"
|
||||
#include "edu_wpi_first_wpilibj_hal_SerialPortJNI.h"
|
||||
|
||||
using namespace frc;
|
||||
using namespace wpi::java;
|
||||
@@ -25,7 +26,7 @@ TLogLevel serialJNILogLevel = logWARNING;
|
||||
if (level > serialJNILogLevel) \
|
||||
; \
|
||||
else \
|
||||
Log().Get(level)
|
||||
Log().Get(level)
|
||||
|
||||
extern "C" {
|
||||
|
||||
@@ -35,8 +36,9 @@ extern "C" {
|
||||
* Signature: (B)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialInitializePort(
|
||||
JNIEnv* env, jclass, jbyte port) {
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialInitializePort
|
||||
(JNIEnv* env, jclass, jbyte port)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Calling Serial Initialize";
|
||||
SERIALJNI_LOG(logDEBUG) << "Port = " << (jint)port;
|
||||
int32_t status = 0;
|
||||
@@ -51,8 +53,9 @@ Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialInitializePort(
|
||||
* Signature: (BLjava/lang/String;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialInitializePortDirect(
|
||||
JNIEnv* env, jclass, jbyte port, jstring portName) {
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialInitializePortDirect
|
||||
(JNIEnv* env, jclass, jbyte port, jstring portName)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Calling Serial Initialize Direct";
|
||||
SERIALJNI_LOG(logDEBUG) << "Port = " << (jint)port;
|
||||
JStringRef portNameRef{env, portName};
|
||||
@@ -70,8 +73,9 @@ Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialInitializePortDirect(
|
||||
* Signature: (BI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetBaudRate(
|
||||
JNIEnv* env, jclass, jbyte port, jint rate) {
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetBaudRate
|
||||
(JNIEnv* env, jclass, jbyte port, jint rate)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Setting Serial Baud Rate";
|
||||
SERIALJNI_LOG(logDEBUG) << "Baud: " << rate;
|
||||
int32_t status = 0;
|
||||
@@ -86,8 +90,9 @@ Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetBaudRate(
|
||||
* Signature: (BB)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetDataBits(
|
||||
JNIEnv* env, jclass, jbyte port, jbyte bits) {
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetDataBits
|
||||
(JNIEnv* env, jclass, jbyte port, jbyte bits)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Setting Serial Data Bits";
|
||||
SERIALJNI_LOG(logDEBUG) << "Data Bits: " << bits;
|
||||
int32_t status = 0;
|
||||
@@ -102,8 +107,9 @@ Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetDataBits(
|
||||
* Signature: (BB)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetParity(
|
||||
JNIEnv* env, jclass, jbyte port, jbyte parity) {
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetParity
|
||||
(JNIEnv* env, jclass, jbyte port, jbyte parity)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Setting Serial Parity";
|
||||
SERIALJNI_LOG(logDEBUG) << "Parity: " << parity;
|
||||
int32_t status = 0;
|
||||
@@ -118,8 +124,9 @@ Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetParity(
|
||||
* Signature: (BB)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetStopBits(
|
||||
JNIEnv* env, jclass, jbyte port, jbyte bits) {
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetStopBits
|
||||
(JNIEnv* env, jclass, jbyte port, jbyte bits)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Setting Serial Stop Bits";
|
||||
SERIALJNI_LOG(logDEBUG) << "Stop Bits: " << bits;
|
||||
int32_t status = 0;
|
||||
@@ -134,8 +141,9 @@ Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetStopBits(
|
||||
* Signature: (BB)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetWriteMode(
|
||||
JNIEnv* env, jclass, jbyte port, jbyte mode) {
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetWriteMode
|
||||
(JNIEnv* env, jclass, jbyte port, jbyte mode)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Setting Serial Write Mode";
|
||||
SERIALJNI_LOG(logDEBUG) << "Write mode: " << mode;
|
||||
int32_t status = 0;
|
||||
@@ -150,8 +158,9 @@ Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetWriteMode(
|
||||
* Signature: (BB)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetFlowControl(
|
||||
JNIEnv* env, jclass, jbyte port, jbyte flow) {
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetFlowControl
|
||||
(JNIEnv* env, jclass, jbyte port, jbyte flow)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Setting Serial Flow Control";
|
||||
SERIALJNI_LOG(logDEBUG) << "Flow Control: " << flow;
|
||||
int32_t status = 0;
|
||||
@@ -166,8 +175,9 @@ Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetFlowControl(
|
||||
* Signature: (BD)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetTimeout(
|
||||
JNIEnv* env, jclass, jbyte port, jdouble timeout) {
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetTimeout
|
||||
(JNIEnv* env, jclass, jbyte port, jdouble timeout)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Setting Serial Timeout";
|
||||
SERIALJNI_LOG(logDEBUG) << "Timeout: " << timeout;
|
||||
int32_t status = 0;
|
||||
@@ -182,12 +192,14 @@ Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetTimeout(
|
||||
* Signature: (BC)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialEnableTermination(
|
||||
JNIEnv* env, jclass, jbyte port, jchar terminator) {
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialEnableTermination
|
||||
(JNIEnv* env, jclass, jbyte port, jchar terminator)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Setting Serial Enable Termination";
|
||||
SERIALJNI_LOG(logDEBUG) << "Terminator: " << terminator;
|
||||
int32_t status = 0;
|
||||
HAL_EnableSerialTermination(static_cast<HAL_SerialPort>(port), terminator, &status);
|
||||
HAL_EnableSerialTermination(static_cast<HAL_SerialPort>(port), terminator,
|
||||
&status);
|
||||
SERIALJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
@@ -198,8 +210,9 @@ Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialEnableTermination(
|
||||
* Signature: (B)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialDisableTermination(
|
||||
JNIEnv* env, jclass, jbyte port) {
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialDisableTermination
|
||||
(JNIEnv* env, jclass, jbyte port)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Setting Serial Disable termination";
|
||||
int32_t status = 0;
|
||||
HAL_DisableSerialTermination(static_cast<HAL_SerialPort>(port), &status);
|
||||
@@ -213,8 +226,9 @@ Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialDisableTermination(
|
||||
* Signature: (BI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetReadBufferSize(
|
||||
JNIEnv* env, jclass, jbyte port, jint size) {
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetReadBufferSize
|
||||
(JNIEnv* env, jclass, jbyte port, jint size)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Setting Serial Read Buffer Size";
|
||||
SERIALJNI_LOG(logDEBUG) << "Size: " << size;
|
||||
int32_t status = 0;
|
||||
@@ -229,12 +243,14 @@ Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetReadBufferSize(
|
||||
* Signature: (BI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetWriteBufferSize(
|
||||
JNIEnv* env, jclass, jbyte port, jint size) {
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetWriteBufferSize
|
||||
(JNIEnv* env, jclass, jbyte port, jint size)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Setting Serial Write Buffer Size";
|
||||
SERIALJNI_LOG(logDEBUG) << "Size: " << size;
|
||||
int32_t status = 0;
|
||||
HAL_SetSerialWriteBufferSize(static_cast<HAL_SerialPort>(port), size, &status);
|
||||
HAL_SetSerialWriteBufferSize(static_cast<HAL_SerialPort>(port), size,
|
||||
&status);
|
||||
SERIALJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
@@ -245,11 +261,13 @@ Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetWriteBufferSize(
|
||||
* Signature: (B)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialGetBytesReceived(
|
||||
JNIEnv* env, jclass, jbyte port) {
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialGetBytesReceived
|
||||
(JNIEnv* env, jclass, jbyte port)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Serial Get Bytes Received";
|
||||
int32_t status = 0;
|
||||
jint retVal = HAL_GetSerialBytesReceived(static_cast<HAL_SerialPort>(port), &status);
|
||||
jint retVal =
|
||||
HAL_GetSerialBytesReceived(static_cast<HAL_SerialPort>(port), &status);
|
||||
SERIALJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
return retVal;
|
||||
@@ -260,16 +278,18 @@ Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialGetBytesReceived(
|
||||
* Method: serialRead
|
||||
* Signature: (B[BI)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialRead(
|
||||
JNIEnv* env, jclass, jbyte port, jbyteArray dataReceived, jint size) {
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialRead
|
||||
(JNIEnv* env, jclass, jbyte port, jbyteArray dataReceived, jint size)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Serial Read";
|
||||
wpi::SmallVector<char, 128> recvBuf;
|
||||
recvBuf.resize(size);
|
||||
int32_t status = 0;
|
||||
jint retVal = HAL_ReadSerial(static_cast<HAL_SerialPort>(port), recvBuf.data(),
|
||||
size, &status);
|
||||
jint retVal = HAL_ReadSerial(static_cast<HAL_SerialPort>(port),
|
||||
recvBuf.data(), size, &status);
|
||||
env->SetByteArrayRegion(dataReceived, 0, size,
|
||||
reinterpret_cast<const jbyte *>(recvBuf.data()));
|
||||
reinterpret_cast<const jbyte*>(recvBuf.data()));
|
||||
SERIALJNI_LOG(logDEBUG) << "ReturnValue = " << retVal;
|
||||
SERIALJNI_LOG(logDEBUG) << "Status = " << status;
|
||||
CheckStatus(env, status);
|
||||
@@ -281,13 +301,15 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialRead(
|
||||
* Method: serialWrite
|
||||
* Signature: (B[BI)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialWrite(
|
||||
JNIEnv* env, jclass, jbyte port, jbyteArray dataToSend, jint size) {
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialWrite
|
||||
(JNIEnv* env, jclass, jbyte port, jbyteArray dataToSend, jint size)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Serial Write";
|
||||
int32_t status = 0;
|
||||
jint retVal =
|
||||
HAL_WriteSerial(static_cast<HAL_SerialPort>(port),
|
||||
reinterpret_cast<const char *>(
|
||||
reinterpret_cast<const char*>(
|
||||
JByteArrayRef(env, dataToSend).array().data()),
|
||||
size, &status);
|
||||
SERIALJNI_LOG(logDEBUG) << "ReturnValue = " << retVal;
|
||||
@@ -301,8 +323,10 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialWrite(
|
||||
* Method: serialFlush
|
||||
* Signature: (B)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialFlush(
|
||||
JNIEnv* env, jclass, jbyte port) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialFlush
|
||||
(JNIEnv* env, jclass, jbyte port)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Serial Flush";
|
||||
int32_t status = 0;
|
||||
HAL_FlushSerial(static_cast<HAL_SerialPort>(port), &status);
|
||||
@@ -315,8 +339,10 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialFlush(
|
||||
* Method: serialClear
|
||||
* Signature: (B)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialClear(
|
||||
JNIEnv* env, jclass, jbyte port) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialClear
|
||||
(JNIEnv* env, jclass, jbyte port)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Serial Clear";
|
||||
int32_t status = 0;
|
||||
HAL_ClearSerial(static_cast<HAL_SerialPort>(port), &status);
|
||||
@@ -329,8 +355,10 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialClear(
|
||||
* Method: serialClose
|
||||
* Signature: (B)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialClose(
|
||||
JNIEnv* env, jclass, jbyte port) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialClose
|
||||
(JNIEnv* env, jclass, jbyte port)
|
||||
{
|
||||
SERIALJNI_LOG(logDEBUG) << "Serial Close";
|
||||
int32_t status = 0;
|
||||
HAL_CloseSerial(static_cast<HAL_SerialPort>(port), &status);
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-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 "HAL/Solenoid.h"
|
||||
|
||||
#include "HAL/Ports.h"
|
||||
#include "HAL/handles/HandlesInternal.h"
|
||||
#include "HAL/Solenoid.h"
|
||||
#include "HAL/cpp/Log.h"
|
||||
|
||||
#include "edu_wpi_first_wpilibj_hal_SolenoidJNI.h"
|
||||
|
||||
#include "HAL/handles/HandlesInternal.h"
|
||||
#include "HALUtil.h"
|
||||
#include "edu_wpi_first_wpilibj_hal_SolenoidJNI.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
@@ -23,7 +22,7 @@ TLogLevel solenoidJNILogLevel = logERROR;
|
||||
if (level > solenoidJNILogLevel) \
|
||||
; \
|
||||
else \
|
||||
Log().Get(level)
|
||||
Log().Get(level)
|
||||
|
||||
extern "C" {
|
||||
|
||||
@@ -33,8 +32,9 @@ extern "C" {
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_initializeSolenoidPort(
|
||||
JNIEnv *env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_initializeSolenoidPort
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
SOLENOIDJNI_LOG(logDEBUG) << "Calling SolenoidJNI initializeSolenoidPort";
|
||||
|
||||
SOLENOIDJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_PortHandle)id;
|
||||
@@ -55,10 +55,12 @@ Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_initializeSolenoidPort(
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_SolenoidJNI
|
||||
* Method: checkSolenoidChannel
|
||||
* Signature: (I)Z;
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_checkSolenoidChannel(
|
||||
JNIEnv *env, jclass, jint channel) {
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_checkSolenoidChannel
|
||||
(JNIEnv* env, jclass, jint channel)
|
||||
{
|
||||
SOLENOIDJNI_LOG(logDEBUG) << "Calling SolenoidJNI checkSolenoidChannel";
|
||||
SOLENOIDJNI_LOG(logDEBUG) << "Channel = " << channel;
|
||||
return HAL_CheckSolenoidChannel(channel);
|
||||
@@ -67,10 +69,12 @@ JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_checkSolen
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_SolenoidJNI
|
||||
* Method: checkSolenoidModule
|
||||
* Signature: (I)Z;
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_checkSolenoidModule(
|
||||
JNIEnv *env, jclass, jint module) {
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_checkSolenoidModule
|
||||
(JNIEnv* env, jclass, jint module)
|
||||
{
|
||||
SOLENOIDJNI_LOG(logDEBUG) << "Calling SolenoidJNI checkSolenoidModule";
|
||||
SOLENOIDJNI_LOG(logDEBUG) << "Module = " << module;
|
||||
return HAL_CheckSolenoidModule(module);
|
||||
@@ -82,8 +86,9 @@ JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_checkSolen
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_freeSolenoidPort(
|
||||
JNIEnv *env, jclass, jint id) {
|
||||
Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_freeSolenoidPort
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
SOLENOIDJNI_LOG(logDEBUG) << "Calling SolenoidJNI initializeSolenoidPort";
|
||||
|
||||
SOLENOIDJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_SolenoidHandle)id;
|
||||
@@ -95,12 +100,14 @@ Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_freeSolenoidPort(
|
||||
* Method: setSolenoid
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_setSolenoid(
|
||||
JNIEnv *env, jclass, jint solenoid_port, jboolean value) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_setSolenoid
|
||||
(JNIEnv* env, jclass, jint solenoid_port, jboolean value)
|
||||
{
|
||||
SOLENOIDJNI_LOG(logDEBUG) << "Calling SolenoidJNI SetSolenoid";
|
||||
|
||||
SOLENOIDJNI_LOG(logDEBUG) << "Solenoid Port Handle = "
|
||||
<< (HAL_SolenoidHandle)solenoid_port;
|
||||
SOLENOIDJNI_LOG(logDEBUG)
|
||||
<< "Solenoid Port Handle = " << (HAL_SolenoidHandle)solenoid_port;
|
||||
|
||||
int32_t status = 0;
|
||||
HAL_SetSolenoid((HAL_SolenoidHandle)solenoid_port, value, &status);
|
||||
@@ -113,8 +120,9 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_setSolenoid(
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_getSolenoid(
|
||||
JNIEnv *env, jclass, jint solenoid_port) {
|
||||
Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_getSolenoid
|
||||
(JNIEnv* env, jclass, jint solenoid_port)
|
||||
{
|
||||
int32_t status = 0;
|
||||
jboolean val = HAL_GetSolenoid((HAL_SolenoidHandle)solenoid_port, &status);
|
||||
CheckStatus(env, status);
|
||||
@@ -127,8 +135,9 @@ Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_getSolenoid(
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_getAllSolenoids(
|
||||
JNIEnv *env, jclass, jint module) {
|
||||
Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_getAllSolenoids
|
||||
(JNIEnv* env, jclass, jint module)
|
||||
{
|
||||
int32_t status = 0;
|
||||
jint val = HAL_GetAllSolenoids(module, &status);
|
||||
CheckStatus(env, status);
|
||||
@@ -141,8 +150,9 @@ Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_getAllSolenoids(
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_getPCMSolenoidBlackList(
|
||||
JNIEnv *env, jclass, jint module) {
|
||||
Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_getPCMSolenoidBlackList
|
||||
(JNIEnv* env, jclass, jint module)
|
||||
{
|
||||
int32_t status = 0;
|
||||
jint val = HAL_GetPCMSolenoidBlackList(module, &status);
|
||||
CheckStatus(env, status);
|
||||
@@ -154,8 +164,9 @@ Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_getPCMSolenoidBlackList(
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_getPCMSolenoidVoltageStickyFault(
|
||||
JNIEnv *env, jclass, jint module) {
|
||||
Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_getPCMSolenoidVoltageStickyFault
|
||||
(JNIEnv* env, jclass, jint module)
|
||||
{
|
||||
int32_t status = 0;
|
||||
bool val = HAL_GetPCMSolenoidVoltageStickyFault(module, &status);
|
||||
CheckStatus(env, status);
|
||||
@@ -167,8 +178,9 @@ Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_getPCMSolenoidVoltageStickyFault(
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_getPCMSolenoidVoltageFault(
|
||||
JNIEnv *env, jclass, jint module) {
|
||||
Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_getPCMSolenoidVoltageFault
|
||||
(JNIEnv* env, jclass, jint module)
|
||||
{
|
||||
int32_t status = 0;
|
||||
bool val = HAL_GetPCMSolenoidVoltageFault(module, &status);
|
||||
CheckStatus(env, status);
|
||||
@@ -180,8 +192,9 @@ Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_getPCMSolenoidVoltageFault(
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_clearAllPCMStickyFaults(
|
||||
JNIEnv *env, jclass, jint module) {
|
||||
Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_clearAllPCMStickyFaults
|
||||
(JNIEnv* env, jclass, jint module)
|
||||
{
|
||||
int32_t status = 0;
|
||||
HAL_ClearAllPCMStickyFaults(module, &status);
|
||||
CheckStatus(env, status);
|
||||
@@ -192,17 +205,19 @@ Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_clearAllPCMStickyFaults(
|
||||
* Method: setOneShotDuration
|
||||
* Signature: (IJ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_setOneShotDuration
|
||||
(JNIEnv *env, jclass, jint solenoid_port, jlong durationMS)
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_setOneShotDuration
|
||||
(JNIEnv* env, jclass, jint solenoid_port, jlong durationMS)
|
||||
{
|
||||
SOLENOIDJNI_LOG(logDEBUG) << "Calling SolenoidJNI SetOneShotDuration";
|
||||
|
||||
SOLENOIDJNI_LOG(logDEBUG) << "Solenoid Port Handle = "
|
||||
<< (HAL_SolenoidHandle)solenoid_port;
|
||||
SOLENOIDJNI_LOG(logDEBUG)
|
||||
<< "Solenoid Port Handle = " << (HAL_SolenoidHandle)solenoid_port;
|
||||
SOLENOIDJNI_LOG(logDEBUG) << "Duration (MS) = " << durationMS;
|
||||
|
||||
int32_t status = 0;
|
||||
HAL_SetOneShotDuration((HAL_SolenoidHandle)solenoid_port, durationMS, &status);
|
||||
HAL_SetOneShotDuration((HAL_SolenoidHandle)solenoid_port, durationMS,
|
||||
&status);
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
|
||||
@@ -211,13 +226,14 @@ JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_setOneShotDura
|
||||
* Method: fireOneShot
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_fireOneShot
|
||||
(JNIEnv *env, jclass, jint solenoid_port)
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_fireOneShot
|
||||
(JNIEnv* env, jclass, jint solenoid_port)
|
||||
{
|
||||
SOLENOIDJNI_LOG(logDEBUG) << "Calling SolenoidJNI fireOneShot";
|
||||
|
||||
SOLENOIDJNI_LOG(logDEBUG) << "Solenoid Port Handle = "
|
||||
<< (HAL_SolenoidHandle)solenoid_port;
|
||||
SOLENOIDJNI_LOG(logDEBUG)
|
||||
<< "Solenoid Port Handle = " << (HAL_SolenoidHandle)solenoid_port;
|
||||
|
||||
int32_t status = 0;
|
||||
HAL_FireOneShot((HAL_SolenoidHandle)solenoid_port, &status);
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
||||
/* Copyright (c) 2016-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 <assert.h>
|
||||
#include <jni.h>
|
||||
#include "HAL/cpp/Log.h"
|
||||
|
||||
#include "edu_wpi_first_wpilibj_hal_ThreadsJNI.h"
|
||||
#include <cassert>
|
||||
|
||||
#include "HAL/Threads.h"
|
||||
#include "HAL/cpp/Log.h"
|
||||
#include "HALUtil.h"
|
||||
#include "edu_wpi_first_wpilibj_hal_ThreadsJNI.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
@@ -21,18 +21,20 @@ TLogLevel threadsJNILogLevel = logWARNING;
|
||||
|
||||
#define THREADSJNI_LOG(level) \
|
||||
if (level > threadsJNILogLevel) \
|
||||
; \
|
||||
else \
|
||||
Log().Get(level)
|
||||
; \
|
||||
else \
|
||||
Log().Get(level)
|
||||
|
||||
extern "C" {
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_ThreadsJNI
|
||||
* Method: GetCurrentThreadPriority
|
||||
* Method: getCurrentThreadPriority
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_ThreadsJNI_getCurrentThreadPriority
|
||||
(JNIEnv *env, jclass) {
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_ThreadsJNI_getCurrentThreadPriority
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
THREADSJNI_LOG(logDEBUG) << "Callling GetCurrentThreadPriority";
|
||||
int32_t status = 0;
|
||||
HAL_Bool isRT = false;
|
||||
@@ -43,11 +45,13 @@ JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_ThreadsJNI_getCurrentThrea
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_ThreadsJNI
|
||||
* Method: GetCurrentThreadIsRealTime
|
||||
* Method: getCurrentThreadIsRealTime
|
||||
* Signature: ()Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_ThreadsJNI_getCurrentThreadIsRealTime
|
||||
(JNIEnv *env, jclass) {
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_ThreadsJNI_getCurrentThreadIsRealTime
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
THREADSJNI_LOG(logDEBUG) << "Callling GetCurrentThreadIsRealTime";
|
||||
int32_t status = 0;
|
||||
HAL_Bool isRT = false;
|
||||
@@ -58,16 +62,19 @@ JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_ThreadsJNI_getCurrentT
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_hal_ThreadsJNI
|
||||
* Method: SetCurrentThreadPriority
|
||||
* Method: setCurrentThreadPriority
|
||||
* Signature: (ZI)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_ThreadsJNI_setCurrentThreadPriority
|
||||
(JNIEnv *env, jclass, jboolean realTime, jint priority) {
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_wpilibj_hal_ThreadsJNI_setCurrentThreadPriority
|
||||
(JNIEnv* env, jclass, jboolean realTime, jint priority)
|
||||
{
|
||||
THREADSJNI_LOG(logDEBUG) << "Callling SetCurrentThreadPriority";
|
||||
int32_t status = 0;
|
||||
auto ret = HAL_SetCurrentThreadPriority((HAL_Bool)realTime, (int32_t)priority, &status);
|
||||
auto ret = HAL_SetCurrentThreadPriority(
|
||||
(HAL_Bool)realTime, static_cast<int32_t>(priority), &status);
|
||||
CheckStatus(env, status);
|
||||
return (jboolean)ret;
|
||||
}
|
||||
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
#ifndef __FRC_ROBORIO__
|
||||
|
||||
#include <wpi/StringRef.h>
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include <wpi/StringRef.h>
|
||||
|
||||
#include "MockData/HAL_Value.h"
|
||||
|
||||
namespace frc {
|
||||
|
||||
@@ -13,148 +13,266 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
|
||||
* Method: registerActiveCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_registerActiveCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_registerActiveCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterAccelerometerActiveCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
|
||||
* Method: cancelActiveCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_cancelActiveCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_cancelActiveCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelAccelerometerActiveCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
|
||||
* Method: getActive
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_getActive(JNIEnv*,
|
||||
jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_getActive
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetAccelerometerActive(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
|
||||
* Method: setActive
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_setActive(
|
||||
JNIEnv*, jclass, jint index, jboolean value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_setActive
|
||||
(JNIEnv*, jclass, jint index, jboolean value)
|
||||
{
|
||||
HALSIM_SetAccelerometerActive(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
|
||||
* Method: registerRangeCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_registerRangeCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_registerRangeCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterAccelerometerRangeCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
|
||||
* Method: cancelRangeCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_cancelRangeCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_cancelRangeCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelAccelerometerRangeCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
|
||||
* Method: getRange
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_getRange(JNIEnv*,
|
||||
jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_getRange
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetAccelerometerRange(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
|
||||
* Method: setRange
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_setRange(JNIEnv*,
|
||||
jclass,
|
||||
jint index,
|
||||
jint value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_setRange
|
||||
(JNIEnv*, jclass, jint index, jint value)
|
||||
{
|
||||
HALSIM_SetAccelerometerRange(index,
|
||||
static_cast<HAL_AccelerometerRange>(value));
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
|
||||
* Method: registerXCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_registerXCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_registerXCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterAccelerometerXCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
|
||||
* Method: cancelXCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_cancelXCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_cancelXCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelAccelerometerXCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
|
||||
* Method: getX
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_getX(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_getX
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetAccelerometerX(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
|
||||
* Method: setX
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_setX(JNIEnv*, jclass,
|
||||
jint index,
|
||||
jdouble value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_setX
|
||||
(JNIEnv*, jclass, jint index, jdouble value)
|
||||
{
|
||||
HALSIM_SetAccelerometerX(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
|
||||
* Method: registerYCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_registerYCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_registerYCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterAccelerometerYCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
|
||||
* Method: cancelYCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_cancelYCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_cancelYCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelAccelerometerYCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
|
||||
* Method: getY
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_getY(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_getY
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetAccelerometerY(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
|
||||
* Method: setY
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_setY(JNIEnv*, jclass,
|
||||
jint index,
|
||||
jdouble value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_setY
|
||||
(JNIEnv*, jclass, jint index, jdouble value)
|
||||
{
|
||||
HALSIM_SetAccelerometerY(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
|
||||
* Method: registerZCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_registerZCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_registerZCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterAccelerometerZCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
|
||||
* Method: cancelZCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_cancelZCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_cancelZCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelAccelerometerZCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
|
||||
* Method: getZ
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_getZ(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_getZ
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetAccelerometerZ(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
|
||||
* Method: setZ
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_setZ(JNIEnv*, jclass,
|
||||
jint index,
|
||||
jdouble value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_setZ
|
||||
(JNIEnv*, jclass, jint index, jdouble value)
|
||||
{
|
||||
HALSIM_SetAccelerometerZ(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI
|
||||
* Method: resetData
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_resetData(JNIEnv*,
|
||||
jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AccelerometerDataJNI_resetData
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
HALSIM_ResetAccelerometerData(index);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,89 +13,165 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI
|
||||
* Method: registerAngleCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_registerAngleCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_registerAngleCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterAnalogGyroAngleCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI
|
||||
* Method: cancelAngleCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_cancelAngleCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_cancelAngleCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelAnalogGyroAngleCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI
|
||||
* Method: getAngle
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_getAngle(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_getAngle
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetAnalogGyroAngle(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI
|
||||
* Method: setAngle
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_setAngle(JNIEnv*, jclass,
|
||||
jint index,
|
||||
jdouble value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_setAngle
|
||||
(JNIEnv*, jclass, jint index, jdouble value)
|
||||
{
|
||||
HALSIM_SetAnalogGyroAngle(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI
|
||||
* Method: registerRateCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_registerRateCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_registerRateCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterAnalogGyroRateCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI
|
||||
* Method: cancelRateCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_cancelRateCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_cancelRateCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelAnalogGyroRateCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI
|
||||
* Method: getRate
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_getRate(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_getRate
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetAnalogGyroRate(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI
|
||||
* Method: setRate
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_setRate(JNIEnv*, jclass,
|
||||
jint index,
|
||||
jdouble value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_setRate
|
||||
(JNIEnv*, jclass, jint index, jdouble value)
|
||||
{
|
||||
HALSIM_SetAnalogGyroRate(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI
|
||||
* Method: registerInitializedCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_registerInitializedCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_registerInitializedCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterAnalogGyroInitializedCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI
|
||||
* Method: cancelInitializedCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_cancelInitializedCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_cancelInitializedCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelAnalogGyroInitializedCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI
|
||||
* Method: getInitialized
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_getInitialized(
|
||||
JNIEnv*, jclass, jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_getInitialized
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetAnalogGyroInitialized(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI
|
||||
* Method: setInitialized
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_setInitialized(
|
||||
JNIEnv*, jclass, jint index, jboolean value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_setInitialized
|
||||
(JNIEnv*, jclass, jint index, jboolean value)
|
||||
{
|
||||
HALSIM_SetAnalogGyroInitialized(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI
|
||||
* Method: resetData
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_resetData(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogGyroDataJNI_resetData
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
HALSIM_ResetAnalogGyroData(index);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,253 +13,470 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: registerInitializedCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_registerInitializedCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_registerInitializedCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterAnalogInInitializedCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: cancelInitializedCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_cancelInitializedCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_cancelInitializedCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelAnalogInInitializedCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: getInitialized
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_getInitialized(JNIEnv*,
|
||||
jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_getInitialized
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetAnalogInInitialized(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: setInitialized
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_setInitialized(
|
||||
JNIEnv*, jclass, jint index, jboolean value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_setInitialized
|
||||
(JNIEnv*, jclass, jint index, jboolean value)
|
||||
{
|
||||
HALSIM_SetAnalogInInitialized(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: registerAverageBitsCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_registerAverageBitsCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_registerAverageBitsCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterAnalogInAverageBitsCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: cancelAverageBitsCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_cancelAverageBitsCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_cancelAverageBitsCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelAnalogInAverageBitsCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: getAverageBits
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_getAverageBits(JNIEnv*,
|
||||
jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_getAverageBits
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetAnalogInAverageBits(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: setAverageBits
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_setAverageBits(JNIEnv*,
|
||||
jclass,
|
||||
jint index,
|
||||
jint value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_setAverageBits
|
||||
(JNIEnv*, jclass, jint index, jint value)
|
||||
{
|
||||
HALSIM_SetAnalogInAverageBits(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: registerOversampleBitsCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_registerOversampleBitsCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_registerOversampleBitsCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterAnalogInOversampleBitsCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: cancelOversampleBitsCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_cancelOversampleBitsCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_cancelOversampleBitsCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelAnalogInOversampleBitsCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: getOversampleBits
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_getOversampleBits(
|
||||
JNIEnv*, jclass, jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_getOversampleBits
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetAnalogInOversampleBits(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: setOversampleBits
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_setOversampleBits(
|
||||
JNIEnv*, jclass, jint index, jint value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_setOversampleBits
|
||||
(JNIEnv*, jclass, jint index, jint value)
|
||||
{
|
||||
HALSIM_SetAnalogInOversampleBits(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: registerVoltageCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_registerVoltageCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_registerVoltageCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterAnalogInVoltageCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: cancelVoltageCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_cancelVoltageCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_cancelVoltageCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelAnalogInVoltageCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: getVoltage
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_getVoltage(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_getVoltage
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetAnalogInVoltage(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: setVoltage
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_setVoltage(JNIEnv*, jclass,
|
||||
jint index,
|
||||
jdouble value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_setVoltage
|
||||
(JNIEnv*, jclass, jint index, jdouble value)
|
||||
{
|
||||
HALSIM_SetAnalogInVoltage(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: registerAccumulatorInitializedCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_registerAccumulatorInitializedCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_registerAccumulatorInitializedCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(
|
||||
env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterAnalogInAccumulatorInitializedCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: cancelAccumulatorInitializedCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_cancelAccumulatorInitializedCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_cancelAccumulatorInitializedCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(
|
||||
env, handle, index, &HALSIM_CancelAnalogInAccumulatorInitializedCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: getAccumulatorInitialized
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_getAccumulatorInitialized(
|
||||
JNIEnv*, jclass, jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_getAccumulatorInitialized
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetAnalogInAccumulatorInitialized(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: setAccumulatorInitialized
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_setAccumulatorInitialized(
|
||||
JNIEnv*, jclass, jint index, jboolean value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_setAccumulatorInitialized
|
||||
(JNIEnv*, jclass, jint index, jboolean value)
|
||||
{
|
||||
HALSIM_SetAnalogInAccumulatorInitialized(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: registerAccumulatorValueCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_registerAccumulatorValueCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_registerAccumulatorValueCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(
|
||||
env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterAnalogInAccumulatorValueCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: cancelAccumulatorValueCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_cancelAccumulatorValueCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_cancelAccumulatorValueCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelAnalogInAccumulatorValueCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: getAccumulatorValue
|
||||
* Signature: (I)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_getAccumulatorValue(
|
||||
JNIEnv*, jclass, jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_getAccumulatorValue
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetAnalogInAccumulatorValue(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: setAccumulatorValue
|
||||
* Signature: (IJ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_setAccumulatorValue(
|
||||
JNIEnv*, jclass, jint index, jlong value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_setAccumulatorValue
|
||||
(JNIEnv*, jclass, jint index, jlong value)
|
||||
{
|
||||
HALSIM_SetAnalogInAccumulatorValue(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: registerAccumulatorCountCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_registerAccumulatorCountCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_registerAccumulatorCountCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(
|
||||
env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterAnalogInAccumulatorCountCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: cancelAccumulatorCountCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_cancelAccumulatorCountCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_cancelAccumulatorCountCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelAnalogInAccumulatorCountCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: getAccumulatorCount
|
||||
* Signature: (I)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_getAccumulatorCount(
|
||||
JNIEnv*, jclass, jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_getAccumulatorCount
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetAnalogInAccumulatorCount(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: setAccumulatorCount
|
||||
* Signature: (IJ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_setAccumulatorCount(
|
||||
JNIEnv*, jclass, jint index, jlong value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_setAccumulatorCount
|
||||
(JNIEnv*, jclass, jint index, jlong value)
|
||||
{
|
||||
HALSIM_SetAnalogInAccumulatorCount(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: registerAccumulatorCenterCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_registerAccumulatorCenterCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_registerAccumulatorCenterCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(
|
||||
env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterAnalogInAccumulatorCenterCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: cancelAccumulatorCenterCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_cancelAccumulatorCenterCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_cancelAccumulatorCenterCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelAnalogInAccumulatorCenterCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: getAccumulatorCenter
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_getAccumulatorCenter(
|
||||
JNIEnv*, jclass, jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_getAccumulatorCenter
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetAnalogInAccumulatorCenter(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: setAccumulatorCenter
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_setAccumulatorCenter(
|
||||
JNIEnv*, jclass, jint index, jint value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_setAccumulatorCenter
|
||||
(JNIEnv*, jclass, jint index, jint value)
|
||||
{
|
||||
HALSIM_SetAnalogInAccumulatorCenter(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: registerAccumulatorDeadbandCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_registerAccumulatorDeadbandCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_registerAccumulatorDeadbandCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(
|
||||
env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterAnalogInAccumulatorDeadbandCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: cancelAccumulatorDeadbandCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_cancelAccumulatorDeadbandCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_cancelAccumulatorDeadbandCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelAnalogInAccumulatorDeadbandCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: getAccumulatorDeadband
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_getAccumulatorDeadband(
|
||||
JNIEnv*, jclass, jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_getAccumulatorDeadband
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetAnalogInAccumulatorDeadband(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: setAccumulatorDeadband
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_setAccumulatorDeadband(
|
||||
JNIEnv*, jclass, jint index, jint value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_setAccumulatorDeadband
|
||||
(JNIEnv*, jclass, jint index, jint value)
|
||||
{
|
||||
HALSIM_SetAnalogInAccumulatorDeadband(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI
|
||||
* Method: resetData
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_resetData(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogInDataJNI_resetData
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
HALSIM_ResetAnalogInData(index);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,62 +13,115 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI
|
||||
* Method: registerVoltageCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI_registerVoltageCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI_registerVoltageCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterAnalogOutVoltageCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI
|
||||
* Method: cancelVoltageCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI_cancelVoltageCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI_cancelVoltageCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelAnalogOutVoltageCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI
|
||||
* Method: getVoltage
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI_getVoltage(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI_getVoltage
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetAnalogOutVoltage(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI
|
||||
* Method: setVoltage
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI_setVoltage(JNIEnv*, jclass,
|
||||
jint index,
|
||||
jdouble value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI_setVoltage
|
||||
(JNIEnv*, jclass, jint index, jdouble value)
|
||||
{
|
||||
HALSIM_SetAnalogOutVoltage(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI
|
||||
* Method: registerInitializedCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI_registerInitializedCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI_registerInitializedCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterAnalogOutInitializedCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI
|
||||
* Method: cancelInitializedCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI_cancelInitializedCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI_cancelInitializedCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelAnalogOutInitializedCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI
|
||||
* Method: getInitialized
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI_getInitialized(
|
||||
JNIEnv*, jclass, jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI_getInitialized
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetAnalogOutInitialized(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI
|
||||
* Method: setInitialized
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI_setInitialized(
|
||||
JNIEnv*, jclass, jint index, jboolean value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI_setInitialized
|
||||
(JNIEnv*, jclass, jint index, jboolean value)
|
||||
{
|
||||
HALSIM_SetAnalogOutInitialized(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI
|
||||
* Method: resetData
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI_resetData(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogOutDataJNI_resetData
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
HALSIM_ResetAnalogOutData(index);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,91 +13,168 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI
|
||||
* Method: registerInitializedCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_registerInitializedCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_registerInitializedCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(
|
||||
env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterAnalogTriggerInitializedCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI
|
||||
* Method: cancelInitializedCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_cancelInitializedCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_cancelInitializedCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelAnalogTriggerInitializedCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI
|
||||
* Method: getInitialized
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_getInitialized(
|
||||
JNIEnv*, jclass, jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_getInitialized
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetAnalogTriggerInitialized(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI
|
||||
* Method: setInitialized
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_setInitialized(
|
||||
JNIEnv*, jclass, jint index, jboolean value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_setInitialized
|
||||
(JNIEnv*, jclass, jint index, jboolean value)
|
||||
{
|
||||
HALSIM_SetAnalogTriggerInitialized(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI
|
||||
* Method: registerTriggerLowerBoundCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_registerTriggerLowerBoundCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_registerTriggerLowerBoundCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(
|
||||
env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterAnalogTriggerTriggerLowerBoundCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI
|
||||
* Method: cancelTriggerLowerBoundCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_cancelTriggerLowerBoundCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_cancelTriggerLowerBoundCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(
|
||||
env, handle, index, &HALSIM_CancelAnalogTriggerTriggerLowerBoundCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI
|
||||
* Method: getTriggerLowerBound
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_getTriggerLowerBound(
|
||||
JNIEnv*, jclass, jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_getTriggerLowerBound
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetAnalogTriggerTriggerLowerBound(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI
|
||||
* Method: setTriggerLowerBound
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_setTriggerLowerBound(
|
||||
JNIEnv*, jclass, jint index, jdouble value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_setTriggerLowerBound
|
||||
(JNIEnv*, jclass, jint index, jdouble value)
|
||||
{
|
||||
HALSIM_SetAnalogTriggerTriggerLowerBound(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI
|
||||
* Method: registerTriggerUpperBoundCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_registerTriggerUpperBoundCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_registerTriggerUpperBoundCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(
|
||||
env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterAnalogTriggerTriggerUpperBoundCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI
|
||||
* Method: cancelTriggerUpperBoundCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_cancelTriggerUpperBoundCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_cancelTriggerUpperBoundCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(
|
||||
env, handle, index, &HALSIM_CancelAnalogTriggerTriggerUpperBoundCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI
|
||||
* Method: getTriggerUpperBound
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_getTriggerUpperBound(
|
||||
JNIEnv*, jclass, jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_getTriggerUpperBound
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetAnalogTriggerTriggerUpperBound(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI
|
||||
* Method: setTriggerUpperBound
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_setTriggerUpperBound(
|
||||
JNIEnv*, jclass, jint index, jdouble value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_setTriggerUpperBound
|
||||
(JNIEnv*, jclass, jint index, jdouble value)
|
||||
{
|
||||
HALSIM_SetAnalogTriggerTriggerUpperBound(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI
|
||||
* Method: resetData
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_resetData(JNIEnv*,
|
||||
jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_AnalogTriggerDataJNI_resetData
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
HALSIM_ResetAnalogTriggerData(index);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "BufferCallbackStore.h"
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#include <wpi/jni_util.h>
|
||||
|
||||
#include "HAL/Types.h"
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#include <wpi/jni_util.h>
|
||||
|
||||
#include "HAL/Types.h"
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "CallbackStore.h"
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#include <wpi/jni_util.h>
|
||||
|
||||
#include "HAL/Types.h"
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#include <wpi/jni_util.h>
|
||||
|
||||
#include "HAL/Types.h"
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "ConstBufferCallbackStore.h"
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#include <wpi/jni_util.h>
|
||||
|
||||
#include "HAL/Types.h"
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#include <wpi/jni_util.h>
|
||||
|
||||
#include "HAL/Types.h"
|
||||
|
||||
@@ -13,140 +13,264 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
|
||||
* Method: registerInitializedCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_registerInitializedCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_registerInitializedCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterDIOInitializedCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
|
||||
* Method: cancelInitializedCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_cancelInitializedCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_cancelInitializedCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelDIOInitializedCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
|
||||
* Method: getInitialized
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_getInitialized(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_getInitialized
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetDIOInitialized(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
|
||||
* Method: setInitialized
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_setInitialized(JNIEnv*, jclass,
|
||||
jint index,
|
||||
jboolean value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_setInitialized
|
||||
(JNIEnv*, jclass, jint index, jboolean value)
|
||||
{
|
||||
HALSIM_SetDIOInitialized(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
|
||||
* Method: registerValueCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_registerValueCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_registerValueCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterDIOValueCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
|
||||
* Method: cancelValueCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_cancelValueCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_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
|
||||
* Method: getValue
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_getValue(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_getValue
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetDIOValue(index);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_setValue(
|
||||
JNIEnv*, jclass, jint index, jboolean value) {
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
|
||||
* Method: setValue
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_setValue
|
||||
(JNIEnv*, jclass, jint index, jboolean value)
|
||||
{
|
||||
HALSIM_SetDIOValue(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
|
||||
* Method: registerPulseLengthCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_registerPulseLengthCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_registerPulseLengthCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterDIOPulseLengthCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
|
||||
* Method: cancelPulseLengthCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_cancelPulseLengthCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_cancelPulseLengthCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelDIOPulseLengthCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
|
||||
* Method: getPulseLength
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_getPulseLength(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_getPulseLength
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetDIOPulseLength(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
|
||||
* Method: setPulseLength
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_setPulseLength(JNIEnv*, jclass,
|
||||
jint index,
|
||||
jdouble value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_setPulseLength
|
||||
(JNIEnv*, jclass, jint index, jdouble value)
|
||||
{
|
||||
HALSIM_SetDIOPulseLength(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
|
||||
* Method: registerIsInputCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_registerIsInputCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_registerIsInputCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterDIOIsInputCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
|
||||
* Method: cancelIsInputCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_cancelIsInputCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_cancelIsInputCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelDIOIsInputCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
|
||||
* Method: getIsInput
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_getIsInput(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_getIsInput
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetDIOIsInput(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
|
||||
* Method: setIsInput
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_setIsInput(JNIEnv*, jclass,
|
||||
jint index,
|
||||
jboolean value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_setIsInput
|
||||
(JNIEnv*, jclass, jint index, jboolean value)
|
||||
{
|
||||
HALSIM_SetDIOIsInput(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
|
||||
* Method: registerFilterIndexCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_registerFilterIndexCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_registerFilterIndexCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterDIOFilterIndexCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
|
||||
* Method: cancelFilterIndexCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_cancelFilterIndexCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_cancelFilterIndexCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelDIOFilterIndexCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
|
||||
* Method: getFilterIndex
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_getFilterIndex(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_getFilterIndex
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetDIOFilterIndex(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
|
||||
* Method: setFilterIndex
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_setFilterIndex(JNIEnv*, jclass,
|
||||
jint index,
|
||||
jint value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_setFilterIndex
|
||||
(JNIEnv*, jclass, jint index, jint value)
|
||||
{
|
||||
HALSIM_SetDIOFilterIndex(index, value);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_resetData(
|
||||
JNIEnv*, jclass, jint index) {
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DIODataJNI
|
||||
* Method: resetData
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DIODataJNI_resetData
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
HALSIM_ResetDIOData(index);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,89 +13,165 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI
|
||||
* Method: registerInitializedCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_registerInitializedCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_registerInitializedCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterDigitalPWMInitializedCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI
|
||||
* Method: cancelInitializedCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_cancelInitializedCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_cancelInitializedCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelDigitalPWMInitializedCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI
|
||||
* Method: getInitialized
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_getInitialized(
|
||||
JNIEnv*, jclass, jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_getInitialized
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetDigitalPWMInitialized(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI
|
||||
* Method: setInitialized
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_setInitialized(
|
||||
JNIEnv*, jclass, jint index, jboolean value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_setInitialized
|
||||
(JNIEnv*, jclass, jint index, jboolean value)
|
||||
{
|
||||
HALSIM_SetDigitalPWMInitialized(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI
|
||||
* Method: registerDutyCycleCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_registerDutyCycleCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_registerDutyCycleCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterDigitalPWMDutyCycleCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI
|
||||
* Method: cancelDutyCycleCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_cancelDutyCycleCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_cancelDutyCycleCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelDigitalPWMDutyCycleCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI
|
||||
* Method: getDutyCycle
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_getDutyCycle(JNIEnv*,
|
||||
jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_getDutyCycle
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetDigitalPWMDutyCycle(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI
|
||||
* Method: setDutyCycle
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_setDutyCycle(
|
||||
JNIEnv*, jclass, jint index, jdouble value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_setDutyCycle
|
||||
(JNIEnv*, jclass, jint index, jdouble value)
|
||||
{
|
||||
HALSIM_SetDigitalPWMDutyCycle(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI
|
||||
* Method: registerPinCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_registerPinCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_registerPinCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterDigitalPWMPinCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI
|
||||
* Method: cancelPinCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_cancelPinCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_cancelPinCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelDigitalPWMPinCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI
|
||||
* Method: getPin
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_getPin(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_getPin
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetDigitalPWMPin(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI
|
||||
* Method: setPin
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_setPin(JNIEnv*, jclass,
|
||||
jint index,
|
||||
jint value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_setPin
|
||||
(JNIEnv*, jclass, jint index, jint value)
|
||||
{
|
||||
HALSIM_SetDigitalPWMPin(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI
|
||||
* Method: resetData
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_resetData(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DigitalPWMDataJNI_resetData
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
HALSIM_ResetDigitalPWMData(index);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,174 +13,319 @@
|
||||
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_setDsAttached
|
||||
(JNIEnv*, jclass, jboolean value)
|
||||
{
|
||||
HALSIM_SetDriverStationDsAttached(value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DriverStationSim
|
||||
* 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) {
|
||||
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);
|
||||
@@ -198,13 +343,14 @@ Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_setJoystickAxes(
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DriverStationSim
|
||||
* 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) {
|
||||
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);
|
||||
@@ -222,13 +368,14 @@ Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_setJoystickPOVs(
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DriverStationSim
|
||||
* 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) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_setJoystickButtons
|
||||
(JNIEnv* env, jclass, jbyte joystickNum, jint buttons, jint count)
|
||||
{
|
||||
if (count > 32) {
|
||||
count = 32;
|
||||
}
|
||||
@@ -239,22 +386,24 @@ Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_setJoystickButtons(
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DriverStationSim
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
|
||||
* Method: setMatchInfo
|
||||
* Signature: (Ledu/wpi/first/wpilibj/hal/MatchInfoData;)V
|
||||
* Signature: (Ljava/lang/Object;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_setMatchInfo(
|
||||
JNIEnv* env, jclass, jobject info) {}
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_setMatchInfo
|
||||
(JNIEnv* env, jclass, jobject info)
|
||||
{}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DriverStationSim
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI
|
||||
* Method: registerAllCallbacks
|
||||
* Signature: (Ledu/wpi/first/hal/sim/NotifyCallback;Z)V
|
||||
* 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) {
|
||||
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) {
|
||||
@@ -264,19 +413,26 @@ Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_registerAllCallbacks(
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_DriverStationSim
|
||||
* 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) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_notifyNewData
|
||||
(JNIEnv*, jclass)
|
||||
{
|
||||
HALSIM_NotifyDriverStationNewData();
|
||||
}
|
||||
|
||||
/*
|
||||
* 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) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_DriverStationDataJNI_resetData
|
||||
(JNIEnv*, jclass)
|
||||
{
|
||||
HALSIM_ResetDriverStationData();
|
||||
}
|
||||
|
||||
|
||||
@@ -13,222 +13,415 @@
|
||||
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_EncoderDataJNI_resetData
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
HALSIM_ResetEncoderData(index);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,108 +16,115 @@
|
||||
extern "C" {
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_I2CSim
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_I2CDataJNI
|
||||
* Method: registerInitializedCallback
|
||||
* Signature: (ILedu/wpi/first/hal/sim/NotifyCallback;Z)I
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_I2CDataJNI_registerInitializedCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_I2CDataJNI_registerInitializedCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterI2CInitializedCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_I2CSim
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_I2CDataJNI
|
||||
* Method: cancelInitializedCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_I2CDataJNI_cancelInitializedCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_I2CDataJNI_cancelInitializedCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelI2CInitializedCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_I2CSim
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_I2CDataJNI
|
||||
* Method: getInitialized
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_I2CDataJNI_getInitialized(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_I2CDataJNI_getInitialized
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetI2CInitialized(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_I2CSim
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_I2CDataJNI
|
||||
* Method: setInitialized
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_I2CDataJNI_setInitialized(JNIEnv*, jclass,
|
||||
jint index,
|
||||
jboolean value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_I2CDataJNI_setInitialized
|
||||
(JNIEnv*, jclass, jint index, jboolean value)
|
||||
{
|
||||
HALSIM_SetI2CInitialized(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_I2CSim
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_I2CDataJNI
|
||||
* Method: registerReadCallback
|
||||
* Signature: (ILedu/wpi/first/hal/sim/BufferCallback;)I
|
||||
* Signature: (ILjava/lang/Object;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_I2CDataJNI_registerReadCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_I2CDataJNI_registerReadCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback)
|
||||
{
|
||||
return sim::AllocateBufferCallback(env, index, callback,
|
||||
&HALSIM_RegisterI2CReadCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_I2CSim
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_I2CDataJNI
|
||||
* Method: cancelReadCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_I2CDataJNI_cancelReadCallback(JNIEnv* env,
|
||||
jclass,
|
||||
jint index,
|
||||
jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_I2CDataJNI_cancelReadCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
sim::FreeBufferCallback(env, handle, index, &HALSIM_CancelI2CReadCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_I2CSim
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_I2CDataJNI
|
||||
* Method: registerWriteCallback
|
||||
* Signature: (ILedu/wpi/first/hal/sim/ConstBufferCallback;)I
|
||||
* Signature: (ILjava/lang/Object;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_I2CDataJNI_registerWriteCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_I2CDataJNI_registerWriteCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback)
|
||||
{
|
||||
return sim::AllocateConstBufferCallback(env, index, callback,
|
||||
&HALSIM_RegisterI2CWriteCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_I2CSim
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_I2CDataJNI
|
||||
* Method: cancelWriteCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_I2CDataJNI_cancelWriteCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_I2CDataJNI_cancelWriteCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
sim::FreeConstBufferCallback(env, handle, index,
|
||||
&HALSIM_CancelI2CWriteCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_I2CSim
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_I2CDataJNI
|
||||
* Method: resetData
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_hal_sim_mockdata_I2CDataJNI_resetData(
|
||||
JNIEnv*, jclass, jint index) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_I2CDataJNI_resetData
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
HALSIM_ResetI2CData(index);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,205 +13,370 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
|
||||
* Method: registerSolenoidInitializedCallback
|
||||
* Signature: (IILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_registerSolenoidInitializedCallback(
|
||||
JNIEnv* env, jclass, jint index, jint channel, jobject callback,
|
||||
jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_registerSolenoidInitializedCallback
|
||||
(JNIEnv* env, jclass, jint index, jint channel, jobject callback,
|
||||
jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateChannelCallback(
|
||||
env, index, channel, callback, initialNotify,
|
||||
&HALSIM_RegisterPCMSolenoidInitializedCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
|
||||
* Method: cancelSolenoidInitializedCallback
|
||||
* Signature: (III)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_cancelSolenoidInitializedCallback(
|
||||
JNIEnv* env, jclass, jint index, jint channel, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_cancelSolenoidInitializedCallback
|
||||
(JNIEnv* env, jclass, jint index, jint channel, jint handle)
|
||||
{
|
||||
return sim::FreeChannelCallback(env, handle, index, channel,
|
||||
&HALSIM_CancelPCMSolenoidInitializedCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
|
||||
* Method: getSolenoidInitialized
|
||||
* Signature: (II)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_getSolenoidInitialized(
|
||||
JNIEnv*, jclass, jint index, jint channel) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_getSolenoidInitialized
|
||||
(JNIEnv*, jclass, jint index, jint channel)
|
||||
{
|
||||
return HALSIM_GetPCMSolenoidInitialized(index, channel);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
|
||||
* Method: setSolenoidInitialized
|
||||
* Signature: (IIZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_setSolenoidInitialized(
|
||||
JNIEnv*, jclass, jint index, jint channel, jboolean value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_setSolenoidInitialized
|
||||
(JNIEnv*, jclass, jint index, jint channel, jboolean value)
|
||||
{
|
||||
HALSIM_SetPCMSolenoidInitialized(index, channel, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
|
||||
* Method: registerSolenoidOutputCallback
|
||||
* Signature: (IILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_registerSolenoidOutputCallback(
|
||||
JNIEnv* env, jclass, jint index, jint channel, jobject callback,
|
||||
jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_registerSolenoidOutputCallback
|
||||
(JNIEnv* env, jclass, jint index, jint channel, jobject callback,
|
||||
jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateChannelCallback(
|
||||
env, index, channel, callback, initialNotify,
|
||||
&HALSIM_RegisterPCMSolenoidOutputCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
|
||||
* Method: cancelSolenoidOutputCallback
|
||||
* Signature: (III)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_cancelSolenoidOutputCallback(
|
||||
JNIEnv* env, jclass, jint index, jint channel, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_cancelSolenoidOutputCallback
|
||||
(JNIEnv* env, jclass, jint index, jint channel, jint handle)
|
||||
{
|
||||
return sim::FreeChannelCallback(env, handle, index, channel,
|
||||
&HALSIM_CancelPCMSolenoidOutputCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
|
||||
* Method: getSolenoidOutput
|
||||
* Signature: (II)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_getSolenoidOutput(JNIEnv*,
|
||||
jclass,
|
||||
jint index,
|
||||
jint channel) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_getSolenoidOutput
|
||||
(JNIEnv*, jclass, jint index, jint channel)
|
||||
{
|
||||
return HALSIM_GetPCMSolenoidOutput(index, channel);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
|
||||
* Method: setSolenoidOutput
|
||||
* Signature: (IIZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_setSolenoidOutput(
|
||||
JNIEnv*, jclass, jint index, jint channel, jboolean value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_setSolenoidOutput
|
||||
(JNIEnv*, jclass, jint index, jint channel, jboolean value)
|
||||
{
|
||||
HALSIM_SetPCMSolenoidOutput(index, channel, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
|
||||
* Method: registerCompressorInitializedCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_registerCompressorInitializedCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_registerCompressorInitializedCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(
|
||||
env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterPCMCompressorInitializedCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
|
||||
* Method: cancelCompressorInitializedCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_cancelCompressorInitializedCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_cancelCompressorInitializedCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelPCMCompressorInitializedCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
|
||||
* Method: getCompressorInitialized
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_getCompressorInitialized(
|
||||
JNIEnv*, jclass, jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_getCompressorInitialized
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetPCMCompressorInitialized(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
|
||||
* Method: setCompressorInitialized
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_setCompressorInitialized(
|
||||
JNIEnv*, jclass, jint index, jboolean value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_setCompressorInitialized
|
||||
(JNIEnv*, jclass, jint index, jboolean value)
|
||||
{
|
||||
HALSIM_SetPCMCompressorInitialized(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
|
||||
* Method: registerCompressorOnCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_registerCompressorOnCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_registerCompressorOnCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterPCMCompressorOnCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
|
||||
* Method: cancelCompressorOnCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_cancelCompressorOnCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_cancelCompressorOnCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelPCMCompressorOnCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
|
||||
* Method: getCompressorOn
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_getCompressorOn(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_getCompressorOn
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetPCMCompressorOn(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
|
||||
* Method: setCompressorOn
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_setCompressorOn(JNIEnv*, jclass,
|
||||
jint index,
|
||||
jboolean value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_setCompressorOn
|
||||
(JNIEnv*, jclass, jint index, jboolean value)
|
||||
{
|
||||
HALSIM_SetPCMCompressorOn(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
|
||||
* Method: registerClosedLoopEnabledCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_registerClosedLoopEnabledCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_registerClosedLoopEnabledCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterPCMClosedLoopEnabledCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
|
||||
* Method: cancelClosedLoopEnabledCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_cancelClosedLoopEnabledCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_cancelClosedLoopEnabledCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelPCMClosedLoopEnabledCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
|
||||
* Method: getClosedLoopEnabled
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_getClosedLoopEnabled(
|
||||
JNIEnv*, jclass, jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_getClosedLoopEnabled
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetPCMClosedLoopEnabled(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
|
||||
* Method: setClosedLoopEnabled
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_setClosedLoopEnabled(
|
||||
JNIEnv*, jclass, jint index, jboolean value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_setClosedLoopEnabled
|
||||
(JNIEnv*, jclass, jint index, jboolean value)
|
||||
{
|
||||
HALSIM_SetPCMClosedLoopEnabled(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
|
||||
* Method: registerPressureSwitchCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_registerPressureSwitchCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_registerPressureSwitchCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterPCMPressureSwitchCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
|
||||
* Method: cancelPressureSwitchCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_cancelPressureSwitchCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_cancelPressureSwitchCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelPCMPressureSwitchCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
|
||||
* Method: getPressureSwitch
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_getPressureSwitch(JNIEnv*,
|
||||
jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_getPressureSwitch
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetPCMPressureSwitch(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
|
||||
* Method: setPressureSwitch
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_setPressureSwitch(
|
||||
JNIEnv*, jclass, jint index, jboolean value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_setPressureSwitch
|
||||
(JNIEnv*, jclass, jint index, jboolean value)
|
||||
{
|
||||
HALSIM_SetPCMPressureSwitch(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
|
||||
* Method: registerCompressorCurrentCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_registerCompressorCurrentCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_registerCompressorCurrentCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterPCMCompressorCurrentCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
|
||||
* Method: cancelCompressorCurrentCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_cancelCompressorCurrentCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_cancelCompressorCurrentCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelPCMCompressorCurrentCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
|
||||
* Method: getCompressorCurrent
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_getCompressorCurrent(
|
||||
JNIEnv*, jclass, jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_getCompressorCurrent
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetPCMCompressorCurrent(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
|
||||
* Method: setCompressorCurrent
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_setCompressorCurrent(
|
||||
JNIEnv*, jclass, jint index, jdouble value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_setCompressorCurrent
|
||||
(JNIEnv*, jclass, jint index, jdouble value)
|
||||
{
|
||||
HALSIM_SetPCMCompressorCurrent(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMSim
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
|
||||
* Method: registerAllNonSolenoidCallbacks
|
||||
* Signature: (ILedu/wpi/first/hal/sim/NotifyCallback;Z)V
|
||||
* Signature: (ILjava/lang/Object;Z)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_registerAllNonSolenoidCallbacks(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_registerAllNonSolenoidCallbacks
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
sim::AllocateCallback(
|
||||
env, index, callback, initialNotify,
|
||||
[](int32_t index, HAL_NotifyCallback cb, void* param, HAL_Bool in) {
|
||||
@@ -221,14 +386,15 @@ Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_registerAllNonSolenoidCallbacks(
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMSim
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
|
||||
* Method: registerAllSolenoidCallbacks
|
||||
* Signature: (IILedu/wpi/first/hal/sim/NotifyCallback;Z)V
|
||||
* Signature: (IILjava/lang/Object;Z)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_registerAllSolenoidCallbacks(
|
||||
JNIEnv* env, jclass, jint index, jint channel, jobject callback,
|
||||
jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_registerAllSolenoidCallbacks
|
||||
(JNIEnv* env, jclass, jint index, jint channel, jobject callback,
|
||||
jboolean initialNotify)
|
||||
{
|
||||
sim::AllocateChannelCallback(
|
||||
env, index, channel, callback, initialNotify,
|
||||
[](int32_t index, int32_t channel, HAL_NotifyCallback cb, void* param,
|
||||
@@ -238,8 +404,15 @@ Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_registerAllSolenoidCallbacks(
|
||||
});
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_resetData(
|
||||
JNIEnv*, jclass, jint index) {
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PCMDataJNI
|
||||
* Method: resetData
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PCMDataJNI_resetData
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
HALSIM_ResetPCMData(index);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,120 +13,217 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
|
||||
* Method: registerInitializedCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_registerInitializedCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_registerInitializedCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterPDPInitializedCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
|
||||
* Method: cancelInitializedCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_cancelInitializedCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_cancelInitializedCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelPDPInitializedCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
|
||||
* Method: getInitialized
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_getInitialized(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_getInitialized
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetPDPInitialized(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
|
||||
* Method: setInitialized
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_setInitialized(JNIEnv*, jclass,
|
||||
jint index,
|
||||
jboolean value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_setInitialized
|
||||
(JNIEnv*, jclass, jint index, jboolean value)
|
||||
{
|
||||
HALSIM_SetPDPInitialized(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
|
||||
* Method: registerTemperatureCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_registerTemperatureCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_registerTemperatureCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterPDPTemperatureCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
|
||||
* Method: cancelTemperatureCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_cancelTemperatureCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_cancelTemperatureCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelPDPTemperatureCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
|
||||
* Method: getTemperature
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_getTemperature(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_getTemperature
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetPDPTemperature(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
|
||||
* Method: setTemperature
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_setTemperature(JNIEnv*, jclass,
|
||||
jint index,
|
||||
jdouble value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_setTemperature
|
||||
(JNIEnv*, jclass, jint index, jdouble value)
|
||||
{
|
||||
HALSIM_SetPDPTemperature(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
|
||||
* Method: registerVoltageCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_registerVoltageCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_registerVoltageCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterPDPVoltageCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
|
||||
* Method: cancelVoltageCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_cancelVoltageCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_cancelVoltageCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelPDPVoltageCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
|
||||
* Method: getVoltage
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_getVoltage(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_getVoltage
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetPDPVoltage(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
|
||||
* Method: setVoltage
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_setVoltage(JNIEnv*, jclass,
|
||||
jint index,
|
||||
jdouble value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_setVoltage
|
||||
(JNIEnv*, jclass, jint index, jdouble value)
|
||||
{
|
||||
HALSIM_SetPDPVoltage(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
|
||||
* Method: registerCurrentCallback
|
||||
* Signature: (IILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_registerCurrentCallback(
|
||||
JNIEnv* env, jclass, jint index, jint channel, jobject callback,
|
||||
jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_registerCurrentCallback
|
||||
(JNIEnv* env, jclass, jint index, jint channel, jobject callback,
|
||||
jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateChannelCallback(env, index, channel, callback,
|
||||
initialNotify,
|
||||
&HALSIM_RegisterPDPCurrentCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
|
||||
* Method: cancelCurrentCallback
|
||||
* Signature: (III)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_cancelCurrentCallback(
|
||||
JNIEnv* env, jclass, jint index, jint channel, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_cancelCurrentCallback
|
||||
(JNIEnv* env, jclass, jint index, jint channel, jint handle)
|
||||
{
|
||||
return sim::FreeChannelCallback(env, handle, index, channel,
|
||||
&HALSIM_CancelPDPCurrentCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
|
||||
* Method: getCurrent
|
||||
* Signature: (II)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_getCurrent(JNIEnv*, jclass,
|
||||
jint index,
|
||||
jint channel) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_getCurrent
|
||||
(JNIEnv*, jclass, jint index, jint channel)
|
||||
{
|
||||
return HALSIM_GetPDPCurrent(index, channel);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
|
||||
* Method: setCurrent
|
||||
* Signature: (IID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_setCurrent(JNIEnv*, jclass,
|
||||
jint index,
|
||||
jint channel,
|
||||
jdouble value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_setCurrent
|
||||
(JNIEnv*, jclass, jint index, jint channel, jdouble value)
|
||||
{
|
||||
HALSIM_SetPDPCurrent(index, channel, value);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_resetData(
|
||||
JNIEnv*, jclass, jint index) {
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PDPDataJNI
|
||||
* Method: resetData
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PDPDataJNI_resetData
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
HALSIM_ResetPDPData(index);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,167 +13,314 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
|
||||
* Method: registerInitializedCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_registerInitializedCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_registerInitializedCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterPWMInitializedCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
|
||||
* Method: cancelInitializedCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_cancelInitializedCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_cancelInitializedCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelPWMInitializedCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
|
||||
* Method: getInitialized
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_getInitialized(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_getInitialized
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetPWMInitialized(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
|
||||
* Method: setInitialized
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_setInitialized(JNIEnv*, jclass,
|
||||
jint index,
|
||||
jboolean value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_setInitialized
|
||||
(JNIEnv*, jclass, jint index, jboolean value)
|
||||
{
|
||||
HALSIM_SetPWMInitialized(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
|
||||
* Method: registerRawValueCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_registerRawValueCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_registerRawValueCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterPWMRawValueCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
|
||||
* Method: cancelRawValueCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_cancelRawValueCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_cancelRawValueCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelPWMRawValueCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
|
||||
* Method: getRawValue
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_getRawValue(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_getRawValue
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetPWMRawValue(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
|
||||
* Method: setRawValue
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_setRawValue(JNIEnv*, jclass,
|
||||
jint index,
|
||||
jint value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_setRawValue
|
||||
(JNIEnv*, jclass, jint index, jint value)
|
||||
{
|
||||
HALSIM_SetPWMRawValue(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
|
||||
* Method: registerSpeedCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_registerSpeedCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_registerSpeedCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterPWMSpeedCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
|
||||
* Method: cancelSpeedCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_cancelSpeedCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_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
|
||||
* Method: getSpeed
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_getSpeed(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_getSpeed
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetPWMSpeed(index);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_setSpeed(
|
||||
JNIEnv*, jclass, jint index, jdouble value) {
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
|
||||
* Method: setSpeed
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_setSpeed
|
||||
(JNIEnv*, jclass, jint index, jdouble value)
|
||||
{
|
||||
HALSIM_SetPWMSpeed(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
|
||||
* Method: registerPositionCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_registerPositionCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_registerPositionCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterPWMPositionCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
|
||||
* Method: cancelPositionCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_cancelPositionCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_cancelPositionCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelPWMPositionCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
|
||||
* Method: getPosition
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_getPosition(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_getPosition
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetPWMPosition(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
|
||||
* Method: setPosition
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_setPosition(JNIEnv*, jclass,
|
||||
jint index,
|
||||
jdouble value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_setPosition
|
||||
(JNIEnv*, jclass, jint index, jdouble value)
|
||||
{
|
||||
HALSIM_SetPWMPosition(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
|
||||
* Method: registerPeriodScaleCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_registerPeriodScaleCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_registerPeriodScaleCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterPWMPeriodScaleCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
|
||||
* Method: cancelPeriodScaleCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_cancelPeriodScaleCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_cancelPeriodScaleCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelPWMPeriodScaleCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
|
||||
* Method: getPeriodScale
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_getPeriodScale(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_getPeriodScale
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetPWMPeriodScale(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
|
||||
* Method: setPeriodScale
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_setPeriodScale(JNIEnv*, jclass,
|
||||
jint index,
|
||||
jint value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_setPeriodScale
|
||||
(JNIEnv*, jclass, jint index, jint value)
|
||||
{
|
||||
HALSIM_SetPWMPeriodScale(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
|
||||
* Method: registerZeroLatchCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_registerZeroLatchCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_registerZeroLatchCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterPWMZeroLatchCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
|
||||
* Method: cancelZeroLatchCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_cancelZeroLatchCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_cancelZeroLatchCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelPWMZeroLatchCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
|
||||
* Method: getZeroLatch
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_getZeroLatch(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_getZeroLatch
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetPWMZeroLatch(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
|
||||
* Method: setZeroLatch
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_setZeroLatch(JNIEnv*, jclass,
|
||||
jint index,
|
||||
jboolean value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_setZeroLatch
|
||||
(JNIEnv*, jclass, jint index, jboolean value)
|
||||
{
|
||||
HALSIM_SetPWMZeroLatch(index, value);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_resetData(
|
||||
JNIEnv*, jclass, jint index) {
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_PWMDataJNI
|
||||
* Method: resetData
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_PWMDataJNI_resetData
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
HALSIM_ResetPWMData(index);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,115 +13,215 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
|
||||
* Method: registerInitializedForwardCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_registerInitializedForwardCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_registerInitializedForwardCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterRelayInitializedForwardCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
|
||||
* Method: cancelInitializedForwardCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_cancelInitializedForwardCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_cancelInitializedForwardCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelRelayInitializedForwardCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
|
||||
* Method: getInitializedForward
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_getInitializedForward(
|
||||
JNIEnv*, jclass, jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_getInitializedForward
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetRelayInitializedForward(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
|
||||
* Method: setInitializedForward
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_setInitializedForward(
|
||||
JNIEnv*, jclass, jint index, jboolean value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_setInitializedForward
|
||||
(JNIEnv*, jclass, jint index, jboolean value)
|
||||
{
|
||||
HALSIM_SetRelayInitializedForward(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
|
||||
* Method: registerInitializedReverseCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_registerInitializedReverseCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_registerInitializedReverseCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterRelayInitializedReverseCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
|
||||
* Method: cancelInitializedReverseCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_cancelInitializedReverseCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_cancelInitializedReverseCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelRelayInitializedReverseCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
|
||||
* Method: getInitializedReverse
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_getInitializedReverse(
|
||||
JNIEnv*, jclass, jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_getInitializedReverse
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetRelayInitializedReverse(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
|
||||
* Method: setInitializedReverse
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_setInitializedReverse(
|
||||
JNIEnv*, jclass, jint index, jboolean value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_setInitializedReverse
|
||||
(JNIEnv*, jclass, jint index, jboolean value)
|
||||
{
|
||||
HALSIM_SetRelayInitializedReverse(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
|
||||
* Method: registerForwardCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_registerForwardCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_registerForwardCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterRelayForwardCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
|
||||
* Method: cancelForwardCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_cancelForwardCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_cancelForwardCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelRelayForwardCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
|
||||
* Method: getForward
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_getForward(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_getForward
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetRelayForward(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
|
||||
* Method: setForward
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_setForward(JNIEnv*, jclass,
|
||||
jint index,
|
||||
jboolean value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_setForward
|
||||
(JNIEnv*, jclass, jint index, jboolean value)
|
||||
{
|
||||
HALSIM_SetRelayForward(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
|
||||
* Method: registerReverseCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_registerReverseCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_registerReverseCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterRelayReverseCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
|
||||
* Method: cancelReverseCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_cancelReverseCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_cancelReverseCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelRelayReverseCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
|
||||
* Method: getReverse
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_getReverse(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_getReverse
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetRelayReverse(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
|
||||
* Method: setReverse
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_setReverse(JNIEnv*, jclass,
|
||||
jint index,
|
||||
jboolean value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_setReverse
|
||||
(JNIEnv*, jclass, jint index, jboolean value)
|
||||
{
|
||||
HALSIM_SetRelayReverse(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_RelayDataJNI
|
||||
* Method: resetData
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_resetData(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RelayDataJNI_resetData
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
HALSIM_ResetRelayData(index);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,410 +13,765 @@
|
||||
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_RoboRioDataJNI_resetData
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
HALSIM_ResetRoboRioData(index);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,142 +13,265 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
|
||||
* Method: registerActiveCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_registerActiveCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_registerActiveCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterSPIAccelerometerActiveCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
|
||||
* Method: cancelActiveCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_cancelActiveCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_cancelActiveCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelSPIAccelerometerActiveCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
|
||||
* Method: getActive
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_getActive(
|
||||
JNIEnv*, jclass, jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_getActive
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetSPIAccelerometerActive(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
|
||||
* Method: setActive
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_setActive(
|
||||
JNIEnv*, jclass, jint index, jboolean value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_setActive
|
||||
(JNIEnv*, jclass, jint index, jboolean value)
|
||||
{
|
||||
HALSIM_SetSPIAccelerometerActive(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
|
||||
* Method: registerRangeCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_registerRangeCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_registerRangeCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterSPIAccelerometerRangeCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
|
||||
* Method: cancelRangeCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_cancelRangeCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_cancelRangeCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelSPIAccelerometerRangeCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
|
||||
* Method: getRange
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_getRange(
|
||||
JNIEnv*, jclass, jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_getRange
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetSPIAccelerometerRange(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
|
||||
* Method: setRange
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_setRange(
|
||||
JNIEnv*, jclass, jint index, jint value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_setRange
|
||||
(JNIEnv*, jclass, jint index, jint value)
|
||||
{
|
||||
HALSIM_SetSPIAccelerometerRange(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
|
||||
* Method: registerXCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_registerXCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_registerXCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterSPIAccelerometerXCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
|
||||
* Method: cancelXCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_cancelXCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_cancelXCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelSPIAccelerometerXCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
|
||||
* Method: getX
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_getX(JNIEnv*,
|
||||
jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_getX
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetSPIAccelerometerX(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
|
||||
* Method: setX
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_setX(
|
||||
JNIEnv*, jclass, jint index, jdouble value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_setX
|
||||
(JNIEnv*, jclass, jint index, jdouble value)
|
||||
{
|
||||
HALSIM_SetSPIAccelerometerX(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
|
||||
* Method: registerYCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_registerYCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_registerYCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterSPIAccelerometerYCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
|
||||
* Method: cancelYCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_cancelYCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_cancelYCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelSPIAccelerometerYCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
|
||||
* Method: getY
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_getY(JNIEnv*,
|
||||
jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_getY
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetSPIAccelerometerY(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
|
||||
* Method: setY
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_setY(
|
||||
JNIEnv*, jclass, jint index, jdouble value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_setY
|
||||
(JNIEnv*, jclass, jint index, jdouble value)
|
||||
{
|
||||
HALSIM_SetSPIAccelerometerY(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
|
||||
* Method: registerZCallback
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_registerZCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_registerZCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterSPIAccelerometerZCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
|
||||
* Method: cancelZCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_cancelZCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_cancelZCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelSPIAccelerometerZCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
|
||||
* Method: getZ
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_getZ(JNIEnv*,
|
||||
jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_getZ
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetSPIAccelerometerZ(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
|
||||
* Method: setZ
|
||||
* Signature: (ID)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_setZ(
|
||||
JNIEnv*, jclass, jint index, jdouble value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_setZ
|
||||
(JNIEnv*, jclass, jint index, jdouble value)
|
||||
{
|
||||
HALSIM_SetSPIAccelerometerZ(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI
|
||||
* Method: resetData
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_resetData(
|
||||
JNIEnv*, jclass, jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIAccelerometerDataJNI_resetData
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
HALSIM_ResetSPIAccelerometerData(index);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,132 +17,141 @@
|
||||
extern "C" {
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPISim
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIDataJNI
|
||||
* Method: registerInitializedCallback
|
||||
* Signature: (ILedu/wpi/first/hal/sim/NotifyCallback;Z)I
|
||||
* Signature: (ILjava/lang/Object;Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_registerInitializedCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_registerInitializedCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
|
||||
{
|
||||
return sim::AllocateCallback(env, index, callback, initialNotify,
|
||||
&HALSIM_RegisterSPIInitializedCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPISim
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIDataJNI
|
||||
* Method: cancelInitializedCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_cancelInitializedCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_cancelInitializedCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
return sim::FreeCallback(env, handle, index,
|
||||
&HALSIM_CancelSPIInitializedCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPISim
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIDataJNI
|
||||
* Method: getInitialized
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_getInitialized(JNIEnv*, jclass,
|
||||
jint index) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_getInitialized
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
return HALSIM_GetSPIInitialized(index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPISim
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIDataJNI
|
||||
* Method: setInitialized
|
||||
* Signature: (IZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_setInitialized(JNIEnv*, jclass,
|
||||
jint index,
|
||||
jboolean value) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_setInitialized
|
||||
(JNIEnv*, jclass, jint index, jboolean value)
|
||||
{
|
||||
HALSIM_SetSPIInitialized(index, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPISim
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIDataJNI
|
||||
* Method: registerReadCallback
|
||||
* Signature: (ILedu/wpi/first/hal/sim/BufferCallback;)I
|
||||
* Signature: (ILjava/lang/Object;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_registerReadCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_registerReadCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback)
|
||||
{
|
||||
return sim::AllocateBufferCallback(env, index, callback,
|
||||
&HALSIM_RegisterSPIReadCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPISim
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIDataJNI
|
||||
* Method: cancelReadCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_cancelReadCallback(JNIEnv* env,
|
||||
jclass,
|
||||
jint index,
|
||||
jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_cancelReadCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
sim::FreeBufferCallback(env, handle, index, &HALSIM_CancelSPIReadCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPISim
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIDataJNI
|
||||
* Method: registerWriteCallback
|
||||
* Signature: (ILedu/wpi/first/hal/sim/ConstBufferCallback;)I
|
||||
* Signature: (ILjava/lang/Object;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_registerWriteCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_registerWriteCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback)
|
||||
{
|
||||
return sim::AllocateConstBufferCallback(env, index, callback,
|
||||
&HALSIM_RegisterSPIWriteCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPISim
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIDataJNI
|
||||
* Method: cancelWriteCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_cancelWriteCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_cancelWriteCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
sim::FreeConstBufferCallback(env, handle, index,
|
||||
&HALSIM_CancelSPIWriteCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPISim
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIDataJNI
|
||||
* Method: registerReadAutoReceiveBufferCallback
|
||||
* Signature: (ILedu/wpi/first/hal/sim/SpiReadAutoReceiveBufferCallback;)I
|
||||
* Signature: (ILjava/lang/Object;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_registerReadAutoReceiveBufferCallback(
|
||||
JNIEnv* env, jclass, jint index, jobject callback) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_registerReadAutoReceiveBufferCallback
|
||||
(JNIEnv* env, jclass, jint index, jobject callback)
|
||||
{
|
||||
return sim::AllocateSpiBufferCallback(
|
||||
env, index, callback, &HALSIM_RegisterSPIReadAutoReceivedDataCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPISim
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIDataJNI
|
||||
* Method: cancelReadAutoReceiveBufferCallback
|
||||
* Signature: (II)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_cancelReadAutoReceiveBufferCallback(
|
||||
JNIEnv* env, jclass, jint index, jint handle) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_cancelReadAutoReceiveBufferCallback
|
||||
(JNIEnv* env, jclass, jint index, jint handle)
|
||||
{
|
||||
sim::FreeSpiBufferCallback(env, handle, index,
|
||||
&HALSIM_CancelSPIReadAutoReceivedDataCallback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPISim
|
||||
* Class: edu_wpi_first_hal_sim_mockdata_SPIDataJNI
|
||||
* Method: resetData
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_resetData(
|
||||
JNIEnv*, jclass, jint index) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SPIDataJNI_resetData
|
||||
(JNIEnv*, jclass, jint index)
|
||||
{
|
||||
HALSIM_ResetSPIData(index);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "SimulatorJNI.h"
|
||||
|
||||
#include "BufferCallbackStore.h"
|
||||
#include "CallbackStore.h"
|
||||
#include "ConstBufferCallbackStore.h"
|
||||
@@ -12,7 +14,6 @@
|
||||
#include "HAL/cpp/Log.h"
|
||||
#include "HAL/handles/HandlesInternal.h"
|
||||
#include "MockData/MockHooks.h"
|
||||
#include "SimulatorJNI.h"
|
||||
#include "SpiReadAutoReceiveBufferCallbackStore.h"
|
||||
#include "edu_wpi_first_hal_sim_mockdata_SimulatorJNI.h"
|
||||
|
||||
@@ -112,8 +113,9 @@ extern "C" {
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SimulatorJNI_waitForProgramStart(JNIEnv*,
|
||||
jclass) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SimulatorJNI_waitForProgramStart
|
||||
(JNIEnv*, jclass)
|
||||
{
|
||||
HALSIM_WaitForProgramStart();
|
||||
}
|
||||
|
||||
@@ -123,8 +125,9 @@ Java_edu_wpi_first_hal_sim_mockdata_SimulatorJNI_waitForProgramStart(JNIEnv*,
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SimulatorJNI_setProgramStarted(JNIEnv*,
|
||||
jclass) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SimulatorJNI_setProgramStarted
|
||||
(JNIEnv*, jclass)
|
||||
{
|
||||
HALSIM_SetProgramStarted();
|
||||
}
|
||||
|
||||
@@ -134,8 +137,9 @@ Java_edu_wpi_first_hal_sim_mockdata_SimulatorJNI_setProgramStarted(JNIEnv*,
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SimulatorJNI_restartTiming(JNIEnv*,
|
||||
jclass) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SimulatorJNI_restartTiming
|
||||
(JNIEnv*, jclass)
|
||||
{
|
||||
HALSIM_RestartTiming();
|
||||
}
|
||||
|
||||
@@ -145,7 +149,9 @@ Java_edu_wpi_first_hal_sim_mockdata_SimulatorJNI_restartTiming(JNIEnv*,
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SimulatorJNI_resetHandles(JNIEnv*, jclass) {
|
||||
Java_edu_wpi_first_hal_sim_mockdata_SimulatorJNI_resetHandles
|
||||
(JNIEnv*, jclass)
|
||||
{
|
||||
hal::HandleBase::ResetGlobalHandles();
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "SpiReadAutoReceiveBufferCallbackStore.h"
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#include <wpi/jni_util.h>
|
||||
|
||||
#include "HAL/Types.h"
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#include <wpi/jni_util.h>
|
||||
|
||||
#include "HAL/Types.h"
|
||||
|
||||
31
ntcore/.styleguide
Normal file
31
ntcore/.styleguide
Normal file
@@ -0,0 +1,31 @@
|
||||
cHeaderFileInclude {
|
||||
_c\.h$
|
||||
}
|
||||
|
||||
cppHeaderFileInclude {
|
||||
(?<!_c)\.h$
|
||||
\.inc$
|
||||
}
|
||||
|
||||
cppSrcFileInclude {
|
||||
\.cpp$
|
||||
}
|
||||
|
||||
generatedFileExclude {
|
||||
ntcore/doc/
|
||||
}
|
||||
|
||||
repoRootNameOverride {
|
||||
ntcore
|
||||
}
|
||||
|
||||
includeGuardRoots {
|
||||
ntcore/src/main/native/cpp/
|
||||
ntcore/src/main/native/include/
|
||||
ntcore/src/test/native/cpp/
|
||||
}
|
||||
|
||||
includeOtherLibs {
|
||||
^support/
|
||||
^wpi/
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2017-2018. All Rights Reserved. */
|
||||
/* Copyright (c) 2017-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. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2017-2018. All Rights Reserved. */
|
||||
/* Copyright (c) 2017-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. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2017-2018. All Rights Reserved. */
|
||||
/* Copyright (c) 2017-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. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2017-2018. All Rights Reserved. */
|
||||
/* Copyright (c) 2017-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. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2017-2018. All Rights Reserved. */
|
||||
/* Copyright (c) 2017-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. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2017-2018. All Rights Reserved. */
|
||||
/* Copyright (c) 2017-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. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2017-2018. All Rights Reserved. */
|
||||
/* Copyright (c) 2017-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. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2017-2018. All Rights Reserved. */
|
||||
/* Copyright (c) 2017-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. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2017-2018. All Rights Reserved. */
|
||||
/* Copyright (c) 2017-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. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2017-2018. All Rights Reserved. */
|
||||
/* Copyright (c) 2017-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. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2017-2018. All Rights Reserved. */
|
||||
/* Copyright (c) 2017-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. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2017-2018. All Rights Reserved. */
|
||||
/* Copyright (c) 2017-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. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2017-2018. All Rights Reserved. */
|
||||
/* Copyright (c) 2017-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. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2017-2018. All Rights Reserved. */
|
||||
/* Copyright (c) 2017-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. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2017-2018. All Rights Reserved. */
|
||||
/* Copyright (c) 2017-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. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2017-2018. All Rights Reserved. */
|
||||
/* Copyright (c) 2017-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. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2017-2018. All Rights Reserved. */
|
||||
/* Copyright (c) 2017-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. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2017-2018. All Rights Reserved. */
|
||||
/* Copyright (c) 2017-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. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2017-2018. All Rights Reserved. */
|
||||
/* Copyright (c) 2017-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. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2017-2018. All Rights Reserved. */
|
||||
/* Copyright (c) 2017-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. */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user