Modbus: reuse modbus decoder in aa55 (#30848)

This commit is contained in:
andig 2026-06-14 18:15:43 +02:00 • committed by GitHub
parent 18609ee874
commit cae5e66085
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 83 additions and 246 deletions

View file

@ -60,11 +60,6 @@ func NewAA55UDPFromConfig(ctx context.Context, other map[string]any) (Plugin, er
return nil, err
}
count, err := cc.Register.Length()
if err != nil {
return nil, err
}
raddr, err := net.ResolveUDPAddr("udp4", net.JoinHostPort(cc.Host, "8899"))
if err != nil {
return nil, err
@ -76,7 +71,7 @@ func NewAA55UDPFromConfig(ctx context.Context, other map[string]any) (Plugin, er
return nil, err
}
res, err := aa55.New(util.NewLogger("aa55udp"), conn, cc.Id, cc.Register.Address, count, cc.Block, cc.Register.Decode, cc.Scale, cc.Delay)
res, err := aa55.New(util.NewLogger("aa55udp"), conn, cc.Id, cc.Register, cc.Block, cc.Scale, cc.Delay)
if err != nil {
return nil, fmt.Errorf("aa55udp: %w", err)
}