java: Changed size_t and unsigned int to int in array declarations. Renamed buf to buffer where necesarry. Moved most Java array typemaps to java_buffer.i. Fixed some String buffers.

Signed-off-by: Petre Eftime <petre.p.eftime@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>

Conflicts:
	src/upm.i
This commit is contained in:
Petre Eftime
2015-09-07 19:00:30 +03:00
committed by Mihai Tudor Panu
parent ab730038fd
commit 2cab79b4c2
50 changed files with 237 additions and 326 deletions

View File

@ -1,25 +1,11 @@
%module javaupm_ublox6
%include "../upm.i"
%include "../java_buffer.i"
%{
#include "ublox6.h"
speed_t int_B9600 = B9600;
%}
%typemap(jni) (char *buffer, size_t len) "jbyteArray";
%typemap(jtype) (char *buffer, size_t len) "byte[]";
%typemap(jstype) (char *buffer, size_t len) "byte[]";
%typemap(javain) (char *buffer, size_t len) "$javainput";
%typemap(in) (char *buffer, size_t len) {
$1 = (char *) JCALL2(GetByteArrayElements, jenv, $input, NULL);
$2 = JCALL1(GetArrayLength, jenv, $input);
}
%typemap(freearg) (char *buffer, size_t len) {
JCALL3(ReleaseByteArrayElements, jenv, $input, (jbyte *) $1, 0);
}
%include "ublox6.h"
speed_t int_B9600 = B9600;

View File

@ -87,7 +87,7 @@ bool Ublox6::dataAvailable()
return false;
}
int Ublox6::readData(char *buffer, size_t len)
int Ublox6::readData(char *buffer, int len)
{
if (m_ttyFd == -1)
return(-1);
@ -100,7 +100,7 @@ int Ublox6::readData(char *buffer, size_t len)
return rv;
}
int Ublox6::writeData(char * buffer, size_t len)
int Ublox6::writeData(char * buffer, int len)
{
if (m_ttyFd == -1)
return(-1);

View File

@ -98,7 +98,7 @@ namespace upm {
* @param len Length of the buffer
* @return the Number of bytes read
*/
int readData(char *buffer, size_t len);
int readData(char *buffer, int len);
/**
* Writes the data in the buffer to the device
@ -107,7 +107,7 @@ namespace upm {
* @param len Length of the buffer
* @return Number of bytes written
*/
int writeData(char *buffer, size_t len);
int writeData(char *buffer, int len);
/**
* Sets up proper tty I/O modes and the baud rate. The default