Skip to content

Commit

Permalink
EVA-FTP-Client.ps1: make WriteFile ack wait depend on size of uploade… (
Browse files Browse the repository at this point in the history
#56)

* Update README.md

* EVA-FTP-Client.ps1: make WriteFile ack wait depend on size of uploaded data
  • Loading branch information
PeterPawn committed May 4, 2023
1 parent 61053b0 commit f0b0942
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![YourFritz-Logo](yourfritz_logo.png) ![YourFritz-QR](www.yourfritz.de.png)
![YourFritz-Logo](yourfritz_logo.png)

The final target of this project is to provide a really dynamic package management for SOHO/consumer IADs built by
well-known vendor (at least known in Germany) AVM from Berlin.
Expand Down
10 changes: 9 additions & 1 deletion eva_tools/EVA-FTP-Client.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ function WriteFile {
try {
$path = Resolve-Path $filename
$file = [System.IO.File]::Open($path, "Open", "Read")
$size = $file.Length
}
catch {
$ex = New-Object System.IO.IOException "Unable to locate or open input file."
Expand Down Expand Up @@ -404,7 +405,14 @@ function WriteFile {
$sending = $False
# try to get an answer from the device after closing the data stream and the connection, the response from the device was
# very late during my tests
Start-Sleep -Milliseconds 5000
if ($size -gt (1024*1024)) {
$wait = 15
}
else {
$wait = 5
}
Write-Debug "Upload completed, waiting $wait seconds for acknowledgement ..."
Start-Sleep -Milliseconds ($wait * 1000)
}
$answer = [String]::Empty
$answer = ReadAnswer
Expand Down

0 comments on commit f0b0942

Please sign in to comment.