This repository has been archived by the owner on Jun 29, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from openconnectivity/develop
Merge develop into master
- Loading branch information
Showing
15 changed files
with
343 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Package: OTGC | ||
Version: 2.0.5 | ||
Version: 2.0.6 | ||
Section: custom | ||
Priority: optional | ||
Architecture: amd64 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
|
||
# Constants | ||
PROJECT_NAME="otgc" | ||
VERSION="2.0.5" | ||
VERSION="2.0.6" | ||
|
||
program=$0 | ||
|
||
|
Submodule iotivity-lite
updated
from 1b955e to 513d1c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/main/java/org/openconnectivity/otgc/domain/usecase/ResetClientModeUseCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright 2019 DEKRA Testing and Certification, S.A.U. All Rights Reserved. | ||
* | ||
* **************************************************************** | ||
* | ||
* 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. | ||
*/ | ||
|
||
package org.openconnectivity.otgc.domain.usecase; | ||
|
||
import io.reactivex.Completable; | ||
import org.openconnectivity.otgc.data.repository.ProvisionRepository; | ||
import org.openconnectivity.otgc.data.repository.SettingRepository; | ||
import org.openconnectivity.otgc.utils.constant.OtgcMode; | ||
|
||
import javax.inject.Inject; | ||
|
||
public class ResetClientModeUseCase { | ||
|
||
private final ProvisionRepository provisionRepository; | ||
private final SettingRepository settingRepository; | ||
|
||
@Inject | ||
public ResetClientModeUseCase(ProvisionRepository provisionRepository, | ||
SettingRepository settingRepository) { | ||
this.provisionRepository = provisionRepository; | ||
this.settingRepository = settingRepository; | ||
} | ||
|
||
public Completable execute() { | ||
return provisionRepository.resetSvrDb() | ||
.andThen(settingRepository.set(SettingRepository.MODE_KEY, OtgcMode.CLIENT)); | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
src/main/java/org/openconnectivity/otgc/domain/usecase/ResetObtModeUseCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright 2019 DEKRA Testing and Certification, S.A.U. All Rights Reserved. | ||
* | ||
* **************************************************************** | ||
* | ||
* 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. | ||
*/ | ||
|
||
package org.openconnectivity.otgc.domain.usecase; | ||
|
||
import io.reactivex.Completable; | ||
import org.openconnectivity.otgc.data.repository.DoxsRepository; | ||
import org.openconnectivity.otgc.data.repository.IotivityRepository; | ||
import org.openconnectivity.otgc.data.repository.ProvisionRepository; | ||
import org.openconnectivity.otgc.data.repository.SettingRepository; | ||
import org.openconnectivity.otgc.utils.constant.OtgcMode; | ||
|
||
import javax.inject.Inject; | ||
import java.util.concurrent.TimeUnit; | ||
|
||
public class ResetObtModeUseCase { | ||
|
||
private final IotivityRepository iotivityRepository; | ||
private final DoxsRepository doxsRepository; | ||
private final ProvisionRepository provisioningRepository; | ||
private final SettingRepository settingRepository; | ||
|
||
@Inject | ||
public ResetObtModeUseCase(IotivityRepository iotivityRepository, | ||
DoxsRepository doxsRepository, | ||
ProvisionRepository provisioningRepository, | ||
SettingRepository settingRepository) { | ||
this.iotivityRepository = iotivityRepository; | ||
this.doxsRepository = doxsRepository; | ||
this.provisioningRepository = provisioningRepository; | ||
this.settingRepository = settingRepository; | ||
} | ||
|
||
public Completable execute() { | ||
int delay = Integer.parseInt(settingRepository.get(SettingRepository.REQUESTS_DELAY_KEY, SettingRepository.REQUESTS_DELAY_DEFAULT_VALUE)); | ||
|
||
return iotivityRepository.scanOwnedDevices() | ||
.flatMapCompletable(device -> doxsRepository.resetDevice(device.getDeviceId())) | ||
.delay(delay, TimeUnit.SECONDS) | ||
.andThen(provisioningRepository.resetSvrDb()) | ||
.andThen(settingRepository.set(SettingRepository.MODE_KEY, OtgcMode.OBT)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.