Documentation
¶
Index ¶
- type Device
- type Options
- type RedisDeviceStore
- func (s *RedisDeviceStore) Activate(appEUI types.AppEUI, devEUI types.DevEUI, devAddr types.DevAddr, ...) error
- func (s *RedisDeviceStore) Delete(appEUI types.AppEUI, devEUI types.DevEUI) error
- func (s *RedisDeviceStore) Get(appEUI types.AppEUI, devEUI types.DevEUI) (*Device, error)
- func (s *RedisDeviceStore) List(opts *storage.ListOptions) ([]*Device, error)
- func (s *RedisDeviceStore) ListForAddress(devAddr types.DevAddr) ([]*Device, error)
- func (s *RedisDeviceStore) Set(new *Device, properties ...string) (err error)
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct {
DevEUI types.DevEUI `redis:"dev_eui"`
AppEUI types.AppEUI `redis:"app_eui"`
AppID string `redis:"app_id"`
DevID string `redis:"dev_id"`
DevAddr types.DevAddr `redis:"dev_addr"`
NwkSKey types.NwkSKey `redis:"nwk_s_key"`
FCntUp uint32 `redis:"f_cnt_up"`
FCntDown uint32 `redis:"f_cnt_down"`
LastSeen time.Time `redis:"last_seen"`
Options Options `redis:"options"`
CreatedAt time.Time `redis:"created_at"`
UpdatedAt time.Time `redis:"updated_at"`
// contains filtered or unexported fields
}
Device contains the state of a device
func (Device) ChangedFields ¶
ChangedFields returns the names of the changed fields since the last call to StartUpdate
func (*Device) StartUpdate ¶
func (d *Device) StartUpdate()
StartUpdate stores the state of the device
type Options ¶
type Options struct {
ActivationConstraints string `json:"activation_constraints,omitempty"` // Activation Constraints (public/local/private)
DisableFCntCheck bool `json:"disable_fcnt_check,omitemtpy"` // Disable Frame counter check (insecure)
Uses32BitFCnt bool `json:"uses_32_bit_fcnt,omitemtpy"` // Use 32-bit Frame counters
}
Options for the specified device
type RedisDeviceStore ¶
type RedisDeviceStore struct {
// contains filtered or unexported fields
}
RedisDeviceStore stores Devices in Redis. - Devices are stored as a Hash - DevAddr mappings are indexed in a Set
func (*RedisDeviceStore) Activate ¶
func (s *RedisDeviceStore) Activate(appEUI types.AppEUI, devEUI types.DevEUI, devAddr types.DevAddr, nwkSKey types.NwkSKey) error
Activate a Device
func (*RedisDeviceStore) List ¶
func (s *RedisDeviceStore) List(opts *storage.ListOptions) ([]*Device, error)
List all Devices
func (*RedisDeviceStore) ListForAddress ¶
func (s *RedisDeviceStore) ListForAddress(devAddr types.DevAddr) ([]*Device, error)
ListForAddress lists all devices for a specific DevAddr
type Store ¶
type Store interface {
List(opts *storage.ListOptions) ([]*Device, error)
ListForAddress(devAddr types.DevAddr) ([]*Device, error)
Get(appEUI types.AppEUI, devEUI types.DevEUI) (*Device, error)
Set(new *Device, properties ...string) (err error)
Activate(appEUI types.AppEUI, devEUI types.DevEUI, devAddr types.DevAddr, nwkSKey types.NwkSKey) error
Delete(appEUI types.AppEUI, devEUI types.DevEUI) error
}
Store interface for Devices
Click to show internal directories.
Click to hide internal directories.