Skip to content

Commit

Permalink
Changes that went into the 1.0 firmware
Browse files Browse the repository at this point in the history
  • Loading branch information
kiet committed Jan 20, 2024
1 parent ee4c453 commit ed3e4e6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"os"
)

const logFilePath = "/root/frc-radio-api.log"
const logFilePath = "/tmp/frc-radio-api.log"

func main() {
// Set up logging to file.
Expand Down
4 changes: 2 additions & 2 deletions web/firmware_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const (
maxRequestSizeBytes = 64 * 1024 * 1024 // 64 MB

// Maximum size of the firmware file that can be held in memory at once (based on device memory limitations).
maxMemorySizeBytes = 20 * 1024 * 1024 // 20 MB
maxMemorySizeBytes = 2 * 1024 * 1024 // 2 MB

// Path to the optional file containing the private key for decrypting new firmware.
firmwareDecryptionKeyFilePath = "/root/frc-radio-api-firmware-key.txt"
Expand Down Expand Up @@ -95,7 +95,7 @@ func (web *WebServer) firmwareHandler(w http.ResponseWriter, r *http.Request) {
}()

w.WriteHeader(http.StatusAccepted)
_, _ = fmt.Fprintln(w, "New firmware received and will be applied now.")
_, _ = fmt.Fprintln(w, "New firmware received and will be applied now. The radio will reboot several times. The firmware upgrade process is complete when the SYS light is slowly blinking.")
}

// decryptAndSaveFirmwareFile decrypts the given uploaded file and saves it to the hardcoded path for new firmware.
Expand Down
4 changes: 2 additions & 2 deletions web/web_server_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

const (
// TCP port that the web server listens on.
port = 8081
port = 80

// Path to the optional file containing the password for the API.
passwordFilePath = "/root/frc-radio-api-password.txt"
Expand Down Expand Up @@ -85,7 +85,7 @@ func (web *WebServer) newRouter() http.Handler {

// rootHandler redirects the root URL to the status page.
func (web *WebServer) rootHandler(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "/status", http.StatusFound)
http.Redirect(w, r, "/configuration", http.StatusFound)
}

// healthHandler returns a simple "OK" response to indicate that the server is running.
Expand Down

0 comments on commit ed3e4e6

Please sign in to comment.