Skip to content

Commit

Permalink
fix: Fixup serialpipe creation logic a little bit
Browse files Browse the repository at this point in the history
  • Loading branch information
feelfreelinux committed May 17, 2024
1 parent c5b522c commit 72eb32d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
1 change: 0 additions & 1 deletion app/app/src/main/cpp/vsp-pty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ extern "C"

[[noreturn]] static void* ptyThread(void* irrelevant)
{

int slave;
__android_log_print(ANDROID_LOG_VERBOSE, "TAG", "PtyThread getting ready");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class BootstrapRepositoryImpl(
companion object {
private val FILES_PATH = "/data/data/com.octo4a/files"
val PREFIX_PATH = "$FILES_PATH/bootstrap"
val HOME_PATH = "$FILES_PATH/home"
val HOME_PATH = "$FILES_PATH"
}

val filesPath: String by lazy { context.getExternalFilesDir(null).absolutePath }
Expand Down Expand Up @@ -266,10 +266,10 @@ class BootstrapRepositoryImpl(
}

override fun ensureHomeDirectory() {
// val homeFile = File(HOME_PATH)
// if (!homeFile.exists()) {
// homeFile.mkdir()
// }
val homeFile = File(HOME_PATH)
if (!homeFile.exists()) {
homeFile.mkdir()
}
}

override val isSSHConfigured: Boolean
Expand Down
4 changes: 1 addition & 3 deletions app/app/src/main/java/com/octo4a/service/OctoPrintService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,11 @@ class OctoPrintService : LifecycleService() {
override fun onCreate() {
registerReceiver(broadcastReceiver, intentFilter)
bootstrapRepository.ensureHomeDirectory()
virtualSerialDriver.initializeVSP()
virtualSerialDriver.handlePtyThread()

scope.launch {
handlerRepository.beginInstallation()
virtualSerialDriver.initializeVSP()
virtualSerialDriver.handlePtyThread()
handlerRepository.beginInstallation()
}

handlerRepository.serverState.asLiveData().observe(this) {
Expand Down

0 comments on commit 72eb32d

Please sign in to comment.