NetworkTables Core Library
Clone or download
PeterJohnson Fix two bugs in client synchronization. (#270)
Both could occur if a client and server write to the same key and the server
disconnects/reconnects (or restarts).

Bug 1: the client did not properly update the sequence number in this case,
so later server updates could be ignored until the sequence number wrapped.

Bug 2: the client did not properly set the id and sequence number for the
update message back to the server, so the server would ignore the message.
Latest commit 3025a18 Mar 1, 2018
Permalink
Failed to load latest commit information.
.travis-scripts
doc
gmock
gradle/wrapper Added gradlew.bat to .gitattributes (#225) Aug 14, 2017
manualTests Updated copyright year Jan 2, 2018
src Fix two bugs in client synchronization. (#270) Mar 1, 2018
.clang-format Set up wpiformat Jan 2, 2018
.gitattributes Added gradlew.bat to .gitattributes (#225) Aug 14, 2017
.gitignore
.styleguide Set up wpiformat Jan 2, 2018
.styleguide-license Set up wpiformat Jan 2, 2018
.travis.yml Fix Travis CI wpiformat install (#269) Feb 21, 2018
CONTRIBUTING.md Set up wpiformat Jan 2, 2018
README.md Set up wpiformat Jan 2, 2018
TODO.md Implement keep-alives. Sep 9, 2015
appveyor.yml Add dependency to jni task to fix 32 bit builds (#216) Aug 4, 2017
build.gradle
config.gradle Fixes linux and mac builds to -Og, and strips binaries (#261) Dec 30, 2017
gradlew Remove wpiutil and update to the new build system (#210) Aug 3, 2017
gradlew.bat Added gradlew.bat to .gitattributes (#225) Aug 14, 2017
license.txt
publish.gradle
settings.gradle Remove wpiutil and update to the new build system (#210) Aug 3, 2017

README.md

ntcore

Travis CI Build Status Appveyor Build status

ntcore is the reimplementation of the NetworkTables protocol for both Java and C++, communicating with the former by way of a JNI interface. ntcore implements v3 of the NetworkTables spec.

Build Requirements

To build ntcore, a few requirements must be met:

  • Platform Native Toolchain - You must have a toolchain for your native platform installed if you wish to build ntcore for your machine. On Windows, this is Visual Studio. On Mac, this is Clang, and on Linux, this is GCC. Your toolchain must support the -std=c++11 language flag.
  • Platform Native JDK - In order to compile ntcore your native platform, you must have the JDK for your platform installed, so that the correct JNI headers can be included.
  • ARM Toolchain - To crosscompile ntcore for the roboRIO, you must have the FRC ARM toolchain installed, which can be found here.
  • Cross Toolchains (coming soon)

Building

Gradle is the main build system used by ntcore. All tasks are run with the gradlew wrapper, which is included in the root of the repository. All targets that can be accomplished by Gradle are referred to as tasks. The main task available is build. To run Gradle, cd into the build directory and run:

./gradlew build

This will build the roboRIO ntcore library, in addition to the library for your native platform. Note if the roboRIO compiler cannot be found, the build will skip the roboRIO build. To build for either only the roboRIO, or every platform except the roboRIO, use the following flags:

-PskipAthena
-PonlyAthena

Note if you choose the onlyAthena flag, tests will not be ran, as they depend on the current platform being built.

In addition, more platforms can be built. For instance, with additional cross compilers more Arm binaries can be built. In addition, the second bitness for your current platform can be built with an additional flag. To enable every possible platform, use the following flag.

-PbuildAll

If you are building the native version on a 64 bit Linux computer, use a GCC installation which has multilib support enabled (it can compile both 32 and 64 bit programs). The package providing that support on most Linux distributions is called gcc-multilib.

By default, debug binaries of the libraries will be built. To switch to instead build release binaries, use the following flag

-PreleaseBuild

Custom Cross Compilers

Coming soon

Testing

By default, tests will be built for any native platform, and will be run during any execution of the build or publish tasks. To skip building and running the tests, use the -PskipAllTests command line flag.

Publishing

to use ntcore in downstream projects as a Maven-style dependency, use the publish command. This will publish the following artifact id's:

  • edu.wpi.first.ntcore:ntcore-cpp
  • edu.wpi.first.ntcore:ntcore-java

The ntcore-cpp artifact will contain the following 2 classifiers:

  • headers (contains C++ headers)
  • sources (contains C++ sources)

In addition, a classifier will be created for each binary built by the current build. The internal layout of the artifacts will be as follows.

  • /os/arch/shared/ (shared binaries located here)
  • /os/arch/static/ (static binaries located here)

The ntcore-java artifact will contain a jar with no classifiers. This is the java jar file. In addition, the following 2 classifiers will be contained

  • sources (contains Java sources)
  • javadoc (contains Javadoc sources)

All of these artifacts by default are published to ~/releases/maven/development. To switch to the release repository (~/release/maven/release), use the flag -PreleaseType=OFFICIAL.

All downstream projects are configured to use the individual classifier artifacts. The previouse desktop classifier does not exist anymore.

When you do a publish of ntcore locally, the locally built copy will override all references to networktables dependencies from the FRC Maven server. To undo this, you must delete ~/releases/maven/<repo>/edu/wpi/first/ntcore.