model

package
v0.0.0-...-fd2512f Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NEWLORHAMMER   = "newLorhammer"   // prevent orchestrator new lorhammer is here LORHAMMER -> ORCHESTRATOR
	LORHAMMERADDED = "lorhammerAdded" // orchestrator has received lorhammer infos ORCHESTRATOR -> LORHAMME
	INIT           = "init"           // send init (lorawan info) ORCHESTRATOR -> LORHAMMER
	REGISTER       = "register"       // send lorawan sensors to provision LORHAMMER -> ORCHESTRATOR
	START          = "start"          // send start after sensors provisioning ORCHESTRATOR -> LORHAMMER
	STOP           = "stop"           // send stop to finish test ORCHESTRATOR -> LORHAMMER
	SHUTDOWN       = "shutdown"       // kill lorhammers ORCHESTRATOR -> LORHAMMER
)

All commands for communication between orchestrator and lorhammer

Variables

This section is empty.

Functions

This section is empty.

Types

type CMD

type CMD struct {
	CmdName CommandName     `json:"cmd"`
	Payload json.RawMessage `json:"payload"`
}

CMD is the stuct for communication between orchestrator and lorhammer

type CommandName

type CommandName string

CommandName is a type to be sure command are send (and not all string possible)

type Gateway

type Gateway struct {
	Nodes                 []*Node
	NsAddress             string
	MacAddress            lorawan.EUI64
	RxpkDate              int64
	PayloadsReplayMaxLaps int
	AllLapsCompleted      bool
	ReceiveTimeoutTime    time.Duration
}

Gateway represent a lorawan gateway

type Init

type Init struct {
	NsAddress            string    `json:"nsAddress"`
	NbGateway            int       `json:"nbGatewayPerLorhammer"`
	NbNode               [2]int    `json:"nbNodePerGateway"`
	NbScenarioReplayLaps int       `json:"nbScenarioReplayLaps"`
	ScenarioSleepTime    [2]string `json:"scenarioSleepTime"`
	GatewaySleepTime     [2]string `json:"gatewaySleepTime"`
	AppsKey              string    `json:"appskey"`
	Nwskey               string    `json:"nwskey"`
	WithJoin             bool      `json:"withJoin"`
	Payloads             []Payload `json:"payloads"`
	RxpkDate             int64     `json:"rxpkDate"`
	ReceiveTimeoutTime   string    `json:"receiveTimeoutTime"`
	Description          string    `json:"description"`
	RandomPayloads       bool      `json:"randomPayloads"`
}

Init is the struc send by orchestrator to lorhammer

type NewLorhammer

type NewLorhammer struct {
	CallbackTopic string
}

NewLorhammer is the struct used by lorhammer to prevent orchestrator

type Node

type Node struct {
	DevAddr           lorawan.DevAddr
	DevEUI            lorawan.EUI64
	AppEUI            lorawan.EUI64
	AppKey            lorawan.AES128Key
	AppSKey           lorawan.AES128Key
	NwSKey            lorawan.AES128Key
	JoinedNetwork     bool
	Payloads          []Payload
	NextPayload       int
	PayloadsReplayLap int
	RandomPayloads    bool
	Description       string
}

Node represent a lorawan sensor

type Payload

type Payload struct {
	Value string `json:"value"`
	Date  int64  `json:"date"`
}

Payload struct define a payload with timestamp date attached { "value": "a string", "date": <timestamp>}

type Register

type Register struct {
	ScenarioUUID  string    `json:"scenarioid"`
	Gateways      []Gateway `json:"gateways"`
	CallBackTopic string    `json:"callBackTopic"`
}

Register struct is the command send by lorhammer to orchestrator for register gateway and sensors to network-server

type Start

type Start struct {
	ScenarioUUID string `json:"scenarioid"`
}

Start is the command send by orchestrator to lorhammer because all gateway and sensor have been registered

Jump to

Keyboard shortcuts

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