Skip to content

Commit

Permalink
Don't use '-uart' suffix for proxied devices (#472)
Browse files Browse the repository at this point in the history
  • Loading branch information
floitsch committed Jan 17, 2024
1 parent 0ec8068 commit 4ebd0a9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
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

0 comments on commit 4ebd0a9

Please sign in to comment.