Skip to content

Commit

Permalink
cli: Fix gateway antenna
Browse files Browse the repository at this point in the history
  • Loading branch information
onizmx committed Sep 18, 2023
1 parent 8466c19 commit 8c7a142
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions cmd/ttn-lw-cli/commands/applications_downlink.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,20 @@ var (
return err
}
var downlink ttnpb.ApplicationDownlink
paths, err := downlink.SetFromFlags(cmd.Flags(), "")
_, err = downlink.SetFromFlags(cmd.Flags(), "")
if err != nil {
return err
}
antennas, err := GetGatewayAntennaIdentifiers(cmd.Flags(), "class-b-c")
if err != nil {
return err
}
if len(antennas) > 0 {
paths = append(paths, "class-b-c.gateways")
for i, antenna := range antennas {
gateway := ttnpb.ClassBCGatewayIdentifiers{
GatewayIds: antenna.GatewayIds,
GroupIndex: uint32(i),
}
downlink.ClassBC.Gateways = append(downlink.ClassBC.Gateways, &gateway)
}
as, err := api.Dial(ctx, config.ApplicationServerGRPCAddress)
if err != nil {
Expand All @@ -73,16 +77,20 @@ var (
}

var downlink ttnpb.ApplicationDownlink
paths, err := downlink.SetFromFlags(cmd.Flags(), "")
_, err = downlink.SetFromFlags(cmd.Flags(), "")
if err != nil {
return err
}
antennas, err := GetGatewayAntennaIdentifiers(cmd.Flags(), "class-b-c")
if err != nil {
return err
}
if len(antennas) > 0 {
paths = append(paths, "class-b-c.gateways")
for i, antenna := range antennas {
gateway := ttnpb.ClassBCGatewayIdentifiers{
GatewayIds: antenna.GatewayIds,
GroupIndex: uint32(i),
}
downlink.ClassBC.Gateways = append(downlink.ClassBC.Gateways, &gateway)
}
as, err := api.Dial(ctx, config.ApplicationServerGRPCAddress)
if err != nil {
Expand Down

0 comments on commit 8c7a142

Please sign in to comment.