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 all commits
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
7 changes: 6 additions & 1 deletion cmd/jag/commands/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,15 @@ type Device struct {
Address string `mapstructure:"address" yaml:"address" json:"address"`
SDKVersion string `mapstructure:"sdkVersion" yaml:"sdkVersion" json:"sdkVersion"`
WordSize int `mapstructure:"wordSize" yaml:"wordSize" json:"wordSize"`
Proxied bool `mapstructure:"proxied" yaml:"proxied" json:"proxied"`
}

func (d Device) String() string {
return fmt.Sprintf("%s (address: %s, %d-bit)", d.Name, d.Address, d.WordSize*8)
proxied := ""
if d.Proxied {
proxied = ", proxied"
}
return fmt.Sprintf("%s (address: %s, %d-bit%s)", d.Name, d.Address, d.WordSize*8, proxied)
}

func (d Device) Short() string {
Expand Down
3 changes: 2 additions & 1 deletion cmd/jag/commands/proxy_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,13 @@ 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,
"id": identity.Id,
"chip": identity.Chip,
"sdkVersion": identity.SdkVersion,
"address": "http://" + localIP + ":" + strconv.Itoa(localPort),
"wordSize": 4,
"proxied": true,
},
}
return json.Marshal(jsonIdentity)
Expand Down