Commit Graph

405 Commits

Author SHA1 Message Date
Thad House
b979fc2a67 Adds SetDefault Java definitions to Def file (#82) 2016-07-13 01:53:26 -07:00
Thad House
58092c5190 Adds SetDefault methods to NetworkTables (#54)
There was no way to atomically check for a key in the table,
and then setting if it if non existant. Back before persistent
this was not a problem, however now it is, as its possible for
values to be added before team's robot programs start. This makes
the old method of calling Put*** methods in RobotInit invalid.
This adds SetDefault methods, which do this atomically.
2016-07-13 00:31:03 -07:00
Fredric Silberberg
6615a34e99 Added contributing and license files (#63) 2016-07-12 23:20:51 -07:00
Peter Johnson
50a2612839 Notifier: maintain freelist to reuse uids. (#81)
This avoids endless growth of the vector.

Fixes #80.
2016-07-12 23:19:46 -07:00
Peter Johnson
eb4350033b Update Travis OS X build to use newest image. (#75)
Fixes #74.
2016-07-01 00:08:43 -07:00
Fredric Silberberg
384ad57d21 Updates Gradle to 2.14 (#78) 2016-06-30 19:57:29 -07:00
Peter Johnson
4b516de183 Don't delete persistent entries in DeleteAllEntries. (#71)
This is a behavior change but without it DeleteAllEntries is dangerous and
not very useful, so I consider the current behavior to be a bug.
2016-06-17 22:33:02 -07:00
Peter Johnson
c7d9ecbab3 Fix mac build by not defining false and true. (#73) 2016-06-17 22:32:18 -07:00
Tyler Veness
b2795af2b8 Added note that multilib GCC is required when building the native version on 64 bit Linux (#66)
Without a GCC installation that can build both 32 and 64 bit executables, the native build will fail on 64 bit Linux machines with an error about unsigned __int128 being undefined. GCC does not support __int128 on 32 bit targets, and GCC was using it via a standard library implementation header intended for 64 bit machines.

Instances of "arm" were replaced with "ARM" where the acronym was intended.
2016-06-11 02:55:46 -04:00
Thad House
6c6c087e30 Fixes .gitignore ignoring needed files (#68)
ntcore.def and build.gradle were being ignored, which could cause issues
if those files ever got deleted.
2016-06-11 02:52:24 -04:00
Peter Johnson
3c77faaf61 Fix UTF8 conversion in Java. (#70)
Java doesn't use standard UTF8, so surrogate pairs were being converted
incorrectly and incompatibly with C++.

Fixes #69 (artf3973).
2016-06-10 22:24:42 -04:00
Jonathan Leitschuh
6272244a73 Adds error-prone to check java code 2016-05-13 21:17:20 -07:00
Jonathan Leitschuh
a532518056 Adds all relevent tools to gitignore 2016-05-13 21:10:41 -07:00
Peter Johnson
320db8df18 Add .clang-format. 2016-05-13 21:05:56 -07:00
Jonathan Leitschuh
d1fb8cc209 Merge pull request #60 from wpilibsuite/build/appveyor
Adds appveyor build config
2016-05-12 11:57:35 -04:00
Jonathan Leitschuh
7d33059c20 Add appveyor badge to readme 2016-05-11 18:47:39 -04:00
Jonathan Leitschuh
ed0f197d1b Adds appveyor build config 2016-05-11 14:17:55 -04:00
Jonathan Leitschuh
25ad7a6230 Merge pull request #59 from wpilibsuite/build/osxTravisBuild
Adds OSX Build to travis
2016-05-11 14:12:28 -04:00
Jonathan Leitschuh
5fb31baea6 Adds OSX Build to travis 2016-05-11 13:45:53 -04:00
Jonathan Leitschuh
ffb384ebfc Add Travis Badge to ReadMe 2016-05-11 11:54:15 -04:00
Jonathan Leitschuh
95098c5496 Add required apt packages to travis 2016-05-11 11:43:03 -04:00
Jonathan Leitschuh
3862668420 Add Travis config file 2016-05-11 11:32:02 -04:00
Peter Johnson
5ac68f74d4 Support client round robin to multiple server addresses.
Change-Id: If87dc64a485b1c8a340c5f6fa39ca09d40133e30
2016-04-08 22:02:52 -07:00
Peter Johnson
b8ad1de33c Make members of ConnectionInfo and EntryInfo public. 2016-04-08 13:08:07 -07:00
Peter Johnson
f80312b86b Merge pull request #52 from robotdotnet/master
Fixes Connection Listeners
2016-02-08 23:55:10 -08:00
Thad House
836dc7a880 Fixes Connection Listeners
AddConnectionListener was returning the uid of entry listeners, which
would make connection listeners not work.
2016-02-08 15:40:34 -08:00
Peter Johnson
7283293887 Merge pull request #51 from robotdotnet/RemoteChanges
Adds extended Remote Connection Listener
2016-02-08 01:19:02 -08:00
Thad House
710bd586d5 Adds extended Remote Connection Listener
Since we now get ConnectionInfo when setting a connection listener,
there is some good information in there that teams could use.
Implemented using default interface methods, so teams should see no
change if they don't implement the Ex methods.

I noticed that the connection listener methods don't exist at all in
C++, so they did not get added there.
2016-02-06 23:28:19 -08:00
Peter Johnson (294)
cb4cc63221 Merge "Added -pthread" 2016-01-22 13:44:47 -08:00
Fredric Silberberg
838d8abf63 Added -pthread
Change-Id: Iea1553c9632fb270d56140a046cffa5258ce6d2d
2016-01-22 14:18:52 -05:00
Peter Johnson
94bd629b80 Merge pull request #48 from ThadHouse/master
Load ntcore from path if extracted load fails
2016-01-21 21:53:04 -08:00
Thad House
73d6e98bf2 Loads ntcore from path if extracted load fails
There's a lot of buzz going around the internet about people trying to
get ntcore working on other devices. One of the things that makes it
harder is having to have a separate jar for each platform. What this
change does is if the loading of the extracted library fails, it will
attempt to load ntcore from the path. This means that a program like
GRIP can just provide the libntcore.so and not have to worry about
compiling different versions for different platforms.
2016-01-18 22:39:27 -08:00
Peter Johnson
c90a8c586f getTable(): Don't prepend slash if key already starts with it.
This makes getTable("/foo") and getTable("foo") equivalent.
2016-01-14 21:38:04 -08:00
Peter Johnson
9092b74f4e TCPAcceptor: Check for socket creation failure. 2016-01-04 18:13:39 -08:00
Peter Johnson
b3d28c7e3a Merge pull request #46 from 333fred/master
Adds a compilerPrefix argument for using a compiler with a different toolchain.
2016-01-04 18:03:49 -08:00
Peter Johnson
ed92385469 Merge pull request #44 from ThadHouse/master
Fixes Android Build issues
2016-01-04 18:02:08 -08:00
Thad House
1247976a34 Fixes Android Build issues
Trying to build with the android standalone compiler, and these 2 things
were causing errors. I don't know what an equivalent to basename would
be, because I don't really know what it does.
2016-01-04 17:35:51 -08:00
Fredric Silberberg
880bc7db9f Adds a compilerPrefix argument for using a compiler with a different
toolchain.
Resolves github #45.

Change-Id: I6f16dcc41278f12fbbc1f742d6aaf3ad19ac61bc
2016-01-04 19:53:56 -05:00
Peter Johnson
20f23e0e31 TCPConnector: Don't leak socket descriptors.
Also check to see if socket() returns error (less than 0) and error out.
2016-01-04 13:08:00 -08:00
Peter Johnson
d9efcbc7a9 C++ NetworkTable: Add array and raw getters and setters.
For consistency with Java NetworkTable; also makes these data types easier
to use (although they are less efficient as they require a memory allocation
and data copy).
2016-01-04 09:37:29 -08:00
Peter Johnson
5e2a07d58a Fix client connection to 2.0 server.
Fixes #42.
2016-01-03 17:54:08 -08:00
Peter Johnson
620836e1cb Update .gitignore. 2016-01-02 09:39:14 -08:00
Peter Johnson
af2f54720d Java: Don't detach thread when releasing globals.
JavaGlobal was unconditionally attaching to (okay) and detaching from (bad)
the current thread during destruction.  We don't want to do this if the
destructor gets called from an attached thread.  Instead, use GetEnv to
first try to get the environment, and only attach and detach if it returns
an error saying the thread is detached.

Also, make sure notifier callbacks appropriately free Java locals to avoid
running out of local variable space.
2016-01-01 19:05:00 -08:00
Peter Johnson
236ef199aa Merge pull request #41 from 333fred/master
Added skipArm flag to disable the arm build entirely
2015-12-29 13:37:29 -06:00
Fredric Silberberg
1ea5b21dcf Added skipArm flag to disable the arm build entirely
Change-Id: I49c6cb3bfb3b1eda60d5b99b634b1e82fb2afcc8
2015-12-29 12:08:51 -05:00
Peter Johnson
e6054f543a ntcore_c.h: Whitespace fixes. 2015-12-29 08:57:10 -08:00
Peter Johnson
2aaaed34f9 Unbreak build on VS2012. 2015-12-28 19:27:05 -08:00
Peter Johnson
fef8f933d9 Add SafeThread to fix thread JNI shutdown races.
During JVM shutdown, some JNI calls may not return, so it's not possible to
reliably perform a join() during static variable destruction (which occurs
as the JVM unloads the JNI module).

Also, due to static variable destruction, it's not safe to use any members
of a static class instance from a separate thread of execution.

SafeThread is a templated thread class and a related owner class that's
designed for safe operation and shutdown of threads in the presence of
callbacks that may not return.  It also passes ownership of variables from
the static instance to the thread, so the thread can safely operate until
it exits (the last operation of the thread being to destroy its instance).

Notifiers, RpcServer, and Logger now use SafeThread to ensure race-free
destruction in both C++ and Java.

All Java callback threads are now marked as Java daemon threads so they
don't keep the JVM running after main() terminates.

All Java callback threads are now named so their purpose is more easily
identified in a debugger.

Add SetRpcServerOnStart and SetRpcServerOnExit (similar to Listener).
2015-12-28 17:51:56 -08:00
Fredric Silberberg
d8de5e4f19 Added ntcore sources zip to the main build
Change-Id: I7760ebb86c5493d5d9bc3ef9b9def02bcfb7216c
2015-12-24 14:42:36 -05:00
Peter Johnson (294)
554543c5d0 Merge "Fixes the sources zip to actually include all sources." 2015-12-23 18:07:57 -08:00