Skip to content

Commit

Permalink
rx test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
pauleyj committed Aug 22, 2018
1 parent 3de7af8 commit a7b97ca
Show file tree
Hide file tree
Showing 4 changed files with 331 additions and 124 deletions.
8 changes: 6 additions & 2 deletions api/rx/modem_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const (
)

type ModemStatus struct {
Status byte
status byte
}

func newModemStatus() Frame {
Expand All @@ -14,7 +14,11 @@ func newModemStatus() Frame {


func (f *ModemStatus) RX(b byte) error {
f.Status = b
f.status = b

return nil
}

func (f *ModemStatus) Status() byte {
return f.status
}
69 changes: 69 additions & 0 deletions api/rx/rx_frame.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,72 @@ const (
type Frame interface {
RX(byte) error
}

// IDGetter gets frame ID
type IDGetter interface {
ID() byte
}

// Addr64Getter gets 64-address
type Addr64Getter interface {
Addr64() uint64
}

// Addr16Getter get 16-bit address
type Addr16Getter interface {
Addr16() uint16
}

// SrcEPGetter gets source endpoint
type SrcEPGetter interface {
SrcEP() byte
}
// DstEPGetter getsdestination endpoint
type DstEPGetter interface {
DstEP() byte
}

// ClusterIDGetter gets cluster ID
type ClusterIDGetter interface {
ClusterID() uint16
}

// ProfileIDGetter gets profile ID
type ProfileIDGetter interface {
ProfileID() uint16
}

// CommandGetter gets command
type CommandGetter interface {
Command() []byte
}

// StatusGetter gets status
type StatusGetter interface {
Status() byte
}

// OptionsGetter gets options
type OptionsGetter interface {
Options() byte
}

// DataGetter gets data
type DataGetter interface {
Data() []byte
}

// RetriesGetter gets retries
type RetriesGetter interface {
Retries() byte
}

// DeliveryGetter gets delivery
type DeliveryGetter interface {
Delivery() byte
}

// DiscoveryGetter gets discovery
type DiscoveryGetter interface {
Discovery() byte
}
Loading

0 comments on commit a7b97ca

Please sign in to comment.