notecard

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 24 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ReqReserve     = "reserve"
	ReqTransaction = "transaction"
)

Request types

View Source
const (
	NetworkBearerUnknown      = -1
	NetworkBearerGsm          = 0
	NetworkBearerTdScdma      = 1
	NetworkBearerWcdma        = 2
	NetworkBearerCdma2000     = 3
	NetworkBearerWiMax        = 4
	NetworkBearerLteTdd       = 5
	NetworkBearerLteFdd       = 6
	NetworkBearerNBIot        = 7
	NetworkBearerWLan         = 21
	NetworkBearerBluetooth    = 22
	NetworkBearerIeee802p15p4 = 23
	NetworkBearerEthernet     = 41
	NetworkBearerDsl          = 42
	NetworkBearerPlc          = 43
)
View Source
const (
	NotecardInterfaceSerial = "serial"
	NotecardInterfaceI2C    = "i2c"
	NotecardInterfaceLease  = "lease"
)

Module communication interfaces

View Source
const CardI2CMax = 253

CardI2CMax controls chunk size that's socially appropriate on the I2C bus. It must be 1-253 bytes as per spec (which allows space for the 2-byte header in a 255-byte read)

View Source
const CardRequestI2CSegmentDelayMs = 250

CardRequestI2CSegmentDelayMs (golint)

View Source
const CardRequestI2CSegmentMaxLen = 250

CardRequestI2CSegmentMaxLen (golint)

View Source
const CardRequestSerialSegmentDelayMs = 250

CardRequestSerialSegmentDelayMs (golint)

View Source
const CardRequestSerialSegmentMaxLen = 250

CardRequestSerialSegmentMaxLen (golint)

View Source
const (
	// I2CSlave is the slave device address
	I2CSlave = 0x0703
)
View Source
const IoErrorIsRecoverable = true

IoErrorIsRecoverable is a configuration parameter describing library capabilities. Set this to true if the error recovery of the implementation supports re-open. On all implementations tested to date, I can't yet get the close/reopen working the way it does on microcontrollers. For example, on the go serial, I get a nil pointer dereference within the go library. This MAY have soemthing to do with the fact that we don't cleanly implement the shutdown/restart of the inputHandler in trace, in which case that should be fixed. In the meantime, this is disabled.

View Source
const ReqCardAUX = "card.aux"

ReqCardAUX (golint)

View Source
const ReqCardAUXSerial = "card.aux.serial"

ReqCardAUXSerial (golint)

View Source
const ReqCardAttn = "card.attn"

ReqCardAttn (golint)

View Source
const ReqCardBinary = "card.binary"

ReqCardBinary (golint)

View Source
const ReqCardBinaryGet = "card.binary.get"

ReqCardBinaryGet (golint)

View Source
const ReqCardBinaryPut = "card.binary.put"

ReqCardBinaryPut (golint)

View Source
const ReqCardBootloader = "card.bootloader"

ReqCardBootloader (golint)

View Source
const ReqCardCarrier = "card.carrier"

ReqCardCarrier (golint)

View Source
const ReqCardCheckpoint = "card.checkpoint"

ReqCardCheckpoint (golint)

View Source
const ReqCardContact = "card.contact"

ReqCardContact (golint)

View Source
const ReqCardDFU = "card.dfu"

ReqCardDFU (golint)

View Source
const ReqCardIO = "card.io"

ReqCardIO (golint)

View Source
const ReqCardIllumination = "card.illumination"

ReqCardIllumination (golint)

View Source
const ReqCardLocation = "card.location"

ReqCardLocation (golint)

View Source
const ReqCardLocationMode = "card.location.mode"

ReqCardLocationMode (golint)

View Source
const ReqCardLocationTrack = "card.location.track"

ReqCardLocationTrack (golint)

View Source
const ReqCardLog = "card.log"

ReqCardLog (golint)

View Source
const ReqCardMonitor = "card.monitor"

ReqCardMonitor (golint)

View Source
const ReqCardMotion = "card.motion"

ReqCardMotion (golint)

View Source
const ReqCardMotionMode = "card.motion.mode"

ReqCardMotionMode (golint)

View Source
const ReqCardMotionSync = "card.motion.sync"

ReqCardMotionSync (golint)

View Source
const ReqCardMotionTrack = "card.motion.track"

ReqCardMotionTrack (golint)

View Source
const ReqCardPower = "card.power"

ReqCardPower (golint)

View Source
const ReqCardRandom = "card.random"

ReqCardRandom (golint)

View Source
const ReqCardReserve = "card.reserve"

ReqCardReserve (golint)

View Source
const ReqCardRestart = "card.restart"

ReqCardRestart (golint)

View Source
const ReqCardRestore = "card.restore"

ReqCardRestore (golint)

View Source
const ReqCardSetup = "card.setup"

ReqCardSetup (golint)

View Source
const ReqCardSleep = "card.sleep"

ReqCardSleep (golint)

View Source
const ReqCardStatus = "card.status"

ReqCardStatus (golint)

View Source
const ReqCardTemp = "card.temp"

ReqCardTemp (golint)

View Source
const ReqCardTest = "card.test"

ReqCardTest (golint)

View Source
const ReqCardTime = "card.time"

ReqCardTime (golint)

View Source
const ReqCardTrace = "card.trace"

ReqCardTrace (golint)

View Source
const ReqCardTransport = "card.transport"

ReqCardTransport (golint)

View Source
const ReqCardTriangulate = "card.triangulate"

ReqCardTriangulate (golint)

View Source
const ReqCardUsageGet = "card.usage.get"

ReqCardUsageGet (golint)

View Source
const ReqCardUsageRate = "card.usage.rate"

ReqCardUsageRate (golint)

View Source
const ReqCardUsageTest = "card.usage.test"

ReqCardUsageTest (golint)

View Source
const ReqCardVersion = "card.version"

ReqCardVersion (golint)

View Source
const ReqCardVoltage = "card.voltage"

ReqCardVoltage (golint)

View Source
const ReqCardWiFi = "card.wifi"

ReqCardWiFi (golint)

View Source
const ReqCardWireless = "card.wireless"

ReqCardWireless (golint)

View Source
const ReqCardWirelessPenalty = "card.wireless.penalty"

ReqCardWirelessPenalty (golint)

View Source
const ReqDFUGet = "dfu.get"

ReqDFUGet (golint)

View Source
const ReqDFUPut = "dfu.put"

ReqDFUPut (golint)

View Source
const ReqDFUStatus = "dfu.status"

ReqDFUStatus (golint)

View Source
const ReqEnvDefault = "env.default"

ReqEnvDefault (golint)

View Source
const ReqEnvGet = "env.get"

ReqEnvGet (golint)

View Source
const ReqEnvLocation = "env.location"

ReqEnvLocation (golint)

View Source
const ReqEnvModified = "env.modified"

ReqEnvModified (golint)

View Source
const ReqEnvSet = "env.set"

ReqEnvSet (golint)

View Source
const ReqEnvSync = "env.sync"

ReqEnvSync (golint)

View Source
const ReqEnvTemplate = "env.template"

ReqEnvTemplate (golint)

View Source
const ReqEnvTime = "env.time"

ReqEnvTime (golint)

View Source
const ReqEnvVersion = "env.version"

ReqEnvVersion (golint)

View Source
const ReqFileAdd = "file.add"

ReqFileAdd (golint)

View Source
const ReqFileChanges = "file.changes"

ReqFileChanges (golint)

View Source
const ReqFileChangesPending = "file.changes.pending"

ReqFileChangesPending (golint)

View Source
const ReqFileDelete = "file.delete"

ReqFileDelete (golint)

View Source
const ReqFileGetL = "file.get"

ReqFileGetL (golint)

View Source
const ReqFileSet = "file.set"

ReqFileSet (golint)

View Source
const ReqFileStats = "file.stats"

ReqFileStats (golint)

View Source
const ReqFileSync = "file.sync"

ReqFileSync (golint)

View Source
const ReqHubDFUGet = "hub.dfu.get"

ReqHubDFUGet (golint)

View Source
const ReqHubDFUGetL = "dfu.service.get"

ReqHubHubDFUGetL (golint)

View Source
const ReqHubEnvL = "hub.env"

ReqHubEnvL (golint)

View Source
const ReqHubEnvLL = "service.env"

ReqHubEnvLL (golint)

View Source
const ReqHubFileGet = "hub.file.get"

ReqHubFileGet (golint)

View Source
const ReqHubGet = "hub.get"

ReqHubGet (golint)

View Source
const ReqHubGetL = "service.get"

ReqHubGetL (golint)

View Source
const ReqHubLog = "hub.log"

ReqHubLog (golint)

View Source
const ReqHubLogL = "service.log"

ReqHubLogL (golint)

View Source
const ReqHubSet = "hub.set"

ReqHubSet (golint)

View Source
const ReqHubSetL = "service.set"

ReqHubSetL (golint)

View Source
const ReqHubSignal = "hub.signal"

ReqHubSignal (golint)

View Source
const ReqHubSignalL = "service.signal"

ReqHubSignalL (golint)

View Source
const ReqHubStatus = "hub.status"

ReqHubStatus (golint)

View Source
const ReqHubStatusL = "service.status"

ReqHubStatusL (golint)

View Source
const ReqHubSync = "hub.sync"

ReqHubSync (golint)

View Source
const ReqHubSyncL = "service.sync"

ReqHubSyncL (golint)

View Source
const ReqHubSyncStatus = "hub.sync.status"

ReqHubSyncStatus (golint)

View Source
const ReqHubSyncStatusL = "service.sync.status"

ReqHubSyncStatusL (golint)

View Source
const ReqNoteAdd = "note.add"

ReqNoteAdd (golint)

View Source
const ReqNoteChanges = "note.changes"

ReqNoteChanges (golint)

View Source
const ReqNoteDecrypt = "note.decrypt"

ReqNoteDecrypt (golint)

View Source
const ReqNoteDelete = "note.delete"

ReqNoteDelete (golint)

View Source
const ReqNoteEncrypt = "note.encrypt"

ReqNoteEncrypt (golint)

View Source
const ReqNoteEvent = "note.event"

ReqNoteEvent (golint)

View Source
const ReqNoteGet = "note.get"

ReqNoteGet (golint)

View Source
const ReqNoteTemplate = "note.template"

ReqNoteTemplate (golint)

View Source
const ReqNoteUpdate = "note.update"

ReqNoteUpdate (golint)

View Source
const ReqNotesGetL = "notes.get"

ReqNotesGetL (golint)

View Source
const ReqWeb = "web"

ReqWeb (golint)

View Source
const ReqWebDelete = "web.delete"

ReqWebDelete (golint)

View Source
const ReqWebGet = "web.get"

ReqWebGet (golint)

View Source
const ReqWebPost = "web.post"

ReqWebPost (golint)

View Source
const ReqWebPut = "web.put"

ReqWebPut (golint)

View Source
const SyncLogLevelAll = SyncLogLevelProg

SyncLogLevelAll is all events

View Source
const SyncLogLevelDetail = 2

SyncLogLevelDetail is major, minor, and detailed events

View Source
const SyncLogLevelMajor = 0

SyncLogLevelMajor is just major events

View Source
const SyncLogLevelMinor = 1

SyncLogLevelMinor is just major and minor events

View Source
const SyncLogLevelNone = -1

SyncLogLevelNone is no events

View Source
const SyncLogLevelProg = 3

SyncLogLevelProg is everything plus programmatically-targeted

View Source
const SyncLogNotefile = "_synclog.qi"

SyncLogNotefile is the special notefile containing sync log info

Variables

View Source
var DoNotReterminateJSON = false
View Source
var IgnoreWindowsHWErrSecs = 2

IgnoreWindowsHWErrSecs is the amount of time to ignore a Windows serial communiction error.

View Source
var InitialDebugMode = false

InitialDebugMode is the debug mode that the context is initialized with

View Source
var InitialResetMode = true

InitialResetMode says whether or not we should reset the port on entry

View Source
var InitialTraceMode = false

InitialTraceMode is whether or not we will be entering trace mode, to prevent reservationsa

View Source
var RequestSegmentDelayMs = -1

RequestSegmentDelayMs (golint)

View Source
var RequestSegmentMaxLen = -1

RequestSegmentMaxLen (golint)

View Source
var SerialTimeoutMs = 30000

SerialTimeoutMs is the response timeout for Notecard serial communications.

Functions

func CobsDecode added in v1.6.7

func CobsDecode(input []byte, xor byte) ([]byte, error)

Decode with optional XOR

func CobsEncode added in v1.6.7

func CobsEncode(input []byte, xor byte) ([]byte, error)

Encode with optional XOR

func CobsEncodedLength added in v1.6.10

func CobsEncodedLength(length int) int

Get the maximum size of the cobs-encoded buffer

func Defaults added in v1.1.16

func Defaults() (moduleInterface string, port string, portConfig int)

Defaults gets the default interface, port, and config

func I2CDefaults

func I2CDefaults() (port string, portConfig int)

I2CDefaults returns the default serial parameters

func I2CPorts

func I2CPorts() (allports []string, usbports []string, notecardports []string, err error)

I2CPorts returns the list of available I2C ports

func NewBody added in v1.1.5

func NewBody() (body map[string]interface{})

NewBody creates a new body. Note that this method is provided merely as syntactic sugar, as of the form body := note.NewBody()

func NewCommand added in v1.4.4

func NewCommand(reqType string) (cmd map[string]interface{})

NewCommand creates a new command that requires no response from the notecard.

func NewRequest added in v1.1.5

func NewRequest(reqType string) (req map[string]interface{})

NewRequest creates a new request that is guaranteed to get a response from the Notecard. Note that this method is provided merely as syntactic sugar, as of the form req := notecard.NewRequest("note.add")

func SerialDefaults

func SerialDefaults() (port string, portConfig int)

SerialDefaults returns the default serial parameters

func SerialPorts

func SerialPorts() (allports []string, usbports []string, notecardports []string, err error)

SerialPorts returns the list of available serial ports

Types

type CardTest added in v1.1.16

type CardTest struct {
	DeviceUID           string `json:"device,omitempty"`
	DefaultProductUID   string `json:"default_product,omitempty"`
	Error               string `json:"err,omitempty"`
	Status              string `json:"status,omitempty"`
	Tests               string `json:"tests,omitempty"`
	FailTest            string `json:"fail_test,omitempty"`
	FailReason          string `json:"fail_reason,omitempty"`
	Info                string `json:"info,omitempty"`
	BoardVersion        uint32 `json:"board,omitempty"`
	BoardType           uint32 `json:"board_type,omitempty"`
	Modem               string `json:"modem,omitempty"`
	ICCID               string `json:"iccid,omitempty"`
	ICCID2              string `json:"iccid2,omitempty"`
	IMSI                string `json:"imsi,omitempty"`
	IMSI2               string `json:"imsi2,omitempty"`
	IMEI                string `json:"imei,omitempty"`
	When                uint32 `json:"when,omitempty"`
	SKU                 string `json:"sku,omitempty"`
	OrderingCode        string `json:"ordering_code,omitempty"`
	SIMActivationKey    string `json:"key,omitempty"`
	Station             string `json:"station,omitempty"`
	Operator            string `json:"operator,omitempty"`
	Check               uint32 `json:"check,omitempty"`
	CellUsageBytes      uint32 `json:"cell_used,omitempty"`
	CellProvisionedTime uint32 `json:"cell_provisioned,omitempty"`
	LSEStability        string `json:"lse,omitempty"`
	// Firmware info
	FirmwareOrg     string `json:"org,omitempty"`
	FirmwareProduct string `json:"product,omitempty"`
	FirmwareVersion string `json:"version,omitempty"`
	FirmwareMajor   uint32 `json:"ver_major,omitempty"`
	FirmwareMinor   uint32 `json:"ver_minor,omitempty"`
	FirmwarePatch   uint32 `json:"ver_patch,omitempty"`
	FirmwareBuild   uint32 `json:"ver_build,omitempty"`
	FirmwareBuilt   string `json:"built,omitempty"`
	// LoRa notecard provisioning info
	DevEui    string `json:"deveui,omitempty"`
	AppEui    string `json:"appeui,omitempty"`
	AppKey    string `json:"appkey,omitempty"`
	FreqPlan  string `json:"freqplan,omitempty"`
	LWVersion string `json:"lorawan,omitempty"`
	PHVersion string `json:"regional,omitempty"`
	// Certificate and cert info
	CertSN string `json:"certsn,omitempty"`
	Cert   string `json:"cert,omitempty"`
	// Card initialization requests
	SetupRequests string `json:"setup,omitempty"`
}

CardTest is a structure that is returned by the notecard after completing its self-test

type Context

type Context struct {
	// True to emit trace output
	Debug bool

	// Pretty-print trace output JSON
	Pretty bool

	// Disable generation of User Agent object
	DisableUA bool

	// Class functions
	PortEnumFn     func() (allports []string, usbports []string, notecardports []string, err error)
	PortDefaultsFn func() (port string, portConfig int)
	CloseFn        func(context *Context)
	ReopenFn       func(context *Context, portConfig int) (err error)
	ResetFn        func(context *Context, portConfig int) (err error)
	TransactionFn  func(context *Context, portConfig int, noResponse bool, reqJSON []byte) (rspJSON []byte, err error)
	// contains filtered or unexported fields
}

Context for the port that is open

func Open

func Open(moduleInterface string, port string, portConfig int) (context *Context, err error)

Open the card to establish communications

func OpenI2C

func OpenI2C(port string, portConfig int) (context *Context, err error)

OpenI2C opens the card on I2C

func OpenLease added in v1.6.11

func OpenLease(leaseScope string, leaseMins int) (context *Context, err error)

OpenLease opens a remote card with a lease

func OpenSerial

func OpenSerial(port string, portConfig int) (context *Context, err error)

OpenSerial opens the card on serial

func (*Context) Close

func (context *Context) Close()

Close the port

func (*Context) DebugOutput added in v1.1.7

func (context *Context) DebugOutput(enabled bool, pretty bool)

DebugOutput enables/disables debug output

func (*Context) EnumPorts

func (context *Context) EnumPorts() (allports []string, usbports []string, notecardports []string, err error)

EnumPorts returns the list of all available ports on the specified interface

func (*Context) Identify added in v1.1.10

func (context *Context) Identify() (protocol string, port string, portConfig int)

Identify this Notecard connection

func (*Context) Interactive added in v1.1.21

func (context *Context) Interactive(watch bool, watchLevel int, prompt bool, watchCommand string, quitCommand string) (err error)

Interactive enters interactive request/response mode, disabling trace in case that was the last mode entered

func (*Context) PortDefaults

func (context *Context) PortDefaults() (port string, portConfig int)

PortDefaults gets the defaults for the specified port

func (*Context) ReceiveBytes added in v1.5.1

func (context *Context) ReceiveBytes() (rspBytes []byte, err error)

ReceiveBytes receives arbitrary Bytes from the Notecard

func (*Context) Reopen added in v1.1.10

func (context *Context) Reopen(portConfig int) (err error)

Reopen the port

func (*Context) ReopenIfRequired added in v1.2.9

func (context *Context) ReopenIfRequired(portConfig int) (err error)

ReopenIfRequired reopens the port but only if required

func (*Context) Request

func (context *Context) Request(req map[string]interface{}) (err error)

Request performs a card transaction with a JSON structure and doesn't return a response (This is for semantic compatibility with other languages.)

func (*Context) RequestResponse

func (context *Context) RequestResponse(req map[string]interface{}) (rsp map[string]interface{}, err error)

RequestResponse performs a card transaction with a JSON structure and doesn't return a response (This is for semantic compatibility with other languages.)

func (*Context) Reset

func (context *Context) Reset(portConfig int) (err error)

Reset the port

func (*Context) Response added in v1.1.16

func (context *Context) Response() (rsp map[string]interface{}, err error)

Response is used in rare cases where there is a transaction that returns multiple responses

func (*Context) SendBytes added in v1.6.6

func (context *Context) SendBytes(reqBytes []byte) (err error)

SendBytes sends arbitrary Bytes to the Notecard

func (*Context) Trace

func (context *Context) Trace() (err error)

Trace the incoming serial output AND connect the input handler

func (*Context) Transaction

func (context *Context) Transaction(req map[string]interface{}) (rsp map[string]interface{}, err error)

Transaction performs a card transaction with a JSON structure

func (*Context) TransactionJSON

func (context *Context) TransactionJSON(reqJSON []byte) (rspJSON []byte, err error)

TransactionJSON performs a card transaction using raw JSON []bytes

func (*Context) TransactionJSONToPort added in v1.3.2

func (context *Context) TransactionJSONToPort(reqJSON []byte, portConfig int) (rspJSON []byte, err error)

TransactionJSONToPort performs a card transaction using raw JSON []bytes to a specified port

func (*Context) TransactionRequest

func (context *Context) TransactionRequest(req Request) (rsp Request, err error)

TransactionRequest performs a card transaction with a Req structure

func (*Context) TransactionRequestToPort added in v1.3.2

func (context *Context) TransactionRequestToPort(req Request, portConfig int) (rsp Request, err error)

TransactionRequestToPort performs a card transaction with a Req structure, to a specified port

func (*Context) UserAgent added in v1.4.8

func (context *Context) UserAgent() (ua map[string]interface{})

UserAgent generates a User Agent object for a given interface

type I2C

type I2C struct {
	// contains filtered or unexported fields
}

I2C is the handle to the I2C subsystem

type LeaseTransaction added in v1.6.11

type LeaseTransaction struct {
	Request    string `json:"req,omitempty"`
	Lessor     string `json:"lessor,omitempty"`
	Scope      string `json:"scope,omitempty"`
	Expires    int64  `json:"expires,omitempty"`
	Error      string `json:"err,omitempty"`
	DeviceUID  string `json:"device,omitempty"`
	NoResponse bool   `json:"no_response,omitempty"`
	ReqJSON    string `json:"request_json,omitempty"`
	RspJSON    string `json:"response_json,omitempty"`
}

Lease transaction

type NetInfo added in v1.2.1

type NetInfo struct {
	Iccid            string `json:"iccid,omitempty"`
	Iccid2           string `json:"iccid2,omitempty"`
	IccidExternal    string `json:"iccid_external,omitempty"`
	Imsi             string `json:"imsi,omitempty"`
	Imsi2            string `json:"imsi2,omitempty"`
	ImsiExternal     string `json:"imsi_external,omitempty"`
	Imei             string `json:"imei,omitempty"`
	ModemFirmware    string `json:"modem,omitempty"`
	Band             string `json:"band,omitempty"`
	AccessTechnology string `json:"rat,omitempty"`
	Bssid            string `json:"bssid,omitempty"`
	Ssid             string `json:"ssid,omitempty"`
	// Internal vs external SIM used at any given moment
	InternalSIMSelected bool `json:"internal,omitempty"`
	// Radio signal strength in dBm, or ModemValueUnknown if it is not
	// available from the modem.
	RssiRange int32 `json:"rssir,omitempty"`
	// GSM RxQual, or ModemValueUnknown if it is not available from the modem.
	Rxqual int32 `json:"rxqual,omitempty"`
	// General received signal strength, in dBm
	Rssi int32 `json:"rssi,omitempty"`
	// An integer indicating the reference signal received power (RSRP)
	Rsrp int32 `json:"rsrp,omitempty"`
	// An integer indicating the signal to interference plus noise ratio (SINR).
	// Logarithmic value of SINR. Values are in 1/5th of a dB. The range is 0-250
	// which translates to -20dB - +30dB
	Sinr int32 `json:"sinr,omitempty"`
	// An integer indicating the reference signal received quality (RSRQ)
	Rsrq int32 `json:"rsrq,omitempty"`
	// An integer indicating relative signal strength in a human-readable way
	Bars uint32 `json:"bars,omitempty"`
	// IP address assigned to the device
	IP string `json:"ip,omitempty"`
	// IP address that the device is talking to (if known)
	Gw string `json:"gateway,omitempty"`
	// Device APN name
	Apn string `json:"apn,omitempty"`
	// Location area code (16 bits) or ModemValueUnknown if it is not avail from modem
	Lac uint32 `json:"lac,omitempty"`
	// Cell ID (28 bits) or ModemValueUnknown if it is not available from the modem.
	Cellid uint32 `json:"cid,omitempty"`
	// Network info
	NetworkBearer int32  `json:"bearer,omitempty"`
	Mcc           uint32 `json:"mcc,omitempty"`
	Mnc           uint32 `json:"mnc,omitempty"`
	// Modem debug
	ModemDebugEvents int32 `json:"modem_test_events,omitempty"`
	// Overcurrent events
	OvercurrentEvents    int32 `json:"oc_events,omitempty"`
	OvercurrentEventSecs int32 `json:"oc_event_time,omitempty"`
	// When the signal strength fields were last updated
	Modified int64 `json:"updated,omitempty"`
}

NetInfo is the composite structure with all networking connection info

type PinState

type PinState struct {
	High  bool     `json:"high,omitempty"`
	Low   bool     `json:"low,omitempty"`
	Count []uint32 `json:"count,omitempty"`
}

PinState describes the state of an AUX pin for hardware-related Notecard requests

type Request

type Request struct {
	Req                    string                        `json:"req,omitempty"`
	Cmd                    string                        `json:"cmd,omitempty"`
	Err                    string                        `json:"err,omitempty"`
	RequestID              uint32                        `json:"id,omitempty"`
	NotefileID             string                        `json:"file,omitempty"`
	TrackerID              string                        `json:"tracker,omitempty"`
	NoteID                 string                        `json:"note,omitempty"`
	Body                   *map[string]interface{}       `json:"body,omitempty"`
	Payload                *[]byte                       `json:"payload,omitempty"`
	Deleted                bool                          `json:"deleted,omitempty"`
	Start                  bool                          `json:"start,omitempty"`
	Stop                   bool                          `json:"stop,omitempty"`
	Delete                 bool                          `json:"delete,omitempty"`
	USB                    bool                          `json:"usb,omitempty"`
	Edge                   bool                          `json:"edge,omitempty"`
	Connected              bool                          `json:"connected,omitempty"`
	Secure                 bool                          `json:"secure,omitempty"`
	Unsecure               bool                          `json:"unsecure,omitempty"`
	Alert                  bool                          `json:"alert,omitempty"`
	Retry                  bool                          `json:"retry,omitempty"`
	Signals                int32                         `json:"signals,omitempty"`
	Max                    int32                         `json:"max,omitempty"`
	Changes                int32                         `json:"changes,omitempty"`
	Seconds                int32                         `json:"seconds,omitempty"`
	SecondsV               string                        `json:"vseconds,omitempty"`
	Minutes                int32                         `json:"minutes,omitempty"`
	MinutesV               string                        `json:"vminutes,omitempty"`
	Hours                  int32                         `json:"hours,omitempty"`
	HoursV                 string                        `json:"vhours,omitempty"`
	Days                   int32                         `json:"days,omitempty"`
	Result                 int32                         `json:"result,omitempty"`
	I2C                    int32                         `json:"i2c,omitempty"`
	Status                 string                        `json:"status,omitempty"`
	Version                string                        `json:"version,omitempty"`
	Name                   string                        `json:"name,omitempty"`
	Org                    string                        `json:"org,omitempty"`
	Role                   string                        `json:"role,omitempty"`
	Email                  string                        `json:"email,omitempty"`
	Area                   string                        `json:"area,omitempty"`
	Country                string                        `json:"country,omitempty"`
	Zone                   string                        `json:"zone,omitempty"`
	Mode                   string                        `json:"mode,omitempty"`
	Host                   string                        `json:"host,omitempty"`
	Movements              string                        `json:"movements,omitempty"`
	ProductUID             string                        `json:"product,omitempty"`
	DeviceUID              string                        `json:"device,omitempty"`
	RouteUID               string                        `json:"route,omitempty"`
	Files                  *[]string                     `json:"files,omitempty"`
	Names                  *[]string                     `json:"names,omitempty"`
	FileInfo               *map[string]note.NotefileInfo `json:"info,omitempty"`
	Notes                  *map[string]note.Info         `json:"notes,omitempty"`
	Pad                    int32                         `json:"pad,omitempty"`
	Storage                int32                         `json:"storage,omitempty"`
	LocationOLC            string                        `json:"olc,omitempty"`
	Latitude               float64                       `json:"lat,omitempty"`
	Longitude              float64                       `json:"lon,omitempty"`
	LocationTime           int64                         `json:"ltime,omitempty"`
	Value                  float64                       `json:"value,omitempty"`
	ValueV                 string                        `json:"vvalue,omitempty"`
	SN                     string                        `json:"sn,omitempty"`
	APN                    string                        `json:"apn,omitempty"`
	Text                   string                        `json:"text,omitempty"`
	Base                   int32                         `json:"base,omitempty"`
	Offset                 int32                         `json:"offset,omitempty"`
	Length                 int32                         `json:"length,omitempty"`
	Total                  int32                         `json:"total,omitempty"`
	BytesSent              uint32                        `json:"bytes_sent,omitempty"`
	BytesReceived          uint32                        `json:"bytes_received,omitempty"`
	BytesSentSecondary     uint32                        `json:"bytes_sent_secondary,omitempty"`
	BytesReceivedSecondary uint32                        `json:"bytes_received_secondary,omitempty"`
	NotesSent              uint32                        `json:"notes_sent,omitempty"`
	NotesReceived          uint32                        `json:"notes_received,omitempty"`
	SessionsStandard       uint32                        `json:"sessions_standard,omitempty"`
	SessionsSecure         uint32                        `json:"sessions_secure,omitempty"`
	Megabytes              uint32                        `json:"megabytes,omitempty"`
	BytesPerDay            int32                         `json:"bytes_per_day,omitempty"`
	DataRate               float64                       `json:"rate,omitempty"`
	NumBytes               int32                         `json:"bytes,omitempty"`
	Template               bool                          `json:"template,omitempty"`
	Allow                  bool                          `json:"allow,omitempty"`
	Align                  bool                          `json:"align,omitempty"`
	Limit                  bool                          `json:"limit,omitempty"`
	Pending                bool                          `json:"pending,omitempty"`
	Charging               bool                          `json:"charging,omitempty"`
	On                     bool                          `json:"on,omitempty"`
	Off                    bool                          `json:"off,omitempty"`
	ReqTime                bool                          `json:"reqtime,omitempty"`
	ReqLoc                 bool                          `json:"reqloc,omitempty"`
	Trace                  string                        `json:"trace,omitempty"`
	Usage                  *[]string                     `json:"usage,omitempty"`
	State                  *[]PinState                   `json:"state,omitempty"`
	Time                   int64                         `json:"time,omitempty"` // Time is defined as uint32 on Notecard and int64 on Notehub. See the rationale below.
	Motion                 uint32                        `json:"motion,omitempty"`
	VMin                   float64                       `json:"vmin,omitempty"`
	VMax                   float64                       `json:"vmax,omitempty"`
	VAvg                   float64                       `json:"vavg,omitempty"`
	Daily                  float64                       `json:"daily,omitempty"`
	Weekly                 float64                       `json:"weekly,omitempty"`
	Montly                 float64                       `json:"monthly,omitempty"`
	Verify                 bool                          `json:"verify,omitempty"`
	Confirm                bool                          `json:"confirm,omitempty"`
	Port                   int32                         `json:"port,omitempty"`
	Set                    bool                          `json:"set,omitempty"`
	Reset                  bool                          `json:"reset,omitempty"`
	Calibration            float64                       `json:"calibration,omitempty"`
	Heartbeat              bool                          `json:"heartbeat,omitempty"`
	Threshold              int32                         `json:"threshold,omitempty"`
	Count                  uint32                        `json:"count,omitempty"`
	Sync                   bool                          `json:"sync,omitempty"`
	Live                   bool                          `json:"live,omitempty"`
	Now                    bool                          `json:"now,omitempty"`
	Type                   int32                         `json:"type,omitempty"`
	Number                 int64                         `json:"number,omitempty"`
	SKU                    string                        `json:"sku,omitempty"`
	OrderingCode           string                        `json:"ordering_code,omitempty"`
	Board                  string                        `json:"board,omitempty"`
	Net                    *NetInfo                      `json:"net,omitempty"`
	Sensitivity            int32                         `json:"sensitivity,omitempty"`
	Requested              int32                         `json:"requested,omitempty"`
	Completed              int32                         `json:"completed,omitempty"`
	WiFi                   bool                          `json:"wifi,omitempty"`
	Cell                   bool                          `json:"cell,omitempty"`
	GPS                    bool                          `json:"gps,omitempty"`
	LoRa                   bool                          `json:"lora,omitempty"`
	NTN                    bool                          `json:"ntn,omitempty"`
	Inbound                int32                         `json:"inbound,omitempty"`
	InboundV               string                        `json:"vinbound,omitempty"`
	Outbound               int32                         `json:"outbound,omitempty"`
	OutboundV              string                        `json:"voutbound,omitempty"`
	Duration               int32                         `json:"duration,omitempty"`
	Temperature            float64                       `json:"temperature,omitempty"`
	Pressure               float64                       `json:"pressure,omitempty"`
	Humidity               float64                       `json:"humidity,omitempty"`
	API                    int32                         `json:"api,omitempty"`
	SSID                   string                        `json:"ssid,omitempty"`
	Password               string                        `json:"password,omitempty"`
	Security               string                        `json:"security,omitempty"`
	Key                    string                        `json:"key,omitempty"`
	Method                 string                        `json:"method,omitempty"`
	Content                string                        `json:"content,omitempty"`
	Min                    int32                         `json:"min,omitempty"`
	Add                    int32                         `json:"add,omitempty"`
	Encrypt                bool                          `json:"encrypt,omitempty"`
	Decrypt                bool                          `json:"decrypt,omitempty"`
	Alt                    bool                          `json:"alt,omitempty"`
	Scan                   bool                          `json:"scan,omitempty"`
	Journey                bool                          `json:"journey,omitempty"`
	UOff                   bool                          `json:"uoff,omitempty"`
	UMin                   bool                          `json:"umin,omitempty"`
	UPeriodic              bool                          `json:"uperiodic,omitempty"`
	Milliseconds           int32                         `json:"ms,omitempty"`
	Full                   bool                          `json:"full,omitempty"`
	Async                  bool                          `json:"async,omitempty"`
	Binary                 bool                          `json:"binary,omitempty"`
	Cobs                   int32                         `json:"cobs,omitempty"`
	Append                 bool                          `json:"append,omitempty"`
	Details                *map[string]interface{}       `json:"details,omitempty"`
	Tower                  *note.TowerLocation           `json:"tower,omitempty"`
	Change                 float64                       `json:"change,omitempty"`
	Format                 string                        `json:"format,omitempty"`
	Voltage                float64                       `json:"voltage,omitempty"`
	MilliampHours          float64                       `json:"milliamp_hours,omitempty"`
}

Request is the core API request/response data structure

type SyncLogBody added in v1.1.21

type SyncLogBody struct {
	TimeSecs    int64  `json:"time,omitempty"`
	BootMs      int64  `json:"sequence,omitempty"`
	DetailLevel uint32 `json:"level,omitempty"`
	Subsystem   string `json:"subsystem,omitempty"`
	Text        string `json:"text,omitempty"`
}

SyncLogBody is the data structure used in the SyncLogNotefile

Jump to

Keyboard shortcuts

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