first commit of files
This commit is contained in:
22
models/jsonData.go
Normal file
22
models/jsonData.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package models
|
||||
|
||||
type JsonData struct {
|
||||
Set *[]Set `json:"set,omitempty"`
|
||||
}
|
||||
|
||||
func NewRequest() *JsonData {
|
||||
return &JsonData{}
|
||||
|
||||
}
|
||||
|
||||
func (r *JsonData) AddSet(bus, address uint, value uint8) {
|
||||
if r.Set == nil {
|
||||
r.Set = &[]Set{}
|
||||
}
|
||||
|
||||
*r.Set = append(*r.Set, Set{
|
||||
Bus: bus,
|
||||
Address: address,
|
||||
Value: value,
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user