Documentation
¶
Index ¶
- Constants
- Variables
- func PrintMACCommand(cmd string, content string) string
- type Device
- func (d *Device) ADRProcedure()
- func (d *Device) CanExecute() bool
- func (d *Device) ChangeLocation(lat float64, lng float64, alt int32)
- func (d *Device) ChangePayload(mtype lorawan.MType, payload lorawan.Payload)
- func (d *Device) CreateACK() []byte
- func (d *Device) CreateEmptyFrame() []byte
- func (d *Device) CreateJoinRequest() []byte
- func (d *Device) CreateUplink() [][]byte
- func (d *Device) DataRateToString() string
- func (d *Device) DownlinkReceivedRX2ClassC()
- func (d *Device) Execute()
- func (d *Device) ExecuteMACCommand(downlink dl.InformationDownlink)
- func (d *Device) FPendingProcedure(downlink *dl.InformationDownlink)
- func (d *Device) GenerateCodecPayload() lorawan.Payload
- func (d *Device) GetLogBuffer() []socket.ConsoleLog
- func (d *Device) GetModulation() string
- func (d *Device) GetSendInterval() time.Duration
- func (d *Device) IsOn() bool
- func (d *Device) NewUplink(mtype lorawan.MType, payload string)
- func (d *Device) OtaaActivation()
- func (d *Device) Print(content string, err error, printType int)
- func (d *Device) ProcessDownlink(phy lorawan.PHYPayload) (*dl.InformationDownlink, error)
- func (d *Device) ProcessJoinAccept(JoinAccPayload *lorawan.JoinAcceptPayload) (*dl.InformationDownlink, error)
- func (d *Device) Run()
- func (d *Device) SendAck()
- func (d *Device) SendEmptyFrame()
- func (d *Device) SendJoinRequest()
- func (d *Device) SendMACCommand(cid lorawan.CID, periodicity uint8) error
- func (d *Device) SetConsole(console *c.Console)
- func (d *Device) SetInfo(payload []byte, joinRequest bool) pkt.RXPK
- func (d *Device) SetSendInterval(interval time.Duration)
- func (d *Device) Setup(Resources *res.Resources, forwarder *f.Forwarder)
- func (d *Device) SwitchChannel()
- func (d *Device) SwitchClass(class int)
- func (d *Device) TurnOFF()
- func (d *Device) TurnON()
- func (d *Device) UnJoined() bool
Constants ¶
View Source
const ( JOINACCEPTDELAY1 = time.Duration(5 * time.Second) JOINACCEPTDELAY2 = time.Duration(6 * time.Second) )
View Source
const ( //MaxMargin is max value for margin (DevStatusReq) MaxMargin = int8(64) )
Variables ¶
View Source
var Codecs *codec.Registry
Codecs is a global codec registry instance It will be initialized by the simulator
Functions ¶
func PrintMACCommand ¶
Types ¶
type Device ¶
type Device struct {
State int `json:"-"`
Exit chan struct{} `json:"-"`
IntervalChanged chan struct{} `json:"-"` // Signal to reset ticker when interval changes
Id int `json:"id"`
Info models.InformationDevice `json:"info"`
Class classes.Class `json:"-"`
Resources *res.Resources `json:"-"`
Mutex sync.Mutex `json:"-"`
Console c.Console `json:"-"`
LogBuffer []socket.ConsoleLog `json:"-"`
StartDelay time.Duration `json:"-"` // Per-device random jitter before Run() begins
// contains filtered or unexported fields
}
func (*Device) ADRProcedure ¶
func (d *Device) ADRProcedure()
func (*Device) CanExecute ¶
func (*Device) ChangeLocation ¶
func (*Device) ChangePayload ¶
func (*Device) CreateEmptyFrame ¶
func (*Device) CreateJoinRequest ¶
func (*Device) CreateUplink ¶
func (*Device) DataRateToString ¶
func (*Device) DownlinkReceivedRX2ClassC ¶
func (d *Device) DownlinkReceivedRX2ClassC()
func (*Device) ExecuteMACCommand ¶
func (d *Device) ExecuteMACCommand(downlink dl.InformationDownlink)
func (*Device) FPendingProcedure ¶
func (d *Device) FPendingProcedure(downlink *dl.InformationDownlink)
func (*Device) GenerateCodecPayload ¶
GenerateCodecPayload generates a payload using the configured codec
func (*Device) GetLogBuffer ¶
func (d *Device) GetLogBuffer() []socket.ConsoleLog
func (*Device) GetModulation ¶
func (*Device) GetSendInterval ¶
GetSendInterval returns the device's send interval (implements codec.DeviceInterface)
func (*Device) OtaaActivation ¶
func (d *Device) OtaaActivation()
func (*Device) ProcessDownlink ¶
func (d *Device) ProcessDownlink(phy lorawan.PHYPayload) (*dl.InformationDownlink, error)
func (*Device) ProcessJoinAccept ¶
func (d *Device) ProcessJoinAccept(JoinAccPayload *lorawan.JoinAcceptPayload) (*dl.InformationDownlink, error)
func (*Device) SendEmptyFrame ¶
func (d *Device) SendEmptyFrame()
func (*Device) SendJoinRequest ¶
func (d *Device) SendJoinRequest()
func (*Device) SendMACCommand ¶
func (*Device) SetConsole ¶
func (*Device) SetSendInterval ¶
SetSendInterval sets the device's send interval (implements codec.DeviceInterface)
func (*Device) SwitchChannel ¶
func (d *Device) SwitchChannel()
func (*Device) SwitchClass ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.