ntcore: Add support for local-only operation (#2204)

StartLocal() causes future calls to StartServer() or StartClient() to have
no effect. StopLocal() re-enables these calls.
This commit is contained in:
Peter Johnson
2019-12-29 14:56:41 -06:00
committed by GitHub
parent 44bcf7fb4d
commit 6ea13ea8f3
11 changed files with 123 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -1368,6 +1368,30 @@ Java_edu_wpi_first_networktables_NetworkTablesJNI_getNetworkMode
return nt::GetNetworkMode(inst);
}
/*
* Class: edu_wpi_first_networktables_NetworkTablesJNI
* Method: startLocal
* Signature: (I)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_networktables_NetworkTablesJNI_startLocal
(JNIEnv*, jclass, jint inst)
{
nt::StartLocal(inst);
}
/*
* Class: edu_wpi_first_networktables_NetworkTablesJNI
* Method: stopLocal
* Signature: (I)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_networktables_NetworkTablesJNI_stopLocal
(JNIEnv*, jclass, jint inst)
{
nt::StopLocal(inst);
}
/*
* Class: edu_wpi_first_networktables_NetworkTablesJNI
* Method: startServer