Pavel Pisa [Fri, 4 Oct 2013 07:48:27 +0000 (09:48 +0200)]
Omit "byteswap.h" from pre-configured OMK Linux build.
The CDR and rest of the ORTE code uses open-codded ORTE provided
rtps_byteswap function. Build environment provided byteswap
functions are not utilized in the actual ORTE setups.
They could result in better optimized code in future but
attempt to include "byteswap.h" is probably the last blocker
to use Linux pre-configured ORTE on RTEMS, BSD and BlackBerry.
So comment out HAVE_BYTESWAP_H for now.
Pavel Pisa [Mon, 30 Sep 2013 10:02:00 +0000 (12:02 +0200)]
OMK build: move linker specification of pthread library to separate variable TARGET_LOADLIBES.
This allows to override libraries list suitable for the Linux
build by other target OS specific list of the libraries.
I.e. the explicit "pthread" library specification is blocker
for QNX/BlackBerry build because POSIX threads are included
in stadartd library. On the other hand BSD networking "socket"
library has to be specified explicitly. Another difference
is missing "byteswap.h" header file (undef HAVE_BYTESWAP_H).
Martin Vajnar [Mon, 5 Aug 2013 21:37:29 +0000 (23:37 +0200)]
ROBOT_DEMO: fix sync. problems in publisher for "motion_speed"
Don't use synchronized(), because it may block the setSpeed() and prevent
receiving new data from accelerometer. The isSent variable is now used
to determine whether we need new data.
Add robot's IP address to the list of fellow managers.
Martin Vajnar [Mon, 5 Aug 2013 19:26:29 +0000 (21:26 +0200)]
ROBOT_DEMO: fix sync. problems in HokuyoView
Set new data only if the previous batch has been drawn and clone the newly
arrived data array. This prevents concurrent access problems when
the previous batch is being drawn on the UI thread and new data arrives
through ORTE's receive thread.
Martin Vajnar [Fri, 26 Jul 2013 08:44:46 +0000 (10:44 +0200)]
JORTE: improve ByteOrder handling
Store the ByteOrder of MessageData's ByteBuffer in receive callback
structure in C (in case someone reuses already created MessageData instance
with new subscriber).
Martin Vajnar [Thu, 25 Jul 2013 12:45:43 +0000 (14:45 +0200)]
JORTE: switch from deserialize function to endianness callback
Yesterday's attempt at setting the byte order of ByteBuffer through
a deserialize function has one significant drawback and that is if more
than one data type is defined under one VM instance (thus accessible by
other threads) and subscribers are then registered for these data types
the deserialize function will stop working correctly, because there are
no parameter structures being passed to it, except for the CDR_Codec,
thus it had to use a global reference to a byte buffer which is
unfortunately overwritten the moment a new data type is registered.
If the deserialize function for the previously registered data type
is invoked it then tampers with ByteBuffer settings of a newly registered
data type.
Martin Vajnar [Tue, 23 Jul 2013 09:09:39 +0000 (11:09 +0200)]
JORTE: fix memory leak and add DomainEvents to DomainMgr
Memory leaks in jORTEDomainAppCreate() and jORTEDomainMgrCreate()
(domain events callback structure) are fixed. Domain events callbacks
are placed in a separate file. Their prototypes are placed in "jorte/
/jorte_protos_api.h". This way they could be used by DomainApp
and DomainMgr.
Native functions in both DomainApp.java and DomainMgr.java are now non-
static. This allows native domain destructor to free the memory allocated
to domain events callback structure.
It is now also possible to pass null for DomainEvents or DomainProp to
DomainApp and DomainMgr constructors.
The header file onLoad.h is removed and the findClass() prototype is placed
into "jorte/jorte_protos_api.h".
Martin Vajnar [Sun, 21 Jul 2013 08:25:50 +0000 (10:25 +0200)]
JORTE: remove unused code
Since the domain is started (receiving and sending threads) either by
calling ORTEDomainAppCreate() or ORTEDomainMgrCreate(), there is no need
to have DomainStart() on the Java side.
Martin Vajnar [Fri, 19 Jul 2013 09:37:04 +0000 (11:37 +0200)]
ROBOT_DEMO: completely rewritten
This adds complete rewrite of the demo application. Buttons are now removed
from views and are instead placed to a menu. At the start a domain manager
and an application domain are created under which every subscriber
and publisher is launched. Support for hokuyo_scan is added.
Martin Vajnar [Fri, 19 Jul 2013 09:20:39 +0000 (11:20 +0200)]
JORTE: fix subscription destruction
Destroy subscription first, then destroy references to objects
in subscription callback. This prevents SEGFAULTs from the receiving
thread, that tries to save received instance to a non-existent object.
DeleteLocalReference was replaced with DeleteGlobalReference, since we are
destroying a global reference. This prevents dvmAbort() being called
on Android. This also fixes a memory leak (the ctx->msg reference was not
deleted).
Martin Vajnar [Tue, 16 Jul 2013 09:48:07 +0000 (11:48 +0200)]
JORTE: don't use finalizers in Java classes
This replaces finalizers with explicit destroy() functions, because the
order in which objects with no reference in the VM are garbage-collected
is not guaranteed. This caused trouble with finalization of DomainApp
and Publisher (or Subscriber). If the DomainApp was destroyed before
the Publisher (or Subscriber) the Publisher's finalizer would have been
stuck (eventually leading to TimeoutException to be thrown).