12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- package bx
- type BxCmd interface {
- Build() []byte
- }
- type baseBxCmd struct {
- BxCmd
- group byte
- cmd byte
- reqResp byte
- r0 byte
- r1 byte
- }
- func newBaseCmd(group, cmd byte) baseBxCmd {
- return baseBxCmd{
- group: group,
- cmd: cmd,
- reqResp: 0x01,
- }
- }
- func (b *baseBxCmd) Group() byte {
- return b.group
- }
- func (b *baseBxCmd) SetGroup(group byte) {
- b.group = group
- }
- func (b *baseBxCmd) Cmd() byte {
- return b.cmd
- }
- func (b *baseBxCmd) SetCmd(cmd byte) {
- b.cmd = cmd
- }
- func (b *baseBxCmd) ReqResp() byte {
- return b.reqResp
- }
- func (b *baseBxCmd) SetReqResp(reqResp byte) {
- b.reqResp = reqResp
- }
- func (b *baseBxCmd) R0() byte {
- return b.r0
- }
- func (b *baseBxCmd) SetR0(r0 byte) {
- b.r0 = r0
- }
- func (b *baseBxCmd) R1() byte {
- return b.r1
- }
- func (b *baseBxCmd) SetR1(r1 byte) {
- b.r1 = r1
- }
|