-
Notifications
You must be signed in to change notification settings - Fork 302
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
Add initial CPF support to GCS #1747
Add initial CPF support to GCS #1747
Conversation
bff8baa
to
210b026
Compare
return nil, err | ||
} | ||
var gatewayConf LoradGatewayConf | ||
if len(gtw.Antennas) > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this makes sense - it seems that SX1301
only allows for 1 antenna gain to be configured, what should happen when there are multiple?
Same question for location.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC, with the v1 and v1.5 ref design, there's usually only one antenna per concentrator and each concentrator gets one SX1301_Conf object.
@htdvisser can confirm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one.
pkg/gatewayconfigurationserver/gatewayconfigurationserver_test.go
Outdated
Show resolved
Hide resolved
pkg/gatewayconfigurationserver/gatewayconfigurationserver_test.go
Outdated
Show resolved
Hide resolved
pkg/gatewayconfigurationserver/gatewayconfigurationserver_test.go
Outdated
Show resolved
Hide resolved
}) | ||
} | ||
|
||
func (gcs *GatewayConfigurationServer) makeTextMarshalerGatewayConfigHandler(contentType string, f func(context.Context, *ttnpb.Gateway) (encoding.TextMarshaler, error)) func(echo.Context) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: "TextMarshalling" is a golang term right? I think it would be nice to use the output file format in the funtion name. For example, makeJSON
, makeTOML
, makeYAML
etc..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's named this way, because this method uses the MarshalText
method on an encoding.TextMarshaler
and it takes the content-type as parameter.
E.g. makeJSONHandler
only takes an interface{}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think that it's better to name a function after what it creates rather than what method it calls internally. But again this is nitpick.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method does not know what it creates - that's the point.
The content-type is a parameter - it may create TOML, JSON, YAML or anything else.
return nil, err | ||
} | ||
var gatewayConf LoradGatewayConf | ||
if len(gtw.Antennas) > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC, with the v1 and v1.5 ref design, there's usually only one antenna per concentrator and each concentrator gets one SX1301_Conf object.
@htdvisser can confirm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase for your fixup commit and I think you need to run go:fmt
to fix the lint errors.
f55ef65
to
5283afa
Compare
Existing implementation silently ignores errors, replace that by a cleaner approach
5283afa
to
a71a35f
Compare
Summary
References #1631 TheThingsNetwork/kerlink-wirnet-firmware#9
Changes
Notes for Reviewers
I will file issue(s) for added support for CPF in GCS before "undrafting" this
Checklist
README.md
.CHANGELOG.md
.CONTRIBUTING.md
, there are no fixup commits left.