diff --git a/pi4j-core/src/test/java/com/pi4j/util/StringUtilTests.java b/pi4j-core/src/test/java/com/pi4j/util/StringUtilTests.java index 9f799b835..4bbfa4956 100644 --- a/pi4j-core/src/test/java/com/pi4j/util/StringUtilTests.java +++ b/pi4j-core/src/test/java/com/pi4j/util/StringUtilTests.java @@ -1,5 +1,33 @@ package com.pi4j.util; +/* + * #%L + * ********************************************************************** + * ORGANIZATION : Pi4J + * PROJECT : Pi4J :: Java Library (Core) + * FILENAME : StringUtilTests.java + * + * This file is part of the Pi4J project. More information about + * this project can be found here: http://www.pi4j.com/ + * ********************************************************************** + * %% + * Copyright (C) 2012 - 2013 Pi4J + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + + import static org.junit.Assert.*; import org.junit.BeforeClass; diff --git a/pi4j-example/src/main/java/LcdExample.java b/pi4j-example/src/main/java/LcdExample.java index 07c765d39..91ac2ece5 100644 --- a/pi4j-example/src/main/java/LcdExample.java +++ b/pi4j-example/src/main/java/LcdExample.java @@ -4,7 +4,7 @@ * ********************************************************************** * ORGANIZATION : Pi4J * PROJECT : Pi4J :: Java Examples - * FILENAME : WiringPiGpioExample.java + * FILENAME : LcdExample.java * * This file is part of the Pi4J project. More information about * this project can be found here: http://www.pi4j.com/ diff --git a/pi4j-example/src/main/java/WiringPiLcdExample.java b/pi4j-example/src/main/java/WiringPiLcdExample.java index 046a3b276..ab14b0128 100644 --- a/pi4j-example/src/main/java/WiringPiLcdExample.java +++ b/pi4j-example/src/main/java/WiringPiLcdExample.java @@ -4,7 +4,7 @@ * ********************************************************************** * ORGANIZATION : Pi4J * PROJECT : Pi4J :: Java Examples - * FILENAME : WiringPiGpioExample.java + * FILENAME : WiringPiLcdExample.java * * This file is part of the Pi4J project. More information about * this project can be found here: http://www.pi4j.com/ diff --git a/pi4j-native/src/main/native/com_pi4j_jni_I2C.c b/pi4j-native/src/main/native/com_pi4j_jni_I2C.c index e9a5b1daa..05fb9442a 100644 --- a/pi4j-native/src/main/native/com_pi4j_jni_I2C.c +++ b/pi4j-native/src/main/native/com_pi4j_jni_I2C.c @@ -9,7 +9,7 @@ * this project can be found here: http://www.pi4j.com/ * ********************************************************************** * %% - * Copyright (C) 2012 Pi4J + * Copyright (C) 2012 - 2013 Pi4J * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/pi4j-native/src/main/native/com_pi4j_jni_I2C.h b/pi4j-native/src/main/native/com_pi4j_jni_I2C.h index 03c0b02dd..71dd70fa3 100644 --- a/pi4j-native/src/main/native/com_pi4j_jni_I2C.h +++ b/pi4j-native/src/main/native/com_pi4j_jni_I2C.h @@ -9,7 +9,7 @@ * this project can be found here: http://www.pi4j.com/ * ********************************************************************** * %% - * Copyright (C) 2012 Pi4J + * Copyright (C) 2012 - 2013 Pi4J * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/pi4j-native/src/main/native/com_pi4j_jni_Serial.c b/pi4j-native/src/main/native/com_pi4j_jni_Serial.c index 08ba36e75..a73435c1e 100644 --- a/pi4j-native/src/main/native/com_pi4j_jni_Serial.c +++ b/pi4j-native/src/main/native/com_pi4j_jni_Serial.c @@ -9,7 +9,7 @@ * this project can be found here: http://www.pi4j.com/ * ********************************************************************** * %% - * Copyright (C) 2012 Pi4J + * Copyright (C) 2012 - 2013 Pi4J * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/pi4j-native/src/main/native/com_pi4j_jni_Serial.h b/pi4j-native/src/main/native/com_pi4j_jni_Serial.h index ab9dc261b..d9078793f 100644 --- a/pi4j-native/src/main/native/com_pi4j_jni_Serial.h +++ b/pi4j-native/src/main/native/com_pi4j_jni_Serial.h @@ -9,7 +9,7 @@ * this project can be found here: http://www.pi4j.com/ * ********************************************************************** * %% - * Copyright (C) 2012 Pi4J + * Copyright (C) 2012 - 2013 Pi4J * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/pi4j-native/src/main/native/com_pi4j_wiringpi_Gertboard.c b/pi4j-native/src/main/native/com_pi4j_wiringpi_Gertboard.c index 854f0ed2c..b83c9f3d8 100644 --- a/pi4j-native/src/main/native/com_pi4j_wiringpi_Gertboard.c +++ b/pi4j-native/src/main/native/com_pi4j_wiringpi_Gertboard.c @@ -9,7 +9,7 @@ * this project can be found here: http://www.pi4j.com/ * ********************************************************************** * %% - * Copyright (C) 2012 Pi4J + * Copyright (C) 2012 - 2013 Pi4J * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/pi4j-native/src/main/native/com_pi4j_wiringpi_Gertboard.h b/pi4j-native/src/main/native/com_pi4j_wiringpi_Gertboard.h index a83a35328..ff61dd194 100644 --- a/pi4j-native/src/main/native/com_pi4j_wiringpi_Gertboard.h +++ b/pi4j-native/src/main/native/com_pi4j_wiringpi_Gertboard.h @@ -9,7 +9,7 @@ * this project can be found here: http://www.pi4j.com/ * ********************************************************************** * %% - * Copyright (C) 2012 Pi4J + * Copyright (C) 2012 - 2013 Pi4J * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/pi4j-native/src/main/native/com_pi4j_wiringpi_Gpio.c b/pi4j-native/src/main/native/com_pi4j_wiringpi_Gpio.c index d55570dae..49f421680 100644 --- a/pi4j-native/src/main/native/com_pi4j_wiringpi_Gpio.c +++ b/pi4j-native/src/main/native/com_pi4j_wiringpi_Gpio.c @@ -9,7 +9,7 @@ * this project can be found here: http://www.pi4j.com/ * ********************************************************************** * %% - * Copyright (C) 2012 Pi4J + * Copyright (C) 2012 - 2013 Pi4J * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/pi4j-native/src/main/native/com_pi4j_wiringpi_Gpio.h b/pi4j-native/src/main/native/com_pi4j_wiringpi_Gpio.h index ce991efc1..5bb3c5b47 100644 --- a/pi4j-native/src/main/native/com_pi4j_wiringpi_Gpio.h +++ b/pi4j-native/src/main/native/com_pi4j_wiringpi_Gpio.h @@ -9,7 +9,7 @@ * this project can be found here: http://www.pi4j.com/ * ********************************************************************** * %% - * Copyright (C) 2012 Pi4J + * Copyright (C) 2012 - 2013 Pi4J * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/pi4j-native/src/main/native/com_pi4j_wiringpi_GpioInterrupt.c b/pi4j-native/src/main/native/com_pi4j_wiringpi_GpioInterrupt.c index ce0c54b58..4331dcc34 100644 --- a/pi4j-native/src/main/native/com_pi4j_wiringpi_GpioInterrupt.c +++ b/pi4j-native/src/main/native/com_pi4j_wiringpi_GpioInterrupt.c @@ -9,7 +9,7 @@ * this project can be found here: http://www.pi4j.com/ * ********************************************************************** * %% - * Copyright (C) 2012 Pi4J + * Copyright (C) 2012 - 2013 Pi4J * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/pi4j-native/src/main/native/com_pi4j_wiringpi_GpioInterrupt.h b/pi4j-native/src/main/native/com_pi4j_wiringpi_GpioInterrupt.h index 44a021b24..85fcfa2b8 100644 --- a/pi4j-native/src/main/native/com_pi4j_wiringpi_GpioInterrupt.h +++ b/pi4j-native/src/main/native/com_pi4j_wiringpi_GpioInterrupt.h @@ -9,7 +9,7 @@ * this project can be found here: http://www.pi4j.com/ * ********************************************************************** * %% - * Copyright (C) 2012 Pi4J + * Copyright (C) 2012 - 2013 Pi4J * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/pi4j-native/src/main/native/com_pi4j_wiringpi_GpioPin.c b/pi4j-native/src/main/native/com_pi4j_wiringpi_GpioPin.c index 487c60360..08d86da72 100644 --- a/pi4j-native/src/main/native/com_pi4j_wiringpi_GpioPin.c +++ b/pi4j-native/src/main/native/com_pi4j_wiringpi_GpioPin.c @@ -9,7 +9,7 @@ * this project can be found here: http://www.pi4j.com/ * ********************************************************************** * %% - * Copyright (C) 2012 Pi4J + * Copyright (C) 2012 - 2013 Pi4J * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/pi4j-native/src/main/native/com_pi4j_wiringpi_GpioPin.h b/pi4j-native/src/main/native/com_pi4j_wiringpi_GpioPin.h index d46af1439..60b1eee90 100644 --- a/pi4j-native/src/main/native/com_pi4j_wiringpi_GpioPin.h +++ b/pi4j-native/src/main/native/com_pi4j_wiringpi_GpioPin.h @@ -9,7 +9,7 @@ * this project can be found here: http://www.pi4j.com/ * ********************************************************************** * %% - * Copyright (C) 2012 Pi4J + * Copyright (C) 2012 - 2013 Pi4J * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/pi4j-native/src/main/native/com_pi4j_wiringpi_GpioUtil.c b/pi4j-native/src/main/native/com_pi4j_wiringpi_GpioUtil.c index c09c75ffa..793b22fba 100644 --- a/pi4j-native/src/main/native/com_pi4j_wiringpi_GpioUtil.c +++ b/pi4j-native/src/main/native/com_pi4j_wiringpi_GpioUtil.c @@ -9,7 +9,7 @@ * this project can be found here: http://www.pi4j.com/ * ********************************************************************** * %% - * Copyright (C) 2012 Pi4J + * Copyright (C) 2012 - 2013 Pi4J * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/pi4j-native/src/main/native/com_pi4j_wiringpi_GpioUtil.h b/pi4j-native/src/main/native/com_pi4j_wiringpi_GpioUtil.h index 85594b88b..2339cba31 100644 --- a/pi4j-native/src/main/native/com_pi4j_wiringpi_GpioUtil.h +++ b/pi4j-native/src/main/native/com_pi4j_wiringpi_GpioUtil.h @@ -9,7 +9,7 @@ * this project can be found here: http://www.pi4j.com/ * ********************************************************************** * %% - * Copyright (C) 2012 Pi4J + * Copyright (C) 2012 - 2013 Pi4J * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/pi4j-native/src/main/native/com_pi4j_wiringpi_Lcd.c b/pi4j-native/src/main/native/com_pi4j_wiringpi_Lcd.c index 2e75ec5dc..beff48f9a 100644 --- a/pi4j-native/src/main/native/com_pi4j_wiringpi_Lcd.c +++ b/pi4j-native/src/main/native/com_pi4j_wiringpi_Lcd.c @@ -9,7 +9,7 @@ * this project can be found here: http://www.pi4j.com/ * ********************************************************************** * %% - * Copyright (C) 2012 Pi4J + * Copyright (C) 2012 - 2013 Pi4J * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/pi4j-native/src/main/native/com_pi4j_wiringpi_Lcd.h b/pi4j-native/src/main/native/com_pi4j_wiringpi_Lcd.h index bbca06a5e..ed4436cd5 100644 --- a/pi4j-native/src/main/native/com_pi4j_wiringpi_Lcd.h +++ b/pi4j-native/src/main/native/com_pi4j_wiringpi_Lcd.h @@ -9,7 +9,7 @@ * this project can be found here: http://www.pi4j.com/ * ********************************************************************** * %% - * Copyright (C) 2012 Pi4J + * Copyright (C) 2012 - 2013 Pi4J * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/pi4j-native/src/main/native/com_pi4j_wiringpi_Nes.c b/pi4j-native/src/main/native/com_pi4j_wiringpi_Nes.c index 2742061ef..fe93784cd 100644 --- a/pi4j-native/src/main/native/com_pi4j_wiringpi_Nes.c +++ b/pi4j-native/src/main/native/com_pi4j_wiringpi_Nes.c @@ -9,7 +9,7 @@ * this project can be found here: http://www.pi4j.com/ * ********************************************************************** * %% - * Copyright (C) 2012 Pi4J + * Copyright (C) 2012 - 2013 Pi4J * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/pi4j-native/src/main/native/com_pi4j_wiringpi_Nes.h b/pi4j-native/src/main/native/com_pi4j_wiringpi_Nes.h index 9fff4eb93..f02d93cc5 100644 --- a/pi4j-native/src/main/native/com_pi4j_wiringpi_Nes.h +++ b/pi4j-native/src/main/native/com_pi4j_wiringpi_Nes.h @@ -9,7 +9,7 @@ * this project can be found here: http://www.pi4j.com/ * ********************************************************************** * %% - * Copyright (C) 2012 Pi4J + * Copyright (C) 2012 - 2013 Pi4J * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/pi4j-native/src/main/native/com_pi4j_wiringpi_Serial.c b/pi4j-native/src/main/native/com_pi4j_wiringpi_Serial.c index 6812c959f..c1e971512 100644 --- a/pi4j-native/src/main/native/com_pi4j_wiringpi_Serial.c +++ b/pi4j-native/src/main/native/com_pi4j_wiringpi_Serial.c @@ -9,7 +9,7 @@ * this project can be found here: http://www.pi4j.com/ * ********************************************************************** * %% - * Copyright (C) 2012 Pi4J + * Copyright (C) 2012 - 2013 Pi4J * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/pi4j-native/src/main/native/com_pi4j_wiringpi_Serial.h b/pi4j-native/src/main/native/com_pi4j_wiringpi_Serial.h index 253ab257b..6e8cc32bb 100644 --- a/pi4j-native/src/main/native/com_pi4j_wiringpi_Serial.h +++ b/pi4j-native/src/main/native/com_pi4j_wiringpi_Serial.h @@ -9,7 +9,7 @@ * this project can be found here: http://www.pi4j.com/ * ********************************************************************** * %% - * Copyright (C) 2012 Pi4J + * Copyright (C) 2012 - 2013 Pi4J * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/pi4j-native/src/main/native/com_pi4j_wiringpi_Shift.c b/pi4j-native/src/main/native/com_pi4j_wiringpi_Shift.c index eefe758e3..211c8ddbe 100644 --- a/pi4j-native/src/main/native/com_pi4j_wiringpi_Shift.c +++ b/pi4j-native/src/main/native/com_pi4j_wiringpi_Shift.c @@ -9,7 +9,7 @@ * this project can be found here: http://www.pi4j.com/ * ********************************************************************** * %% - * Copyright (C) 2012 Pi4J + * Copyright (C) 2012 - 2013 Pi4J * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/pi4j-native/src/main/native/com_pi4j_wiringpi_Shift.h b/pi4j-native/src/main/native/com_pi4j_wiringpi_Shift.h index 3abe6fd84..e7c356fc2 100644 --- a/pi4j-native/src/main/native/com_pi4j_wiringpi_Shift.h +++ b/pi4j-native/src/main/native/com_pi4j_wiringpi_Shift.h @@ -9,7 +9,7 @@ * this project can be found here: http://www.pi4j.com/ * ********************************************************************** * %% - * Copyright (C) 2012 Pi4J + * Copyright (C) 2012 - 2013 Pi4J * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/pi4j-native/src/main/native/com_pi4j_wiringpi_SoftPwm.c b/pi4j-native/src/main/native/com_pi4j_wiringpi_SoftPwm.c index 9f9af1ecb..c839c85cf 100644 --- a/pi4j-native/src/main/native/com_pi4j_wiringpi_SoftPwm.c +++ b/pi4j-native/src/main/native/com_pi4j_wiringpi_SoftPwm.c @@ -9,7 +9,7 @@ * this project can be found here: http://www.pi4j.com/ * ********************************************************************** * %% - * Copyright (C) 2012 Pi4J + * Copyright (C) 2012 - 2013 Pi4J * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/pi4j-native/src/main/native/com_pi4j_wiringpi_SoftPwm.h b/pi4j-native/src/main/native/com_pi4j_wiringpi_SoftPwm.h index 18ab14eba..eaf25a338 100644 --- a/pi4j-native/src/main/native/com_pi4j_wiringpi_SoftPwm.h +++ b/pi4j-native/src/main/native/com_pi4j_wiringpi_SoftPwm.h @@ -9,7 +9,7 @@ * this project can be found here: http://www.pi4j.com/ * ********************************************************************** * %% - * Copyright (C) 2012 Pi4J + * Copyright (C) 2012 - 2013 Pi4J * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/pi4j-native/src/main/native/com_pi4j_wiringpi_Spi.c b/pi4j-native/src/main/native/com_pi4j_wiringpi_Spi.c index 2107d7911..1a6cda98d 100644 --- a/pi4j-native/src/main/native/com_pi4j_wiringpi_Spi.c +++ b/pi4j-native/src/main/native/com_pi4j_wiringpi_Spi.c @@ -9,7 +9,7 @@ * this project can be found here: http://www.pi4j.com/ * ********************************************************************** * %% - * Copyright (C) 2012 Pi4J + * Copyright (C) 2012 - 2013 Pi4J * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,9 +52,12 @@ JNIEXPORT jint JNICALL Java_com_pi4j_wiringpi_Spi_wiringPiSPIDataRW char datachararr[2048]; int len = (*env)->GetStringLength(env, data); (*env)->GetStringUTFRegion(env, data, 0, len, datachararr); - return wiringPiSPIDataRW(channel, (unsigned char *)datachararr, length); -} + jint result = wiringPiSPIDataRW(channel, (unsigned char *)datachararr, length); + jstring returnString = (*env)->NewStringUTF(env, datachararr); + data = returnString; + return result; +} /* * Class: com_pi4j_wiringpi_Spi diff --git a/pi4j-native/src/main/native/com_pi4j_wiringpi_Spi.h b/pi4j-native/src/main/native/com_pi4j_wiringpi_Spi.h index 12be10471..9f01ea90b 100644 --- a/pi4j-native/src/main/native/com_pi4j_wiringpi_Spi.h +++ b/pi4j-native/src/main/native/com_pi4j_wiringpi_Spi.h @@ -9,7 +9,7 @@ * this project can be found here: http://www.pi4j.com/ * ********************************************************************** * %% - * Copyright (C) 2012 Pi4J + * Copyright (C) 2012 - 2013 Pi4J * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/pi4j-native/src/main/native/wiringpi-build.sh b/pi4j-native/src/main/native/wiringpi-build.sh index 3cc82d272..682e2bfa6 100644 --- a/pi4j-native/src/main/native/wiringpi-build.sh +++ b/pi4j-native/src/main/native/wiringpi-build.sh @@ -9,7 +9,7 @@ # this project can be found here: http://www.pi4j.com/ # ********************************************************************** # %% -# Copyright (C) 2012 Pi4J +# Copyright (C) 2012 - 2013 Pi4J # %% # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ sudo apt-get install git-core -y # ---------------------------------- # clone wiringPi from github # ---------------------------------- -git clone git://git.drogon.net/wiringPi +git clone git://github.com/WiringPi/WiringPi.git wiringPi cd wiringPi git pull origin @@ -48,4 +48,4 @@ sudo make uninstall # build latest wiringPi # ---------------------------------- cd .. -./build +./build \ No newline at end of file