Unverified Commit dfe275ec authored by Javier Guerra's avatar Javier Guerra Committed by GitHub

Merge pull request #11 from openconnectivity/develop

Merge develop into master
parents cdfc7cc6 c62eea43
......@@ -30,7 +30,7 @@ android {
minSdkVersion 21
targetSdkVersion 28
versionCode 13
versionName "2.0.8"
versionName "2.0.9"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
compileOptions {
......
......@@ -24,6 +24,7 @@ package org.openconnectivity.otgc.data.repository;
import android.content.Context;
import org.iotivity.CborEncoder;
import org.iotivity.OCBufferSettings;
import org.iotivity.OCClientResponse;
import org.iotivity.OCCoreRes;
import org.iotivity.OCEndpoint;
......@@ -138,13 +139,15 @@ public class IotivityRepository {
emitter.onError(e);
}
OCIntrospection.setIntrospectionData(0 /* First device */, introspectionData);
OCBufferSettings.setMaxAppDataSize(16384); // 16 KB
int ret = OCMain.mainInit(new OCMainInitHandler() {
@Override
public int initialize() {
Timber.d("In OCMainInitHandler.initilize()");
int ret = OCMain.initPlatform("OCF");
ret |= OCMain.addDevice("/oic/d", "oic.wk.d", "OTGC", "ocf.2.4.0", "ocf.res.1.3.0");
ret |= OCMain.addDevice("/oic/d", "oic.wk.d", "OTGC", "ocf.2.0.5", "ocf.res.1.3.0");
return ret;
}
......
......@@ -26,6 +26,7 @@ import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import org.openconnectivity.otgc.domain.usecase.GetDeviceDatabaseUseCase;
import org.openconnectivity.otgc.domain.usecase.GetDeviceIdUseCase;
import org.openconnectivity.otgc.domain.usecase.GetModeUseCase;
import org.openconnectivity.otgc.domain.usecase.accesscontrol.CreateAclUseCase;
import org.openconnectivity.otgc.domain.usecase.wifi.CheckConnectionUseCase;
......@@ -78,6 +79,7 @@ public class DoxsViewModel extends BaseViewModel {
private final PairwiseDevicesUseCase mPairwiseDevicesUseCase;
private final UnlinkDevicesUseCase mUnlinkDevicesUseCase;
private final GetDeviceDatabaseUseCase mGetDeviceDatabaseUseCase;
private final GetDeviceIdUseCase mGetDeviceIdUseCase;
private final SchedulersFacade mSchedulersFacade;
......@@ -112,6 +114,7 @@ public class DoxsViewModel extends BaseViewModel {
PairwiseDevicesUseCase pairwiseDevicesUseCase,
UnlinkDevicesUseCase unlinkDevicesUseCase,
GetDeviceDatabaseUseCase getDeviceDatabaseUseCase,
GetDeviceIdUseCase getDeviceIdUseCase,
SchedulersFacade schedulersFacade) {
this.mCheckConnectionUseCase = checkConnectionUseCase;
this.mGetModeUseCase = getModeUseCase;
......@@ -129,6 +132,7 @@ public class DoxsViewModel extends BaseViewModel {
this.mPairwiseDevicesUseCase = pairwiseDevicesUseCase;
this.mUnlinkDevicesUseCase = unlinkDevicesUseCase;
this.mGetDeviceDatabaseUseCase = getDeviceDatabaseUseCase;
this.mGetDeviceIdUseCase = getDeviceIdUseCase;
this.mSchedulersFacade = schedulersFacade;
......@@ -258,7 +262,8 @@ public class DoxsViewModel extends BaseViewModel {
deviceRole -> {
ownedDevice.setDeviceRole(deviceRole);
deviceRoleResponse.setValue(Response.success(ownedDevice));
mCreateAclUseCase.execute(ownedDevice, true, Arrays.asList("*"), 31)
String deviceId = mGetDeviceIdUseCase.execute().blockingGet();
mCreateAclUseCase.execute(ownedDevice, deviceId, Arrays.asList("*"), 6)
.subscribeOn(mSchedulersFacade.io())
.observeOn(mSchedulersFacade.ui())
.subscribe(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment