Skip to content
This repository has been archived by the owner on Jun 29, 2021. It is now read-only.

Commit

Permalink
Merge pull request #11 from openconnectivity/develop
Browse files Browse the repository at this point in the history
Merge develop into master
  • Loading branch information
javiguerra committed Oct 15, 2019
2 parents cf64dce + a382914 commit f46fa90
Show file tree
Hide file tree
Showing 13 changed files with 95 additions and 106 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,18 @@ To import the IoTivity-lite API Binary into the OTGC Linux App project:

4. Copy **libiotivity-lite.so** into <otgc-linux>/lib/jni

5. Add the following command, to link the previous libraries with iotivity.jar, in the run/debug configuration:
5. Install iotivity-lite.jar into the local Maven repository
```
mvn install:install-file \
-Dfile=lib/iotivity-lite.jar \
-DgroupId=org.iotivity \
-DartifactId=iotivity-lite \
-Dversion=1.0 \
-Dpackaging=jar \
-DgeneratePom=true
```

6. Add the following command, to link the previous libraries with iotivity.jar, in the run/debug configuration:
```
-Djava.library.path=<otgc-linux>/lib/jni
```
Expand All @@ -54,7 +65,6 @@ git checkout swig
2. Apply all patchs of the OTGC in IoTivity-lite
```
git apply <otgc-linux>/extlibs/patchs/remove_cred_by_credid.patch
git apply <otgc-linux>/extlibs/patchs/fix_oc_api.patch
```
3. Go to the linux directory.
```
Expand Down
23 changes: 15 additions & 8 deletions build/debian/otgc_native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,23 @@

# Constants
PROJECT_NAME="otgc"
VERSION="2.1.0"
VERSION="2.2.0"

program=$0

function usage()
{
echo "usage: $program app_path"
echo "usage: $program app_path arch"
echo " path Path to assets, libraries and application jar"
echo " arch Target architecture (see values with the command dpkg-architecture -L)"
exit 1
}

if [ $# -ne 1 ] ; then
if [ $# -ne 2 ] ; then
usage
else
path=$1
arch=$2

mkdir $(pwd)/out

Expand All @@ -40,12 +42,17 @@ else
mkdir -p $(pwd)/out/$PROJECT_NAME-$VERSION/usr/share/applications # item desktop

# Copy configuration and script files to DEBIAN folder
if [ -e "$(pwd)/control" ]
if [ -e "$(pwd)/template_control.sh" ]
then
cp $(pwd)/control $(pwd)/out/$PROJECT_NAME-$VERSION/DEBIAN
else
echo "Control file does not exist."
exit 1
chmod 755 $(pwd)/template_control.sh
if [ -e "$(pwd)/out/control" ]
then
rm $(pwd)/out/control
fi
$(pwd)/template_control.sh "$VERSION" $arch > $(pwd)/out/control
chmod 755 $(pwd)/out/control
cp $(pwd)/out/control $(pwd)/out/$PROJECT_NAME-$VERSION/DEBIAN
rm $(pwd)/out/control
fi
# Pre-Installation script
if [ -e "$(pwd)/template_preinst.sh" ]
Expand Down
14 changes: 11 additions & 3 deletions build/debian/control → build/debian/template_control.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
#!/bin/bash

# Define parameters which are passed in
VERSION=$1
ARCH=$2

# Define the template
cat << EOF
Package: OTGC
Version: 2.1.0
Version: $VERSION
Section: custom
Priority: optional
Architecture: amd64
Architecture: $ARCH
Pre-Depends: openjdk-8-jdk, openjfx
Maintainer: DEKRA Testing and Certification, S.A.U.
Description: Onboarding Tool and Generic Client.

EOF
2 changes: 1 addition & 1 deletion extlibs/iotivity-lite
Submodule iotivity-lite updated from d301b8 to 66a2d0
13 changes: 0 additions & 13 deletions extlibs/patchs/fix_oc_api.patch

This file was deleted.

20 changes: 3 additions & 17 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>otgc</groupId>
<artifactId>otgc</artifactId>
<version>2.1.0</version>
<version>2.2.0</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -73,7 +73,7 @@
</goals>
<configuration>
<!-- <outputDirectory>${project.build.directory}/classes/lib</outputDirectory> -->
<outputDirectory>${build.directory}/jfx/app/lib</outputDirectory>
<outputDirectory>${project.build.directory}/jfx/app/lib</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
Expand All @@ -98,8 +98,6 @@
<groupId>org.iotivity</groupId>
<artifactId>iotivity-lite</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/iotivity-lite.jar</systemPath>
</dependency>
<!-- -->
<dependency>
Expand Down Expand Up @@ -168,25 +166,19 @@
<artifactId>hsqldb</artifactId>
<version>2.4.0</version>
</dependency>
<!-- JUnit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- JUnit -->
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-junit</artifactId>
<version>2.0.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<!-- Mockito -->
<dependency>
<groupId>org.mockito</groupId>
Expand Down Expand Up @@ -238,11 +230,5 @@
<artifactId>cbor</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,7 @@ public Completable provisionRoleCertificate(String deviceId, String roleId, Stri
return Completable.create(emitter -> {
OCUuid di = OCUuidUtil.stringToUuid(deviceId);

OCRole role = new OCRole();
role.setRole(roleId);
role.setAuthority(roleAuthority);
OCRole roles = OCObt.addRoleId(null, roleId, roleAuthority);

OCObtStatusHandler handler = (int status) -> {
if (status >= 0) {
Expand All @@ -289,9 +287,10 @@ public Completable provisionRoleCertificate(String deviceId, String roleId, Stri
}
};

int ret = OCObt.provisionRoleCertificate(role, di, handler);
int ret = OCObt.provisionRoleCertificate(roles, di, handler);
if (ret < 0) {
emitter.onError(new IOException("Provision role certificate error"));
OCObt.freeRoleId(roles);
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public class DeleteAclUseCase {
public Completable execute(Device device, long aceId) {
return iotivityRepository.getSecureEndpoint(device)
.flatMapCompletable(endpoint ->
pstatRepository.changeDeviceStatus(device.getIpv6SecureHost(), device.getDeviceId(), OcfDosType.OC_DOSTYPE_RFPRO)
.andThen(amsRepository.deleteAcl(device.getIpv6SecureHost(), device.getDeviceId(), aceId))
.andThen(pstatRepository.changeDeviceStatus(device.getIpv6SecureHost(), device.getDeviceId(), OcfDosType.OC_DOSTYPE_RFNOP)));
pstatRepository.changeDeviceStatus(endpoint, device.getDeviceId(), OcfDosType.OC_DOSTYPE_RFPRO)
.andThen(amsRepository.deleteAcl(endpoint, device.getDeviceId(), aceId))
.andThen(pstatRepository.changeDeviceStatus(endpoint, device.getDeviceId(), OcfDosType.OC_DOSTYPE_RFNOP)));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@

package org.openconnectivity.otgc.utils.constant;

import sun.reflect.generics.reflectiveObjects.NotImplementedException;

public class OcfResourceAttributeKey {

private OcfResourceAttributeKey() {
throw new NotImplementedException();
private OcfResourceAttributeKey() throws Exception {
throw new Exception("Static class");
}

/* Resource base */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@

package org.openconnectivity.otgc.utils.constant;

import sun.reflect.generics.reflectiveObjects.NotImplementedException;

public class OcfResourceUri {

private OcfResourceUri() {
throw new NotImplementedException();
private OcfResourceUri() throws Exception {
throw new Exception("Static class");
}

// URIs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@

package org.openconnectivity.otgc.utils.constant;

import sun.reflect.generics.reflectiveObjects.NotImplementedException;

import java.io.File;

public class OtgcConstant {

private OtgcConstant() {
throw new NotImplementedException();
private OtgcConstant() throws Exception {
throw new Exception("Static class");
}

// Data resource path
Expand Down
Loading

0 comments on commit f46fa90

Please sign in to comment.