Skip to content

Commit

Permalink
Merge pull request #4 from wirenboard/feature/remove-writable
Browse files Browse the repository at this point in the history
Remove writable meta-topic support
  • Loading branch information
evgeny-boger authored Apr 20, 2020
2 parents 4e18d81 + 9f07a96 commit c2bf1cc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
7 changes: 2 additions & 5 deletions control.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ type ControlArgs interface {
SetType(string) ControlArgs
SetUnits(string) ControlArgs
SetReadonly(bool) ControlArgs
SetWritable(bool) ControlArgs
SetMax(int) ControlArgs
SetError(ControlError) ControlArgs
SetOrder(int) ControlArgs
Expand All @@ -30,7 +29,7 @@ type ControlArgs interface {
GetDescription() *string
GetType() *string
GetUnits() *string
GetWritable() *bool
GetReadonly() *bool
GetMax() *int
GetError() ControlError
GetOrder() *int
Expand Down Expand Up @@ -66,8 +65,7 @@ type Control interface {
GetDescription() string // Gets control description (/meta/description)
GetType() string // Gets control type string (/meta/type) (TODO: special type for this)
GetUnits() string // Gets control value units (/meta/units)
GetReadonly() bool // Checks whether control is read only (TODO: merge with Writable?)
GetWritable() bool // Checks whether control is writable
GetReadonly() bool // Checks whether control is read only
GetMax() int // Gets max value for 'range' type (FIXME: rework this?)
GetError() ControlError // Gets control error (/meta/error)
GetOrder() int // Gets control order (or -1 for auto) (/meta/order)
Expand All @@ -80,7 +78,6 @@ type Control interface {
SetType(t string) FuncError
SetUnits(units string) FuncError
SetReadonly(r bool) FuncError
SetWritable(w bool) FuncError
SetMax(max int) FuncError
SetError(e ControlError) FuncError
SetOrder(ord int) FuncError
Expand Down
4 changes: 0 additions & 4 deletions conventions.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ const (
CONV_META_SUBTOPIC_UNITS = "units" // for /devices/+/controls/+/meta/units
CONV_META_SUBTOPIC_MAX = "max" // for /devices/+/controls/+/meta/max
CONV_META_SUBTOPIC_DESCRIPTION = "description" // for /devices/+/controls/+/meta/description
CONV_META_SUBTOPIC_WRITABLE = "writable" // for /devices/+/controls/+/meta/writable
CONV_META_SUBTOPIC_READONLY = "readonly" // for /devices/+/controls/+/meta/readonly

// Type names
Expand Down Expand Up @@ -97,9 +96,6 @@ const (
CONV_ALARM_DEFAULT_VALUE = CONV_ALARM_VALUE_FALSE

CONV_SUBTOPIC_ALL = "+"

// Default values for control fields
CONV_CONTROL_WRITABLE_DEFAULT = false
)

// ControlDataType is a real data types used in representations
Expand Down
1 change: 1 addition & 0 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,5 @@ var (
IncorrectControlIdError = errors.New("Control ID is incorrect")
NoTxContextError = errors.New("No Tx context")
NotWritableControlError = errors.New("This control is not writable")
ReadonlyMissingError = errors.New("Missing of mandatory readonly argument")
)

0 comments on commit c2bf1cc

Please sign in to comment.