Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use '-uart' suffix for proxied devices #472

Merged
merged 3 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion cmd/jag/commands/firmware.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"io/ioutil"
"os"
"path/filepath"
"strings"

"github.com/google/uuid"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -106,9 +107,14 @@ func FirmwareUpdateCmd() *cobra.Command {
return err
}

name := device.Name
// Drop `^...` suffix from device-name. Typically this "^uart" as in "foo-bar^uart".
if hatIndex := strings.Index(name, "^"); hatIndex != -1 {
name = name[:hatIndex]
}
deviceOptions := DeviceOptions{
Id: newID,
Name: device.Name,
Name: name,
Chip: chip,
WifiSsid: wifiSSID,
WifiPassword: wifiPassword,
Expand Down
2 changes: 1 addition & 1 deletion cmd/jag/commands/proxy_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func createIdentityPayload(identity *uartIdentity, localIP string, localPort int
jsonIdentity := map[string]interface{}{
"method": "jaguar.identify",
"payload": map[string]interface{}{
"name": identity.Name + "-uart",
"name": identity.Name + "^uart",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like the hat, so much.

"id": identity.Id,
"chip": identity.Chip,
"sdkVersion": identity.SdkVersion,
Expand Down