Skip to content

Commit

Permalink
FIX: partial commit 530e79f by accident
Browse files Browse the repository at this point in the history
  • Loading branch information
pascaldekloe committed Jul 24, 2024
1 parent 530e79f commit a7ceb23
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion info/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ func (q SetPtQual) N() uint { return uint(q & 127) }

// SetN resplaces the QL value, range 0..127.
// Any bits from n values over 127 get discarded silently.
func (q *SetPtQual) SetN(n uint) { *q = *q&128 | n&127 }
func (q *SetPtQual) SetN(n uint) { *q = *q&128 | SetPtQual(n&127) }

// Select gets the S/E flag, which causes the command to select instead of
// execute. See “Command transmission” in section 5, subclause 6.8.
Expand Down
5 changes: 2 additions & 3 deletions info/packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,16 @@ func (p Params[Orig, Com, Obj]) DoubleCmd(addr Obj, pt DoublePt, q CmdQual) Data
// (0 and 3) are not permitted.
func (p Params[Orig, Com, Obj]) RegulCmd(addr Obj, r Regul, q CmdQual) DataUnit[Orig, Com, Obj] {
u := p.cmd(addr, byte(r&3)|byte(q&^3))
u := p.cmd(addr, c)
u.Type = C_RC_NA_1
return u
}

func (p Params[Orig, Com, Obj]) cmd(addr Obj, c Cmd) DataUnit[Orig, Com, Obj] {
func (p Params[Orig, Com, Obj]) cmd(addr Obj, c byte) DataUnit[Orig, Com, Obj] {
u := p.NewDataUnit()
u.Enc = 1 // fixed
u.Cause = Act // could Deact
u.setAddr(addr)
u.Info = append(u.Info, byte(c))
u.Info = append(u.Info, c)
return u
}

Expand Down

0 comments on commit a7ceb23

Please sign in to comment.