refactor(relay): remove redundant uint16 conversion in coil write calls
The WriteMultipleCoils method already accepts int as the first argument, making the explicit uint16(0) conversion unnecessary. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
@@ -40,12 +40,12 @@ func (r *device) Close() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (r *device) OnAll() error {
|
func (r *device) OnAll() error {
|
||||||
_, err := r.c.WriteMultipleCoils(uint16(0), 16, []byte{0xFF, 0xFF})
|
_, err := r.c.WriteMultipleCoils(0, 16, []byte{0xFF, 0xFF})
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *device) OffAll() error {
|
func (r *device) OffAll() error {
|
||||||
_, err := r.c.WriteMultipleCoils(uint16(0), 16, []byte{0x00, 0x00})
|
_, err := r.c.WriteMultipleCoils(0, 16, []byte{0x00, 0x00})
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user