device

package
v0.0.0-...-7a68c68 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2022 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JOINACCEPTDELAY1 = time.Duration(5 * time.Second)
	JOINACCEPTDELAY2 = time.Duration(1 * time.Second)
)
View Source
const (
	//MaxMargin is max value for margin (DevStatusReq)
	MaxMargin = int8(64)
)

Variables

This section is empty.

Functions

func PrintMACCommand

func PrintMACCommand(cmd string, content string) string

Types

type Device

type Device struct {
	State     int                      `json:"-"`
	Exit      chan struct{}            `json:"-"`
	Id        int                      `json:"id"`
	Info      models.InformationDevice `json:"info"`
	Class     classes.Class            `json:"-"`
	Resources *res.Resources           `json:"-"`
	Mutex     sync.Mutex               `json:"-"`
}

func (*Device) ADRProcedure

func (d *Device) ADRProcedure()

func (*Device) CanExecute

func (d *Device) CanExecute() bool

func (*Device) ChangeLocation

func (d *Device) ChangeLocation(lat float64, lng float64, alt int32)

func (*Device) ChangePayload

func (d *Device) ChangePayload(mtype lorawan.MType, payload lorawan.Payload)

func (*Device) CreateACK

func (d *Device) CreateACK() []byte

func (*Device) CreateEmptyFrame

func (d *Device) CreateEmptyFrame() []byte

func (*Device) CreateJoinRequest

func (d *Device) CreateJoinRequest() []byte
func (d *Device) CreateUplink() [][]byte

func (*Device) DataRateToString

func (d *Device) DataRateToString() string

func (*Device) DownlinkReceivedRX2ClassC

func (d *Device) DownlinkReceivedRX2ClassC()

func (*Device) Execute

func (d *Device) Execute()

func (*Device) ExecuteMACCommand

func (d *Device) ExecuteMACCommand(downlink dl.InformationDownlink)

func (*Device) FPendingProcedure

func (d *Device) FPendingProcedure(downlink *dl.InformationDownlink)

func (*Device) GetModulation

func (d *Device) GetModulation() string

func (*Device) IsOn

func (d *Device) IsOn() bool
func (d *Device) NewUplink(mtype lorawan.MType, payload string)

func (*Device) OtaaActivation

func (d *Device) OtaaActivation()

func (*Device) Print

func (d *Device) Print(content string, err error, printType int)
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) Run

func (d *Device) Run()

*******************Intern func*******************/

func (*Device) SendAck

func (d *Device) SendAck()

func (*Device) SendEmptyFrame

func (d *Device) SendEmptyFrame()

func (*Device) SendJoinRequest

func (d *Device) SendJoinRequest()

func (*Device) SendMACCommand

func (d *Device) SendMACCommand(cid lorawan.CID, periodicity uint8) error

func (*Device) SetInfo

func (d *Device) SetInfo(payload []byte, joinRequest bool) pkt.RXPK

func (*Device) Setup

func (d *Device) Setup(Resources *res.Resources, forwarder *f.Forwarder)

func (*Device) SwitchChannel

func (d *Device) SwitchChannel()

func (*Device) SwitchClass

func (d *Device) SwitchClass(class int)

func (*Device) TurnOFF

func (d *Device) TurnOFF()

func (*Device) TurnON

func (d *Device) TurnON()

func (*Device) UnJoined

func (d *Device) UnJoined() bool

se il dispositivo non supporta OTAA non può essere unjoined

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL