devstatus

package
Version: v0.3.67 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const Anslen = 3

Anslen is the length of the answer

View Source
const Reqlen = 1

Reqlen is the length of the request

Variables

This section is empty.

Functions

func ParseAns

func ParseAns(bb []byte) commands.Fopter

ParseAns parses the byte array representation of the answer

func ParseReq

func ParseReq(bb []byte) commands.Fopter

ParseReq parses the byte array representation of the request

Types

type DevStatusAns

type DevStatusAns interface {
	commands.Fopter
	// +=========+================================================================+
	// | Battery |                          Description                           |
	// +=========+================================================================+
	// |       0 | The end-device is connected to an external power source.       |
	// +---------+----------------------------------------------------------------+
	// | 1...254 | The battery level, 1 being at minimum and 254 being at maximum |
	// +---------+----------------------------------------------------------------+
	// |     255 | The end-device was not able to measure the battery level.      |
	// +---------+----------------------------------------------------------------+
	Battery() uint8
	// The margin (Margin) is the demodulation signal-to-noise ratio in dB
	// rounded to the nearest integer value for the last successfully received
	// DevStatusReq command. It is a signed integer of 6 bits with a minimum
	// value of -32 and a maximum value of 31.
	// +========+=====+========+
	// |  Bits  | 7:6 |  5:0   |
	// +========+=====+========+
	// | Status | RFU | Margin |
	// +--------+-----+--------+
	Margin() uint8
}

DevStatusAns contains the status of the end-device If a DevStatusReq is received by an end-device, it responds with a DevStatusAns command. +======================+=========+========+ | Size (bytes) | 1 | 1 | +======================+=========+========+ | DevStatusAns Payload | Battery | Margin | +----------------------+---------+--------+

func NewAns

func NewAns(battery, margin uint8) DevStatusAns

NewAns creates a new answer

type DevStatusReq

type DevStatusReq interface {
	commands.Fopter
}

DevStatusReq requests for the status of the end-device With the DevStatusReq command a network server may request status information from an end-device.

func NewReq

func NewReq() DevStatusReq

NewReq creates a new request

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL