feat(modem): method to configure APN/authentication

This commit is contained in:
2025-06-11 12:11:17 +02:00
parent 359a0018c5
commit 3224e1ef0f
7 changed files with 133 additions and 0 deletions

View File

@ -0,0 +1,41 @@
package protocol
type SetModemOptions struct {
Apn *string
Type *string
Username *string
Password *string
}
type SetModemOptionsFunc func(opts *SetModemOptions)
func NewSetModemOptions(funcs ...SetModemOptionsFunc) *SetModemOptions {
opts := &SetModemOptions{}
for _, fn := range funcs {
fn(opts)
}
return opts
}
func WithApn(value string) SetModemOptionsFunc {
return func(opts *SetModemOptions) {
opts.Apn = &value
}
}
func WithType(value string) SetModemOptionsFunc {
return func(opts *SetModemOptions) {
opts.Type = &value
}
}
func WithUsername(value string) SetModemOptionsFunc {
return func(opts *SetModemOptions) {
opts.Username = &value
}
}
func WithPassword(value string) SetModemOptionsFunc {
return func(opts *SetModemOptions) {
opts.Password = &value
}
}