Class NativeMethods
The P/Invoke declarations for the actuator drivers that run over an I2C bus and their
simulated parts, mirroring pamoja.h one-to-one.
public static class NativeMethods
- Inheritance
-
NativeMethods
- Inherited Members
Remarks
Split from the other declarations only to keep each file readable; this is the same NativeMethods class and the same low-level escape hatch. Every part must be updated together with the generated header.
Fields
AuditDigestLen
The length in bytes of an audit entry hash.
public const int AuditDigestLen = 32
Field Value
AuditSignatureLen
The length in bytes of an audit entry signature.
public const int AuditSignatureLen = 64
Field Value
Bme280CalibrationHumidityLen
The BME280 humidity calibration block length.
public const int Bme280CalibrationHumidityLen = 7
Field Value
Bme280CalibrationTempPressLen
The BME280 temperature and pressure calibration block length.
public const int Bme280CalibrationTempPressLen = 26
Field Value
Bme280MeasurementLen
The length of a BME280 burst measurement read.
public const int Bme280MeasurementLen = 8
Field Value
Bmp280CalibrationLen
The length of a BMP280 calibration block.
public const int Bmp280CalibrationLen = 24
Field Value
Bmp280DataLen
The length of a BMP280 burst data read.
public const int Bmp280DataLen = 6
Field Value
CanBusDevice
A bus kind: a kernel CAN interface reached through SocketCAN.
public const byte CanBusDevice = 0
Field Value
CanBusSimulated
A bus kind: a bus inside the program.
public const byte CanBusSimulated = 1
Field Value
ChirpstackApplicationId
The field naming the application.
public const byte ChirpstackApplicationId = 2
Field Value
ChirpstackDeduplicationId
The field naming the uplink's deduplication identifier.
public const byte ChirpstackDeduplicationId = 0
Field Value
ChirpstackDeviceName
The field naming the device.
public const byte ChirpstackDeviceName = 3
Field Value
ChirpstackTime
The field naming when the uplink was received.
public const byte ChirpstackTime = 1
Field Value
Ds18b20ScratchpadLen
The length of a DS18B20 scratchpad, the ninth byte its CRC.
public const int Ds18b20ScratchpadLen = 9
Field Value
GatewayEuiLen
The length of a gateway's unique identifier.
public const int GatewayEuiLen = 8
Field Value
GatewayModulationFsk
An FSK packet, whose bitrate is in its bitrate field.
public const byte GatewayModulationFsk = 1
Field Value
GatewayModulationLora
A LoRa packet, whose settings are in the link.
public const byte GatewayModulationLora = 0
Field Value
GatewayNetworkData
A session frame arrived, decrypted into the caller buffer.
public const byte GatewayNetworkData = 1
Field Value
GatewayNetworkForeign
The frame belongs to a device this site never granted.
public const byte GatewayNetworkForeign = 2
Field Value
GatewayNetworkJoined
A device joined, and its accept is in the event.
public const byte GatewayNetworkJoined = 0
Field Value
GatewayNetworkRx1Downstream
The first receive window answers on a run of downlink channels.
public const byte GatewayNetworkRx1Downstream = 1
Field Value
GatewayNetworkRx1Same
The first receive window answers on the frequency the uplink arrived on.
public const byte GatewayNetworkRx1Same = 0
Field Value
GatewayProtocolVersion
The protocol version every datagram starts with.
public const byte GatewayProtocolVersion = 2
Field Value
GatewayPullAck
The server acknowledging a PULL_DATA.
public const byte GatewayPullAck = 4
Field Value
GatewayPullData
The gateway holding its route open.
public const byte GatewayPullData = 2
Field Value
GatewayPullResp
The server sending a packet to transmit.
public const byte GatewayPullResp = 3
Field Value
GatewayPushAck
The server acknowledging a PUSH_DATA.
public const byte GatewayPushAck = 1
Field Value
GatewayPushData
The gateway forwarding what it heard.
public const byte GatewayPushData = 0
Field Value
GatewayStationDownlink
A frame the server asks the station to transmit.
public const byte GatewayStationDownlink = 5
Field Value
GatewayStationJoinRequest
A join request the station heard.
public const byte GatewayStationJoinRequest = 0
Field Value
GatewayStationOther
A kind this build does not model, readable only as its text.
public const byte GatewayStationOther = 9
Field Value
GatewayStationProprietary
A frame of a kind this protocol does not describe, carried whole.
public const byte GatewayStationProprietary = 2
Field Value
GatewayStationRouterConfig
How the server tells the station to configure its radios.
public const byte GatewayStationRouterConfig = 4
Field Value
GatewayStationSchedule
Frames the server asks the station to transmit to a group.
public const byte GatewayStationSchedule = 6
Field Value
GatewayStationTextFeatures
What a version says the station can do.
public const byte GatewayStationTextFeatures = 4
Field Value
GatewayStationTextFirmware
The firmware a version reports.
public const byte GatewayStationTextFirmware = 1
Field Value
GatewayStationTextHwspec
The concentrator a configuration is written for.
public const byte GatewayStationTextHwspec = 6
Field Value
GatewayStationTextModel
The hardware model a version reports.
public const byte GatewayStationTextModel = 3
Field Value
GatewayStationTextMsgtype
The word a message calls itself on the wire.
public const byte GatewayStationTextMsgtype = 7
Field Value
GatewayStationTextPackage
The package a version reports.
public const byte GatewayStationTextPackage = 2
Field Value
GatewayStationTextRegion
The region a configuration names.
public const byte GatewayStationTextRegion = 5
Field Value
GatewayStationTextStation
The station software a version reports.
public const byte GatewayStationTextStation = 0
Field Value
GatewayStationTimeSync
The clock the two keep between them.
public const byte GatewayStationTimeSync = 8
Field Value
GatewayStationTransmitted
What became of a frame the station was asked to transmit.
public const byte GatewayStationTransmitted = 7
Field Value
GatewayStationUplink
A data frame the station heard.
public const byte GatewayStationUplink = 1
Field Value
GatewayStationVersion
What the station reports about itself when a session opens.
public const byte GatewayStationVersion = 3
Field Value
GatewayTxAck
The gateway reporting what became of a PULL_RESP.
public const byte GatewayTxAck = 5
Field Value
Hdc1080MeasurementLen
The length of a HDC1080 measurement frame.
public const int Hdc1080MeasurementLen = 4
Field Value
I2cBusAdapter
A bus kind: the kernel's adapter.
public const byte I2cBusAdapter = 0
Field Value
I2cBusScripted
A bus kind: a script.
public const byte I2cBusScripted = 2
Field Value
I2cBusSimulated
A bus kind: simulated parts.
public const byte I2cBusSimulated = 1
Field Value
I2cPartBytes
A part kind: registers a byte wide.
public const byte I2cPartBytes = 0
Field Value
I2cPartCommands
A part kind: commands that leave replies.
public const byte I2cPartCommands = 2
Field Value
I2cPartWords
A part kind: registers sixteen bits wide.
public const byte I2cPartWords = 1
Field Value
I2cReservedBelow
The first 7-bit address above the reserved block at the bottom.
public const byte I2cReservedBelow = 8
Field Value
I2cReservedFrom
The lowest 7-bit address the I2C specification keeps for itself.
public const byte I2cReservedFrom = 120
Field Value
Ina219ConfigReset
The INA219 configuration register's power-on value.
public const ushort Ina219ConfigReset = 14751
Field Value
J1939BroadcastAddress
The destination address every node on the bus reads.
public const byte J1939BroadcastAddress = 255
Field Value
J1939NotAvailable
The byte a J1939 sender writes for a signal it is not reporting.
public const byte J1939NotAvailable = 255
Field Value
J1939PriorityControl
The priority a control message takes, ahead of ordinary traffic.
public const byte J1939PriorityControl = 3
Field Value
J1939PriorityDefault
The priority ordinary traffic takes.
public const byte J1939PriorityDefault = 6
Field Value
J1939PriorityLowest
The priority that yields to everything else on the bus.
public const byte J1939PriorityLowest = 7
Field Value
LoraChannelListMhz800
The 800 MHz channel list numbering.
public const byte LoraChannelListMhz800 = 1
Field Value
LoraChannelListMhz900
The 900 MHz channel list numbering.
public const byte LoraChannelListMhz900 = 2
Field Value
LoraChannelListNone
A plan that reads a type 1 channel list against no numbering.
public const byte LoraChannelListNone = 0
Field Value
LoraChannelsDefault
The channels a device starts with before a network adds any.
public const uint LoraChannelsDefault = 1
Field Value
LoraChannelsDownlink
The numbered downlink channels a fixed plan answers the first receive window on.
public const uint LoraChannelsDownlink = 2
Field Value
LoraChannelsJoin
The channels a device must use to send a join request.
public const uint LoraChannelsJoin = 0
Field Value
LoraCn470Antenna20MhzA
The CN470-510 plan for a 20 MHz antenna, type A.
public const uint LoraCn470Antenna20MhzA = 1
Field Value
LoraCn470Antenna20MhzB
The CN470-510 plan for a 20 MHz antenna, type B.
public const uint LoraCn470Antenna20MhzB = 2
Field Value
LoraCn470Antenna26MhzA
The CN470-510 plan for a 26 MHz antenna, type A.
public const uint LoraCn470Antenna26MhzA = 3
Field Value
LoraCn470Antenna26MhzB
The CN470-510 plan for a 26 MHz antenna, type B.
public const uint LoraCn470Antenna26MhzB = 4
Field Value
LoraCn470Channels96
The 96-channel CN470-510 plan.
public const uint LoraCn470Channels96 = 5
Field Value
LoraCn470None
No CN470-510 plan.
public const uint LoraCn470None = 0
Field Value
LoraDirectionDownlink
The downlink direction, for a table that differs between the two.
public const uint LoraDirectionDownlink = 1
Field Value
LoraDirectionUplink
The uplink direction, for a table that differs between the two.
public const uint LoraDirectionUplink = 0
Field Value
LoraJoinOctetPasses
Join channels tried in octet passes.
public const byte LoraJoinOctetPasses = 1
Field Value
LoraJoinRandom
Join channels chosen at random.
public const byte LoraJoinRandom = 0
Field Value
LoraMaskAll
A mask control that turns every channel on or off, then sets a group.
public const byte LoraMaskAll = 3
Field Value
LoraMaskBanks
A mask control whose ten low bits switch banks of eight.
public const byte LoraMaskBanks = 1
Field Value
LoraMaskGroup
A mask control that sets one group of sixteen channels.
public const byte LoraMaskGroup = 0
Field Value
LoraMaskPairedBanks
A mask control that switches banks of eight with their 500 kHz channel.
public const byte LoraMaskPairedBanks = 2
Field Value
LoraMaskReserved
A mask control the region reserves.
public const byte LoraMaskReserved = 4
Field Value
LoraModulationFsk
A data rate carried by FSK modulation.
public const byte LoraModulationFsk = 1
Field Value
LoraModulationLora
A data rate carried by LoRa modulation.
public const byte LoraModulationLora = 0
Field Value
LoraModulationLrFhss
A data rate carried by long-range frequency-hopping spread spectrum.
public const byte LoraModulationLrFhss = 2
Field Value
LoraModulationReserved
A data-rate number the region reserves, which carries nothing.
public const byte LoraModulationReserved = 3
Field Value
LoraPayloadTableDownlinkDirect
The downlink payload limits for a device that will not.
public const uint LoraPayloadTableDownlinkDirect = 3
Field Value
LoraPayloadTableDownlinkRepeater
The downlink payload limits for a device that may sit behind a repeater.
public const uint LoraPayloadTableDownlinkRepeater = 2
Field Value
LoraPayloadTableDwellLimited
The payload limits that apply under a dwell-time limit.
public const uint LoraPayloadTableDwellLimited = 4
Field Value
LoraPayloadTableUplinkDirect
The uplink payload limits for a device that will not.
public const uint LoraPayloadTableUplinkDirect = 1
Field Value
LoraPayloadTableUplinkRepeater
The uplink payload limits for a device that may sit behind a repeater.
public const uint LoraPayloadTableUplinkRepeater = 0
Field Value
LoraPlanKindDynamic
A plan whose network creates channels and moves them.
public const byte LoraPlanKindDynamic = 0
Field Value
LoraPlanKindFixed
A plan whose channels are numbered in advance and only enabled or disabled.
public const byte LoraPlanKindFixed = 1
Field Value
LoraPowerConducted
Power indexes that count down from a conducted ceiling.
public const byte LoraPowerConducted = 1
Field Value
LoraPowerEirp
Power indexes that count down from a radiated ceiling.
public const byte LoraPowerEirp = 0
Field Value
LoraRadioCorrupt
A reception outcome: a frame arrived whose check failed, and was dropped.
public const byte LoraRadioCorrupt = 2
Field Value
LoraRadioDefaultSpiHz
The SPI clock a radio opens at when the call passes 0, in hertz.
public const uint LoraRadioDefaultSpiHz = 2000000
Field Value
LoraRadioFrame
A reception outcome: a frame arrived and checked.
public const byte LoraRadioFrame = 0
Field Value
LoraRadioNothing
A reception outcome: nothing has arrived since the last frame was taken.
public const byte LoraRadioNothing = 3
Field Value
LoraRadioSx126x
The family of an SX1261, SX1262, SX1268, or LLCC68.
public const byte LoraRadioSx126x = 0
Field Value
LoraRadioSx127x
The family of an SX1276, SX1277, SX1278, or SX1279.
public const byte LoraRadioSx127x = 1
Field Value
LoraRadioSyncWordPrivate
The sync word of a private network, and both families' reset value.
public const byte LoraRadioSyncWordPrivate = 18
Field Value
LoraRadioSyncWordPublic
The sync word of a public network such as LoRaWAN.
public const byte LoraRadioSyncWordPublic = 52
Field Value
LoraRadioTimeout
A reception outcome: no frame arrived before the timeout.
public const byte LoraRadioTimeout = 1
Field Value
LoraRegionAs923
The AS923 band.
public const uint LoraRegionAs923 = 6
Field Value
LoraRegionAu915
The AU915-928 band.
public const uint LoraRegionAu915 = 4
Field Value
LoraRegionCn470
The CN470-510 band.
public const uint LoraRegionCn470 = 5
Field Value
LoraRegionEu433
The EU433 band.
public const uint LoraRegionEu433 = 3
Field Value
LoraRegionEu868
The EU863-870 band.
public const uint LoraRegionEu868 = 1
Field Value
LoraRegionIn865
The IN865-867 band.
public const uint LoraRegionIn865 = 8
Field Value
LoraRegionKr920
The KR920-923 band.
public const uint LoraRegionKr920 = 7
Field Value
LoraRegionRu864
The RU864-870 band.
public const uint LoraRegionRu864 = 9
Field Value
LoraRegionUs915
The US902-928 band.
public const uint LoraRegionUs915 = 2
Field Value
LorawanCfListFrequencies
How many frequencies a type 0 channel list carries.
public const int LorawanCfListFrequencies = 5
Field Value
LorawanCfListLen
The number of bytes a channel list occupies.
public const int LorawanCfListLen = 16
Field Value
LorawanCfListMaskGroups
How many sixteen-bit masks a type 1 channel list carries.
public const int LorawanCfListMaskGroups = 6
Field Value
LorawanCfListTypeChannelMasks
The CFListType byte of a list of channel mask groups.
public const byte LorawanCfListTypeChannelMasks = 1
Field Value
LorawanCfListTypeFrequencies
The CFListType byte of a list of frequencies.
public const byte LorawanCfListTypeFrequencies = 0
Field Value
LorawanClockPort
The port clock synchronization is spoken on, TS003-2.0.0.
public const byte LorawanClockPort = 202
Field Value
LorawanEuiLen
The length of a LoRaWAN EUI, in bytes.
public const int LorawanEuiLen = 8
Field Value
LorawanFirmwarePort
The port firmware management is spoken on, TS006-1.0.0.
public const byte LorawanFirmwarePort = 203
Field Value
LorawanFragmentPort
The port fragmented data block transport is spoken on, TS004-2.0.0.
public const byte LorawanFragmentPort = 201
Field Value
LorawanImageCorrupt
One is there, but it is corrupt or its signature does not verify.
public const byte LorawanImageCorrupt = 1
Field Value
LorawanImageNone
The device holds no firmware upgrade image.
public const byte LorawanImageNone = 0
Field Value
LorawanImageValid
One is there, and it can be installed.
public const byte LorawanImageValid = 3
Field Value
LorawanImageWrongHardware
One is there and authentic, but it is not for this hardware.
public const byte LorawanImageWrongHardware = 2
Field Value
LorawanKeyLen
The length of a LoRaWAN key, in bytes.
public const int LorawanKeyLen = 16
Field Value
LorawanMaxFragments
The most fragments one session carries.
public const ushort LorawanMaxFragments = 16383
Field Value
LorawanMulticastPort
The port remote multicast setup is spoken on, TS005-2.0.0.
public const byte LorawanMulticastPort = 200
Field Value
LorawanPayloadMax
The largest LoRaWAN application payload, in bytes.
public const int LorawanPayloadMax = 243
Field Value
LorawanRelayDeviceControlled
The device itself decides.
public const byte LorawanRelayDeviceControlled = 3
Field Value
LorawanRelayDisabled
The device never sends through a relay, the default.
public const byte LorawanRelayDisabled = 0
Field Value
LorawanRelayDynamic
It does once a run of uplinks goes unanswered.
public const byte LorawanRelayDynamic = 2
Field Value
LorawanRelayEnabled
It always does.
public const byte LorawanRelayEnabled = 1
Field Value
LorawanRelayHeardDevice
The relay's own device read the frame.
public const byte LorawanRelayHeardDevice = 0
Field Value
LorawanRelayHeardDownlink
The frame carried a downlink to pass on to an end device.
public const byte LorawanRelayHeardDownlink = 1
Field Value
LorawanRelayHeardUndeliverable
It carried one that cannot be passed on.
public const byte LorawanRelayHeardUndeliverable = 2
Field Value
LorawanRelayInitialized
No wake-on-radio frame has gone out yet.
public const byte LorawanRelayInitialized = 0
Field Value
LorawanRelaySynchronized
The device knows when the relay next scans.
public const byte LorawanRelaySynchronized = 2
Field Value
LorawanRelayUnsynchronized
One went out unanswered, so the next preamble spans a scan period.
public const byte LorawanRelayUnsynchronized = 1
Field Value
LorawanSavedLen
How many bytes a saved device state takes.
public const int LorawanSavedLen = 1678
Field Value
LorawanVersion103
LoRaWAN 1.0.3.
public const byte LorawanVersion103 = 3
Field Value
LorawanVersion104
TS001-1.0.4, the LoRaWAN 1.0.4 link layer.
public const byte LorawanVersion104 = 4
Field Value
LorawanWakeJoinRequest
A wake-on-radio frame ahead of a join request the relay lets through.
public const byte LorawanWakeJoinRequest = 0
Field Value
LorawanWakeNotified
One from a device the relay tells its network about.
public const byte LorawanWakeNotified = 2
Field Value
LorawanWakeUplink
One ahead of a trusted device's uplink.
public const byte LorawanWakeUplink = 1
Field Value
LorawanWorJoinRequest
A WOR frame ahead of a join request.
public const byte LorawanWorJoinRequest = 0
Field Value
LorawanWorNextUplink
The uplink goes out at the time the exchange named.
public const byte LorawanWorNextUplink = 0
Field Value
LorawanWorNextWakeUp
The relay is woken again first.
public const byte LorawanWorNextWakeUp = 1
Field Value
LorawanWorUplink
A WOR frame ahead of a Class A uplink.
public const byte LorawanWorUplink = 1
Field Value
MavlinkAckFinal
The command finished.
public const uint MavlinkAckFinal = 3
Field Value
MavlinkAckInProgress
The command is still running.
public const uint MavlinkAckInProgress = 2
Field Value
MavlinkAckUnrelated
An acknowledgment was for a different command.
public const uint MavlinkAckUnrelated = 1
Field Value
MavlinkDefaultTimestampWindow
The default window a verifier accepts a timestamp within.
public const ulong MavlinkDefaultTimestampWindow = 6000000
Field Value
MavlinkKeyLen
The length of a signing key, in bytes.
public const int MavlinkKeyLen = 32
Field Value
MavlinkMaxFrame
The largest frame, in bytes, header, checksum and signature included.
public const int MavlinkMaxFrame = 280
Field Value
MavlinkMaxPayload
The largest payload a frame can carry, in bytes.
public const int MavlinkMaxPayload = 255
Field Value
MavlinkMaxRetries
The retransmissions the mission protocol recommends before giving up.
public const byte MavlinkMaxRetries = 5
Field Value
MavlinkReceiverAck
A receiver answered with the acknowledgment that ends the transfer.
public const uint MavlinkReceiverAck = 2
Field Value
MavlinkReceiverRequest
A receiver answered with a request for the next item.
public const uint MavlinkReceiverRequest = 1
Field Value
MavlinkSenderFinished
A sender saw the receiver's acknowledgment.
public const uint MavlinkSenderFinished = 2
Field Value
MavlinkSenderReply
A sender answered with a frame to send.
public const uint MavlinkSenderReply = 1
Field Value
MavlinkSignatureLen
The length of a v2 signature block, in bytes.
public const int MavlinkSignatureLen = 13
Field Value
MavlinkStepIgnored
The frame was not one the machine handles.
public const uint MavlinkStepIgnored = 0
Field Value
MavlinkVersionV1
The original wire format, with a six-byte header.
public const byte MavlinkVersionV1 = 1
Field Value
MavlinkVersionV2
The current wire format, with a 24-bit message id and signing.
public const byte MavlinkVersionV2 = 2
Field Value
MeshBroadcast
The destination address that means every node.
public const uint MeshBroadcast = 4294967295
Field Value
MeshDefaultHopLimit
The hop limit a mesh frame starts with unless one is set.
public const byte MeshDefaultHopLimit = 3
Field Value
MeshFrameMax
The largest mesh frame, in bytes, header and checksum included.
public const int MeshFrameMax = 250
Field Value
MeshHeaderLen
How many bytes of a mesh frame are header.
public const int MeshHeaderLen = 12
Field Value
MeshPayloadMax
The largest payload a single mesh frame can carry, in bytes.
public const int MeshPayloadMax = 236
Field Value
MeshSeenDefaultCapacity
A duplicate-cache size for a caller with no reason to choose one.
public const int MeshSeenDefaultCapacity = 64
Field Value
ModbusClientBroadcastRead
A client error kind: a read was addressed to the broadcast address.
public const byte ModbusClientBroadcastRead = 2
Field Value
ModbusClientException
A client error kind: the device refused the request with an exception.
public const byte ModbusClientException = 9
Field Value
ModbusClientFrame
A client error kind: the reply failed its CRC or is not the shape its function gives.
public const byte ModbusClientFrame = 5
Field Value
ModbusClientMismatch
A client error kind: a well-formed reply that does not answer the request.
public const byte ModbusClientMismatch = 8
Field Value
ModbusClientOk
A client error kind: the call succeeded.
public const byte ModbusClientOk = 0
Field Value
ModbusClientPort
A client error kind: the serial port failed.
public const byte ModbusClientPort = 3
Field Value
ModbusClientRequest
A client error kind: the request could not be built.
public const byte ModbusClientRequest = 1
Field Value
ModbusClientTimeout
A client error kind: no complete reply arrived within the response timeout.
public const byte ModbusClientTimeout = 4
Field Value
ModbusClientWrongFunction
A client error kind: a reply answered another function.
public const byte ModbusClientWrongFunction = 7
Field Value
ModbusClientWrongUnit
A client error kind: a reply came back from another unit.
public const byte ModbusClientWrongUnit = 6
Field Value
Opt3001RegisterLen
The length of a OPT3001 register.
public const int Opt3001RegisterLen = 2
Field Value
ParityEven
A parity bit that makes the count of ones even.
public const byte ParityEven = 1
Field Value
ParityNone
No parity bit.
public const byte ParityNone = 0
Field Value
ParityOdd
A parity bit that makes the count of ones odd.
public const byte ParityOdd = 2
Field Value
Pca9685DefaultAddress
The address a PCA9685 answers at with its six address pins low.
public const byte Pca9685DefaultAddress = 64
Field Value
Pca9685DefaultFrequencyHz
The frequency a PCA9685 driver runs at unless given another, in hertz.
public const uint Pca9685DefaultFrequencyHz = 200
Field Value
Pca9685Mode1AutoIncrement
MODE1's auto-increment bit.
public const byte Pca9685Mode1AutoIncrement = 32
Field Value
Pca9685Mode1Extclk
MODE1's EXTCLK bit.
public const byte Pca9685Mode1Extclk = 64
Field Value
Pca9685Mode1Reset
A PCA9685's MODE1 at power-up.
public const byte Pca9685Mode1Reset = 17
Field Value
Pca9685Mode1Restart
MODE1's RESTART bit.
public const byte Pca9685Mode1Restart = 128
Field Value
Pca9685Mode1Sleep
MODE1's SLEEP bit.
public const byte Pca9685Mode1Sleep = 16
Field Value
Pca9685Mode2Reset
A PCA9685's MODE2 at power-up.
public const byte Pca9685Mode2Reset = 4
Field Value
Pca9685OscillatorStartupMicros
How long a PCA9685's oscillator takes to run once woken, in microseconds.
public const uint Pca9685OscillatorStartupMicros = 500
Field Value
Pca9685PreScaleMin
The smallest value a PCA9685 loads into PRE_SCALE.
public const byte Pca9685PreScaleMin = 3
Field Value
Pca9685PreScaleReset
A PCA9685's PRE_SCALE at power-up.
public const byte Pca9685PreScaleReset = 30
Field Value
Pca9685RegisterAllLedOnL
The first of a PCA9685's four ALL_LED registers.
public const byte Pca9685RegisterAllLedOnL = 250
Field Value
Pca9685RegisterLed0OnL
The first of a PCA9685's channel 0 registers.
public const byte Pca9685RegisterLed0OnL = 6
Field Value
Pca9685RegisterMode1
A PCA9685's mode register 1.
public const byte Pca9685RegisterMode1 = 0
Field Value
Pca9685RegisterMode2
A PCA9685's mode register 2.
public const byte Pca9685RegisterMode2 = 1
Field Value
Pca9685RegisterPreScale
A PCA9685's prescaler.
public const byte Pca9685RegisterPreScale = 254
Field Value
RoutingDefaultCapacity
A routing table size for a caller with no reason to choose one.
public const int RoutingDefaultCapacity = 64
Field Value
Scd4xCommandLen
The length of a SCD4x command frame.
public const int Scd4xCommandLen = 2
Field Value
Scd4xMeasurementLen
The length of a SCD4x measurement frame.
public const int Scd4xMeasurementLen = 9
Field Value
Scd4xWordLen
The length of a SCD4x word and its checksum.
public const int Scd4xWordLen = 3
Field Value
Scd4xWriteLen
The length of a SCD4x command-and-value frame.
public const int Scd4xWriteLen = 5
Field Value
SerialPortDevice
A port kind: the kernel's serial device.
public const byte SerialPortDevice = 0
Field Value
SerialPortLooped
A port kind: the port's own output, looped back to its input.
public const byte SerialPortLooped = 1
Field Value
SerialPortPaired
A port kind: the other end of a null-modem pair.
public const byte SerialPortPaired = 2
Field Value
SerialPortScripted
A port kind: a script of the writes a driver is expected to make.
public const byte SerialPortScripted = 4
Field Value
SerialPortSimulated
A port kind: a simulated device that answers each write.
public const byte SerialPortSimulated = 3
Field Value
SessionKeyLen
The length in bytes of an agreement seed, key, or digest.
public const int SessionKeyLen = 32
Field Value
SessionTagLen
The length in bytes of the tag on a sealed message.
public const int SessionTagLen = 16
Field Value
Sht3xMeasurementLen
The length of a SHT3x measurement frame.
public const int Sht3xMeasurementLen = 6
Field Value
Sht3xWordLen
The length of a SHT3x word and its checksum.
public const int Sht3xWordLen = 3
Field Value
StepperDefaultPulseMicros
How long a step and direction driver holds the direction before a step pulse, and the pulse itself, unless given another, in microseconds.
public const uint StepperDefaultPulseMicros = 10
Field Value
StepperDefaultStepMicros
The pause a stepper driver takes after each step unless given another, in microseconds.
public const uint StepperDefaultStepMicros = 2000
Field Value
Sx126xCommandMax
The most bytes an SX126x command or command header takes.
public const int Sx126xCommandMax = 10
Field Value
Sx126xErrorAdcCalibration
The device error for a failed ADC calibration.
public const ushort Sx126xErrorAdcCalibration = 8
Field Value
Sx126xErrorImageCalibration
The device error for a failed image calibration.
public const ushort Sx126xErrorImageCalibration = 16
Field Value
Sx126xErrorPaRamp
The device error for a power-amplifier ramp that failed.
public const ushort Sx126xErrorPaRamp = 256
Field Value
Sx126xErrorPllCalibration
The device error for a failed PLL calibration.
public const ushort Sx126xErrorPllCalibration = 4
Field Value
Sx126xErrorPllLock
The device error for a PLL that failed to lock.
public const ushort Sx126xErrorPllLock = 64
Field Value
Sx126xErrorRc13mCalibration
The device error for a failed RC13M calibration.
public const ushort Sx126xErrorRc13mCalibration = 2
Field Value
Sx126xErrorRc64kCalibration
The device error for a failed RC64k calibration.
public const ushort Sx126xErrorRc64kCalibration = 1
Field Value
Sx126xErrorXoscStart
The device error for a crystal oscillator that failed to start.
public const ushort Sx126xErrorXoscStart = 32
Field Value
Sx126xIrqAll
Every interrupt the chip defines.
public const ushort Sx126xIrqAll = 17407
Field Value
Sx126xIrqCadDetected
The interrupt raised when channel activity detection hears a signal.
public const ushort Sx126xIrqCadDetected = 256
Field Value
Sx126xIrqCadDone
The interrupt raised when channel activity detection finishes.
public const ushort Sx126xIrqCadDone = 128
Field Value
Sx126xIrqCrcError
The interrupt raised when a received payload fails its CRC.
public const ushort Sx126xIrqCrcError = 64
Field Value
Sx126xIrqHeaderError
The interrupt raised when a LoRa header fails its CRC.
public const ushort Sx126xIrqHeaderError = 32
Field Value
Sx126xIrqHeaderValid
The interrupt raised when a valid LoRa header is received.
public const ushort Sx126xIrqHeaderValid = 16
Field Value
Sx126xIrqLrFhssHop
The interrupt raised on an LR-FHSS frequency hop.
public const ushort Sx126xIrqLrFhssHop = 16384
Field Value
Sx126xIrqPreambleDetected
The interrupt raised when a preamble is detected.
public const ushort Sx126xIrqPreambleDetected = 4
Field Value
Sx126xIrqRxDone
The interrupt raised when a frame has been received.
public const ushort Sx126xIrqRxDone = 2
Field Value
Sx126xIrqSyncWordValid
The interrupt raised when a valid sync word is detected.
public const ushort Sx126xIrqSyncWordValid = 8
Field Value
Sx126xIrqTimeout
The interrupt raised when a transmit or receive timeout expires.
public const ushort Sx126xIrqTimeout = 512
Field Value
Sx126xIrqTxDone
The interrupt raised when a frame has been sent.
public const ushort Sx126xIrqTxDone = 1
Field Value
Sx126xRegisterLoraSyncWord
The register the two bytes of the LoRa sync word are written to.
public const ushort Sx126xRegisterLoraSyncWord = 1856
Field Value
Sx126xRxContinuous
The SetRx timeout that keeps the receiver listening until told otherwise.
public const uint Sx126xRxContinuous = 16777215
Field Value
Sx126xSyncWordPrivate
The LoRa sync word private networks use.
public const ushort Sx126xSyncWordPrivate = 5156
Field Value
Sx126xSyncWordPublic
The LoRa sync word public LoRaWAN networks use.
public const ushort Sx126xSyncWordPublic = 13380
Field Value
Sx127xDio0CadDone
RegDioMapping1 with DIO0 signaling CadDone.
public const byte Sx127xDio0CadDone = 128
Field Value
Sx127xDio0RxDone
RegDioMapping1 with DIO0 signaling RxDone.
public const byte Sx127xDio0RxDone = 0
Field Value
Sx127xDio0TxDone
RegDioMapping1 with DIO0 signaling TxDone.
public const byte Sx127xDio0TxDone = 64
Field Value
Sx127xImageCalRunning
The RegImageCal bit set while a calibration runs.
public const byte Sx127xImageCalRunning = 32
Field Value
Sx127xImageCalStart
The RegImageCal bit that starts a calibration.
public const byte Sx127xImageCalStart = 64
Field Value
Sx127xIrqAll
The SX127x interrupt flag 0xFF.
public const byte Sx127xIrqAll = 255
Field Value
Sx127xIrqCadDetected
The SX127x interrupt flag 0x01.
public const byte Sx127xIrqCadDetected = 1
Field Value
Sx127xIrqCadDone
The SX127x interrupt flag 0x04.
public const byte Sx127xIrqCadDone = 4
Field Value
Sx127xIrqFhssChangeChannel
The SX127x interrupt flag 0x02.
public const byte Sx127xIrqFhssChangeChannel = 2
Field Value
Sx127xIrqPayloadCrcError
The SX127x interrupt flag 0x20.
public const byte Sx127xIrqPayloadCrcError = 32
Field Value
Sx127xIrqRxDone
The SX127x interrupt flag 0x40.
public const byte Sx127xIrqRxDone = 64
Field Value
Sx127xIrqRxTimeout
The SX127x interrupt flag 0x80.
public const byte Sx127xIrqRxTimeout = 128
Field Value
Sx127xIrqTxDone
The SX127x interrupt flag 0x08.
public const byte Sx127xIrqTxDone = 8
Field Value
Sx127xIrqValidHeader
The SX127x interrupt flag 0x10.
public const byte Sx127xIrqValidHeader = 16
Field Value
Sx127xLnaBoosted
RegLna with maximum gain and the high frequency LNA boost.
public const byte Sx127xLnaBoosted = 35
Field Value
Sx127xModeCad
The SX127x operating mode code 7.
public const byte Sx127xModeCad = 7
Field Value
Sx127xModeFsRx
The SX127x operating mode code 4.
public const byte Sx127xModeFsRx = 4
Field Value
Sx127xModeFsTx
The SX127x operating mode code 2.
public const byte Sx127xModeFsTx = 2
Field Value
Sx127xModeRxContinuous
The SX127x operating mode code 5.
public const byte Sx127xModeRxContinuous = 5
Field Value
Sx127xModeRxSingle
The SX127x operating mode code 6.
public const byte Sx127xModeRxSingle = 6
Field Value
Sx127xModeSleep
The SX127x operating mode code 0.
public const byte Sx127xModeSleep = 0
Field Value
Sx127xModeStandby
The SX127x operating mode code 1.
public const byte Sx127xModeStandby = 1
Field Value
Sx127xModeTx
The SX127x operating mode code 3.
public const byte Sx127xModeTx = 3
Field Value
Sx127xPaDacDefault
RegPaDac at its reset value.
public const byte Sx127xPaDacDefault = 132
Field Value
Sx127xPaDacHighPower
RegPaDac with the +20 dBm setting on PA_BOOST.
public const byte Sx127xPaDacHighPower = 135
Field Value
Sx127xRegDetectOptimize
The SX127x register at 0x31.
public const byte Sx127xRegDetectOptimize = 49
Field Value
Sx127xRegDetectionThreshold
The SX127x register at 0x37.
public const byte Sx127xRegDetectionThreshold = 55
Field Value
Sx127xRegDioMapping1
The SX127x register at 0x40.
public const byte Sx127xRegDioMapping1 = 64
Field Value
Sx127xRegDioMapping2
The SX127x register at 0x41.
public const byte Sx127xRegDioMapping2 = 65
Field Value
Sx127xRegFifo
The SX127x register at 0x00.
public const byte Sx127xRegFifo = 0
Field Value
Sx127xRegFifoAddrPtr
The SX127x register at 0x0D.
public const byte Sx127xRegFifoAddrPtr = 13
Field Value
Sx127xRegFifoRxBaseAddr
The SX127x register at 0x0F.
public const byte Sx127xRegFifoRxBaseAddr = 15
Field Value
Sx127xRegFifoRxCurrentAddr
The SX127x register at 0x10.
public const byte Sx127xRegFifoRxCurrentAddr = 16
Field Value
Sx127xRegFifoTxBaseAddr
The SX127x register at 0x0E.
public const byte Sx127xRegFifoTxBaseAddr = 14
Field Value
Sx127xRegFrfLsb
The SX127x register at 0x08.
public const byte Sx127xRegFrfLsb = 8
Field Value
Sx127xRegFrfMid
The SX127x register at 0x07.
public const byte Sx127xRegFrfMid = 7
Field Value
Sx127xRegFrfMsb
The SX127x register at 0x06.
public const byte Sx127xRegFrfMsb = 6
Field Value
Sx127xRegHighBwOptimize1
The SX127x register at 0x36.
public const byte Sx127xRegHighBwOptimize1 = 54
Field Value
Sx127xRegHighBwOptimize2
The SX127x register at 0x3A.
public const byte Sx127xRegHighBwOptimize2 = 58
Field Value
Sx127xRegHopChannel
The SX127x register at 0x1C.
public const byte Sx127xRegHopChannel = 28
Field Value
Sx127xRegIfFreq1
The SX127x register at 0x30.
public const byte Sx127xRegIfFreq1 = 48
Field Value
Sx127xRegIfFreq2
The SX127x register at 0x2F.
public const byte Sx127xRegIfFreq2 = 47
Field Value
Sx127xRegImageCal
The SX127x register at 0x3B.
public const byte Sx127xRegImageCal = 59
Field Value
Sx127xRegInvertIq
The SX127x register at 0x33.
public const byte Sx127xRegInvertIq = 51
Field Value
Sx127xRegInvertIq2
The SX127x register at 0x3B.
public const byte Sx127xRegInvertIq2 = 59
Field Value
Sx127xRegIrqFlags
The SX127x register at 0x12.
public const byte Sx127xRegIrqFlags = 18
Field Value
Sx127xRegIrqFlagsMask
The SX127x register at 0x11.
public const byte Sx127xRegIrqFlagsMask = 17
Field Value
Sx127xRegLna
The SX127x register at 0x0C.
public const byte Sx127xRegLna = 12
Field Value
Sx127xRegMaxPayloadLength
The SX127x register at 0x23.
public const byte Sx127xRegMaxPayloadLength = 35
Field Value
Sx127xRegModemConfig1
The SX127x register at 0x1D.
public const byte Sx127xRegModemConfig1 = 29
Field Value
Sx127xRegModemConfig2
The SX127x register at 0x1E.
public const byte Sx127xRegModemConfig2 = 30
Field Value
Sx127xRegModemConfig3
The SX127x register at 0x26.
public const byte Sx127xRegModemConfig3 = 38
Field Value
Sx127xRegModemStat
The SX127x register at 0x18.
public const byte Sx127xRegModemStat = 24
Field Value
Sx127xRegOcp
The SX127x register at 0x0B.
public const byte Sx127xRegOcp = 11
Field Value
Sx127xRegOpMode
The SX127x register at 0x01.
public const byte Sx127xRegOpMode = 1
Field Value
Sx127xRegPaConfig
The SX127x register at 0x09.
public const byte Sx127xRegPaConfig = 9
Field Value
Sx127xRegPaDac
The SX127x register at 0x4D.
public const byte Sx127xRegPaDac = 77
Field Value
Sx127xRegPaRamp
The SX127x register at 0x0A.
public const byte Sx127xRegPaRamp = 10
Field Value
Sx127xRegPayloadLength
The SX127x register at 0x22.
public const byte Sx127xRegPayloadLength = 34
Field Value
Sx127xRegPktRssiValue
The SX127x register at 0x1A.
public const byte Sx127xRegPktRssiValue = 26
Field Value
Sx127xRegPktSnrValue
The SX127x register at 0x19.
public const byte Sx127xRegPktSnrValue = 25
Field Value
Sx127xRegPreambleLsb
The SX127x register at 0x21.
public const byte Sx127xRegPreambleLsb = 33
Field Value
Sx127xRegPreambleMsb
The SX127x register at 0x20.
public const byte Sx127xRegPreambleMsb = 32
Field Value
Sx127xRegRssiValue
The SX127x register at 0x1B.
public const byte Sx127xRegRssiValue = 27
Field Value
Sx127xRegRssiWideband
The SX127x register at 0x2C.
public const byte Sx127xRegRssiWideband = 44
Field Value
Sx127xRegRxNbBytes
The SX127x register at 0x13.
public const byte Sx127xRegRxNbBytes = 19
Field Value
Sx127xRegSymbTimeoutLsb
The SX127x register at 0x1F.
public const byte Sx127xRegSymbTimeoutLsb = 31
Field Value
Sx127xRegSyncWord
The SX127x register at 0x39.
public const byte Sx127xRegSyncWord = 57
Field Value
Sx127xRegTcxo
The SX127x register at 0x4B.
public const byte Sx127xRegTcxo = 75
Field Value
Sx127xRegVersion
The SX127x register at 0x42.
public const byte Sx127xRegVersion = 66
Field Value
Sx127xSyncWordPrivate
The SX127x private sync word, and the chip's reset value.
public const byte Sx127xSyncWordPrivate = 18
Field Value
Sx127xSyncWordPublic
The SX127x sync word reserved for LoRaWAN.
public const byte Sx127xSyncWordPublic = 52
Field Value
Sx127xTcxoInputOn
RegTcxo for a module clocked by a TCXO.
public const byte Sx127xTcxoInputOn = 25
Field Value
Sx127xVersion
The RegVersion value of an SX1276, SX1277, SX1278, or SX1279.
public const byte Sx127xVersion = 18
Field Value
Sx127xWrite
The bit of an SX127x address byte that makes an access a write.
public const byte Sx127xWrite = 128
Field Value
Tmp117RegisterLen
The length of a TMP117 register.
public const int Tmp117RegisterLen = 2
Field Value
UpdateBlockHeaderLength
The bytes a block carrying a signed update puts in front of it.
public const int UpdateBlockHeaderLength = 6
Field Value
UpdateFormatRaw
The payload format meaning the payload is the image itself.
public const byte UpdateFormatRaw = 1
Field Value
UpdateStructureVersion
The manifest structure version this build writes.
public const byte UpdateStructureVersion = 1
Field Value
WindowCapacity
The most readings a windowed helper keeps, and the number it keeps unless told fewer.
public const int WindowCapacity = 32
Field Value
Methods
pamoja_ackermann_curvature(PamojaAckermann, float)
Returns the path curvature of a steering angle.
public static extern float pamoja_ackermann_curvature(PamojaAckermann car, float steering)
Parameters
carPamojaAckermannsteeringfloat
Returns
pamoja_ackermann_steering_angle(PamojaAckermann, float, float)
Returns the steering angle for a forward speed and a yaw rate.
public static extern float pamoja_ackermann_steering_angle(PamojaAckermann car, float linear, float angular)
Parameters
carPamojaAckermannlinearfloatangularfloat
Returns
pamoja_ackermann_turn_radius(PamojaAckermann, float)
Returns the turn radius of a steering angle, infinity with the wheels straight.
public static extern float pamoja_ackermann_turn_radius(PamojaAckermann car, float steering)
Parameters
carPamojaAckermannsteeringfloat
Returns
pamoja_ackermann_yaw_rate(PamojaAckermann, float, float)
Returns the yaw rate a forward speed and a steering angle produce.
public static extern float pamoja_ackermann_yaw_rate(PamojaAckermann car, float linear, float steering)
Parameters
carPamojaAckermannlinearfloatsteeringfloat
Returns
pamoja_ads1115_config(nint, out PamojaAds1115Config)
Copies the configuration an ADS1115 driver writes.
public static PamojaStatus pamoja_ads1115_config(nint sensor, out PamojaAds1115Config outConfig)
Parameters
sensornintoutConfigPamojaAds1115Config
Returns
pamoja_ads1115_config_bits(PamojaAds1115Config)
Assembles the 16-bit ADS1115 configuration register value.
public static extern ushort pamoja_ads1115_config_bits(PamojaAds1115Config config)
Parameters
configPamojaAds1115Config
Returns
pamoja_ads1115_config_from_bits(ushort, out PamojaAds1115Config)
Parses a 16-bit ADS1115 configuration register value.
public static PamojaStatus pamoja_ads1115_config_from_bits(ushort bits, out PamojaAds1115Config outConfig)
Parameters
bitsushortoutConfigPamojaAds1115Config
Returns
pamoja_ads1115_conversion_micros(byte)
Returns how long an ADS1115 conversion takes at a data-rate code, in microseconds.
public static extern uint pamoja_ads1115_conversion_micros(byte dataRate)
Parameters
dataRatebyte
Returns
pamoja_ads1115_free(nint)
Releases an ADS1115 driver. Passing null is a no-op.
public static extern void pamoja_ads1115_free(nint sensor)
Parameters
sensornint
pamoja_ads1115_full_scale_microvolts(byte)
Returns the full-scale range an ADS1115 gain code selects.
public static extern uint pamoja_ads1115_full_scale_microvolts(byte pga)
Parameters
pgabyte
Returns
pamoja_ads1115_init(nint)
Configures an ADS1115 and reads the configuration back.
public static extern PamojaStatus pamoja_ads1115_init(nint sensor)
Parameters
sensornint
Returns
pamoja_ads1115_new(nint, byte, PamojaAds1115Settings, out nint)
Creates an ADS1115 driver on a bus.
public static PamojaStatus pamoja_ads1115_new(nint bus, byte address, PamojaAds1115Settings settings, out nint outSensor)
Parameters
busnintaddressbytesettingsPamojaAds1115SettingsoutSensornint
Returns
pamoja_ads1115_sample(nint, out PamojaAds1115Sample)
Runs one ADS1115 conversion of the configured input.
public static PamojaStatus pamoja_ads1115_sample(nint sensor, out PamojaAds1115Sample outSample)
Parameters
sensornintoutSamplePamojaAds1115Sample
Returns
pamoja_ads1115_sample_input(nint, byte, out PamojaAds1115Sample)
Runs one ADS1115 conversion of another input.
public static PamojaStatus pamoja_ads1115_sample_input(nint sensor, byte mux, out PamojaAds1115Sample outSample)
Parameters
sensornintmuxbyteoutSamplePamojaAds1115Sample
Returns
pamoja_ads1115_samples_per_second(byte)
Returns the sample rate an ADS1115 data-rate code selects.
public static extern ushort pamoja_ads1115_samples_per_second(byte dataRate)
Parameters
dataRatebyte
Returns
pamoja_ads1115_settings_default()
Returns the settings an ADS1115 driver starts with.
public static extern PamojaAds1115Settings pamoja_ads1115_settings_default()
Returns
pamoja_ads1115_sim_part(byte)
Creates a simulated ADS1115 reading its default voltage.
public static extern nint pamoja_ads1115_sim_part(byte address)
Parameters
addressbyte
Returns
pamoja_ads1115_sim_reporting(byte, byte, float)
Creates a simulated ADS1115 that reads what it is asked to.
public static extern nint pamoja_ads1115_sim_reporting(byte address, byte pga, float volts)
Parameters
Returns
pamoja_ads1115_to_nanovolts(byte, short)
Converts a raw ADS1115 conversion result to nanovolts.
public static extern long pamoja_ads1115_to_nanovolts(byte pga, short raw)
Parameters
Returns
pamoja_ads1115_to_volts(byte, short)
Converts a raw ADS1115 conversion result to volts.
public static extern float pamoja_ads1115_to_volts(byte pga, short raw)
Parameters
Returns
pamoja_agreement_key_free(nint)
Releases an agreement key handle.
public static extern void pamoja_agreement_key_free(nint key)
Parameters
keynint
pamoja_agreement_key_from_seed(ReadOnlySpan<byte>, nuint)
Creates a key-agreement secret from a 32-byte seed.
public static nint pamoja_agreement_key_from_seed(ReadOnlySpan<byte> seed, nuint seedLen)
Parameters
seedReadOnlySpan<byte>seedLennuint
Returns
pamoja_agreement_key_public(nint, Span<byte>)
Copies out the public key to hand to a peer.
public static PamojaStatus pamoja_agreement_key_public(nint key, Span<byte> outPublicKey)
Parameters
Returns
pamoja_anomaly_capacity(nint)
Returns how many readings an anomaly detector's baseline keeps.
public static extern nuint pamoja_anomaly_capacity(nint anomaly)
Parameters
anomalynint
Returns
pamoja_anomaly_check(nint, float)
Folds a reading in and reports whether it stands out.
public static bool pamoja_anomaly_check(nint anomaly, float reading)
Parameters
Returns
pamoja_anomaly_free(nint)
Releases an anomaly detector handle. Passing null is a no-op.
public static extern void pamoja_anomaly_free(nint anomaly)
Parameters
anomalynint
pamoja_anomaly_new(float)
Creates an anomaly detector at a deviation threshold.
public static extern nint pamoja_anomaly_new(float sigmas)
Parameters
sigmasfloat
Returns
pamoja_anomaly_with_capacity(float, nuint)
Creates an anomaly detector whose baseline keeps up to a capacity, or null for one out of range.
public static extern nint pamoja_anomaly_with_capacity(float sigmas, nuint capacity)
Parameters
Returns
pamoja_audit_entry_digest(nint, Span<byte>)
Copies out the hash of this entry.
public static PamojaStatus pamoja_audit_entry_digest(nint entry, Span<byte> outDigest)
Parameters
Returns
pamoja_audit_entry_free(nint)
Releases an entry handle.
public static extern void pamoja_audit_entry_free(nint entry)
Parameters
entrynint
pamoja_audit_entry_from_bytes(ReadOnlySpan<byte>, nuint)
Reads an entry back from the bytes it was written as.
public static nint pamoja_audit_entry_from_bytes(ReadOnlySpan<byte> bytes, nuint len)
Parameters
bytesReadOnlySpan<byte>lennuint
Returns
pamoja_audit_entry_index(nint)
Returns the position of an entry in its chain.
public static extern ulong pamoja_audit_entry_index(nint entry)
Parameters
entrynint
Returns
pamoja_audit_entry_payload(nint)
Copies out the record an entry carries.
public static extern nint pamoja_audit_entry_payload(nint entry)
Parameters
entrynint
Returns
pamoja_audit_entry_previous(nint, Span<byte>)
Copies out the hash of the entry before this one.
public static PamojaStatus pamoja_audit_entry_previous(nint entry, Span<byte> outPrevious)
Parameters
Returns
pamoja_audit_entry_signature(nint, Span<byte>)
Copies out the signature over an entry.
public static PamojaStatus pamoja_audit_entry_signature(nint entry, Span<byte> outSignature)
Parameters
Returns
pamoja_audit_entry_to_bytes(nint)
Encodes an entry for storage or transmission.
public static extern nint pamoja_audit_entry_to_bytes(nint entry)
Parameters
entrynint
Returns
pamoja_audit_log_append(nint, ReadOnlySpan<byte>, nuint)
Appends a payload, signing and chaining it.
public static nint pamoja_audit_log_append(nint log, ReadOnlySpan<byte> payload, nuint payloadLen)
Parameters
lognintpayloadReadOnlySpan<byte>payloadLennuint
Returns
pamoja_audit_log_free(nint)
Releases a log handle.
public static extern void pamoja_audit_log_free(nint log)
Parameters
lognint
pamoja_audit_log_new(nint)
Creates a log that signs with a device identity, starting empty.
public static extern nint pamoja_audit_log_new(nint identity)
Parameters
identitynint
Returns
pamoja_audit_log_resume(nint, nint)
Creates a log that carries on from an existing final entry.
public static extern nint pamoja_audit_log_resume(nint identity, nint last)
Parameters
Returns
pamoja_audit_verifier_check(nint, nint)
Checks the next entry of a chain.
public static extern PamojaStatus pamoja_audit_verifier_check(nint verifier, nint entry)
Parameters
Returns
pamoja_audit_verifier_free(nint)
Releases a verifier handle.
public static extern void pamoja_audit_verifier_free(nint verifier)
Parameters
verifiernint
pamoja_audit_verifier_new(ReadOnlySpan<byte>)
Creates a verifier for a chain signed by one public key.
public static nint pamoja_audit_verifier_new(ReadOnlySpan<byte> publicKey)
Parameters
publicKeyReadOnlySpan<byte>
Returns
pamoja_audit_verify_chain(ReadOnlySpan<byte>, ReadOnlySpan<nint>, nuint)
Checks a whole chain that has already arrived.
public static PamojaStatus pamoja_audit_verify_chain(ReadOnlySpan<byte> publicKey, ReadOnlySpan<nint> entries, nuint count)
Parameters
publicKeyReadOnlySpan<byte>entriesReadOnlySpan<nint>countnuint
Returns
pamoja_bme280_calibration_free(nint)
Releases a BME280 calibration handle. Passing null is a no-op.
public static extern void pamoja_bme280_calibration_free(nint calibration)
Parameters
calibrationnint
pamoja_bme280_calibration_new(ReadOnlySpan<byte>, nuint, ReadOnlySpan<byte>, nuint, out nint)
Builds a BME280 calibration from its register bytes.
public static PamojaStatus pamoja_bme280_calibration_new(ReadOnlySpan<byte> tempPress, nuint tempPressLen, ReadOnlySpan<byte> humidity, nuint humidityLen, out nint outCalibration)
Parameters
tempPressReadOnlySpan<byte>tempPressLennuinthumidityReadOnlySpan<byte>humidityLennuintoutCalibrationnint
Returns
pamoja_bme280_compensate(nint, ReadOnlySpan<byte>, nuint, out PamojaBme280Measurement)
Turns a BME280 burst read into a compensated reading.
public static PamojaStatus pamoja_bme280_compensate(nint calibration, ReadOnlySpan<byte> measurement, nuint measurementLen, out PamojaBme280Measurement outMeasurement)
Parameters
calibrationnintmeasurementReadOnlySpan<byte>measurementLennuintoutMeasurementPamojaBme280Measurement
Returns
pamoja_bme280_config_bits(PamojaBme280Config)
Assembles a BME280 config register value.
public static extern byte pamoja_bme280_config_bits(PamojaBme280Config config)
Parameters
configPamojaBme280Config
Returns
pamoja_bme280_config_from_bits(byte, out PamojaBme280Config)
Parses a BME280 config register value.
public static PamojaStatus pamoja_bme280_config_from_bits(byte bits, out PamojaBme280Config outConfig)
Parameters
bitsbyteoutConfigPamojaBme280Config
Returns
pamoja_bme280_ctrl_hum_bits(byte)
Assembles a BME280 ctrl_hum register value from a humidity oversampling code.
public static extern byte pamoja_bme280_ctrl_hum_bits(byte humidity)
Parameters
humiditybyte
Returns
pamoja_bme280_ctrl_hum_from_bits(byte)
Parses a BME280 ctrl_hum register value into its humidity oversampling code.
public static extern byte pamoja_bme280_ctrl_hum_from_bits(byte bits)
Parameters
bitsbyte
Returns
pamoja_bme280_ctrl_meas_bits(PamojaBme280CtrlMeas)
Assembles a BME280 ctrl_meas register value.
public static extern byte pamoja_bme280_ctrl_meas_bits(PamojaBme280CtrlMeas config)
Parameters
configPamojaBme280CtrlMeas
Returns
pamoja_bme280_ctrl_meas_from_bits(byte, out PamojaBme280CtrlMeas)
Parses a BME280 ctrl_meas register value.
public static PamojaStatus pamoja_bme280_ctrl_meas_from_bits(byte bits, out PamojaBme280CtrlMeas outConfig)
Parameters
bitsbyteoutConfigPamojaBme280CtrlMeas
Returns
pamoja_bme280_filter_coefficient(byte)
Returns the IIR filter coefficient a BME280 code selects.
public static extern byte pamoja_bme280_filter_coefficient(byte code)
Parameters
codebyte
Returns
pamoja_bme280_free(nint)
Releases a BME280 driver. Passing null is a no-op.
public static extern void pamoja_bme280_free(nint sensor)
Parameters
sensornint
pamoja_bme280_image_updating(byte)
Reports whether a BME280 status byte says the calibration image is loading.
public static bool pamoja_bme280_image_updating(byte status)
Parameters
statusbyte
Returns
pamoja_bme280_init(nint)
Resets, identifies, calibrates, and configures a BME280.
public static extern PamojaStatus pamoja_bme280_init(nint sensor)
Parameters
sensornint
Returns
pamoja_bme280_max_measurement_micros(byte, byte, byte)
Returns the longest one BME280 measurement can take, in microseconds.
public static extern uint pamoja_bme280_max_measurement_micros(byte temperature, byte pressure, byte humidity)
Parameters
Returns
pamoja_bme280_measure(nint, out PamojaBme280Measurement)
Runs one forced BME280 measurement and compensates it.
public static PamojaStatus pamoja_bme280_measure(nint sensor, out PamojaBme280Measurement outMeasurement)
Parameters
sensornintoutMeasurementPamojaBme280Measurement
Returns
pamoja_bme280_measuring(byte)
Reports whether a BME280 status byte says a conversion is running.
public static bool pamoja_bme280_measuring(byte status)
Parameters
statusbyte
Returns
pamoja_bme280_new(nint, byte, PamojaBme280Settings, out nint)
Creates a BME280 driver on a bus.
public static PamojaStatus pamoja_bme280_new(nint bus, byte address, PamojaBme280Settings settings, out nint outSensor)
Parameters
busnintaddressbytesettingsPamojaBme280SettingsoutSensornint
Returns
pamoja_bme280_oversampling_factor(byte)
Returns how many samples a BME280 oversampling code averages.
public static extern byte pamoja_bme280_oversampling_factor(byte code)
Parameters
codebyte
Returns
pamoja_bme280_settings_default()
Returns the settings a BME280 driver starts with.
public static extern PamojaBme280Settings pamoja_bme280_settings_default()
Returns
pamoja_bme280_sim_burst(Span<byte>)
Copies the one measurement a simulated BME280 holds.
public static PamojaStatus pamoja_bme280_sim_burst(Span<byte> outBurst)
Parameters
Returns
pamoja_bme280_sim_burst_for(float, float, float, Span<byte>)
Builds the data registers a simulated BME280 holds for a reading.
public static PamojaStatus pamoja_bme280_sim_burst_for(float celsius, float hectopascals, float relativeHumidity, Span<byte> outBurst)
Parameters
Returns
pamoja_bme280_sim_calibration(Span<byte>, Span<byte>)
Copies the calibration a simulated BME280 holds.
public static PamojaStatus pamoja_bme280_sim_calibration(Span<byte> outTempPress, Span<byte> outHumidity)
Parameters
Returns
pamoja_bme280_sim_part(byte)
Creates a simulated BME280 holding a real part's calibration and measurement.
public static extern nint pamoja_bme280_sim_part(byte address)
Parameters
addressbyte
Returns
pamoja_bme280_sim_reporting(byte, float, float, float)
Creates a simulated BME280 that reads what it is asked to.
public static extern nint pamoja_bme280_sim_reporting(byte address, float celsius, float hectopascals, float relativeHumidity)
Parameters
Returns
pamoja_bme280_standby_micros(byte)
Returns the normal-mode standby period a BME280 code selects, in microseconds.
public static extern uint pamoja_bme280_standby_micros(byte code)
Parameters
codebyte
Returns
pamoja_bme280_typical_measurement_micros(byte, byte, byte)
Returns the typical time one BME280 measurement takes, in microseconds.
public static extern uint pamoja_bme280_typical_measurement_micros(byte temperature, byte pressure, byte humidity)
Parameters
Returns
pamoja_bmp280_calibration_coefficients(nint, out PamojaBmp280Coefficients)
Reads out the trimming coefficients a BMP280 calibration carries. # Returns [PamojaStatus::Ok] on success, with *out_coefficients filled in, or [PamojaStatus::InvalidArgument] if either pointer is null. # Safety calibration must be a live handle from [pamoja_bmp280_calibration_new], and out_coefficients must point to a writable PamojaBmp280Coefficients.
public static PamojaStatus pamoja_bmp280_calibration_coefficients(nint calibration, out PamojaBmp280Coefficients outCoefficients)
Parameters
calibrationnintoutCoefficientsPamojaBmp280Coefficients
Returns
pamoja_bmp280_calibration_free(nint)
Releases a BMP280 calibration handle. Passing null is a no-op. # Safety calibration must be a handle from [pamoja_bmp280_calibration_new] that has not already been freed, or null. After this call it must not be used again.
public static extern void pamoja_bmp280_calibration_free(nint calibration)
Parameters
calibrationnint
pamoja_bmp280_calibration_new(ReadOnlySpan<byte>, nuint, out nint)
Builds a BMP280 calibration from the 24 bytes read out of its registers. # Returns [PamojaStatus::Ok] on success, with *out_calibration set to a new handle the caller must release with [pamoja_bmp280_calibration_free], or [PamojaStatus::InvalidArgument] if the buffer is not 24 bytes. # Safety bytes must point to at least bytes_len readable bytes, and out_calibration must point to a writable *mut PamojaBmp280Calibration.
public static PamojaStatus pamoja_bmp280_calibration_new(ReadOnlySpan<byte> bytes, nuint bytesLen, out nint outCalibration)
Parameters
bytesReadOnlySpan<byte>bytesLennuintoutCalibrationnint
Returns
pamoja_bmp280_calibration_to_bytes(nint, Span<byte>)
Rebuilds the 24 calibration bytes a device holding these coefficients returns. # Returns [PamojaStatus::Ok] on success, with the 24 bytes written to out_bytes, or [PamojaStatus::InvalidArgument] if either pointer is null. # Safety calibration must be a live handle from [pamoja_bmp280_calibration_new], and out_bytes must point to at least 24 writable bytes.
public static PamojaStatus pamoja_bmp280_calibration_to_bytes(nint calibration, Span<byte> outBytes)
Parameters
Returns
pamoja_bmp280_coefficients(nint, out PamojaBmp280Coefficients)
Copies the trimming coefficients a BMP280 driver read at initialization.
public static bool pamoja_bmp280_coefficients(nint sensor, out PamojaBmp280Coefficients outCoefficients)
Parameters
sensornintoutCoefficientsPamojaBmp280Coefficients
Returns
pamoja_bmp280_compensate(nint, ReadOnlySpan<byte>, nuint, out PamojaBmp280Reading)
Turns a BMP280 burst read into a compensated reading. # Returns [PamojaStatus::Ok] on success, with *out_reading filled in, or [PamojaStatus::InvalidArgument] if the calibration is null or the measurement is not six bytes. # Safety calibration must be a live handle from [pamoja_bmp280_calibration_new], measurement must point to at least measurement_len readable bytes, and out_reading must point to a writable PamojaBmp280Reading.
public static PamojaStatus pamoja_bmp280_compensate(nint calibration, ReadOnlySpan<byte> measurement, nuint measurementLen, out PamojaBmp280Reading outReading)
Parameters
calibrationnintmeasurementReadOnlySpan<byte>measurementLennuintoutReadingPamojaBmp280Reading
Returns
pamoja_bmp280_config_bits(PamojaBmp280Config)
Assembles a BMP280 config register value. # Returns The register value to write.
public static extern byte pamoja_bmp280_config_bits(PamojaBmp280Config config)
Parameters
configPamojaBmp280Config
Returns
pamoja_bmp280_config_from_bits(byte, out PamojaBmp280Config)
Parses a BMP280 config register value. # Returns [PamojaStatus::Ok], with *out_config filled in. Every register value decodes, so this fails only on a null pointer. # Safety out_config must point to a writable PamojaBmp280Config.
public static PamojaStatus pamoja_bmp280_config_from_bits(byte bits, out PamojaBmp280Config outConfig)
Parameters
bitsbyteoutConfigPamojaBmp280Config
Returns
pamoja_bmp280_ctrl_meas_bits(PamojaBmp280CtrlMeas)
Assembles a BMP280 ctrl_meas register value. # Returns The register value to write.
public static extern byte pamoja_bmp280_ctrl_meas_bits(PamojaBmp280CtrlMeas config)
Parameters
configPamojaBmp280CtrlMeas
Returns
pamoja_bmp280_ctrl_meas_from_bits(byte, out PamojaBmp280CtrlMeas)
Parses a BMP280 ctrl_meas register value. # Returns [PamojaStatus::Ok], with *out_config filled in. Every register value decodes, so this fails only on a null pointer. # Safety out_config must point to a writable PamojaBmp280CtrlMeas.
public static PamojaStatus pamoja_bmp280_ctrl_meas_from_bits(byte bits, out PamojaBmp280CtrlMeas outConfig)
Parameters
bitsbyteoutConfigPamojaBmp280CtrlMeas
Returns
pamoja_bmp280_free(nint)
Releases a BMP280 driver. Passing null is a no-op.
public static extern void pamoja_bmp280_free(nint sensor)
Parameters
sensornint
pamoja_bmp280_image_updating(byte)
Reports whether a BMP280 status byte says the calibration image is loading. # Returns true while the coefficients are being copied out of non-volatile memory.
public static bool pamoja_bmp280_image_updating(byte status)
Parameters
statusbyte
Returns
pamoja_bmp280_init(nint)
Resets, identifies, and configures a BMP280.
public static extern PamojaStatus pamoja_bmp280_init(nint sensor)
Parameters
sensornint
Returns
pamoja_bmp280_measure(nint, out PamojaBmp280Reading)
Runs one forced BMP280 measurement and compensates it.
public static PamojaStatus pamoja_bmp280_measure(nint sensor, out PamojaBmp280Reading outReading)
Parameters
sensornintoutReadingPamojaBmp280Reading
Returns
pamoja_bmp280_measurement_bytes(uint, uint, Span<byte>)
Builds the six data bytes a BMP280 holding these codes would return. # Returns [PamojaStatus::Ok] on success, with the six bytes written to out_bytes, or [PamojaStatus::InvalidArgument] if out_bytes is null. # Safety out_bytes must point to at least six writable bytes.
public static PamojaStatus pamoja_bmp280_measurement_bytes(uint pressure, uint temperature, Span<byte> outBytes)
Parameters
Returns
pamoja_bmp280_measuring(byte)
Reports whether a BMP280 status byte says a conversion is running. # Returns true while the part is measuring.
public static bool pamoja_bmp280_measuring(byte status)
Parameters
statusbyte
Returns
pamoja_bmp280_new(nint, byte, PamojaBmp280Settings, out nint)
Creates a BMP280 driver on a bus.
public static PamojaStatus pamoja_bmp280_new(nint bus, byte address, PamojaBmp280Settings settings, out nint outSensor)
Parameters
busnintaddressbytesettingsPamojaBmp280SettingsoutSensornint
Returns
pamoja_bmp280_oversampling_factor(byte)
Returns how many samples a BMP280 oversampling code averages. # Returns The oversampling factor, 1 to 16.
public static extern byte pamoja_bmp280_oversampling_factor(byte code)
Parameters
codebyte
Returns
pamoja_bmp280_parse_measurement(ReadOnlySpan<byte>, nuint, out PamojaBmp280Measurement)
Unpacks the six data bytes a BMP280 burst read returns. # Returns [PamojaStatus::Ok] on success, with *out_measurement filled in, or [PamojaStatus::InvalidArgument] if the buffer is not six bytes. # Safety data must point to at least data_len readable bytes, and out_measurement must point to a writable PamojaBmp280Measurement.
public static PamojaStatus pamoja_bmp280_parse_measurement(ReadOnlySpan<byte> data, nuint dataLen, out PamojaBmp280Measurement outMeasurement)
Parameters
dataReadOnlySpan<byte>dataLennuintoutMeasurementPamojaBmp280Measurement
Returns
pamoja_bmp280_settings_default()
Returns the settings a BMP280 driver starts with.
public static extern PamojaBmp280Settings pamoja_bmp280_settings_default()
Returns
pamoja_bmp280_sim_burst(Span<byte>)
Copies the six data registers a simulated BMP280 holds.
public static PamojaStatus pamoja_bmp280_sim_burst(Span<byte> outBurst)
Parameters
Returns
pamoja_bmp280_sim_burst_for(float, float, Span<byte>)
Builds the six data registers a simulated BMP280 holds for a reading.
public static PamojaStatus pamoja_bmp280_sim_burst_for(float celsius, float hectopascals, Span<byte> outBurst)
Parameters
Returns
pamoja_bmp280_sim_calibration(Span<byte>)
Copies the 24 trimming bytes a simulated BMP280 holds.
public static PamojaStatus pamoja_bmp280_sim_calibration(Span<byte> outCalibration)
Parameters
Returns
pamoja_bmp280_sim_part(byte)
Creates a simulated BMP280 holding a real part's trimming and measurement.
public static extern nint pamoja_bmp280_sim_part(byte address)
Parameters
addressbyte
Returns
pamoja_bmp280_sim_reporting(byte, float, float)
Creates a simulated BMP280 that reads what it is asked to.
public static extern nint pamoja_bmp280_sim_reporting(byte address, float celsius, float hectopascals)
Parameters
Returns
pamoja_bmp280_standby_micros(byte)
Returns the normal-mode standby period a BMP280 code selects. # Returns The period in microseconds.
public static extern uint pamoja_bmp280_standby_micros(byte code)
Parameters
codebyte
Returns
pamoja_buffer_data(nint)
Returns a pointer to a byte buffer's contents.
public static extern nint pamoja_buffer_data(nint buffer)
Parameters
buffernint
Returns
pamoja_buffer_free(nint)
Releases a byte buffer handle. Passing null is a no-op.
public static extern void pamoja_buffer_free(nint buffer)
Parameters
buffernint
pamoja_buffer_len(nint)
Returns the length in bytes of a byte buffer.
public static extern nuint pamoja_buffer_len(nint buffer)
Parameters
buffernint
Returns
pamoja_calibration_apply(nint, float)
Converts a raw reading into calibrated units.
public static extern float pamoja_calibration_apply(nint calibration, float raw)
Parameters
Returns
pamoja_calibration_free(nint)
Releases a calibration handle. Passing null is a no-op.
public static extern void pamoja_calibration_free(nint calibration)
Parameters
calibrationnint
pamoja_calibration_linear(float, float)
Creates a linear calibration.
public static extern nint pamoja_calibration_linear(float scale, float offset)
Parameters
Returns
pamoja_calibration_two_point(float, float, float, float)
Creates a calibration fitted through two reference points.
public static extern nint pamoja_calibration_two_point(float rawLow, float valueLow, float rawHigh, float valueHigh)
Parameters
Returns
pamoja_can_bus_clear_filters(nint)
Keeps every frame again.
public static extern PamojaStatus pamoja_can_bus_clear_filters(nint bus)
Parameters
busnint
Returns
pamoja_can_bus_free(nint)
Releases a node; it leaves the bus. Passing null is a no-op.
public static extern void pamoja_can_bus_free(nint bus)
Parameters
busnint
pamoja_can_bus_join(nint, out nint)
Puts another node on the same bus.
public static PamojaStatus pamoja_can_bus_join(nint bus, out nint outBus)
Parameters
Returns
pamoja_can_bus_kind(nint)
Returns what a node's bus is.
public static extern byte pamoja_can_bus_kind(nint bus)
Parameters
busnint
Returns
pamoja_can_bus_open(string, out nint)
Opens a kernel CAN interface through SocketCAN.
public static PamojaStatus pamoja_can_bus_open(string interfaceName, out nint outBus)
Parameters
Returns
pamoja_can_bus_receive(nint, ulong, out nint)
Takes the next frame the node keeps, leaving the handle null on a timeout.
public static PamojaStatus pamoja_can_bus_receive(nint bus, ulong timeoutMicros, out nint outFrame)
Parameters
Returns
pamoja_can_bus_received(nint)
Returns how many frames a node has received.
public static extern nuint pamoja_can_bus_received(nint bus)
Parameters
busnint
Returns
pamoja_can_bus_send(nint, nint)
Sends a frame to every other node on the bus.
public static extern PamojaStatus pamoja_can_bus_send(nint bus, nint frame)
Parameters
Returns
pamoja_can_bus_sent(nint)
Returns how many frames a node has sent.
public static extern nuint pamoja_can_bus_sent(nint bus)
Parameters
busnint
Returns
pamoja_can_bus_set_filters(nint, ReadOnlySpan<PamojaCanFilter>, nuint)
Keeps only the frames that pass at least one of the filters.
public static PamojaStatus pamoja_can_bus_set_filters(nint bus, ReadOnlySpan<PamojaCanFilter> filters, nuint len)
Parameters
busnintfiltersReadOnlySpan<PamojaCanFilter>lennuint
Returns
pamoja_can_bus_simulated()
Makes a new bus inside the program, with the returned node the first on it.
public static extern nint pamoja_can_bus_simulated()
Returns
pamoja_can_bus_waited_micros(nint)
Returns how long receives on a node have waited without a frame, in microseconds.
public static extern ulong pamoja_can_bus_waited_micros(nint bus)
Parameters
busnint
Returns
pamoja_can_dlc_to_len(byte)
Returns the payload length a data length code encodes.
public static extern nuint pamoja_can_dlc_to_len(byte dlc)
Parameters
dlcbyte
Returns
pamoja_can_filter_exact(uint, bool)
A filter that passes one identifier and nothing else.
public static PamojaCanFilter pamoja_can_filter_exact(uint id, bool extended)
Parameters
Returns
pamoja_can_filter_matches(PamojaCanFilter, uint, bool)
Reports whether a frame with an identifier passes a filter.
public static bool pamoja_can_filter_matches(PamojaCanFilter filter, uint id, bool extended)
Parameters
filterPamojaCanFilteriduintextendedbool
Returns
pamoja_can_filter_pgn(uint)
A filter that passes one J1939 parameter group.
public static extern PamojaCanFilter pamoja_can_filter_pgn(uint pgn)
Parameters
pgnuint
Returns
pamoja_can_frame_data(nint)
Returns a pointer to a frame's payload bytes.
public static extern nint pamoja_can_frame_data(nint frame)
Parameters
framenint
Returns
pamoja_can_frame_data_len(nint)
Returns how many bytes the payload pointer covers.
public static extern nuint pamoja_can_frame_data_len(nint frame)
Parameters
framenint
Returns
pamoja_can_frame_dlc(nint)
Returns a frame's data length code.
public static extern byte pamoja_can_frame_dlc(nint frame)
Parameters
framenint
Returns
pamoja_can_frame_fd(uint, bool, ReadOnlySpan<byte>, nuint, out nint)
Builds a CAN-FD frame.
public static PamojaStatus pamoja_can_frame_fd(uint id, bool extended, ReadOnlySpan<byte> data, nuint dataLen, out nint outFrame)
Parameters
Returns
pamoja_can_frame_free(nint)
Releases a CAN frame handle. Passing null is a no-op.
public static extern void pamoja_can_frame_free(nint frame)
Parameters
framenint
pamoja_can_frame_id(nint)
Returns a frame's identifier.
public static extern uint pamoja_can_frame_id(nint frame)
Parameters
framenint
Returns
pamoja_can_frame_is_extended(nint)
Reports whether a frame carries a 29-bit extended identifier.
public static bool pamoja_can_frame_is_extended(nint frame)
Parameters
framenint
Returns
pamoja_can_frame_is_fd(nint)
Reports whether a frame is CAN-FD rather than classic CAN 2.0.
public static bool pamoja_can_frame_is_fd(nint frame)
Parameters
framenint
Returns
pamoja_can_frame_is_remote(nint)
Reports whether a frame is a remote transmission request.
public static bool pamoja_can_frame_is_remote(nint frame)
Parameters
framenint
Returns
pamoja_can_frame_len(nint)
Returns a frame's data length, which a remote frame only requests.
public static extern nuint pamoja_can_frame_len(nint frame)
Parameters
framenint
Returns
pamoja_can_frame_new(uint, bool, ReadOnlySpan<byte>, nuint, out nint)
Builds a classic CAN 2.0 frame.
public static PamojaStatus pamoja_can_frame_new(uint id, bool extended, ReadOnlySpan<byte> data, nuint dataLen, out nint outFrame)
Parameters
Returns
pamoja_can_frame_remote(uint, bool, nuint, out nint)
Builds a remote transmission request.
public static PamojaStatus pamoja_can_frame_remote(uint id, bool extended, nuint len, out nint outFrame)
Parameters
Returns
pamoja_can_j1939_broadcast(byte, uint, byte)
Composes the identifier of a J1939 broadcast.
public static extern uint pamoja_can_j1939_broadcast(byte priority, uint pgn, byte source)
Parameters
Returns
pamoja_can_j1939_compose(byte, uint, byte, byte)
Composes the extended identifier a set of J1939 fields describes.
public static extern uint pamoja_can_j1939_compose(byte priority, uint pgn, byte source, byte destination)
Parameters
Returns
pamoja_can_j1939_decode(uint, bool, out PamojaJ1939Id)
Decodes the J1939 fields out of an extended CAN identifier.
public static bool pamoja_can_j1939_decode(uint id, bool extended, out PamojaJ1939Id outMessage)
Parameters
iduintextendedbooloutMessagePamojaJ1939Id
Returns
pamoja_can_len_to_dlc(nuint)
Returns the data length code that encodes a payload length.
public static extern byte pamoja_can_len_to_dlc(nuint len)
Parameters
lennuint
Returns
pamoja_can_signals_new()
Builds a J1939 payload with every signal marked not available.
public static extern PamojaJ1939Signals pamoja_can_signals_new()
Returns
pamoja_can_signals_set_u16(PamojaJ1939Signals, nuint, ushort)
Writes a two-byte little-endian signal at the offset its group defines.
public static extern PamojaJ1939Signals pamoja_can_signals_set_u16(PamojaJ1939Signals signals, nuint at, ushort value)
Parameters
signalsPamojaJ1939Signalsatnuintvalueushort
Returns
pamoja_can_signals_set_u8(PamojaJ1939Signals, nuint, byte)
Writes a one-byte signal at the offset its group defines.
public static extern PamojaJ1939Signals pamoja_can_signals_set_u8(PamojaJ1939Signals signals, nuint at, byte value)
Parameters
signalsPamojaJ1939Signalsatnuintvaluebyte
Returns
pamoja_can_signals_u16(PamojaJ1939Signals, nuint, out ushort)
Reads a two-byte little-endian signal at the offset its group defines.
public static bool pamoja_can_signals_u16(PamojaJ1939Signals signals, nuint at, out ushort outValue)
Parameters
signalsPamojaJ1939SignalsatnuintoutValueushort
Returns
pamoja_can_signals_u8(PamojaJ1939Signals, nuint, out byte)
Reads a one-byte signal at the offset its group defines.
public static bool pamoja_can_signals_u8(PamojaJ1939Signals signals, nuint at, out byte outValue)
Parameters
signalsPamojaJ1939SignalsatnuintoutValuebyte
Returns
pamoja_cdr_reader_free(nint)
Releases a CDR decoder handle.
public static extern void pamoja_cdr_reader_free(nint reader)
Parameters
readernint
pamoja_cdr_reader_new(ReadOnlySpan<byte>, nuint)
Creates a CDR decoder over encoded bytes.
public static nint pamoja_cdr_reader_new(ReadOnlySpan<byte> data, nuint dataLen)
Parameters
dataReadOnlySpan<byte>dataLennuint
Returns
pamoja_cdr_reader_read_f32(nint, out float)
Reads the next 32-bit float.
public static PamojaStatus pamoja_cdr_reader_read_f32(nint reader, out float value)
Parameters
Returns
pamoja_cdr_reader_read_f64(nint, out double)
Reads the next 64-bit float.
public static PamojaStatus pamoja_cdr_reader_read_f64(nint reader, out double value)
Parameters
Returns
pamoja_cdr_reader_read_i32(nint, out int)
Reads the next 32-bit signed integer.
public static PamojaStatus pamoja_cdr_reader_read_i32(nint reader, out int value)
Parameters
Returns
pamoja_cdr_reader_read_u32(nint, out uint)
Reads the next 32-bit unsigned integer.
public static PamojaStatus pamoja_cdr_reader_read_u32(nint reader, out uint value)
Parameters
Returns
pamoja_cdr_writer_free(nint)
Releases a CDR encoder handle.
public static extern void pamoja_cdr_writer_free(nint writer)
Parameters
writernint
pamoja_cdr_writer_into_bytes(nint)
Takes the encoded bytes, consuming the encoder.
public static extern nint pamoja_cdr_writer_into_bytes(nint writer)
Parameters
writernint
Returns
pamoja_cdr_writer_new()
Creates a CDR encoder.
public static extern nint pamoja_cdr_writer_new()
Returns
pamoja_cdr_writer_write_f32(nint, float)
Appends a 32-bit float.
public static extern PamojaStatus pamoja_cdr_writer_write_f32(nint writer, float value)
Parameters
Returns
pamoja_cdr_writer_write_f64(nint, double)
Appends a 64-bit float.
public static extern PamojaStatus pamoja_cdr_writer_write_f64(nint writer, double value)
Parameters
Returns
pamoja_cdr_writer_write_i32(nint, int)
Appends a 32-bit signed integer.
public static extern PamojaStatus pamoja_cdr_writer_write_i32(nint writer, int value)
Parameters
Returns
pamoja_cdr_writer_write_u32(nint, uint)
Appends a 32-bit unsigned integer.
public static extern PamojaStatus pamoja_cdr_writer_write_u32(nint writer, uint value)
Parameters
Returns
pamoja_chirpstack_uplink_best_reception(nint, out uint)
Finds the gateway that heard an uplink best.
public static PamojaStatus pamoja_chirpstack_uplink_best_reception(nint uplink, out uint outIndex)
Parameters
Returns
pamoja_chirpstack_uplink_data(nint, out nint)
Copies out the application payload an uplink carried.
public static PamojaStatus pamoja_chirpstack_uplink_data(nint uplink, out nint outData)
Parameters
Returns
pamoja_chirpstack_uplink_free(nint)
Releases an uplink event handle. Passing null is a no-op.
public static extern void pamoja_chirpstack_uplink_free(nint uplink)
Parameters
uplinknint
pamoja_chirpstack_uplink_parse(ReadOnlySpan<byte>, nuint, out nint)
Reads an uplink event from the JSON ChirpStack published.
public static PamojaStatus pamoja_chirpstack_uplink_parse(ReadOnlySpan<byte> text, nuint textLen, out nint outUplink)
Parameters
textReadOnlySpan<byte>textLennuintoutUplinknint
Returns
pamoja_chirpstack_uplink_reception(nint, uint, out PamojaChirpstackReception)
Reads one gateway that heard an uplink.
public static PamojaStatus pamoja_chirpstack_uplink_reception(nint uplink, uint index, out PamojaChirpstackReception outReception)
Parameters
uplinknintindexuintoutReceptionPamojaChirpstackReception
Returns
pamoja_chirpstack_uplink_summary(nint, out PamojaChirpstackUplinkSummary)
Reads the scalar fields of an uplink event.
public static PamojaStatus pamoja_chirpstack_uplink_summary(nint uplink, out PamojaChirpstackUplinkSummary outSummary)
Parameters
uplinknintoutSummaryPamojaChirpstackUplinkSummary
Returns
pamoja_chirpstack_uplink_text(nint, byte)
Reads one of an uplink event's text fields.
public static extern nint pamoja_chirpstack_uplink_text(nint uplink, byte field)
Parameters
Returns
pamoja_chirpstack_uplink_topic(string)
Builds the MQTT topic an application's uplink events are published on.
public static nint pamoja_chirpstack_uplink_topic(string applicationId)
Parameters
applicationIdstring
Returns
pamoja_coap_client_connect(nint)
Binds the local socket of a CoAP endpoint.
public static extern PamojaStatus pamoja_coap_client_connect(nint client)
Parameters
clientnint
Returns
pamoja_coap_client_disconnect(nint)
Releases the socket a CoAP endpoint holds.
public static extern PamojaStatus pamoja_coap_client_disconnect(nint client)
Parameters
clientnint
Returns
pamoja_coap_client_free(nint)
Releases a CoAP endpoint handle.
public static extern void pamoja_coap_client_free(nint client)
Parameters
clientnint
pamoja_coap_client_is_connected(nint)
Reports whether a CoAP endpoint is bound.
public static bool pamoja_coap_client_is_connected(nint client)
Parameters
clientnint
Returns
pamoja_coap_client_new(ref PamojaCoapConfig)
Creates a disconnected CoAP endpoint.
public static nint pamoja_coap_client_new(ref PamojaCoapConfig config)
Parameters
configPamojaCoapConfig
Returns
pamoja_coap_client_recv(nint, out nint)
Waits for the next message on an observed CoAP path.
public static PamojaStatus pamoja_coap_client_recv(nint client, out nint outMessage)
Parameters
Returns
pamoja_coap_client_recv_within(nint, ulong, out nint, out bool)
Waits a limited time for the next message on an observed CoAP path.
public static PamojaStatus pamoja_coap_client_recv_within(nint client, ulong timeoutMs, out nint outMessage, out bool outTimedOut)
Parameters
Returns
pamoja_coap_client_send(nint, nint, ReadOnlySpan<byte>, nuint)
Sends a payload to a CoAP resource path.
public static PamojaStatus pamoja_coap_client_send(nint client, nint topic, ReadOnlySpan<byte> payload, nuint payloadLen)
Parameters
clientninttopicnintpayloadReadOnlySpan<byte>payloadLennuint
Returns
pamoja_coap_client_subscribe(nint, nint)
Observes a CoAP resource path.
public static extern PamojaStatus pamoja_coap_client_subscribe(nint client, nint topic)
Parameters
Returns
pamoja_coap_server_connect(nint)
Binds a CoAP server's socket.
public static extern PamojaStatus pamoja_coap_server_connect(nint server)
Parameters
servernint
Returns
pamoja_coap_server_disconnect(nint)
Closes a CoAP server's socket.
public static extern PamojaStatus pamoja_coap_server_disconnect(nint server)
Parameters
servernint
Returns
pamoja_coap_server_free(nint)
Releases a CoAP server handle.
public static extern void pamoja_coap_server_free(nint server)
Parameters
servernint
pamoja_coap_server_is_connected(nint)
Reports whether a CoAP server holds a bound socket.
public static bool pamoja_coap_server_is_connected(nint server)
Parameters
servernint
Returns
pamoja_coap_server_local_port(nint)
The port a CoAP server listens on, or 0 while it is not connected.
public static extern ushort pamoja_coap_server_local_port(nint server)
Parameters
servernint
Returns
pamoja_coap_server_new(nint)
Creates a CoAP server that will listen on a local address.
public static extern nint pamoja_coap_server_new(nint bind)
Parameters
bindnint
Returns
pamoja_coap_server_observers(nint, nint)
Counts the clients observing a resource.
public static extern nuint pamoja_coap_server_observers(nint server, nint path)
Parameters
Returns
pamoja_coap_server_recv(nint, out nint)
Waits for the next reading a CoAP server takes.
public static PamojaStatus pamoja_coap_server_recv(nint server, out nint outMessage)
Parameters
Returns
pamoja_coap_server_recv_within(nint, ulong, out nint, out bool)
Waits a limited time for the next reading a CoAP server takes.
public static PamojaStatus pamoja_coap_server_recv_within(nint server, ulong timeoutMs, out nint outMessage, out bool outTimedOut)
Parameters
Returns
pamoja_coap_server_send(nint, nint, ReadOnlySpan<byte>, nuint)
Sets a resource's state and notifies its observers.
public static PamojaStatus pamoja_coap_server_send(nint server, nint path, ReadOnlySpan<byte> payload, nuint payloadLen)
Parameters
servernintpathnintpayloadReadOnlySpan<byte>payloadLennuint
Returns
pamoja_coap_server_subscribe(nint, nint)
Takes the readings sent to the paths a filter matches.
public static extern PamojaStatus pamoja_coap_server_subscribe(nint server, nint filter)
Parameters
Returns
pamoja_cobs_decoder_discarded(nint)
Returns how many corrupt frames a COBS decoder has discarded.
public static extern ulong pamoja_cobs_decoder_discarded(nint decoder)
Parameters
decodernint
Returns
pamoja_cobs_decoder_feed(nint, ReadOnlySpan<byte>, nuint, out nint)
Feeds a chunk of the byte stream to a COBS decoder.
public static PamojaStatus pamoja_cobs_decoder_feed(nint decoder, ReadOnlySpan<byte> bytes, nuint bytesLen, out nint outFrames)
Parameters
decodernintbytesReadOnlySpan<byte>bytesLennuintoutFramesnint
Returns
pamoja_cobs_decoder_free(nint)
Releases a COBS decoder handle. Passing null is a no-op.
public static extern void pamoja_cobs_decoder_free(nint decoder)
Parameters
decodernint
pamoja_cobs_decoder_new()
Creates a streaming COBS decoder.
public static extern nint pamoja_cobs_decoder_new()
Returns
pamoja_cobs_decoder_reset(nint)
Discards any partly assembled COBS frame.
public static extern void pamoja_cobs_decoder_reset(nint decoder)
Parameters
decodernint
pamoja_codec_cbor_to_json(ReadOnlySpan<byte>, nuint, out nint)
Converts a CBOR document into its JSON encoding.
public static PamojaStatus pamoja_codec_cbor_to_json(ReadOnlySpan<byte> cbor, nuint cborLen, out nint outBuffer)
Parameters
cborReadOnlySpan<byte>cborLennuintoutBuffernint
Returns
pamoja_codec_decode_deltas(ReadOnlySpan<byte>, nuint, out nint)
Decodes a delta-encoded buffer back into integer samples.
public static PamojaStatus pamoja_codec_decode_deltas(ReadOnlySpan<byte> bytes, nuint bytesLen, out nint outSamples)
Parameters
bytesReadOnlySpan<byte>bytesLennuintoutSamplesnint
Returns
pamoja_codec_encode_deltas(ReadOnlySpan<long>, nuint, out nint)
Delta-encodes a series of integer samples.
public static PamojaStatus pamoja_codec_encode_deltas(ReadOnlySpan<long> samples, nuint count, out nint outBuffer)
Parameters
samplesReadOnlySpan<long>countnuintoutBuffernint
Returns
pamoja_codec_json_to_cbor(ReadOnlySpan<byte>, nuint, out nint)
Converts a JSON document into its CBOR encoding.
public static PamojaStatus pamoja_codec_json_to_cbor(ReadOnlySpan<byte> json, nuint jsonLen, out nint outBuffer)
Parameters
jsonReadOnlySpan<byte>jsonLennuintoutBuffernint
Returns
pamoja_codec_quantizer_decode(float, ReadOnlySpan<byte>, nuint, out nint)
Decodes a quantized batch back into float readings.
public static PamojaStatus pamoja_codec_quantizer_decode(float scale, ReadOnlySpan<byte> bytes, nuint bytesLen, out nint outReadings)
Parameters
scalefloatbytesReadOnlySpan<byte>bytesLennuintoutReadingsnint
Returns
pamoja_codec_quantizer_encode(float, ReadOnlySpan<float>, nuint, out nint)
Quantizes and delta-encodes a batch of float readings.
public static PamojaStatus pamoja_codec_quantizer_encode(float scale, ReadOnlySpan<float> readings, nuint count, out nint outBuffer)
Parameters
scalefloatreadingsReadOnlySpan<float>countnuintoutBuffernint
Returns
pamoja_complementary_estimate(nint)
Reads a complementary filter's estimate.
public static extern float pamoja_complementary_estimate(nint filter)
Parameters
filternint
Returns
pamoja_complementary_free(nint)
Releases a complementary filter handle. Passing null is a no-op.
public static extern void pamoja_complementary_free(nint filter)
Parameters
filternint
pamoja_complementary_new(float, float)
Creates a complementary filter.
public static extern nint pamoja_complementary_new(float alpha, float initial)
Parameters
Returns
pamoja_complementary_update(nint, float, float, float)
Fuses a rate and an absolute reading over a time step.
public static extern float pamoja_complementary_update(nint filter, float rate, float absolute, float dt)
Parameters
Returns
pamoja_controller_evaluate(nint, float, out PamojaReaction)
Decides what one reading calls for.
public static PamojaStatus pamoja_controller_evaluate(nint controller, float reading, out PamojaReaction reaction)
Parameters
controllernintreadingfloatreactionPamojaReaction
Returns
pamoja_controller_free(nint)
Releases a controller handle.
public static extern void pamoja_controller_free(nint controller)
Parameters
controllernint
pamoja_controller_level(float, uint)
Creates a controller that warns before a level reaches empty.
public static extern nint pamoja_controller_level(float empty, uint warnWithin)
Parameters
Returns
pamoja_controller_monitor()
Creates a controller that reports readings without judging them.
public static extern nint pamoja_controller_monitor()
Returns
pamoja_controller_setpoint(float, float, bool, float)
Creates a controller that holds a reading near a setpoint.
public static nint pamoja_controller_setpoint(float setpoint, float hysteresis, bool cooling, float safeBand)
Parameters
Returns
pamoja_controller_surge(bool, float)
Creates a controller that warns when a reading changes too fast.
public static nint pamoja_controller_surge(bool rising, float limit)
Parameters
Returns
pamoja_coordinate_bearing_to(PamojaCoordinate, PamojaCoordinate)
Returns the initial bearing between two coordinates, in degrees.
public static extern double pamoja_coordinate_bearing_to(PamojaCoordinate from, PamojaCoordinate to)
Parameters
fromPamojaCoordinatetoPamojaCoordinate
Returns
pamoja_coordinate_distance_to(PamojaCoordinate, PamojaCoordinate)
Returns the great-circle distance between two coordinates, in meters.
public static extern double pamoja_coordinate_distance_to(PamojaCoordinate from, PamojaCoordinate to)
Parameters
fromPamojaCoordinatetoPamojaCoordinate
Returns
pamoja_debounce_free(nint)
Releases a debouncer handle. Passing null is a no-op.
public static extern void pamoja_debounce_free(nint debounce)
Parameters
debouncenint
pamoja_debounce_new(ushort, bool)
Creates a boolean debouncer.
public static nint pamoja_debounce_new(ushort samples, bool initial)
Parameters
Returns
pamoja_debounce_state(nint)
Reports a debouncer's settled state.
public static bool pamoja_debounce_state(nint debounce)
Parameters
debouncenint
Returns
pamoja_debounce_update(nint, bool)
Feeds a raw reading to a debouncer and returns the settled state.
public static bool pamoja_debounce_update(nint debounce, bool raw)
Parameters
Returns
pamoja_delegation_open(ReadOnlySpan<byte>, nuint, ReadOnlySpan<byte>, out PamojaDelegation)
Opens a signed delegation against its anchor.
public static PamojaStatus pamoja_delegation_open(ReadOnlySpan<byte> bytes, nuint len, ReadOnlySpan<byte> anchorPublicKey, out PamojaDelegation outDelegation)
Parameters
bytesReadOnlySpan<byte>lennuintanchorPublicKeyReadOnlySpan<byte>outDelegationPamojaDelegation
Returns
pamoja_delegation_sign(PamojaDelegation, nint)
Signs a delegation naming a release key.
public static extern nint pamoja_delegation_sign(PamojaDelegation delegation, nint anchor)
Parameters
delegationPamojaDelegationanchornint
Returns
pamoja_depletion_free(nint)
Releases a depletion handle. Passing null is a no-op.
public static extern void pamoja_depletion_free(nint depletion)
Parameters
depletionnint
pamoja_depletion_new(float)
Creates a depletion estimator.
public static extern nint pamoja_depletion_new(float threshold)
Parameters
thresholdfloat
Returns
pamoja_depletion_update(nint, float, out uint)
Records a level and estimates the samples until the threshold.
public static bool pamoja_depletion_update(nint depletion, float level, out uint outSamples)
Parameters
Returns
pamoja_device_identity_free(nint)
Releases a device identity handle. Passing null is a no-op.
public static extern void pamoja_device_identity_free(nint identity)
Parameters
identitynint
pamoja_device_identity_new(ReadOnlySpan<byte>, nuint)
Creates a device identity from a 32-byte seed, or returns null.
public static nint pamoja_device_identity_new(ReadOnlySpan<byte> seed, nuint seedLen)
Parameters
seedReadOnlySpan<byte>seedLennuint
Returns
pamoja_device_identity_public_key(nint, Span<byte>)
Writes the 32-byte public key matching a device identity.
public static PamojaStatus pamoja_device_identity_public_key(nint identity, Span<byte> outPublicKey)
Parameters
Returns
pamoja_device_identity_sign(nint, ReadOnlySpan<byte>, nuint, Span<byte>)
Signs a payload, writing the 64-byte signature.
public static PamojaStatus pamoja_device_identity_sign(nint identity, ReadOnlySpan<byte> payload, nuint payloadLen, Span<byte> outSignature)
Parameters
Returns
pamoja_device_identity_sign_message(nint, ReadOnlySpan<byte>, nuint, out nint)
Signs a payload, returning the signature followed by the payload.
public static PamojaStatus pamoja_device_identity_sign_message(nint identity, ReadOnlySpan<byte> payload, nuint payloadLen, out nint outBuffer)
Parameters
identitynintpayloadReadOnlySpan<byte>payloadLennuintoutBuffernint
Returns
pamoja_dh_transform(PamojaDhParameters)
Returns the transform one Denavit-Hartenberg joint makes.
public static extern PamojaTransform pamoja_dh_transform(PamojaDhParameters joint)
Parameters
jointPamojaDhParameters
Returns
pamoja_diff_drive_body_motion(PamojaDiffDrive, float, float)
Returns the body motion a differential drive makes from measured wheel speeds.
public static extern PamojaBodyMotion pamoja_diff_drive_body_motion(PamojaDiffDrive drive, float left, float right)
Parameters
drivePamojaDiffDriveleftfloatrightfloat
Returns
pamoja_diff_drive_wheel_speeds(PamojaDiffDrive, float, float)
Returns the wheel speeds a differential drive needs for a body motion.
public static extern PamojaSideSpeeds pamoja_diff_drive_wheel_speeds(PamojaDiffDrive drive, float linear, float angular)
Parameters
drivePamojaDiffDrivelinearfloatangularfloat
Returns
pamoja_ds18b20_build_scratchpad(float, byte, sbyte, sbyte, Span<byte>)
Builds the nine bytes a DS18B20 in the given state puts on the bus.
public static PamojaStatus pamoja_ds18b20_build_scratchpad(float celsius, byte bits, sbyte alarmHigh, sbyte alarmLow, Span<byte> outBytes)
Parameters
Returns
pamoja_ds18b20_celsius(short)
Converts a raw DS18B20 temperature register to degrees Celsius.
public static extern float pamoja_ds18b20_celsius(short raw)
Parameters
rawshort
Returns
pamoja_ds18b20_config_byte(byte, out byte)
Returns the configuration byte that selects a DS18B20 resolution.
public static PamojaStatus pamoja_ds18b20_config_byte(byte bits, out byte outByte)
Parameters
Returns
pamoja_ds18b20_crc8(ReadOnlySpan<byte>, nuint)
Computes the Maxim CRC-8 a 1-Wire device checks its bytes with.
public static byte pamoja_ds18b20_crc8(ReadOnlySpan<byte> data, nuint dataLen)
Parameters
dataReadOnlySpan<byte>dataLennuint
Returns
pamoja_ds18b20_discover(string?, out nint)
Lists every DS18B20 the kernel has found under a directory, or the default one.
public static PamojaStatus pamoja_ds18b20_discover(string? devices, out nint outThermometers)
Parameters
Returns
pamoja_ds18b20_max_conversion_micros(byte, out uint)
Returns how long a DS18B20 conversion may take at a resolution.
public static PamojaStatus pamoja_ds18b20_max_conversion_micros(byte bits, out uint outMicros)
Parameters
Returns
pamoja_ds18b20_micro_celsius(short)
Converts a raw DS18B20 temperature register to micro-degrees Celsius.
public static extern int pamoja_ds18b20_micro_celsius(short raw)
Parameters
rawshort
Returns
pamoja_ds18b20_parse_scratchpad(ReadOnlySpan<byte>, nuint, out PamojaDs18b20Reading)
Parses and CRC-checks a nine-byte DS18B20 scratchpad.
public static PamojaStatus pamoja_ds18b20_parse_scratchpad(ReadOnlySpan<byte> bytes, nuint bytesLen, out PamojaDs18b20Reading outReading)
Parameters
bytesReadOnlySpan<byte>bytesLennuintoutReadingPamojaDs18b20Reading
Returns
pamoja_ds18b20_parse_w1_slave(string, out PamojaDs18b20Reading)
Decodes the text the kernel serves for a DS18B20.
public static PamojaStatus pamoja_ds18b20_parse_w1_slave(string text, out PamojaDs18b20Reading outReading)
Parameters
textstringoutReadingPamojaDs18b20Reading
Returns
pamoja_ds18b20_resolution_bits(byte)
Returns the resolution a DS18B20 configuration byte selects, in bits.
public static extern byte pamoja_ds18b20_resolution_bits(byte configByte)
Parameters
configBytebyte
Returns
pamoja_ds18b20_step_micro_celsius(byte, out uint)
Returns the temperature step a DS18B20 resolution resolves.
public static PamojaStatus pamoja_ds18b20_step_micro_celsius(byte bits, out uint outMicroCelsius)
Parameters
Returns
pamoja_ds18b20_thermometer_at(string, out nint)
Names a DS18B20 by the path of its w1_slave file.
public static PamojaStatus pamoja_ds18b20_thermometer_at(string path, out nint outThermometer)
Parameters
Returns
pamoja_ds18b20_thermometer_free(nint)
Releases a thermometer. Passing null is a no-op.
public static extern void pamoja_ds18b20_thermometer_free(nint thermometer)
Parameters
thermometernint
pamoja_ds18b20_thermometer_new(string, out nint)
Names a DS18B20 the kernel serves by its serial.
public static PamojaStatus pamoja_ds18b20_thermometer_new(string serial, out nint outThermometer)
Parameters
Returns
pamoja_ds18b20_thermometer_path(nint)
Returns the path of the file a thermometer reads, as an owned string.
public static extern nint pamoja_ds18b20_thermometer_path(nint thermometer)
Parameters
thermometernint
Returns
pamoja_ds18b20_thermometer_read(nint, out PamojaDs18b20Reading)
Reads and decodes a thermometer's file.
public static PamojaStatus pamoja_ds18b20_thermometer_read(nint thermometer, out PamojaDs18b20Reading outReading)
Parameters
thermometernintoutReadingPamojaDs18b20Reading
Returns
pamoja_ds18b20_thermometer_serial(nint)
Returns the serial in a thermometer's directory name as an owned string, or null when the file does not sit in a DS18B20's directory.
public static extern nint pamoja_ds18b20_thermometer_serial(nint thermometer)
Parameters
thermometernint
Returns
pamoja_ds18b20_thermometers_free(nint)
Releases a list of thermometers. Passing null is a no-op.
public static extern void pamoja_ds18b20_thermometers_free(nint thermometers)
Parameters
thermometersnint
pamoja_ds18b20_thermometers_get(nint, nuint)
Copies one thermometer out of a list, or returns null.
public static extern nint pamoja_ds18b20_thermometers_get(nint thermometers, nuint index)
Parameters
Returns
pamoja_ds18b20_thermometers_len(nint)
Returns how many thermometers a list holds.
public static extern nuint pamoja_ds18b20_thermometers_len(nint thermometers)
Parameters
thermometersnint
Returns
pamoja_ds18b20_w1_slave_text(ReadOnlySpan<byte>, nuint, out nint)
Renders the text the kernel serves for a DS18B20 scratchpad it read cleanly.
public static PamojaStatus pamoja_ds18b20_w1_slave_text(ReadOnlySpan<byte> bytes, nuint len, out nint outText)
Parameters
bytesReadOnlySpan<byte>lennuintoutTextnint
Returns
pamoja_duty_cycle_fraction(PamojaDutyCycle)
Returns the share of a period a duty cycle spends awake.
public static extern float pamoja_duty_cycle_fraction(PamojaDutyCycle duty)
Parameters
dutyPamojaDutyCycle
Returns
pamoja_duty_cycle_from_fraction(ulong, float)
Creates a duty cycle that spends a fraction of a period awake.
public static extern PamojaDutyCycle pamoja_duty_cycle_from_fraction(ulong periodUs, float fraction)
Parameters
Returns
pamoja_duty_cycle_new(ulong, ulong)
Creates a duty cycle from the time awake and the time asleep.
public static extern PamojaDutyCycle pamoja_duty_cycle_new(ulong activeUs, ulong sleepUs)
Parameters
Returns
pamoja_duty_cycle_period_us(PamojaDutyCycle)
Returns the whole period of a duty cycle.
public static extern ulong pamoja_duty_cycle_period_us(PamojaDutyCycle duty)
Parameters
dutyPamojaDutyCycle
Returns
pamoja_envelope_body(ReadOnlySpan<byte>, nuint)
Copies out the signed body of an envelope.
public static nint pamoja_envelope_body(ReadOnlySpan<byte> bytes, nuint len)
Parameters
bytesReadOnlySpan<byte>lennuint
Returns
pamoja_envelope_verify(ReadOnlySpan<byte>, nuint, ReadOnlySpan<byte>, out PamojaManifest)
Verifies an envelope and reads the manifest inside it.
public static PamojaStatus pamoja_envelope_verify(ReadOnlySpan<byte> bytes, nuint len, ReadOnlySpan<byte> publicKey, out PamojaManifest outManifest)
Parameters
bytesReadOnlySpan<byte>lennuintpublicKeyReadOnlySpan<byte>outManifestPamojaManifest
Returns
pamoja_esc_bidirectional()
Returns the common reversible ESC.
public static extern PamojaEsc pamoja_esc_bidirectional()
Returns
pamoja_esc_pulse(PamojaEsc, float)
Returns the pulse width for a throttle.
public static extern ushort pamoja_esc_pulse(PamojaEsc esc, float throttle)
Parameters
Returns
pamoja_estop_engage(nint)
Engages an e-stop.
public static extern void pamoja_estop_engage(nint estop)
Parameters
estopnint
pamoja_estop_free(nint)
Releases an e-stop handle. Passing null is a no-op.
public static extern void pamoja_estop_free(nint estop)
Parameters
estopnint
pamoja_estop_gate(nint, PamojaTwist)
Passes a command through an e-stop.
public static extern PamojaTwist pamoja_estop_gate(nint estop, PamojaTwist desired)
Parameters
estopnintdesiredPamojaTwist
Returns
pamoja_estop_is_engaged(nint)
Reports whether an e-stop is engaged.
public static bool pamoja_estop_is_engaged(nint estop)
Parameters
estopnint
Returns
pamoja_estop_new()
Creates an e-stop that is not engaged.
public static extern nint pamoja_estop_new()
Returns
pamoja_estop_reset(nint)
Clears an e-stop.
public static extern void pamoja_estop_reset(nint estop)
Parameters
estopnint
pamoja_event_bus_free(nint)
Releases an event bus endpoint.
public static extern void pamoja_event_bus_free(nint bus)
Parameters
busnint
pamoja_event_bus_missed(nint)
Counts the events an endpoint lost by falling behind.
public static extern ulong pamoja_event_bus_missed(nint bus)
Parameters
busnint
Returns
pamoja_event_bus_new(nuint)
Creates an event bus.
public static extern nint pamoja_event_bus_new(nuint capacity)
Parameters
capacitynuint
Returns
pamoja_event_bus_next(nint, out nint)
Waits for the next event on an endpoint.
public static PamojaStatus pamoja_event_bus_next(nint bus, out nint outEvent)
Parameters
Returns
pamoja_event_bus_next_within(nint, ulong, out nint, out bool)
Waits a limited time for the next event on an endpoint.
public static PamojaStatus pamoja_event_bus_next_within(nint bus, ulong timeoutMs, out nint outEvent, out bool outTimedOut)
Parameters
Returns
pamoja_event_bus_publish(nint, ReadOnlySpan<byte>, nuint)
Publishes an event to every subscriber, the endpoint included.
public static PamojaStatus pamoja_event_bus_publish(nint bus, ReadOnlySpan<byte> payload, nuint payloadLen)
Parameters
busnintpayloadReadOnlySpan<byte>payloadLennuint
Returns
pamoja_event_bus_publisher(nint)
Takes a publish-only handle on the bus an endpoint is on.
public static extern nint pamoja_event_bus_publisher(nint bus)
Parameters
busnint
Returns
pamoja_event_bus_subscribe(nint)
Takes another endpoint on an event bus.
public static extern nint pamoja_event_bus_subscribe(nint bus)
Parameters
busnint
Returns
pamoja_event_publisher_clone(nint)
Takes another publisher on the same bus.
public static extern nint pamoja_event_publisher_clone(nint publisher)
Parameters
publishernint
Returns
pamoja_event_publisher_free(nint)
Releases a publisher.
public static extern void pamoja_event_publisher_free(nint publisher)
Parameters
publishernint
pamoja_event_publisher_new(nuint)
Creates a bus with no subscribers yet, and a publisher on it.
public static extern nint pamoja_event_publisher_new(nuint capacity)
Parameters
capacitynuint
Returns
pamoja_event_publisher_publish(nint, ReadOnlySpan<byte>, nuint, out nuint)
Hands an event to every current subscriber.
public static PamojaStatus pamoja_event_publisher_publish(nint publisher, ReadOnlySpan<byte> payload, nuint payloadLen, out nuint outReached)
Parameters
publishernintpayloadReadOnlySpan<byte>payloadLennuintoutReachednuint
Returns
pamoja_event_publisher_subscribe(nint)
Subscribes to the bus a publisher publishes on.
public static extern nint pamoja_event_publisher_subscribe(nint publisher)
Parameters
publishernint
Returns
pamoja_forward_kinematics(ReadOnlySpan<PamojaDhParameters>, nuint)
Returns the transform from a serial arm's base to its tool.
public static PamojaTransform pamoja_forward_kinematics(ReadOnlySpan<PamojaDhParameters> joints, nuint len)
Parameters
jointsReadOnlySpan<PamojaDhParameters>lennuint
Returns
pamoja_frames_count(nint)
Returns how many frames a decoder call produced.
public static extern nuint pamoja_frames_count(nint frames)
Parameters
framesnint
Returns
pamoja_frames_data(nint, nuint)
Returns a pointer to one frame's payload bytes.
public static extern nint pamoja_frames_data(nint frames, nuint index)
Parameters
Returns
pamoja_frames_free(nint)
Releases a decoded frame set. Passing null is a no-op.
public static extern void pamoja_frames_free(nint frames)
Parameters
framesnint
pamoja_frames_len(nint, nuint)
Returns the length in bytes of one frame's payload.
public static extern nuint pamoja_frames_len(nint frames, nuint index)
Parameters
Returns
pamoja_gateway_network_answer(nint, uint, PamojaGatewayNetworkSlot, byte, ReadOnlySpan<byte>, nuint, Span<byte>, nuint, out PamojaGatewayTxpk, out nuint)
Builds a downlink for a device, encrypted with its session.
public static PamojaStatus pamoja_gateway_network_answer(nint network, uint devAddr, PamojaGatewayNetworkSlot slot, byte fport, ReadOnlySpan<byte> payload, nuint payloadLen, Span<byte> buffer, nuint capacity, out PamojaGatewayTxpk outTxpk, out nuint outLen)
Parameters
networknintdevAddruintslotPamojaGatewayNetworkSlotfportbytepayloadReadOnlySpan<byte>payloadLennuintbufferSpan<byte>capacitynuintoutTxpkPamojaGatewayTxpkoutLennuint
Returns
pamoja_gateway_network_command(nint, uint, PamojaGatewayNetworkSlot, ReadOnlySpan<PamojaLorawanMacCommand>, nuint, Span<byte>, nuint, out PamojaGatewayTxpk, out nuint)
Builds a downlink carrying MAC commands.
public static PamojaStatus pamoja_gateway_network_command(nint network, uint devAddr, PamojaGatewayNetworkSlot slot, ReadOnlySpan<PamojaLorawanMacCommand> commands, nuint commandsLen, Span<byte> buffer, nuint capacity, out PamojaGatewayTxpk outTxpk, out nuint outLen)
Parameters
networknintdevAddruintslotPamojaGatewayNetworkSlotcommandsReadOnlySpan<PamojaLorawanMacCommand>commandsLennuintbufferSpan<byte>capacitynuintoutTxpkPamojaGatewayTxpkoutLennuint
Returns
pamoja_gateway_network_free(nint)
Releases a network.
public static extern void pamoja_gateway_network_free(nint network)
Parameters
networknint
pamoja_gateway_network_notices(nint, Span<PamojaGatewayNetworkNotice>, nuint, out nuint)
Takes the devices relays reported hearing and could not verify.
public static PamojaStatus pamoja_gateway_network_notices(nint network, Span<PamojaGatewayNetworkNotice> outNotices, nuint capacity, out nuint outLen)
Parameters
networknintoutNoticesSpan<PamojaGatewayNetworkNotice>capacitynuintoutLennuint
Returns
pamoja_gateway_network_open(nint, uint, PamojaGatewayNetworkWindows, uint, out nint)
Opens the network side of a site on a channel plan.
public static PamojaStatus pamoja_gateway_network_open(nint plan, uint netId, PamojaGatewayNetworkWindows windows, uint firstDevAddr, out nint outNetwork)
Parameters
plannintnetIduintwindowsPamojaGatewayNetworkWindowsfirstDevAddruintoutNetworknint
Returns
pamoja_gateway_network_register(nint, ReadOnlySpan<byte>, ReadOnlySpan<byte>, ReadOnlySpan<byte>, byte)
Admits a device, so a join request signed with its key is accepted.
public static PamojaStatus pamoja_gateway_network_register(nint network, ReadOnlySpan<byte> devEui, ReadOnlySpan<byte> appEui, ReadOnlySpan<byte> appKey, byte version)
Parameters
networknintdevEuiReadOnlySpan<byte>appEuiReadOnlySpan<byte>appKeyReadOnlySpan<byte>versionbyte
Returns
pamoja_gateway_network_trust_command(nint, uint, byte, byte, byte, out PamojaLorawanMacCommand)
Builds the command that tells a relay to trust a device.
public static PamojaStatus pamoja_gateway_network_trust_command(nint network, uint devAddr, byte index, byte reloadRate, byte bucketSize, out PamojaLorawanMacCommand outCommand)
Parameters
networknintdevAddruintindexbytereloadRatebytebucketSizebyteoutCommandPamojaLorawanMacCommand
Returns
pamoja_gateway_network_uplink(nint, PamojaGatewayRxpk, ReadOnlySpan<byte>, nuint, Span<byte>, nuint, out PamojaGatewayNetworkEvent)
Reads a packet the gateway forwarded.
public static PamojaStatus pamoja_gateway_network_uplink(nint network, PamojaGatewayRxpk packet, ReadOnlySpan<byte> payload, nuint payloadLen, Span<byte> buffer, nuint capacity, out PamojaGatewayNetworkEvent outEvent)
Parameters
networknintpacketPamojaGatewayRxpkpayloadReadOnlySpan<byte>payloadLennuintbufferSpan<byte>capacitynuintoutEventPamojaGatewayNetworkEvent
Returns
pamoja_gateway_network_windows_default()
Returns the windows a network answers in by default.
public static extern PamojaGatewayNetworkWindows pamoja_gateway_network_windows_default()
Returns
pamoja_gateway_packet_acknowledgment(nint, out nint)
Builds the acknowledgment a server owes a datagram.
public static bool pamoja_gateway_packet_acknowledgment(nint packet, out nint outPacket)
Parameters
Returns
pamoja_gateway_packet_free(nint)
Releases a packet.
public static extern void pamoja_gateway_packet_free(nint packet)
Parameters
packetnint
pamoja_gateway_packet_gateway(nint, Span<byte>)
Writes the gateway's identifier, for the datagrams that carry one.
public static bool pamoja_gateway_packet_gateway(nint packet, Span<byte> outGateway)
Parameters
Returns
pamoja_gateway_packet_kind(nint)
Returns which kind of datagram a packet is, or 255 for a null packet.
public static extern byte pamoja_gateway_packet_kind(nint packet)
Parameters
packetnint
Returns
pamoja_gateway_packet_parse(ReadOnlySpan<byte>, nuint, out nint)
Reads a datagram.
public static PamojaStatus pamoja_gateway_packet_parse(ReadOnlySpan<byte> bytes, nuint len, out nint outPacket)
Parameters
bytesReadOnlySpan<byte>lennuintoutPacketnint
Returns
pamoja_gateway_packet_rxpk(nint, nuint, out PamojaGatewayRxpk)
Reads one of the packets a PUSH_DATA forwards.
public static bool pamoja_gateway_packet_rxpk(nint packet, nuint index, out PamojaGatewayRxpk outRxpk)
Parameters
packetnintindexnuintoutRxpkPamojaGatewayRxpk
Returns
pamoja_gateway_packet_rxpk_count(nint)
Returns how many packets a PUSH_DATA forwards.
public static extern nuint pamoja_gateway_packet_rxpk_count(nint packet)
Parameters
packetnint
Returns
pamoja_gateway_packet_rxpk_payload(nint, nuint)
Returns a pointer to one forwarded packet's payload.
public static extern nint pamoja_gateway_packet_rxpk_payload(nint packet, nuint index)
Parameters
Returns
pamoja_gateway_packet_rxpk_payload_len(nint, nuint)
Returns the length of one forwarded packet's payload.
public static extern nuint pamoja_gateway_packet_rxpk_payload_len(nint packet, nuint index)
Parameters
Returns
pamoja_gateway_packet_stat(nint, out PamojaGatewayStat)
Reads the gateway's status report, when a PUSH_DATA carries one.
public static bool pamoja_gateway_packet_stat(nint packet, out PamojaGatewayStat outStat)
Parameters
packetnintoutStatPamojaGatewayStat
Returns
pamoja_gateway_packet_to_buffer(nint)
Writes a packet as the datagram to send.
public static extern nint pamoja_gateway_packet_to_buffer(nint packet)
Parameters
packetnint
Returns
pamoja_gateway_packet_token(nint)
Returns a packet's token.
public static extern ushort pamoja_gateway_packet_token(nint packet)
Parameters
packetnint
Returns
pamoja_gateway_packet_tx_status(nint)
Returns what a TX_ACK reports, or 255 when the packet is not one.
public static extern byte pamoja_gateway_packet_tx_status(nint packet)
Parameters
packetnint
Returns
pamoja_gateway_packet_txpk(nint, out PamojaGatewayTxpk)
Reads what a PULL_RESP asks the gateway to transmit.
public static bool pamoja_gateway_packet_txpk(nint packet, out PamojaGatewayTxpk outTxpk)
Parameters
packetnintoutTxpkPamojaGatewayTxpk
Returns
pamoja_gateway_packet_txpk_payload(nint)
Returns a pointer to the payload a PULL_RESP carries.
public static extern nint pamoja_gateway_packet_txpk_payload(nint packet)
Parameters
packetnint
Returns
pamoja_gateway_packet_txpk_payload_len(nint)
Returns the length of the payload a PULL_RESP carries.
public static extern nuint pamoja_gateway_packet_txpk_payload_len(nint packet)
Parameters
packetnint
Returns
pamoja_gateway_pull_ack(ushort)
Builds the PULL_ACK that answers a PULL_DATA.
public static extern nint pamoja_gateway_pull_ack(ushort token)
Parameters
tokenushort
Returns
pamoja_gateway_pull_data(ushort, ReadOnlySpan<byte>, out nint)
Builds the PULL_DATA that holds a route open.
public static PamojaStatus pamoja_gateway_pull_data(ushort token, ReadOnlySpan<byte> gateway, out nint outPacket)
Parameters
tokenushortgatewayReadOnlySpan<byte>outPacketnint
Returns
pamoja_gateway_pull_resp(ushort, PamojaGatewayTxpk, ReadOnlySpan<byte>, nuint, out nint)
Builds the PULL_RESP that asks a gateway to transmit.
public static PamojaStatus pamoja_gateway_pull_resp(ushort token, PamojaGatewayTxpk transmit, ReadOnlySpan<byte> payload, nuint payloadLen, out nint outPacket)
Parameters
tokenushorttransmitPamojaGatewayTxpkpayloadReadOnlySpan<byte>payloadLennuintoutPacketnint
Returns
pamoja_gateway_push_ack(ushort)
Builds the PUSH_ACK that answers a PUSH_DATA.
public static extern nint pamoja_gateway_push_ack(ushort token)
Parameters
tokenushort
Returns
pamoja_gateway_push_data(ushort, ReadOnlySpan<byte>, nint, out nint)
Builds the PUSH_DATA that forwards an uplink, taking the uplink over.
public static PamojaStatus pamoja_gateway_push_data(ushort token, ReadOnlySpan<byte> gateway, nint uplink, out nint outPacket)
Parameters
tokenushortgatewayReadOnlySpan<byte>uplinknintoutPacketnint
Returns
pamoja_gateway_station_discovery(ReadOnlySpan<byte>, out nint)
Writes the request a station sends to find its network server.
public static PamojaStatus pamoja_gateway_station_discovery(ReadOnlySpan<byte> router, out nint outText)
Parameters
routerReadOnlySpan<byte>outTextnint
Returns
pamoja_gateway_station_discovery_parse(ReadOnlySpan<byte>, nuint, Span<byte>)
Reads the request a station sent to find its network server.
public static PamojaStatus pamoja_gateway_station_discovery_parse(ReadOnlySpan<byte> text, nuint textLen, Span<byte> outRouter)
Parameters
textReadOnlySpan<byte>textLennuintoutRouterSpan<byte>
Returns
pamoja_gateway_station_eui_of(string, Span<byte>)
Reads an identifier written in any form the protocol accepts.
public static PamojaStatus pamoja_gateway_station_eui_of(string text, Span<byte> outEui)
Parameters
Returns
pamoja_gateway_station_heard(ReadOnlySpan<byte>, nuint, byte, uint, PamojaGatewayStationLevels)
Reads a frame the radio heard into the message that reports it.
public static nint pamoja_gateway_station_heard(ReadOnlySpan<byte> frame, nuint frameLen, byte dataRate, uint frequencyHz, PamojaGatewayStationLevels levels)
Parameters
frameReadOnlySpan<byte>frameLennuintdataRatebytefrequencyHzuintlevelsPamojaGatewayStationLevels
Returns
pamoja_gateway_station_id6(ReadOnlySpan<byte>, out nint)
Writes an identifier in the ID6 form the protocol prefers.
public static PamojaStatus pamoja_gateway_station_id6(ReadOnlySpan<byte> eui, out nint outText)
Parameters
euiReadOnlySpan<byte>outTextnint
Returns
pamoja_gateway_station_message_add_broadcast(nint, in PamojaGatewayStationBroadcast, ReadOnlySpan<byte>, nuint)
Adds a frame to a schedule.
public static PamojaStatus pamoja_gateway_station_message_add_broadcast(nint message, in PamojaGatewayStationBroadcast frame, ReadOnlySpan<byte> pdu, nuint pduLen)
Parameters
messagenintframePamojaGatewayStationBroadcastpduReadOnlySpan<byte>pduLennuint
Returns
pamoja_gateway_station_message_add_data_rate(nint, in PamojaGatewayStationDataRate)
Adds the next number of a configuration's data-rate table.
public static PamojaStatus pamoja_gateway_station_message_add_data_rate(nint message, in PamojaGatewayStationDataRate rate)
Parameters
messagenintratePamojaGatewayStationDataRate
Returns
pamoja_gateway_station_message_add_join_range(nint, in PamojaGatewayStationJoinRange)
Adds a range of join identifiers a configuration forwards.
public static PamojaStatus pamoja_gateway_station_message_add_join_range(nint message, in PamojaGatewayStationJoinRange range)
Parameters
messagenintrangePamojaGatewayStationJoinRange
Returns
pamoja_gateway_station_message_add_net_id(nint, uint)
Adds a network whose data frames a configuration forwards.
public static extern PamojaStatus pamoja_gateway_station_message_add_net_id(nint message, uint netId)
Parameters
Returns
pamoja_gateway_station_message_broadcast(nint, nuint, out PamojaGatewayStationBroadcast, out nint)
Reads one frame of a schedule.
public static PamojaStatus pamoja_gateway_station_message_broadcast(nint message, nuint index, out PamojaGatewayStationBroadcast outFrame, out nint outPdu)
Parameters
messagenintindexnuintoutFramePamojaGatewayStationBroadcastoutPdunint
Returns
pamoja_gateway_station_message_data_rate(nint, nuint, out PamojaGatewayStationDataRate)
Reads one number of a configuration's data-rate table.
public static PamojaStatus pamoja_gateway_station_message_data_rate(nint message, nuint index, out PamojaGatewayStationDataRate outRate)
Parameters
messagenintindexnuintoutRatePamojaGatewayStationDataRate
Returns
pamoja_gateway_station_message_fields(nint, out PamojaGatewayStationFields)
Reads the fields a message carries.
public static PamojaStatus pamoja_gateway_station_message_fields(nint message, out PamojaGatewayStationFields outFields)
Parameters
messagenintoutFieldsPamojaGatewayStationFields
Returns
pamoja_gateway_station_message_free(nint)
Releases a message.
public static extern void pamoja_gateway_station_message_free(nint message)
Parameters
messagenint
pamoja_gateway_station_message_join_range(nint, nuint, out PamojaGatewayStationJoinRange)
Reads one join identifier range a configuration names.
public static PamojaStatus pamoja_gateway_station_message_join_range(nint message, nuint index, out PamojaGatewayStationJoinRange outRange)
Parameters
messagenintindexnuintoutRangePamojaGatewayStationJoinRange
Returns
pamoja_gateway_station_message_json(nint, out nint)
Writes a message as the websocket carries it.
public static PamojaStatus pamoja_gateway_station_message_json(nint message, out nint outText)
Parameters
Returns
pamoja_gateway_station_message_kind(nint)
Returns which kind a message is.
public static extern byte pamoja_gateway_station_message_kind(nint message)
Parameters
messagenint
Returns
pamoja_gateway_station_message_net_id(nint, nuint, out uint)
Reads one network a configuration names.
public static PamojaStatus pamoja_gateway_station_message_net_id(nint message, nuint index, out uint outNetId)
Parameters
Returns
pamoja_gateway_station_message_new(in PamojaGatewayStationFields)
Builds a message of any kind from its fixed fields.
public static nint pamoja_gateway_station_message_new(in PamojaGatewayStationFields fields)
Parameters
fieldsPamojaGatewayStationFields
Returns
pamoja_gateway_station_message_options(nint, out nint)
Returns the frame options a data frame carries.
public static PamojaStatus pamoja_gateway_station_message_options(nint message, out nint outOptions)
Parameters
Returns
pamoja_gateway_station_message_parse(ReadOnlySpan<byte>, nuint)
Reads a message that arrived over the websocket.
public static nint pamoja_gateway_station_message_parse(ReadOnlySpan<byte> text, nuint textLen)
Parameters
textReadOnlySpan<byte>textLennuint
Returns
pamoja_gateway_station_message_payload(nint, out nint)
Returns the bytes a message carries.
public static PamojaStatus pamoja_gateway_station_message_payload(nint message, out nint outPayload)
Parameters
Returns
pamoja_gateway_station_message_set_options(nint, ReadOnlySpan<byte>, nuint)
Sets the frame options a data frame carries.
public static PamojaStatus pamoja_gateway_station_message_set_options(nint message, ReadOnlySpan<byte> bytes, nuint bytesLen)
Parameters
messagenintbytesReadOnlySpan<byte>bytesLennuint
Returns
pamoja_gateway_station_message_set_payload(nint, ReadOnlySpan<byte>, nuint)
Sets the bytes a message carries.
public static PamojaStatus pamoja_gateway_station_message_set_payload(nint message, ReadOnlySpan<byte> bytes, nuint bytesLen)
Parameters
messagenintbytesReadOnlySpan<byte>bytesLennuint
Returns
pamoja_gateway_station_message_set_text(nint, byte, ReadOnlySpan<byte>, nuint)
Sets a piece of text a message carries.
public static PamojaStatus pamoja_gateway_station_message_set_text(nint message, byte field, ReadOnlySpan<byte> text, nuint textLen)
Parameters
messagenintfieldbytetextReadOnlySpan<byte>textLennuint
Returns
pamoja_gateway_station_message_text(nint, byte, out nint)
Returns a piece of text a message carries.
public static PamojaStatus pamoja_gateway_station_message_text(nint message, byte field, out nint outText)
Parameters
Returns
pamoja_gateway_station_router_accepted(ReadOnlySpan<byte>, ReadOnlySpan<byte>, ReadOnlySpan<byte>, nuint, out nint)
Writes the answer that sends a station to its session's websocket.
public static PamojaStatus pamoja_gateway_station_router_accepted(ReadOnlySpan<byte> router, ReadOnlySpan<byte> muxs, ReadOnlySpan<byte> uri, nuint uriLen, out nint outText)
Parameters
routerReadOnlySpan<byte>muxsReadOnlySpan<byte>uriReadOnlySpan<byte>uriLennuintoutTextnint
Returns
pamoja_gateway_station_router_identities(ReadOnlySpan<byte>, nuint, out PamojaGatewayStationRouterIds)
Reads the identities a discovery answer names.
public static PamojaStatus pamoja_gateway_station_router_identities(ReadOnlySpan<byte> text, nuint textLen, out PamojaGatewayStationRouterIds outIds)
Parameters
textReadOnlySpan<byte>textLennuintoutIdsPamojaGatewayStationRouterIds
Returns
pamoja_gateway_station_router_parse(ReadOnlySpan<byte>, nuint, out nint, out nint)
Reads the answer a discovery endpoint gives.
public static PamojaStatus pamoja_gateway_station_router_parse(ReadOnlySpan<byte> text, nuint textLen, out nint outUri, out nint outError)
Parameters
textReadOnlySpan<byte>textLennuintoutUrinintoutErrornint
Returns
pamoja_gateway_station_router_refused(ReadOnlySpan<byte>, ReadOnlySpan<byte>, nuint, out nint)
Writes the answer that refuses a station, saying why.
public static PamojaStatus pamoja_gateway_station_router_refused(ReadOnlySpan<byte> router, ReadOnlySpan<byte> error, nuint errorLen, out nint outText)
Parameters
routerReadOnlySpan<byte>errorReadOnlySpan<byte>errorLennuintoutTextnint
Returns
pamoja_gateway_station_xtime(byte, byte, ulong, out long)
Builds a station clock value from its radio unit, run, and microseconds.
public static PamojaStatus pamoja_gateway_station_xtime(byte unit, byte session, ulong micros, out long outValue)
Parameters
Returns
pamoja_gateway_station_xtime_parts(long, out PamojaGatewayStationXtime)
Takes a station clock value apart.
public static PamojaStatus pamoja_gateway_station_xtime_parts(long value, out PamojaGatewayStationXtime outParts)
Parameters
valuelongoutPartsPamojaGatewayStationXtime
Returns
pamoja_gateway_tx_ack(ushort, ReadOnlySpan<byte>, byte, out nint)
Builds the TX_ACK that reports what became of a PULL_RESP.
public static PamojaStatus pamoja_gateway_tx_ack(ushort token, ReadOnlySpan<byte> gateway, byte status, out nint outPacket)
Parameters
tokenushortgatewayReadOnlySpan<byte>statusbyteoutPacketnint
Returns
pamoja_gateway_uplink_add_rxpk(nint, PamojaGatewayRxpk, ReadOnlySpan<byte>, nuint)
Adds a packet the gateway heard.
public static PamojaStatus pamoja_gateway_uplink_add_rxpk(nint uplink, PamojaGatewayRxpk packet, ReadOnlySpan<byte> payload, nuint payloadLen)
Parameters
uplinknintpacketPamojaGatewayRxpkpayloadReadOnlySpan<byte>payloadLennuint
Returns
pamoja_gateway_uplink_free(nint)
Releases an uplink that will not be sent.
public static extern void pamoja_gateway_uplink_free(nint uplink)
Parameters
uplinknint
pamoja_gateway_uplink_new()
Creates an empty uplink for a PUSH_DATA to carry.
public static extern nint pamoja_gateway_uplink_new()
Returns
pamoja_gateway_uplink_set_stat(nint, PamojaGatewayStat)
Sets the gateway's status report on an uplink.
public static extern PamojaStatus pamoja_gateway_uplink_set_stat(nint uplink, PamojaGatewayStat status)
Parameters
uplinknintstatusPamojaGatewayStat
Returns
pamoja_geofence_contains(nint, PamojaCoordinate)
Reports whether a fix lies inside a geofence.
public static bool pamoja_geofence_contains(nint geofence, PamojaCoordinate point)
Parameters
geofencenintpointPamojaCoordinate
Returns
pamoja_geofence_free(nint)
Releases a geofence handle. Passing null is a no-op.
public static extern void pamoja_geofence_free(nint geofence)
Parameters
geofencenint
pamoja_geofence_new(PamojaCoordinate, double)
Creates a circular geofence.
public static extern nint pamoja_geofence_new(PamojaCoordinate center, double radiusM)
Parameters
centerPamojaCoordinateradiusMdouble
Returns
pamoja_geofence_update(nint, PamojaCoordinate)
Feeds a fix to a geofence and reports where it sits.
public static extern PamojaBoundary pamoja_geofence_update(nint geofence, PamojaCoordinate point)
Parameters
geofencenintpointPamojaCoordinate
Returns
pamoja_gpio_line_drive(nint, PamojaPinLevel)
Drives an output line to a level.
public static extern PamojaStatus pamoja_gpio_line_drive(nint line, PamojaPinLevel level)
Parameters
linenintlevelPamojaPinLevel
Returns
pamoja_gpio_line_free(nint)
Lets a line go, handing it back to the kernel.
public static extern void pamoja_gpio_line_free(nint line)
Parameters
linenint
pamoja_gpio_line_open_input(string, uint, out nint)
Opens a line on a Linux board as an input.
public static PamojaStatus pamoja_gpio_line_open_input(string chip, uint line, out nint outLine)
Parameters
Returns
pamoja_gpio_line_open_output(string, uint, PamojaPinLevel, out nint)
Opens a line on a Linux board as an output, driving an initial level.
public static PamojaStatus pamoja_gpio_line_open_output(string chip, uint line, PamojaPinLevel initial, out nint outLine)
Parameters
chipstringlineuintinitialPamojaPinLeveloutLinenint
Returns
pamoja_gpio_line_read(nint, out PamojaPinLevel)
Reads the level on a line now.
public static PamojaStatus pamoja_gpio_line_read(nint line, out PamojaPinLevel outLevel)
Parameters
linenintoutLevelPamojaPinLevel
Returns
pamoja_hdc1080_celsius(ushort)
Converts a raw HDC1080 temperature register to degrees Celsius. # Returns The temperature.
public static extern float pamoja_hdc1080_celsius(ushort raw)
Parameters
rawushort
Returns
pamoja_hdc1080_config_from_register(ushort, out PamojaHdc1080Config)
Parses an HDC1080 configuration register value. # Returns [PamojaStatus::Ok] on success, with *out_config filled in, or [PamojaStatus::Codec] if the humidity-resolution field carries the code the datasheet leaves undefined, which means the value did not come from a working part. # Safety out_config must point to a writable PamojaHdc1080Config.
public static PamojaStatus pamoja_hdc1080_config_from_register(ushort raw, out PamojaHdc1080Config outConfig)
Parameters
rawushortoutConfigPamojaHdc1080Config
Returns
pamoja_hdc1080_config_to_register(PamojaHdc1080Config, out ushort)
Assembles an HDC1080 configuration register value. # Returns [PamojaStatus::Ok] on success, with *out_register set, or [PamojaStatus::InvalidArgument] if either resolution is not one the part offers. # Safety out_register must point to a writable uint16_t.
public static PamojaStatus pamoja_hdc1080_config_to_register(PamojaHdc1080Config config, out ushort outRegister)
Parameters
configPamojaHdc1080ConfigoutRegisterushort
Returns
pamoja_hdc1080_configuration(nint, out PamojaHdc1080Config)
Copies the configuration an HDC1080 driver writes.
public static PamojaStatus pamoja_hdc1080_configuration(nint sensor, out PamojaHdc1080Config outConfig)
Parameters
sensornintoutConfigPamojaHdc1080Config
Returns
pamoja_hdc1080_conversion_time_micros(PamojaHdc1080Config, out uint)
Returns how long to wait after triggering an HDC1080 in a configuration. # Returns [PamojaStatus::Ok] on success, with *out_micros set, or [PamojaStatus::InvalidArgument] if either resolution is not one the part offers. # Safety out_micros must point to a writable uint32_t.
public static PamojaStatus pamoja_hdc1080_conversion_time_micros(PamojaHdc1080Config config, out uint outMicros)
Parameters
configPamojaHdc1080ConfigoutMicrosuint
Returns
pamoja_hdc1080_free(nint)
Releases an HDC1080 driver. Passing null is a no-op.
public static extern void pamoja_hdc1080_free(nint sensor)
Parameters
sensornint
pamoja_hdc1080_heater(nint, bool)
Switches the HDC1080's heater on or off.
public static PamojaStatus pamoja_hdc1080_heater(nint sensor, bool on)
Parameters
Returns
pamoja_hdc1080_humidity_conversion_micros(byte, out uint)
Returns how long an HDC1080 humidity conversion takes at a resolution. # Returns [PamojaStatus::Ok] on success, with *out_micros set, or [PamojaStatus::InvalidArgument] if bits is not 14, 11, or 8. # Safety out_micros must point to a writable uint32_t.
public static PamojaStatus pamoja_hdc1080_humidity_conversion_micros(byte bits, out uint outMicros)
Parameters
Returns
pamoja_hdc1080_humidity_register(uint)
Builds the HDC1080 humidity register that decodes to a relative humidity. # Returns The 14-bit code in bits 15:2, clamped to full scale.
public static extern ushort pamoja_hdc1080_humidity_register(uint milliPercent)
Parameters
milliPercentuint
Returns
pamoja_hdc1080_init(nint)
Identifies and configures an HDC1080.
public static extern PamojaStatus pamoja_hdc1080_init(nint sensor)
Parameters
sensornint
Returns
pamoja_hdc1080_measure(nint, out PamojaHdc1080Measurement)
Runs one HDC1080 acquisition of both channels.
public static PamojaStatus pamoja_hdc1080_measure(nint sensor, out PamojaHdc1080Measurement outMeasurement)
Parameters
sensornintoutMeasurementPamojaHdc1080Measurement
Returns
pamoja_hdc1080_measurement_bytes(ushort, ushort, Span<byte>)
Builds the four bytes an HDC1080 sends for a pair of raw registers. # Returns [PamojaStatus::Ok] on success, with the four bytes written to out_bytes, or [PamojaStatus::InvalidArgument] if out_bytes is null. # Safety out_bytes must point to at least four writable bytes.
public static PamojaStatus pamoja_hdc1080_measurement_bytes(ushort temperatureRaw, ushort humidityRaw, Span<byte> outBytes)
Parameters
Returns
pamoja_hdc1080_measurement_from_physical(int, uint, out PamojaHdc1080Measurement)
Builds the HDC1080 measurement a sensor reporting these physical values would send.
Returns [PamojaStatus::Ok], with *out_measurement filled in, or
[PamojaStatus::InvalidArgument] if the pointer is null. # Safety out_measurement must point to a writable PamojaHdc1080Measurement.
public static PamojaStatus pamoja_hdc1080_measurement_from_physical(int milliCelsius, uint milliPercent, out PamojaHdc1080Measurement outMeasurement)
Parameters
milliCelsiusintmilliPercentuintoutMeasurementPamojaHdc1080Measurement
Returns
pamoja_hdc1080_milli_celsius(ushort)
Converts a raw HDC1080 temperature register to milli-degrees Celsius. # Returns The temperature, exact in integer arithmetic.
public static extern int pamoja_hdc1080_milli_celsius(ushort raw)
Parameters
rawushort
Returns
pamoja_hdc1080_milli_percent(ushort)
Converts a raw HDC1080 humidity register to milli-percent. # Returns The relative humidity, exact in integer arithmetic.
public static extern uint pamoja_hdc1080_milli_percent(ushort raw)
Parameters
rawushort
Returns
pamoja_hdc1080_new(nint, PamojaHdc1080Settings, out nint)
Creates an HDC1080 driver on a bus.
public static PamojaStatus pamoja_hdc1080_new(nint bus, PamojaHdc1080Settings settings, out nint outSensor)
Parameters
busnintsettingsPamojaHdc1080SettingsoutSensornint
Returns
pamoja_hdc1080_parse_measurement(ReadOnlySpan<byte>, nuint, out PamojaHdc1080Measurement)
Parses the four bytes an HDC1080 sequential read returns. # Returns [PamojaStatus::Ok] on success, with *out_measurement filled in, or [PamojaStatus::InvalidArgument] if the buffer is not four bytes. The part sends no checksum, so a well-sized read always decodes. # Safety bytes must point to at least bytes_len readable bytes, and out_measurement must point to a writable PamojaHdc1080Measurement.
public static PamojaStatus pamoja_hdc1080_parse_measurement(ReadOnlySpan<byte> bytes, nuint bytesLen, out PamojaHdc1080Measurement outMeasurement)
Parameters
bytesReadOnlySpan<byte>bytesLennuintoutMeasurementPamojaHdc1080Measurement
Returns
pamoja_hdc1080_relative_humidity(ushort)
Converts a raw HDC1080 humidity register to a relative humidity percentage. # Returns The relative humidity.
public static extern float pamoja_hdc1080_relative_humidity(ushort raw)
Parameters
rawushort
Returns
pamoja_hdc1080_serial_id(ushort, ushort, ushort)
Joins the three HDC1080 serial-ID registers into the 40-bit serial number. # Returns The serial number.
public static extern ulong pamoja_hdc1080_serial_id(ushort high, ushort mid, ushort low)
Parameters
Returns
pamoja_hdc1080_serial_id_registers(ulong, out ushort)
Splits a serial number back into the three HDC1080 serial-ID registers. # Returns [PamojaStatus::Ok] on success, with the three registers written to out_registers high word first, or [PamojaStatus::InvalidArgument] if the pointer is null. # Safety out_registers must point to at least three writable uint16_t values.
public static PamojaStatus pamoja_hdc1080_serial_id_registers(ulong serial, out ushort outRegisters)
Parameters
Returns
pamoja_hdc1080_settings_default()
Returns the settings an HDC1080 driver starts with.
public static extern PamojaHdc1080Settings pamoja_hdc1080_settings_default()
Returns
pamoja_hdc1080_sim_part()
Creates a simulated HDC1080 reading its default temperature and humidity.
public static extern nint pamoja_hdc1080_sim_part()
Returns
pamoja_hdc1080_sim_reporting(float, float)
Creates a simulated HDC1080 that reads what it is asked to.
public static extern nint pamoja_hdc1080_sim_reporting(float celsius, float relativeHumidity)
Parameters
Returns
pamoja_hdc1080_temperature_conversion_micros(byte, out uint)
Returns how long an HDC1080 temperature conversion takes at a resolution. # Returns [PamojaStatus::Ok] on success, with *out_micros set, or [PamojaStatus::InvalidArgument] if bits is not 14 or 11. # Safety out_micros must point to a writable uint32_t.
public static PamojaStatus pamoja_hdc1080_temperature_conversion_micros(byte bits, out uint outMicros)
Parameters
Returns
pamoja_hdc1080_temperature_register(int)
Builds the HDC1080 temperature register that decodes to a temperature. # Returns The 14-bit code in bits 15:2, clamped to the part's range.
public static extern ushort pamoja_hdc1080_temperature_register(int milliCelsius)
Parameters
milliCelsiusint
Returns
pamoja_i2c_address_frame(PamojaI2cAddress, PamojaI2cDirection, Span<byte>, nuint, out nuint)
Writes the address bytes a controller puts on the bus.
public static PamojaStatus pamoja_i2c_address_frame(PamojaI2cAddress address, PamojaI2cDirection direction, Span<byte> outFrame, nuint outFrameCap, out nuint outLen)
Parameters
addressPamojaI2cAddressdirectionPamojaI2cDirectionoutFrameSpan<byte>outFrameCapnuintoutLennuint
Returns
pamoja_i2c_address_frame_len(PamojaI2cAddress)
Returns how many bytes an address frame occupies.
public static extern nuint pamoja_i2c_address_frame_len(PamojaI2cAddress address)
Parameters
addressPamojaI2cAddress
Returns
pamoja_i2c_address_is_general_call(PamojaI2cAddress)
Reports whether an address is the general call address 0x00.
public static bool pamoja_i2c_address_is_general_call(PamojaI2cAddress address)
Parameters
addressPamojaI2cAddress
Returns
pamoja_i2c_address_is_reserved(PamojaI2cAddress)
Reports whether an address falls in a reserved range.
public static bool pamoja_i2c_address_is_reserved(PamojaI2cAddress address)
Parameters
addressPamojaI2cAddress
Returns
pamoja_i2c_address_seven_bit(byte, out PamojaI2cAddress)
Validates a 7-bit I2C address.
public static PamojaStatus pamoja_i2c_address_seven_bit(byte address, out PamojaI2cAddress outAddress)
Parameters
addressbyteoutAddressPamojaI2cAddress
Returns
pamoja_i2c_address_ten_bit(ushort, out PamojaI2cAddress)
Validates a 10-bit I2C address.
public static PamojaStatus pamoja_i2c_address_ten_bit(ushort address, out PamojaI2cAddress outAddress)
Parameters
addressushortoutAddressPamojaI2cAddress
Returns
pamoja_i2c_bus_attach(nint, nint)
Puts a copy of a part on a simulated bus.
public static extern PamojaStatus pamoja_i2c_bus_attach(nint bus, nint part)
Parameters
Returns
pamoja_i2c_bus_free(nint)
Releases the caller's share of a bus. Passing null is a no-op.
public static extern void pamoja_i2c_bus_free(nint bus)
Parameters
busnint
pamoja_i2c_bus_kind(nint)
Returns what answers on a bus.
public static extern byte pamoja_i2c_bus_kind(nint bus)
Parameters
busnint
Returns
pamoja_i2c_bus_open(string, out nint)
Opens the kernel's I2C adapter.
public static PamojaStatus pamoja_i2c_bus_open(string path, out nint outBus)
Parameters
Returns
pamoja_i2c_bus_part(nint, byte)
Copies what a simulated part holds now, or returns null.
public static extern nint pamoja_i2c_bus_part(nint bus, byte address)
Parameters
Returns
pamoja_i2c_bus_read(nint, byte, Span<byte>, nuint)
Reads bytes from a part, in one transaction.
public static PamojaStatus pamoja_i2c_bus_read(nint bus, byte address, Span<byte> outBytes, nuint len)
Parameters
Returns
pamoja_i2c_bus_remaining(nint, out nuint)
Reports how many steps a scripted bus has left.
public static bool pamoja_i2c_bus_remaining(nint bus, out nuint outRemaining)
Parameters
Returns
pamoja_i2c_bus_scripted(nint)
Creates a bus that plays a copy of a script.
public static extern nint pamoja_i2c_bus_scripted(nint script)
Parameters
scriptnint
Returns
pamoja_i2c_bus_simulated()
Creates a simulated bus with no parts on it yet.
public static extern nint pamoja_i2c_bus_simulated()
Returns
pamoja_i2c_bus_transfers(nint)
Returns how many transfers have been made on a bus.
public static extern nuint pamoja_i2c_bus_transfers(nint bus)
Parameters
busnint
Returns
pamoja_i2c_bus_waited_micros(nint)
Returns how long the drivers on a bus have asked to wait, in microseconds.
public static extern ulong pamoja_i2c_bus_waited_micros(nint bus)
Parameters
busnint
Returns
pamoja_i2c_bus_write(nint, byte, ReadOnlySpan<byte>, nuint)
Writes bytes to a part, in one transaction.
public static PamojaStatus pamoja_i2c_bus_write(nint bus, byte address, ReadOnlySpan<byte> bytes, nuint len)
Parameters
busnintaddressbytebytesReadOnlySpan<byte>lennuint
Returns
pamoja_i2c_bus_write_read(nint, byte, ReadOnlySpan<byte>, nuint, Span<byte>, nuint)
Writes bytes and reads the reply in one transaction.
public static PamojaStatus pamoja_i2c_bus_write_read(nint bus, byte address, ReadOnlySpan<byte> bytes, nuint len, Span<byte> outBytes, nuint outLen)
Parameters
Returns
pamoja_i2c_command_part_new(byte, nuint)
Creates a simulated part answering at one address that takes commands.
public static extern nint pamoja_i2c_command_part_new(byte address, nuint width)
Parameters
Returns
pamoja_i2c_part_address(nint)
Returns the address a part answers to.
public static extern byte pamoja_i2c_part_address(nint part)
Parameters
partnint
Returns
pamoja_i2c_part_answer(nint, ReadOnlySpan<byte>, nuint, ReadOnlySpan<byte>, nuint)
Gives a part that takes commands the reply one command leaves.
public static PamojaStatus pamoja_i2c_part_answer(nint part, ReadOnlySpan<byte> command, nuint commandLen, ReadOnlySpan<byte> reply, nuint replyLen)
Parameters
partnintcommandReadOnlySpan<byte>commandLennuintreplyReadOnlySpan<byte>replyLennuint
Returns
pamoja_i2c_part_free(nint)
Releases a part. Passing null is a no-op.
public static extern void pamoja_i2c_part_free(nint part)
Parameters
partnint
pamoja_i2c_part_kind(nint)
Returns which kind of part a handle holds.
public static extern byte pamoja_i2c_part_kind(nint part)
Parameters
partnint
Returns
pamoja_i2c_part_load(nint, byte, ReadOnlySpan<byte>, nuint)
Puts bytes in a part, from a register on.
public static PamojaStatus pamoja_i2c_part_load(nint part, byte first, ReadOnlySpan<byte> bytes, nuint len)
Parameters
partnintfirstbytebytesReadOnlySpan<byte>lennuint
Returns
pamoja_i2c_part_new(byte)
Creates a simulated part answering at one address from registers a byte wide.
public static extern nint pamoja_i2c_part_new(byte address)
Parameters
addressbyte
Returns
pamoja_i2c_part_read(nint, byte, Span<byte>, nuint)
Reads consecutive registers of a part, from one register on.
public static PamojaStatus pamoja_i2c_part_read(nint part, byte first, Span<byte> outBytes, nuint len)
Parameters
Returns
pamoja_i2c_part_read_only(nint, byte, ushort)
Marks bits of one sixteen-bit register as the part's to set.
public static extern PamojaStatus pamoja_i2c_part_read_only(nint part, byte register, ushort mask)
Parameters
Returns
pamoja_i2c_part_received(nint, nuint)
Copies one write a part that takes commands received, or returns null.
public static extern nint pamoja_i2c_part_received(nint part, nuint index)
Parameters
Returns
pamoja_i2c_part_received_count(nint)
Returns how many writes a part that takes commands has received.
public static extern nuint pamoja_i2c_part_received_count(nint part)
Parameters
partnint
Returns
pamoja_i2c_part_register(nint, byte)
Reads what one of a part's registers holds.
public static extern byte pamoja_i2c_part_register(nint part, byte register)
Parameters
Returns
pamoja_i2c_part_set_word(nint, byte, ushort)
Puts a value in one register of a part whose registers are sixteen bits wide.
public static extern PamojaStatus pamoja_i2c_part_set_word(nint part, byte register, ushort value)
Parameters
Returns
pamoja_i2c_part_transfers(nint)
Returns how many transfers a part has served.
public static extern nuint pamoja_i2c_part_transfers(nint part)
Parameters
partnint
Returns
pamoja_i2c_part_word(nint, byte)
Reads what one register of a part whose registers are sixteen bits wide holds.
public static extern ushort pamoja_i2c_part_word(nint part, byte register)
Parameters
Returns
pamoja_i2c_script_fault(nint, byte, byte)
Adds a step: the next transfer to the address fails.
public static extern PamojaStatus pamoja_i2c_script_fault(nint script, byte address, byte fault)
Parameters
Returns
pamoja_i2c_script_free(nint)
Releases a script. Passing null is a no-op.
public static extern void pamoja_i2c_script_free(nint script)
Parameters
scriptnint
pamoja_i2c_script_len(nint)
Returns how many steps a script holds.
public static extern nuint pamoja_i2c_script_len(nint script)
Parameters
scriptnint
Returns
pamoja_i2c_script_new()
Creates an empty script.
public static extern nint pamoja_i2c_script_new()
Returns
pamoja_i2c_script_read(nint, byte, ReadOnlySpan<byte>, nuint)
Adds a step: the driver reads from the address and receives the reply.
public static PamojaStatus pamoja_i2c_script_read(nint script, byte address, ReadOnlySpan<byte> reply, nuint len)
Parameters
scriptnintaddressbytereplyReadOnlySpan<byte>lennuint
Returns
pamoja_i2c_script_write(nint, byte, ReadOnlySpan<byte>, nuint)
Adds a step: the driver writes exactly these bytes to the address.
public static PamojaStatus pamoja_i2c_script_write(nint script, byte address, ReadOnlySpan<byte> bytes, nuint len)
Parameters
scriptnintaddressbytebytesReadOnlySpan<byte>lennuint
Returns
pamoja_i2c_script_write_read(nint, byte, ReadOnlySpan<byte>, nuint, ReadOnlySpan<byte>, nuint)
Adds a step: a write and then a read in one transaction.
public static PamojaStatus pamoja_i2c_script_write_read(nint script, byte address, ReadOnlySpan<byte> bytes, nuint len, ReadOnlySpan<byte> reply, nuint replyLen)
Parameters
scriptnintaddressbytebytesReadOnlySpan<byte>lennuintreplyReadOnlySpan<byte>replyLennuint
Returns
pamoja_i2c_word_part_new(byte)
Creates a simulated part answering at one address from registers sixteen bits wide.
public static extern nint pamoja_i2c_word_part_new(byte address)
Parameters
addressbyte
Returns
pamoja_image_digest(ReadOnlySpan<byte>, nuint, Span<byte>)
Hashes a complete image, for a publisher filling in a manifest.
public static PamojaStatus pamoja_image_digest(ReadOnlySpan<byte> image, nuint imageLen, Span<byte> outDigest)
Parameters
imageReadOnlySpan<byte>imageLennuintoutDigestSpan<byte>
Returns
pamoja_image_verifier_finish(nint, out uint, Span<byte>)
Settles an image against its manifest, consuming the verifier.
public static PamojaStatus pamoja_image_verifier_finish(nint verifier, out uint outSize, Span<byte> outDigest)
Parameters
Returns
pamoja_image_verifier_free(nint)
Releases a verifier handle that will not be settled.
public static extern void pamoja_image_verifier_free(nint verifier)
Parameters
verifiernint
pamoja_image_verifier_new(PamojaManifest)
Creates a verifier that hashes an image against a manifest.
public static extern nint pamoja_image_verifier_new(PamojaManifest manifest)
Parameters
manifestPamojaManifest
Returns
pamoja_image_verifier_update(nint, ReadOnlySpan<byte>, nuint)
Takes the next piece of the image.
public static PamojaStatus pamoja_image_verifier_update(nint verifier, ReadOnlySpan<byte> chunk, nuint len)
Parameters
verifiernintchunkReadOnlySpan<byte>lennuint
Returns
pamoja_imu_tilt_from_accel(double, double, double)
Computes roll and pitch from a three-axis accelerometer at rest.
public static extern PamojaTilt pamoja_imu_tilt_from_accel(double ax, double ay, double az)
Parameters
Returns
pamoja_ina219_adc_conversion_micros(byte)
Returns how long one INA219 conversion takes at an ADC code, in microseconds.
public static extern uint pamoja_ina219_adc_conversion_micros(byte code)
Parameters
codebyte
Returns
pamoja_ina219_address(byte, byte, out byte)
Returns the I2C address an INA219's A1 and A0 pin codes select.
public static PamojaStatus pamoja_ina219_address(byte a1, byte a0, out byte outAddress)
Parameters
Returns
pamoja_ina219_bus_millivolts(ushort)
Converts a raw INA219 bus-voltage register to millivolts.
public static extern uint pamoja_ina219_bus_millivolts(ushort raw)
Parameters
rawushort
Returns
pamoja_ina219_bus_register(uint)
Builds the INA219 bus-voltage register for a bus voltage.
public static extern ushort pamoja_ina219_bus_register(uint millivolts)
Parameters
millivoltsuint
Returns
pamoja_ina219_calibration(uint, uint)
Computes the INA219 calibration register.
public static extern ushort pamoja_ina219_calibration(uint currentLsbMicroamps, uint shuntMilliohms)
Parameters
Returns
pamoja_ina219_calibration_word(nint)
Returns the calibration word an INA219 driver programs.
public static extern ushort pamoja_ina219_calibration_word(nint sensor)
Parameters
sensornint
Returns
pamoja_ina219_config_bits(PamojaIna219Config)
Assembles an INA219 configuration register value.
public static extern ushort pamoja_ina219_config_bits(PamojaIna219Config config)
Parameters
configPamojaIna219Config
Returns
pamoja_ina219_config_from_bits(ushort, out PamojaIna219Config)
Parses an INA219 configuration register value.
public static PamojaStatus pamoja_ina219_config_from_bits(ushort bits, out PamojaIna219Config outConfig)
Parameters
bitsushortoutConfigPamojaIna219Config
Returns
pamoja_ina219_conversion_micros(PamojaIna219Config)
Returns how long one INA219 conversion cycle takes, in microseconds.
public static extern uint pamoja_ina219_conversion_micros(PamojaIna219Config config)
Parameters
configPamojaIna219Config
Returns
pamoja_ina219_conversion_ready(ushort)
Reports whether an INA219 register says a conversion is ready.
public static bool pamoja_ina219_conversion_ready(ushort raw)
Parameters
rawushort
Returns
pamoja_ina219_current_lsb(nint)
Returns the current step an INA219 driver programs.
public static extern uint pamoja_ina219_current_lsb(nint sensor)
Parameters
sensornint
Returns
pamoja_ina219_current_microamps(short, uint)
Converts a raw INA219 current register to microamps.
public static extern int pamoja_ina219_current_microamps(short raw, uint currentLsbMicroamps)
Parameters
Returns
pamoja_ina219_current_register(int, uint)
Builds the INA219 current register for a current.
public static extern short pamoja_ina219_current_register(int microamps, uint currentLsbMicroamps)
Parameters
Returns
pamoja_ina219_free(nint)
Releases an INA219 driver. Passing null is a no-op.
public static extern void pamoja_ina219_free(nint sensor)
Parameters
sensornint
pamoja_ina219_gain_range_millivolts(byte)
Returns the shunt-voltage range an INA219 gain code selects, in millivolts.
public static extern ushort pamoja_ina219_gain_range_millivolts(byte code)
Parameters
codebyte
Returns
pamoja_ina219_init(nint)
Resets, configures, and calibrates an INA219.
public static extern PamojaStatus pamoja_ina219_init(nint sensor)
Parameters
sensornint
Returns
pamoja_ina219_math_overflow(ushort)
Reports whether an INA219 register flags a math overflow.
public static bool pamoja_ina219_math_overflow(ushort raw)
Parameters
rawushort
Returns
pamoja_ina219_measure(nint, out PamojaIna219Reading)
Runs one INA219 conversion and reads every result.
public static PamojaStatus pamoja_ina219_measure(nint sensor, out PamojaIna219Reading outReading)
Parameters
sensornintoutReadingPamojaIna219Reading
Returns
pamoja_ina219_minimum_current_lsb_microamps(uint)
Returns the smallest current resolution covering an expected maximum.
public static extern uint pamoja_ina219_minimum_current_lsb_microamps(uint maxExpectedMicroamps)
Parameters
maxExpectedMicroampsuint
Returns
pamoja_ina219_new(nint, byte, PamojaIna219Settings, out nint)
Creates an INA219 driver on a bus.
public static PamojaStatus pamoja_ina219_new(nint bus, byte address, PamojaIna219Settings settings, out nint outSensor)
Parameters
busnintaddressbytesettingsPamojaIna219SettingsoutSensornint
Returns
pamoja_ina219_power_microwatts(ushort, uint)
Converts a raw INA219 power register to microwatts.
public static extern uint pamoja_ina219_power_microwatts(ushort raw, uint currentLsbMicroamps)
Parameters
Returns
pamoja_ina219_power_register(uint, uint)
Builds the INA219 power register for a power.
public static extern ushort pamoja_ina219_power_register(uint microwatts, uint currentLsbMicroamps)
Parameters
Returns
pamoja_ina219_settings_default()
Returns the settings an INA219 driver starts with.
public static extern PamojaIna219Settings pamoja_ina219_settings_default()
Returns
pamoja_ina219_shunt_microvolts(short)
Converts a raw INA219 shunt-voltage register to microvolts.
public static extern int pamoja_ina219_shunt_microvolts(short raw)
Parameters
rawshort
Returns
pamoja_ina219_shunt_register(int)
Builds the INA219 shunt-voltage register for a shunt voltage.
public static extern short pamoja_ina219_shunt_register(int microvolts)
Parameters
microvoltsint
Returns
pamoja_ina219_sim_part(byte)
Creates a simulated INA219 carrying its default load.
public static extern nint pamoja_ina219_sim_part(byte address)
Parameters
addressbyte
Returns
pamoja_ina219_sim_reporting(byte, uint, uint, uint, int)
Creates a simulated INA219 that reads what it is asked to.
public static extern nint pamoja_ina219_sim_reporting(byte address, uint shuntMilliohms, uint maxMicroamps, uint busMillivolts, int microamps)
Parameters
Returns
pamoja_ina226_active_alert_function(PamojaIna226MaskEnable, out PamojaIna226AlertFunction)
Returns the alert function an INA226 pin actually responds to. # Returns true when one limit function is selected, with *out_function set to it; false when none is, so the pin only ever signals a completed conversion. # Safety out_function must point to a writable PamojaIna226AlertFunction.
public static bool pamoja_ina226_active_alert_function(PamojaIna226MaskEnable mask, out PamojaIna226AlertFunction outFunction)
Parameters
maskPamojaIna226MaskEnableoutFunctionPamojaIna226AlertFunction
Returns
pamoja_ina226_address(byte, byte, out byte)
Returns the I2C address an INA226's A1 and A0 pin codes select. # Returns [PamojaStatus::Ok] on success, with *out_address set to a 7-bit address in 0x40..=0x4F, or [PamojaStatus::InvalidArgument] if either code is above 3. # Safety out_address must point to a writable uint8_t.
public static PamojaStatus pamoja_ina226_address(byte a1, byte a0, out byte outAddress)
Parameters
Returns
pamoja_ina226_averaging_samples(byte)
Returns how many samples an INA226 averaging code folds into one result. # Returns The sample count, from 1 to 1024.
public static extern ushort pamoja_ina226_averaging_samples(byte code)
Parameters
codebyte
Returns
pamoja_ina226_bus_microvolts(ushort)
Converts a raw INA226 bus-voltage register to microvolts. # Returns The bus voltage, exact in integer arithmetic at 1.25 mV per count.
public static extern uint pamoja_ina226_bus_microvolts(ushort raw)
Parameters
rawushort
Returns
pamoja_ina226_bus_register(uint)
Builds the INA226 bus-voltage register a monitor reports for a bus voltage. # Returns The register value, at 1.25 mV per count.
public static extern ushort pamoja_ina226_bus_register(uint microvolts)
Parameters
microvoltsuint
Returns
pamoja_ina226_bus_volts(ushort)
Converts a raw INA226 bus-voltage register to volts. # Returns The bus voltage.
public static extern float pamoja_ina226_bus_volts(ushort raw)
Parameters
rawushort
Returns
pamoja_ina226_calibration(uint, uint)
Computes the INA226 calibration register for a shunt and current resolution. # Returns The register value to write.
public static extern ushort pamoja_ina226_calibration(uint currentLsbMicroamps, uint shuntMilliohms)
Parameters
Returns
pamoja_ina226_calibration_word(nint)
Returns the calibration word an INA226 driver programs.
public static extern ushort pamoja_ina226_calibration_word(nint sensor)
Parameters
sensornint
Returns
pamoja_ina226_config_from_register(ushort, out PamojaIna226Config)
Parses an INA226 configuration register value. # Returns [PamojaStatus::Ok], with *out_config filled in. Every register value decodes, so this fails only on a null pointer. # Safety out_config must point to a writable PamojaIna226Config.
public static PamojaStatus pamoja_ina226_config_from_register(ushort raw, out PamojaIna226Config outConfig)
Parameters
rawushortoutConfigPamojaIna226Config
Returns
pamoja_ina226_config_to_register(PamojaIna226Config)
Assembles an INA226 configuration register value. # Returns The register value to write.
public static extern ushort pamoja_ina226_config_to_register(PamojaIna226Config config)
Parameters
configPamojaIna226Config
Returns
pamoja_ina226_conversion_micros(byte)
Returns the conversion time an INA226 code selects. # Returns The time in microseconds.
public static extern uint pamoja_ina226_conversion_micros(byte code)
Parameters
codebyte
Returns
pamoja_ina226_current_amps(short, uint)
Converts a raw INA226 current register to amps. # Returns The current.
public static extern float pamoja_ina226_current_amps(short raw, uint currentLsbMicroamps)
Parameters
Returns
pamoja_ina226_current_lsb(nint)
Returns the current step an INA226 driver programs.
public static extern uint pamoja_ina226_current_lsb(nint sensor)
Parameters
sensornint
Returns
pamoja_ina226_current_microamps(short, uint)
Converts a raw INA226 current register to microamps. # Returns The current, at the resolution the calibration selected.
public static extern int pamoja_ina226_current_microamps(short raw, uint currentLsbMicroamps)
Parameters
Returns
pamoja_ina226_current_register(int, uint)
Builds the INA226 current register a monitor reports for a current. # Returns The signed register value, or zero if current_lsb_microamps is zero.
public static extern short pamoja_ina226_current_register(int microamps, uint currentLsbMicroamps)
Parameters
Returns
pamoja_ina226_current_register_from_shunt(short, ushort)
Computes the INA226 current register the chip derives from a shunt reading. # Returns The signed current register the part's own arithmetic produces.
public static extern short pamoja_ina226_current_register_from_shunt(short shunt, ushort calibration)
Parameters
Returns
pamoja_ina226_die_id(ushort, out PamojaIna226DieId)
Splits an INA226 die-ID register into its device and revision fields. # Returns [PamojaStatus::Ok], with *out_die_id filled in. Every register value decodes, so this fails only on a null pointer. # Safety out_die_id must point to a writable PamojaIna226DieId.
public static PamojaStatus pamoja_ina226_die_id(ushort raw, out PamojaIna226DieId outDieId)
Parameters
rawushortoutDieIdPamojaIna226DieId
Returns
pamoja_ina226_free(nint)
Releases an INA226 driver. Passing null is a no-op.
public static extern void pamoja_ina226_free(nint sensor)
Parameters
sensornint
pamoja_ina226_identify(ushort, ushort, out PamojaIna226DieId)
Checks that a pair of identification registers belongs to an INA226. # Returns [PamojaStatus::Ok] on success, with *out_die_id filled in, or [PamojaStatus::Codec] if either register carries something other than the values the datasheet fixes, which means a different part, or nothing at all, answered at that address. # Safety out_die_id must point to a writable PamojaIna226DieId.
public static PamojaStatus pamoja_ina226_identify(ushort manufacturerId, ushort dieId, out PamojaIna226DieId outDieId)
Parameters
manufacturerIdushortdieIdushortoutDieIdPamojaIna226DieId
Returns
pamoja_ina226_identity(nint, out PamojaIna226DieId)
Reports the die id an INA226 driver read at initialization.
public static bool pamoja_ina226_identity(nint sensor, out PamojaIna226DieId outDieId)
Parameters
sensornintoutDieIdPamojaIna226DieId
Returns
pamoja_ina226_init(nint)
Resets, identifies, configures, and calibrates an INA226.
public static extern PamojaStatus pamoja_ina226_init(nint sensor)
Parameters
sensornint
Returns
pamoja_ina226_is_continuous(byte)
Reports whether an INA226 mode code keeps converting after the first result. # Returns true for the continuous modes.
public static bool pamoja_ina226_is_continuous(byte code)
Parameters
codebyte
Returns
pamoja_ina226_mask_enable_from_register(ushort, out PamojaIna226MaskEnable)
Parses an INA226 Mask/Enable register value. # Returns [PamojaStatus::Ok], with *out_mask filled in. Every register value decodes, so this fails only on a null pointer. # Safety out_mask must point to a writable PamojaIna226MaskEnable.
public static PamojaStatus pamoja_ina226_mask_enable_from_register(ushort raw, out PamojaIna226MaskEnable outMask)
Parameters
rawushortoutMaskPamojaIna226MaskEnable
Returns
pamoja_ina226_mask_enable_to_register(PamojaIna226MaskEnable)
Assembles an INA226 Mask/Enable register value. # Returns The register value to write, with the read-only flags written as zero.
public static extern ushort pamoja_ina226_mask_enable_to_register(PamojaIna226MaskEnable mask)
Parameters
Returns
pamoja_ina226_measure(nint, out PamojaIna226Reading)
Runs one INA226 conversion and reads every result.
public static PamojaStatus pamoja_ina226_measure(nint sensor, out PamojaIna226Reading outReading)
Parameters
sensornintoutReadingPamojaIna226Reading
Returns
pamoja_ina226_measures_bus(byte)
Reports whether an INA226 mode code converts the bus voltage. # Returns true when the bus is measured in that mode.
public static bool pamoja_ina226_measures_bus(byte code)
Parameters
codebyte
Returns
pamoja_ina226_measures_shunt(byte)
Reports whether an INA226 mode code converts the shunt voltage. # Returns true when the shunt is measured in that mode.
public static bool pamoja_ina226_measures_shunt(byte code)
Parameters
codebyte
Returns
pamoja_ina226_minimum_current_lsb_microamps(uint)
Returns the smallest current resolution that still covers an expected maximum. # Returns The current LSB in microamps.
public static extern uint pamoja_ina226_minimum_current_lsb_microamps(uint maxExpectedMicroamps)
Parameters
maxExpectedMicroampsuint
Returns
pamoja_ina226_new(nint, byte, PamojaIna226Settings, out nint)
Creates an INA226 driver on a bus.
public static PamojaStatus pamoja_ina226_new(nint bus, byte address, PamojaIna226Settings settings, out nint outSensor)
Parameters
busnintaddressbytesettingsPamojaIna226SettingsoutSensornint
Returns
pamoja_ina226_power_microwatts(ushort, uint)
Converts a raw INA226 power register to microwatts. # Returns The power. The power LSB is fixed at twenty-five times the current LSB.
public static extern uint pamoja_ina226_power_microwatts(ushort raw, uint currentLsbMicroamps)
Parameters
Returns
pamoja_ina226_power_register(uint, uint)
Builds the INA226 power register a monitor reports for a power. # Returns The register value, or zero if current_lsb_microamps is zero.
public static extern ushort pamoja_ina226_power_register(uint microwatts, uint currentLsbMicroamps)
Parameters
Returns
pamoja_ina226_power_register_from_current(short, ushort)
Computes the INA226 power register the chip derives from a current reading. # Returns The power register the part's own arithmetic produces.
public static extern ushort pamoja_ina226_power_register_from_current(short current, ushort bus)
Parameters
Returns
pamoja_ina226_power_watts(ushort, uint)
Converts a raw INA226 power register to watts. # Returns The power.
public static extern float pamoja_ina226_power_watts(ushort raw, uint currentLsbMicroamps)
Parameters
Returns
pamoja_ina226_set_alert(nint, PamojaIna226MaskEnable, ushort)
Programs the INA226's alert pin.
public static extern PamojaStatus pamoja_ina226_set_alert(nint sensor, PamojaIna226MaskEnable mask, ushort limit)
Parameters
sensornintmaskPamojaIna226MaskEnablelimitushort
Returns
pamoja_ina226_settings_default()
Returns the settings an INA226 driver starts with.
public static extern PamojaIna226Settings pamoja_ina226_settings_default()
Returns
pamoja_ina226_shunt_millivolts(short)
Converts a raw INA226 shunt-voltage register to millivolts. # Returns The shunt voltage.
public static extern float pamoja_ina226_shunt_millivolts(short raw)
Parameters
rawshort
Returns
pamoja_ina226_shunt_nanovolts(short)
Converts a raw INA226 shunt-voltage register to nanovolts. # Returns The shunt voltage, exact in integer arithmetic at 2.5 uV per count.
public static extern int pamoja_ina226_shunt_nanovolts(short raw)
Parameters
rawshort
Returns
pamoja_ina226_shunt_register(int)
Builds the INA226 shunt-voltage register a monitor reports for a shunt voltage. # Returns The signed register value, at 2.5 uV per count.
public static extern short pamoja_ina226_shunt_register(int nanovolts)
Parameters
nanovoltsint
Returns
pamoja_ina226_sim_part(byte)
Creates a simulated INA226 carrying its default load.
public static extern nint pamoja_ina226_sim_part(byte address)
Parameters
addressbyte
Returns
pamoja_ina226_sim_reporting(byte, uint, uint, uint, int)
Creates a simulated INA226 that reads what it is asked to.
public static extern nint pamoja_ina226_sim_reporting(byte address, uint shuntMilliohms, uint maxMicroamps, uint busMicrovolts, int microamps)
Parameters
Returns
pamoja_ina226_update_micros(PamojaIna226Config)
Returns how often an INA226 in a configuration updates its results. # Returns The interval in microseconds: every conversion the mode takes, averaged.
public static extern uint pamoja_ina226_update_micros(PamojaIna226Config config)
Parameters
configPamojaIna226Config
Returns
pamoja_kalman_estimate(nint)
Reads a Kalman filter's current estimate.
public static extern float pamoja_kalman_estimate(nint kalman)
Parameters
kalmannint
Returns
pamoja_kalman_free(nint)
Releases a Kalman handle. Passing null is a no-op.
public static extern void pamoja_kalman_free(nint kalman)
Parameters
kalmannint
pamoja_kalman_new(float, float, float)
Creates a one-dimensional Kalman filter.
public static extern nint pamoja_kalman_new(float processNoise, float measurementNoise, float initial)
Parameters
Returns
pamoja_kalman_update(nint, float)
Folds a reading into a Kalman filter and returns the estimate.
public static extern float pamoja_kalman_update(nint kalman, float reading)
Parameters
Returns
pamoja_keyexpr_canonize(string)
Rewrites a key expression into its canonical form.
public static nint pamoja_keyexpr_canonize(string key)
Parameters
keystring
Returns
pamoja_keyexpr_includes(string, string)
Reports whether one key expression selects every key another selects.
public static bool pamoja_keyexpr_includes(string a, string b)
Parameters
Returns
pamoja_keyexpr_intersects(string, string)
Reports whether two key expressions share at least one key.
public static bool pamoja_keyexpr_intersects(string a, string b)
Parameters
Returns
pamoja_keyexpr_is_canon(string)
Reports whether a key expression is already canonical.
public static bool pamoja_keyexpr_is_canon(string key)
Parameters
keystring
Returns
pamoja_keyexpr_is_valid(string)
Reports whether a key expression is well formed.
public static bool pamoja_keyexpr_is_valid(string key)
Parameters
keystring
Returns
pamoja_keyexpr_join(string, string)
Joins two key expressions with a slash and canonizes the result.
public static nint pamoja_keyexpr_join(string prefix, string suffix)
Parameters
Returns
pamoja_keyexpr_matches(string, string)
Reports whether a pattern selects a key.
public static bool pamoja_keyexpr_matches(string pattern, string key)
Parameters
Returns
pamoja_kit_deadband(float, float, float)
Holds a reading at a center while it stays within a band either side.
public static extern float pamoja_kit_deadband(float value, float center, float width)
Parameters
Returns
pamoja_ladder_buffered(nint, out nuint)
Reports how many messages a ladder has buffered.
public static PamojaStatus pamoja_ladder_buffered(nint ladder, out nuint outCount)
Parameters
Returns
pamoja_ladder_connect(nint)
Connects every rung of a ladder.
public static extern PamojaStatus pamoja_ladder_connect(nint ladder)
Parameters
laddernint
Returns
pamoja_ladder_flush(nint, out nuint)
Replays the buffer of a ladder over its rungs.
public static PamojaStatus pamoja_ladder_flush(nint ladder, out nuint outSent)
Parameters
Returns
pamoja_ladder_free(nint)
Releases a ladder handle.
public static extern void pamoja_ladder_free(nint ladder)
Parameters
laddernint
pamoja_ladder_new(nint)
Creates a ladder buffering into a store.
public static extern nint pamoja_ladder_new(nint store)
Parameters
storenint
Returns
pamoja_ladder_recv(nint, out nint)
Waits for the next message from any listening rung of a ladder.
public static PamojaStatus pamoja_ladder_recv(nint ladder, out nint outMessage)
Parameters
Returns
pamoja_ladder_recv_within(nint, ulong, out nint, out bool)
Waits a limited time for the next message from any listening rung of a ladder.
public static PamojaStatus pamoja_ladder_recv_within(nint ladder, ulong timeoutMs, out nint outMessage, out bool outTimedOut)
Parameters
Returns
pamoja_ladder_rung(nint, nint)
Adds a rung to a ladder.
public static extern PamojaStatus pamoja_ladder_rung(nint ladder, nint transport)
Parameters
Returns
pamoja_ladder_send(nint, nint, ReadOnlySpan<byte>, nuint, out PamojaDelivery)
Sends a payload through a ladder.
public static PamojaStatus pamoja_ladder_send(nint ladder, nint topic, ReadOnlySpan<byte> payload, nuint payloadLen, out PamojaDelivery outDelivery)
Parameters
ladderninttopicnintpayloadReadOnlySpan<byte>payloadLennuintoutDeliveryPamojaDelivery
Returns
pamoja_ladder_subscribe(nint, nint)
Subscribes every listening rung of a ladder to a topic.
public static extern PamojaStatus pamoja_ladder_subscribe(nint ladder, nint topic)
Parameters
Returns
pamoja_ladder_uplink(nint, nint)
Adds a rung that only sends to a ladder.
public static extern PamojaStatus pamoja_ladder_uplink(nint ladder, nint transport)
Parameters
Returns
pamoja_last_error_message()
Returns the calling thread's most recent error message, or null.
public static extern nint pamoja_last_error_message()
Returns
pamoja_last_error_set(nint)
Records the text attached to the status a host callback returns.
public static extern void pamoja_last_error_set(nint message)
Parameters
messagenint
pamoja_limits_apply(nint, PamojaTwist, float)
Bounds a command in speed and acceleration.
public static extern PamojaTwist pamoja_limits_apply(nint limits, PamojaTwist desired, float dt)
Parameters
limitsnintdesiredPamojaTwistdtfloat
Returns
pamoja_limits_free(nint)
Releases a limits handle. Passing null is a no-op.
public static extern void pamoja_limits_free(nint limits)
Parameters
limitsnint
pamoja_limits_new(float, float, float, float)
Creates limits on speed and acceleration, starting from rest.
public static extern nint pamoja_limits_new(float maxLinear, float maxAngular, float maxLinearAccel, float maxAngularAccel)
Parameters
Returns
pamoja_limits_reset(nint)
Forgets the motion limits last allowed.
public static extern void pamoja_limits_reset(nint limits)
Parameters
limitsnint
pamoja_link_cost_threshold(PamojaLinkCost)
Returns the level a link cost calls for.
public static extern PamojaTelemetryLevel pamoja_link_cost_threshold(PamojaLinkCost cost)
Parameters
costPamojaLinkCost
Returns
pamoja_loopback_broker_free(nint)
Releases a broker handle.
public static extern void pamoja_loopback_broker_free(nint broker)
Parameters
brokernint
pamoja_loopback_broker_is_reachable(nint)
Reports whether a broker is in reach.
public static bool pamoja_loopback_broker_is_reachable(nint broker)
Parameters
brokernint
Returns
pamoja_loopback_broker_new()
Creates an in-process broker.
public static extern nint pamoja_loopback_broker_new()
Returns
pamoja_loopback_broker_set_reachable(nint, bool)
Takes a broker out of reach, or brings it back.
public static PamojaStatus pamoja_loopback_broker_set_reachable(nint broker, bool reachable)
Parameters
Returns
pamoja_loopback_transport_connect(nint)
Marks a loopback link connected.
public static extern PamojaStatus pamoja_loopback_transport_connect(nint transport)
Parameters
transportnint
Returns
pamoja_loopback_transport_disconnect(nint)
Marks a loopback link disconnected.
public static extern void pamoja_loopback_transport_disconnect(nint transport)
Parameters
transportnint
pamoja_loopback_transport_free(nint)
Releases a loopback link handle.
public static extern void pamoja_loopback_transport_free(nint transport)
Parameters
transportnint
pamoja_loopback_transport_is_connected(nint)
Reports whether a loopback link is connected.
public static bool pamoja_loopback_transport_is_connected(nint transport)
Parameters
transportnint
Returns
pamoja_loopback_transport_new(nint)
Creates a link to a broker.
public static extern nint pamoja_loopback_transport_new(nint broker)
Parameters
brokernint
Returns
pamoja_loopback_transport_recv(nint, out nint)
Waits for the next message on a loopback link.
public static PamojaStatus pamoja_loopback_transport_recv(nint transport, out nint outMessage)
Parameters
Returns
pamoja_loopback_transport_recv_within(nint, ulong, out nint, out bool)
Waits a limited time for the next message on a loopback link.
public static PamojaStatus pamoja_loopback_transport_recv_within(nint transport, ulong timeoutMs, out nint outMessage, out bool outTimedOut)
Parameters
Returns
pamoja_loopback_transport_send(nint, nint, ReadOnlySpan<byte>, nuint)
Publishes a payload on a loopback link.
public static PamojaStatus pamoja_loopback_transport_send(nint transport, nint topic, ReadOnlySpan<byte> payload, nuint payloadLen)
Parameters
transportninttopicnintpayloadReadOnlySpan<byte>payloadLennuint
Returns
pamoja_loopback_transport_subscribe(nint, nint)
Subscribes a loopback link to a topic.
public static extern PamojaStatus pamoja_loopback_transport_subscribe(nint transport, nint topic)
Parameters
Returns
pamoja_lora_airtime_us(PamojaLoraLink, nuint)
Returns the time on air of a payload, in microseconds.
public static extern ulong pamoja_lora_airtime_us(PamojaLoraLink link, nuint payloadLen)
Parameters
linkPamojaLoraLinkpayloadLennuint
Returns
pamoja_lora_demodulator_snr_centi_db(byte)
Returns the SNR the LoRa demodulator needs, in hundredths of a dB.
public static extern int pamoja_lora_demodulator_snr_centi_db(byte spreadingFactor)
Parameters
spreadingFactorbyte
Returns
pamoja_lora_fcc_digital_max_conducted_centi_dbm(int)
Returns the 47 CFR 15.247 limit for digital modulation, in hundredths of a dBm.
public static extern int pamoja_lora_fcc_digital_max_conducted_centi_dbm(int antennaGainCentiDbi)
Parameters
antennaGainCentiDbiint
Returns
pamoja_lora_fcc_hopping_max_conducted_centi_dbm(ushort, int)
Returns the 47 CFR 15.247 limit for frequency hopping, in hundredths of a dBm, or MinValue for fewer than 25 channels.
public static extern int pamoja_lora_fcc_hopping_max_conducted_centi_dbm(ushort hoppingChannels, int antennaGainCentiDbi)
Parameters
Returns
pamoja_lora_free_space_loss_centi_db(uint, uint)
Returns the free-space basic transmission loss, in hundredths of a dB.
public static extern int pamoja_lora_free_space_loss_centi_db(uint distanceM, uint frequencyHz)
Parameters
Returns
pamoja_lora_fresnel_radius_mm(uint, uint, uint)
Returns the radius of the first Fresnel ellipsoid, in millimeters.
public static extern uint pamoja_lora_fresnel_radius_mm(uint nearM, uint farM, uint frequencyHz)
Parameters
Returns
pamoja_lora_link_budget_default()
Returns a LoRa link budget of 0 dBm between isotropic antennas.
public static extern PamojaLoraLinkBudget pamoja_lora_link_budget_default()
Returns
pamoja_lora_link_budget_eirp_centi_dbm(PamojaLoraLinkBudget)
Returns the EIRP of a link budget, in hundredths of a dBm.
public static extern int pamoja_lora_link_budget_eirp_centi_dbm(PamojaLoraLinkBudget budget)
Parameters
budgetPamojaLoraLinkBudget
Returns
pamoja_lora_link_budget_margin_centi_db(PamojaLoraLinkBudget, PamojaLoraLink, int)
Returns the margin a path leaves, in hundredths of a dB.
public static extern int pamoja_lora_link_budget_margin_centi_db(PamojaLoraLinkBudget budget, PamojaLoraLink link, int pathLossCentiDb)
Parameters
budgetPamojaLoraLinkBudgetlinkPamojaLoraLinkpathLossCentiDbint
Returns
pamoja_lora_link_budget_max_path_loss_centi_db(PamojaLoraLinkBudget, PamojaLoraLink)
Returns the most path loss a link survives, in hundredths of a dB.
public static extern int pamoja_lora_link_budget_max_path_loss_centi_db(PamojaLoraLinkBudget budget, PamojaLoraLink link)
Parameters
budgetPamojaLoraLinkBudgetlinkPamojaLoraLink
Returns
pamoja_lora_link_budget_max_transmit_power_centi_dbm(PamojaLoraLinkBudget, int)
Returns the most transmit power under an EIRP ceiling, in hundredths of a dBm.
public static extern int pamoja_lora_link_budget_max_transmit_power_centi_dbm(PamojaLoraLinkBudget budget, int eirpCeilingCentiDbm)
Parameters
budgetPamojaLoraLinkBudgeteirpCeilingCentiDbmint
Returns
pamoja_lora_link_budget_received_centi_dbm(PamojaLoraLinkBudget, int)
Returns the power that reaches the receiving radio, in hundredths of a dBm.
public static extern int pamoja_lora_link_budget_received_centi_dbm(PamojaLoraLinkBudget budget, int pathLossCentiDb)
Parameters
budgetPamojaLoraLinkBudgetpathLossCentiDbint
Returns
pamoja_lora_link_budget_sensitivity_centi_dbm(PamojaLoraLinkBudget, PamojaLoraLink)
Returns the sensitivity of a budget on a link, in hundredths of a dBm.
public static extern int pamoja_lora_link_budget_sensitivity_centi_dbm(PamojaLoraLinkBudget budget, PamojaLoraLink link)
Parameters
budgetPamojaLoraLinkBudgetlinkPamojaLoraLink
Returns
pamoja_lora_link_default(byte, uint)
Returns LoRa link settings with the LoRa defaults filled in.
public static extern PamojaLoraLink pamoja_lora_link_default(byte spreadingFactor, uint bandwidthHz)
Parameters
Returns
pamoja_lora_low_data_rate_optimization(PamojaLoraLink)
Reports whether a link uses low data rate optimization.
public static bool pamoja_lora_low_data_rate_optimization(PamojaLoraLink link)
Parameters
linkPamojaLoraLink
Returns
pamoja_lora_messages_per_hour(PamojaLoraLink, nuint, uint)
Returns how many transmissions of a payload fit in an hour under a limit.
public static extern ulong pamoja_lora_messages_per_hour(PamojaLoraLink link, nuint payloadLen, uint dutyCyclePermille)
Parameters
linkPamojaLoraLinkpayloadLennuintdutyCyclePermilleuint
Returns
pamoja_lora_min_off_time_us(PamojaLoraLink, nuint, uint)
Returns the silence a duty-cycle limit forces after a transmission.
public static extern ulong pamoja_lora_min_off_time_us(PamojaLoraLink link, nuint payloadLen, uint dutyCyclePermille)
Parameters
linkPamojaLoraLinkpayloadLennuintdutyCyclePermilleuint
Returns
pamoja_lora_noise_floor_centi_dbm(uint)
Returns the thermal noise power in a channel, in hundredths of a dBm.
public static extern int pamoja_lora_noise_floor_centi_dbm(uint bandwidthHz)
Parameters
bandwidthHzuint
Returns
pamoja_lora_plan_builder_add_relay_channel(nint, in PamojaLoraRelayChannel)
Appends the next default relay channel to a plan.
public static PamojaStatus pamoja_lora_plan_builder_add_relay_channel(nint builder, in PamojaLoraRelayChannel channel)
Parameters
buildernintchannelPamojaLoraRelayChannel
Returns
pamoja_lora_plan_builder_build(nint, out nint)
Finishes a plan, consuming the builder.
public static PamojaStatus pamoja_lora_plan_builder_build(nint builder, out nint outPlan)
Parameters
Returns
pamoja_lora_plan_builder_free(nint)
Releases a plan builder that will not be built.
public static extern void pamoja_lora_plan_builder_free(nint builder)
Parameters
buildernint
pamoja_lora_plan_builder_new(string, out nint)
Creates an empty plan builder.
public static PamojaStatus pamoja_lora_plan_builder_new(string name, out nint outBuilder)
Parameters
Returns
pamoja_lora_plan_builder_push_backoff(nint, byte, byte)
Appends the next entry in the adaptive back-off chain.
public static extern PamojaStatus pamoja_lora_plan_builder_push_backoff(nint builder, byte hasLower, byte dataRate)
Parameters
Returns
pamoja_lora_plan_builder_push_channel_block(nint, uint, in PamojaLoraChannelBlock)
Appends a run of evenly spaced channels to the plan.
public static PamojaStatus pamoja_lora_plan_builder_push_channel_block(nint builder, uint which, in PamojaLoraChannelBlock block)
Parameters
buildernintwhichuintblockPamojaLoraChannelBlock
Returns
pamoja_lora_plan_builder_push_data_rate(nint, uint, in PamojaLoraDataRate)
Appends a data rate to the end of a direction's table.
public static PamojaStatus pamoja_lora_plan_builder_push_data_rate(nint builder, uint direction, in PamojaLoraDataRate rate)
Parameters
buildernintdirectionuintratePamojaLoraDataRate
Returns
pamoja_lora_plan_builder_push_max_payload(nint, uint, byte, ushort, ushort)
Appends a payload limit to the end of one of the plan's tables.
public static extern PamojaStatus pamoja_lora_plan_builder_push_max_payload(nint builder, uint table, byte present, ushort macPayload, ushort application)
Parameters
Returns
pamoja_lora_plan_builder_push_rx1_row(nint, byte, ReadOnlySpan<byte>, nuint)
Appends one uplink data rate's row of RX1 downlink data rates.
public static PamojaStatus pamoja_lora_plan_builder_push_rx1_row(nint builder, byte dwellLimited, ReadOnlySpan<byte> offsets, nuint offsetsLen)
Parameters
buildernintdwellLimitedbyteoffsetsReadOnlySpan<byte>offsetsLennuint
Returns
pamoja_lora_plan_builder_push_sub_band(nint, in PamojaLoraSubBand)
Appends a sub-band and its transmit limits to the plan.
public static PamojaStatus pamoja_lora_plan_builder_push_sub_band(nint builder, in PamojaLoraSubBand band)
Parameters
buildernintbandPamojaLoraSubBand
Returns
pamoja_lora_plan_builder_set_beacon(nint, in PamojaLoraBeacon, byte)
Sets the plan's Class B beacon and whether it limits dwell time.
public static PamojaStatus pamoja_lora_plan_builder_set_beacon(nint builder, in PamojaLoraBeacon beacon, byte hasDwellTimeLimit)
Parameters
buildernintbeaconPamojaLoraBeaconhasDwellTimeLimitbyte
Returns
pamoja_lora_plan_builder_set_join_sequence(nint, byte)
Sets the order a device tries the join channels in.
public static extern PamojaStatus pamoja_lora_plan_builder_set_join_sequence(nint builder, byte sequence)
Parameters
Returns
pamoja_lora_plan_builder_set_kind(nint, byte, byte)
Sets whether the plan's network creates channels, and its channel list numbering.
public static extern PamojaStatus pamoja_lora_plan_builder_set_kind(nint builder, byte kind, byte channelList)
Parameters
Returns
pamoja_lora_plan_builder_set_mask_controls(nint, ReadOnlySpan<PamojaLoraMaskControl>, nuint)
Sets what each ChMaskCntl value does.
public static PamojaStatus pamoja_lora_plan_builder_set_mask_controls(nint builder, ReadOnlySpan<PamojaLoraMaskControl> controls, nuint len)
Parameters
buildernintcontrolsReadOnlySpan<PamojaLoraMaskControl>lennuint
Returns
pamoja_lora_plan_builder_set_power(nint, sbyte, byte, byte)
Sets the plan's transmit-power ladder.
public static extern PamojaStatus pamoja_lora_plan_builder_set_power(nint builder, sbyte defaultMaxEirpDbm, byte txPowerStepDb, byte maxTxPowerIndex)
Parameters
Returns
pamoja_lora_plan_builder_set_power_reference(nint, byte, byte)
Sets what the plan's transmit power indexes count down from.
public static extern PamojaStatus pamoja_lora_plan_builder_set_power_reference(nint builder, byte reference, byte gainAllowanceDb)
Parameters
Returns
pamoja_lora_plan_builder_set_rx(nint, uint, byte, byte)
Sets the plan's receive windows.
public static extern PamojaStatus pamoja_lora_plan_builder_set_rx(nint builder, uint rx2FrequencyHz, byte rx2DataRate, byte maxRx1DataRateOffset)
Parameters
Returns
pamoja_lora_plan_builder_set_tx_param_setup(nint, byte)
Sets whether devices on the plan answer TXParamSetupReq.
public static extern PamojaStatus pamoja_lora_plan_builder_set_tx_param_setup(nint builder, byte answered)
Parameters
Returns
pamoja_lora_plan_channel_block(nint, uint, ushort, out PamojaLoraChannelBlock)
Returns one of the plan's channel blocks.
public static PamojaStatus pamoja_lora_plan_channel_block(nint plan, uint which, ushort index, out PamojaLoraChannelBlock outBlock)
Parameters
plannintwhichuintindexushortoutBlockPamojaLoraChannelBlock
Returns
pamoja_lora_plan_channel_frequency_hz(nint, ushort, out uint)
Returns the center frequency of one of the plan's default channels.
public static PamojaStatus pamoja_lora_plan_channel_frequency_hz(nint plan, ushort channel, out uint outFrequencyHz)
Parameters
Returns
pamoja_lora_plan_data_rate(nint, uint, byte, out PamojaLoraDataRate)
Returns the data rate a number selects.
public static PamojaStatus pamoja_lora_plan_data_rate(nint plan, uint direction, byte dataRate, out PamojaLoraDataRate outRate)
Parameters
plannintdirectionuintdataRatebyteoutRatePamojaLoraDataRate
Returns
pamoja_lora_plan_downlink_channel_frequency_hz(nint, ushort, out uint)
Returns the frequency of one of the plan's numbered downlink channels.
public static PamojaStatus pamoja_lora_plan_downlink_channel_frequency_hz(nint plan, ushort channel, out uint outFrequencyHz)
Parameters
Returns
pamoja_lora_plan_duty_cycle_permille(nint, uint, out uint)
Returns the share of time a transmitter may hold a frequency.
public static PamojaStatus pamoja_lora_plan_duty_cycle_permille(nint plan, uint frequencyHz, out uint outPermille)
Parameters
Returns
pamoja_lora_plan_for_cn470(uint, out nint)
Returns one of the CN470-510 channel plans.
public static PamojaStatus pamoja_lora_plan_for_cn470(uint which, out nint outPlan)
Parameters
Returns
pamoja_lora_plan_for_region(uint, out nint)
Returns the published channel plan for a region.
public static PamojaStatus pamoja_lora_plan_for_region(uint region, out nint outPlan)
Parameters
Returns
pamoja_lora_plan_free(nint)
Releases a channel plan.
public static extern void pamoja_lora_plan_free(nint plan)
Parameters
plannint
pamoja_lora_plan_info(nint, out PamojaLoraPlanInfo)
Reads the scalar facts of a plan in one call.
public static PamojaStatus pamoja_lora_plan_info(nint plan, out PamojaLoraPlanInfo outInfo)
Parameters
plannintoutInfoPamojaLoraPlanInfo
Returns
pamoja_lora_plan_join_plan(nint, ushort, out PamojaLoraJoinPlan)
Returns one run of join channels that selects a plan.
public static PamojaStatus pamoja_lora_plan_join_plan(nint plan, ushort index, out PamojaLoraJoinPlan outJoinPlan)
Parameters
plannintindexushortoutJoinPlanPamojaLoraJoinPlan
Returns
pamoja_lora_plan_join_plan_for_channel(nint, ushort, out ushort, out ushort)
Finds the run of join channels a join channel belongs to.
public static PamojaStatus pamoja_lora_plan_join_plan_for_channel(nint plan, ushort joinChannel, out ushort outIndex, out ushort outOffset)
Parameters
Returns
pamoja_lora_plan_link_settings(nint, byte, out PamojaLoraLink)
Returns the radio settings an uplink data rate selects.
public static PamojaStatus pamoja_lora_plan_link_settings(nint plan, byte dataRate, out PamojaLoraLink outLink)
Parameters
plannintdataRatebyteoutLinkPamojaLoraLink
Returns
pamoja_lora_plan_mask_control(nint, byte, out PamojaLoraMaskControl)
Reads what one ChMaskCntl value does on a plan.
public static PamojaStatus pamoja_lora_plan_mask_control(nint plan, byte value, out PamojaLoraMaskControl outControl)
Parameters
plannintvaluebyteoutControlPamojaLoraMaskControl
Returns
pamoja_lora_plan_max_eirp_dbm(nint, uint, out sbyte)
Returns the power ceiling that applies at a frequency, in dBm EIRP.
public static PamojaStatus pamoja_lora_plan_max_eirp_dbm(nint plan, uint frequencyHz, out sbyte outDbm)
Parameters
Returns
pamoja_lora_plan_max_payload(nint, uint, byte, out PamojaLoraMaxPayload)
Returns what a data rate may carry in one frame.
public static PamojaStatus pamoja_lora_plan_max_payload(nint plan, uint table, byte dataRate, out PamojaLoraMaxPayload outPayload)
Parameters
planninttableuintdataRatebyteoutPayloadPamojaLoraMaxPayload
Returns
pamoja_lora_plan_name(nint)
Returns the plan's name as an owned string.
public static extern nint pamoja_lora_plan_name(nint plan)
Parameters
plannint
Returns
pamoja_lora_plan_next_backoff_data_rate(nint, byte, out byte)
Returns the next lower data rate for adaptive back-off.
public static PamojaStatus pamoja_lora_plan_next_backoff_data_rate(nint plan, byte dataRate, out byte outDataRate)
Parameters
Returns
pamoja_lora_plan_relay_channel(nint, byte, out PamojaLoraRelayChannel)
Returns one of a plan's default relay channels.
public static PamojaStatus pamoja_lora_plan_relay_channel(nint plan, byte index, out PamojaLoraRelayChannel outChannel)
Parameters
plannintindexbyteoutChannelPamojaLoraRelayChannel
Returns
pamoja_lora_plan_relay_channel_count(nint, out byte)
Counts a plan's default relay channels.
public static PamojaStatus pamoja_lora_plan_relay_channel_count(nint plan, out byte outCount)
Parameters
Returns
pamoja_lora_plan_rules(nint, out PamojaLoraPlanRules)
Reads how a plan defines and uses its channels.
public static PamojaStatus pamoja_lora_plan_rules(nint plan, out PamojaLoraPlanRules outRules)
Parameters
plannintoutRulesPamojaLoraPlanRules
Returns
pamoja_lora_plan_rx1_data_rate(nint, byte, byte, byte, out byte)
Returns the downlink data rate the first receive window listens at.
public static PamojaStatus pamoja_lora_plan_rx1_data_rate(nint plan, byte uplinkDataRate, byte offset, byte dwellLimited, out byte outDataRate)
Parameters
Returns
pamoja_lora_plan_rx1_frequency_hz(nint, ushort, uint, out uint)
Returns where the first receive window listens after an uplink.
public static PamojaStatus pamoja_lora_plan_rx1_frequency_hz(nint plan, ushort uplinkChannel, uint uplinkHz, out uint outFrequencyHz)
Parameters
Returns
pamoja_lora_plan_sub_band(nint, ushort, out PamojaLoraSubBand)
Returns one of the plan's sub-bands.
public static PamojaStatus pamoja_lora_plan_sub_band(nint plan, ushort index, out PamojaLoraSubBand outBand)
Parameters
plannintindexushortoutBandPamojaLoraSubBand
Returns
pamoja_lora_plan_tx_power_dbm(nint, byte, sbyte, out sbyte)
Returns the radiated power a transmit-power index selects, in dBm.
public static PamojaStatus pamoja_lora_plan_tx_power_dbm(nint plan, byte index, sbyte maxEirpDbm, out sbyte outDbm)
Parameters
Returns
pamoja_lora_radio_config_default(uint, PamojaLoraLink, sbyte)
Returns a configuration with a private sync word and standard IQ both ways.
public static extern PamojaLoraRadioConfig pamoja_lora_radio_config_default(uint frequencyHz, PamojaLoraLink link, sbyte outputDbm)
Parameters
frequencyHzuintlinkPamojaLoraLinkoutputDbmsbyte
Returns
pamoja_lora_radio_configure(nint, PamojaLoraRadioConfig)
Tunes a radio to a configuration.
public static extern PamojaStatus pamoja_lora_radio_configure(nint radio, PamojaLoraRadioConfig config)
Parameters
radionintconfigPamojaLoraRadioConfig
Returns
pamoja_lora_radio_detect(nint, byte, out bool)
Listens a few symbols for a LoRa preamble, as a relay's scan does.
public static PamojaStatus pamoja_lora_radio_detect(nint radio, byte symbols, out bool outDetected)
Parameters
Returns
pamoja_lora_radio_family(nint)
Returns the family of a radio's chip, or 255 for a null radio.
public static extern byte pamoja_lora_radio_family(nint radio)
Parameters
radionint
Returns
pamoja_lora_radio_free(nint)
Closes a radio's device files and releases it.
public static extern void pamoja_lora_radio_free(nint radio)
Parameters
radionint
pamoja_lora_radio_listen(nint)
Starts listening, frame after frame, until another call changes the mode.
public static extern PamojaStatus pamoja_lora_radio_listen(nint radio)
Parameters
radionint
Returns
pamoja_lora_radio_open_sx126x(string, uint, string, uint, uint, PamojaSx126xBoard, out nint)
Opens an SX1261, SX1262, SX1268, or LLCC68 module and resets it.
public static PamojaStatus pamoja_lora_radio_open_sx126x(string spi, uint spiHz, string gpioChip, uint busyLine, uint resetLine, PamojaSx126xBoard board, out nint outRadio)
Parameters
spistringspiHzuintgpioChipstringbusyLineuintresetLineuintboardPamojaSx126xBoardoutRadionint
Returns
pamoja_lora_radio_open_sx127x(string, uint, string, uint, bool, bool, out nint)
Opens an SX1276, SX1277, SX1278, or SX1279 module and resets it into LoRa mode.
public static PamojaStatus pamoja_lora_radio_open_sx127x(string spi, uint spiHz, string gpioChip, uint resetLine, bool paBoost, bool tcxo, out nint outRadio)
Parameters
Returns
pamoja_lora_radio_random(nint, out uint)
Draws a random number from the noise a radio's receiver hears.
public static PamojaStatus pamoja_lora_radio_random(nint radio, out uint outValue)
Parameters
Returns
pamoja_lora_radio_read_register(nint, ushort, out byte)
Reads one register of a radio's chip.
public static PamojaStatus pamoja_lora_radio_read_register(nint radio, ushort address, out byte outValue)
Parameters
Returns
pamoja_lora_radio_receive(nint, Span<byte>, nuint, ulong, out PamojaLoraRadioReception)
Listens for one frame for up to a timeout in microseconds.
public static PamojaStatus pamoja_lora_radio_receive(nint radio, Span<byte> buffer, nuint capacity, ulong timeoutUs, out PamojaLoraRadioReception outReception)
Parameters
Returns
pamoja_lora_radio_sleep(nint)
Puts a radio to sleep until the next call wakes it.
public static extern PamojaStatus pamoja_lora_radio_sleep(nint radio)
Parameters
radionint
Returns
pamoja_lora_radio_standby(nint)
Puts a radio in standby, which stops a transmission or a reception.
public static extern PamojaStatus pamoja_lora_radio_standby(nint radio)
Parameters
radionint
Returns
pamoja_lora_radio_take_frame(nint, Span<byte>, nuint, out PamojaLoraRadioReception)
Takes the frame a listening radio has received, if one has arrived.
public static PamojaStatus pamoja_lora_radio_take_frame(nint radio, Span<byte> buffer, nuint capacity, out PamojaLoraRadioReception outReception)
Parameters
radionintbufferSpan<byte>capacitynuintoutReceptionPamojaLoraRadioReception
Returns
pamoja_lora_radio_transmit(nint, ReadOnlySpan<byte>, nuint, out ulong)
Sends one frame and waits for it to leave.
public static PamojaStatus pamoja_lora_radio_transmit(nint radio, ReadOnlySpan<byte> payload, nuint len, out ulong outAirtimeUs)
Parameters
radionintpayloadReadOnlySpan<byte>lennuintoutAirtimeUsulong
Returns
pamoja_lora_radio_write_register(nint, ushort, byte)
Writes one register of a radio's chip.
public static extern PamojaStatus pamoja_lora_radio_write_register(nint radio, ushort address, byte value)
Parameters
Returns
pamoja_lora_region_is_available(uint)
Reports whether a region is compiled into this build.
public static extern byte pamoja_lora_region_is_available(uint region)
Parameters
regionuint
Returns
pamoja_lora_sim_chip_family(nint)
Returns the family of a simulated chip, or 255 for a null chip.
public static extern byte pamoja_lora_sim_chip_family(nint chip)
Parameters
chipnint
Returns
pamoja_lora_sim_chip_free(nint)
Releases a simulated chip.
public static extern void pamoja_lora_sim_chip_free(nint chip)
Parameters
chipnint
pamoja_lora_sim_chip_hear(nint, ReadOnlySpan<byte>, nuint, int, int)
Puts a frame on the air for a simulated chip to receive.
public static PamojaStatus pamoja_lora_sim_chip_hear(nint chip, ReadOnlySpan<byte> payload, nuint len, int rssiCentiDbm, int snrCentiDb)
Parameters
Returns
pamoja_lora_sim_chip_hear_corrupt(nint, int, int)
Puts a frame on the air whose CRC fails.
public static extern PamojaStatus pamoja_lora_sim_chip_hear_corrupt(nint chip, int rssiCentiDbm, int snrCentiDb)
Parameters
Returns
pamoja_lora_sim_chip_radio(nint, out nint)
Wires a radio to a simulated chip and resets it, as opening a module does.
public static PamojaStatus pamoja_lora_sim_chip_radio(nint chip, out nint outRadio)
Parameters
Returns
pamoja_lora_sim_chip_sent_count(nint)
Returns how many frames a simulated chip has put on the air.
public static extern nuint pamoja_lora_sim_chip_sent_count(nint chip)
Parameters
chipnint
Returns
pamoja_lora_sim_chip_sent_payload(nint, nuint)
Copies the payload of a frame a simulated chip sent, or null past the last.
public static extern nint pamoja_lora_sim_chip_sent_payload(nint chip, nuint index)
Parameters
Returns
pamoja_lora_sim_chip_sent_tuning(nint, nuint, out PamojaLoraTuning)
Reads what a simulated chip was tuned to when it sent a frame.
public static PamojaStatus pamoja_lora_sim_chip_sent_tuning(nint chip, nuint index, out PamojaLoraTuning outTuning)
Parameters
chipnintindexnuintoutTuningPamojaLoraTuning
Returns
pamoja_lora_sim_chip_sx126x(PamojaSx126xBoard, out nint)
Creates a simulated SX1261, SX1262, SX1268, or LLCC68, out of reset.
public static PamojaStatus pamoja_lora_sim_chip_sx126x(PamojaSx126xBoard board, out nint outChip)
Parameters
boardPamojaSx126xBoardoutChipnint
Returns
pamoja_lora_sim_chip_sx127x(bool, bool, out nint)
Creates a simulated SX1276, SX1277, SX1278, or SX1279, out of reset.
public static PamojaStatus pamoja_lora_sim_chip_sx127x(bool paBoost, bool tcxo, out nint outChip)
Parameters
Returns
pamoja_lora_sim_chip_tuning(nint, out PamojaLoraTuning)
Reads what a simulated chip is tuned to now.
public static PamojaStatus pamoja_lora_sim_chip_tuning(nint chip, out PamojaLoraTuning outTuning)
Parameters
chipnintoutTuningPamojaLoraTuning
Returns
pamoja_lora_sim_chip_waiting(nint)
Returns how many frames wait on the air for a simulated chip to receive.
public static extern nuint pamoja_lora_sim_chip_waiting(nint chip)
Parameters
chipnint
Returns
pamoja_lora_symbol_time_us(PamojaLoraLink)
Returns the duration of one symbol on a link, in microseconds.
public static extern ulong pamoja_lora_symbol_time_us(PamojaLoraLink link)
Parameters
linkPamojaLoraLink
Returns
pamoja_lorawan_backoff_counter(nint)
Returns how many uplinks have gone unanswered.
public static extern uint pamoja_lorawan_backoff_counter(nint backoff)
Parameters
backoffnint
Returns
pamoja_lorawan_backoff_downlink(nint)
Counts a Class A downlink, which resets the count.
public static extern PamojaStatus pamoja_lorawan_backoff_downlink(nint backoff)
Parameters
backoffnint
Returns
pamoja_lorawan_backoff_free(nint)
Releases a back-off handle. Passing null is a no-op.
public static extern void pamoja_lorawan_backoff_free(nint backoff)
Parameters
backoffnint
pamoja_lorawan_backoff_new(byte, uint, uint, out nint)
Starts a back-off count from zero.
public static PamojaStatus pamoja_lorawan_backoff_new(byte version, uint limit, uint delay, out nint outBackoff)
Parameters
Returns
pamoja_lorawan_backoff_uplink(nint, byte, out PamojaLorawanBackoffStep)
Counts one new uplink, and says what to do before sending it.
public static PamojaStatus pamoja_lorawan_backoff_uplink(nint backoff, byte defaultDataRate, out PamojaLorawanBackoffStep outStep)
Parameters
backoffnintdefaultDataRatebyteoutStepPamojaLorawanBackoffStep
Returns
pamoja_lorawan_backoff_version(nint)
Returns the revision whose steps a count follows.
public static extern byte pamoja_lorawan_backoff_version(nint backoff)
Parameters
backoffnint
Returns
pamoja_lorawan_block_mic_finish(nint, Span<byte>)
Finishes the code, writing the four bytes a session setup carries.
public static PamojaStatus pamoja_lorawan_block_mic_finish(nint mic, Span<byte> outMic)
Parameters
Returns
pamoja_lorawan_block_mic_free(nint)
Releases a code that was never finished.
public static extern void pamoja_lorawan_block_mic_free(nint mic)
Parameters
micnint
pamoja_lorawan_block_mic_start(ReadOnlySpan<byte>, ushort, byte, ReadOnlySpan<byte>, uint, out nint)
Starts a code over one session's block.
public static PamojaStatus pamoja_lorawan_block_mic_start(ReadOnlySpan<byte> dataBlockIntKey, ushort sessionCnt, byte fragIndex, ReadOnlySpan<byte> descriptor, uint blockLen, out nint outMic)
Parameters
dataBlockIntKeyReadOnlySpan<byte>sessionCntushortfragIndexbytedescriptorReadOnlySpan<byte>blockLenuintoutMicnint
Returns
pamoja_lorawan_block_mic_update(nint, ReadOnlySpan<byte>, nuint)
Adds a piece of the block, in order, without any padding.
public static PamojaStatus pamoja_lorawan_block_mic_update(nint mic, ReadOnlySpan<byte> data, nuint dataLen)
Parameters
micnintdataReadOnlySpan<byte>dataLennuint
Returns
pamoja_lorawan_cflist_channel_masks(ReadOnlySpan<byte>, nuint, Span<ushort>, nuint)
Reads the mask groups out of a type 1 channel list.
public static PamojaStatus pamoja_lorawan_cflist_channel_masks(ReadOnlySpan<byte> cflist, nuint cflistLen, Span<ushort> outMasks, nuint len)
Parameters
Returns
pamoja_lorawan_cflist_enables(ReadOnlySpan<byte>, nuint, byte, out byte)
Reports whether a type 1 channel list enables a channel.
public static PamojaStatus pamoja_lorawan_cflist_enables(ReadOnlySpan<byte> cflist, nuint cflistLen, byte channel, out byte outEnabled)
Parameters
cflistReadOnlySpan<byte>cflistLennuintchannelbyteoutEnabledbyte
Returns
pamoja_lorawan_cflist_frequencies(ReadOnlySpan<byte>, nuint, Span<uint>, nuint)
Reads the frequencies out of a type 0 channel list.
public static PamojaStatus pamoja_lorawan_cflist_frequencies(ReadOnlySpan<byte> cflist, nuint cflistLen, Span<uint> outFrequenciesHz, nuint len)
Parameters
Returns
pamoja_lorawan_cflist_from_channel_masks(ReadOnlySpan<ushort>, nuint, Span<byte>)
Builds a type 1 channel list from channel mask groups.
public static PamojaStatus pamoja_lorawan_cflist_from_channel_masks(ReadOnlySpan<ushort> masks, nuint len, Span<byte> outCflist)
Parameters
masksReadOnlySpan<ushort>lennuintoutCflistSpan<byte>
Returns
pamoja_lorawan_cflist_from_frequencies(ReadOnlySpan<uint>, nuint, Span<byte>)
Builds a type 0 channel list from frequencies.
public static PamojaStatus pamoja_lorawan_cflist_from_frequencies(ReadOnlySpan<uint> frequenciesHz, nuint len, Span<byte> outCflist)
Parameters
frequenciesHzReadOnlySpan<uint>lennuintoutCflistSpan<byte>
Returns
pamoja_lorawan_cflist_type(ReadOnlySpan<byte>, nuint, out byte)
Reads which form a channel list takes.
public static PamojaStatus pamoja_lorawan_cflist_type(ReadOnlySpan<byte> cflist, nuint cflistLen, out byte outType)
Parameters
cflistReadOnlySpan<byte>cflistLennuintoutTypebyte
Returns
pamoja_lorawan_clock_sync_answer(nint, uint, Span<byte>, nuint, out nuint)
Writes the answer the device owes, if it owes one.
public static PamojaStatus pamoja_lorawan_clock_sync_answer(nint sync, uint deviceTime, Span<byte> outCommand, nuint capacity, out nuint outLen)
Parameters
Returns
pamoja_lorawan_clock_sync_free(nint)
Releases a clock synchronization package.
public static extern void pamoja_lorawan_clock_sync_free(nint sync)
Parameters
syncnint
pamoja_lorawan_clock_sync_heard(nint, ReadOnlySpan<byte>, nuint, out int, out byte, out byte, out byte, out byte)
Reads a downlink on the clock port and acts on it.
public static PamojaStatus pamoja_lorawan_clock_sync_heard(nint sync, ReadOnlySpan<byte> payload, nuint payloadLen, out int outCorrection, out byte outHasCorrection, out byte outMore, out byte outResync, out byte outAnswerDue)
Parameters
syncnintpayloadReadOnlySpan<byte>payloadLennuintoutCorrectionintoutHasCorrectionbyteoutMorebyteoutResyncbyteoutAnswerDuebyte
Returns
pamoja_lorawan_clock_sync_new(byte, out nint)
Starts the clock synchronization package on a device.
public static PamojaStatus pamoja_lorawan_clock_sync_new(byte selfManaged, out nint outSync)
Parameters
Returns
pamoja_lorawan_clock_sync_request(nint, uint, byte, Span<byte>, nuint, out nuint)
Builds the request that asks a server for a correction.
public static PamojaStatus pamoja_lorawan_clock_sync_request(nint sync, uint deviceTime, byte ansRequired, Span<byte> outCommand, nuint capacity, out nuint outLen)
Parameters
Returns
pamoja_lorawan_clock_sync_status(nint, out byte, out uint, out byte)
Reports the token, the period, and whether an answer is owed.
public static PamojaStatus pamoja_lorawan_clock_sync_status(nint sync, out byte outToken, out uint outPeriodS, out byte outAnswerDue)
Parameters
Returns
pamoja_lorawan_data_block_int_key(ReadOnlySpan<byte>, Span<byte>)
Derives the key that signs a data block.
public static PamojaStatus pamoja_lorawan_data_block_int_key(ReadOnlySpan<byte> rootKey, Span<byte> outKey)
Parameters
rootKeyReadOnlySpan<byte>outKeySpan<byte>
Returns
pamoja_lorawan_defrag_block(nint, Span<byte>, nuint, out nuint)
Copies out the block as far as it has been put back together.
public static PamojaStatus pamoja_lorawan_defrag_block(nint session, Span<byte> outBlock, nuint capacity, out nuint outLen)
Parameters
Returns
pamoja_lorawan_defrag_fragment(nint, ushort, ReadOnlySpan<byte>, nuint, out byte)
Takes one fragment of a session, counting from one.
public static PamojaStatus pamoja_lorawan_defrag_fragment(nint session, ushort n, ReadOnlySpan<byte> fragment, nuint fragmentLen, out byte outDone)
Parameters
Returns
pamoja_lorawan_defrag_free(nint)
Releases a session.
public static extern void pamoja_lorawan_defrag_free(nint session)
Parameters
sessionnint
pamoja_lorawan_defrag_matrix_len(ushort, ushort)
The working memory a session of this shape takes, in bytes.
public static extern nuint pamoja_lorawan_defrag_matrix_len(ushort nbFrag, ushort maxLost)
Parameters
Returns
pamoja_lorawan_defrag_new(ushort, byte, ushort, out nint)
Opens a session for a block being put back together.
public static PamojaStatus pamoja_lorawan_defrag_new(ushort nbFrag, byte fragSize, ushort maxLost, out nint outSession)
Parameters
Returns
pamoja_lorawan_defrag_status(nint, out ushort, out ushort, out byte)
Says how far along a session is.
public static PamojaStatus pamoja_lorawan_defrag_status(nint session, out ushort outReceived, out ushort outMissing, out byte outDone)
Parameters
Returns
pamoja_lorawan_device_accept_join(nint, ReadOnlySpan<byte>, nuint, ushort, out nint)
Turns the join accept a network sent into the settings it grants.
public static PamojaStatus pamoja_lorawan_device_accept_join(nint device, ReadOnlySpan<byte> bytes, nuint bytesLen, ushort devNonce, out nint outAccept)
Parameters
Returns
pamoja_lorawan_device_dev_eui(nint, Span<byte>)
Copies the device EUI a device was created with.
public static bool pamoja_lorawan_device_dev_eui(nint device, Span<byte> outDevEui)
Parameters
Returns
pamoja_lorawan_device_free(nint)
Releases a device handle. Passing null is a no-op.
public static extern void pamoja_lorawan_device_free(nint device)
Parameters
devicenint
pamoja_lorawan_device_join_request(nint, ushort, out nint)
Builds the join request a device broadcasts to activate.
public static PamojaStatus pamoja_lorawan_device_join_request(nint device, ushort devNonce, out nint outFrame)
Parameters
Returns
pamoja_lorawan_device_new(ReadOnlySpan<byte>, nuint, ReadOnlySpan<byte>, nuint, ReadOnlySpan<byte>, nuint, out nint)
Creates a device from the root credentials activation uses.
public static PamojaStatus pamoja_lorawan_device_new(ReadOnlySpan<byte> devEui, nuint devEuiLen, ReadOnlySpan<byte> appEui, nuint appEuiLen, ReadOnlySpan<byte> appKey, nuint appKeyLen, out nint outDevice)
Parameters
devEuiReadOnlySpan<byte>devEuiLennuintappEuiReadOnlySpan<byte>appEuiLennuintappKeyReadOnlySpan<byte>appKeyLennuintoutDevicenint
Returns
pamoja_lorawan_device_settings(sbyte, sbyte, out PamojaLorawanDeviceSettings)
Fills in the settings of a typical node with a radio's output power range.
public static PamojaStatus pamoja_lorawan_device_settings(sbyte minOutputDbm, sbyte maxOutputDbm, out PamojaLorawanDeviceSettings outSettings)
Parameters
minOutputDbmsbytemaxOutputDbmsbyteoutSettingsPamojaLorawanDeviceSettings
Returns
pamoja_lorawan_end_device_channel(nint, ushort, out ushort, out PamojaLorawanChannel)
Reads one of the channels a device may send on.
public static PamojaStatus pamoja_lorawan_end_device_channel(nint device, ushort position, out ushort outIndex, out PamojaLorawanChannel outChannel)
Parameters
devicenintpositionushortoutIndexushortoutChannelPamojaLorawanChannel
Returns
pamoja_lorawan_end_device_error(nint, out PamojaLorawanDeviceError)
Reads why a device's last call failed.
public static PamojaStatus pamoja_lorawan_end_device_error(nint device, out PamojaLorawanDeviceError outError)
Parameters
devicenintoutErrorPamojaLorawanDeviceError
Returns
pamoja_lorawan_end_device_free(nint)
Releases a device handle. Passing null is a no-op.
public static extern void pamoja_lorawan_end_device_free(nint device)
Parameters
devicenint
pamoja_lorawan_end_device_heard(nint, ReadOnlySpan<byte>, nuint, sbyte, out PamojaLorawanHeard, out nint)
Reads a frame heard in a receive window.
public static PamojaStatus pamoja_lorawan_end_device_heard(nint device, ReadOnlySpan<byte> frame, nuint frameLen, sbyte snrDb, out PamojaLorawanHeard outHeard, out nint outPayload)
Parameters
devicenintframeReadOnlySpan<byte>frameLennuintsnrDbsbyteoutHeardPamojaLorawanHeardoutPayloadnint
Returns
pamoja_lorawan_end_device_heard_in(nint, byte, ReadOnlySpan<byte>, nuint, sbyte, out PamojaLorawanHeard, out nint)
Reads a frame heard in a given receive window.
public static PamojaStatus pamoja_lorawan_end_device_heard_in(nint device, byte window, ReadOnlySpan<byte> frame, nuint frameLen, sbyte snrDb, out PamojaLorawanHeard outHeard, out nint outPayload)
Parameters
devicenintwindowbyteframeReadOnlySpan<byte>frameLennuintsnrDbsbyteoutHeardPamojaLorawanHeardoutPayloadnint
Returns
pamoja_lorawan_end_device_heard_wor_ack(nint, ReadOnlySpan<byte>, nuint, out PamojaLorawanRelayStatus)
Reads the acknowledgment a relay answered the last WOR frame with.
public static PamojaStatus pamoja_lorawan_end_device_heard_wor_ack(nint device, ReadOnlySpan<byte> frame, nuint frameLen, out PamojaLorawanRelayStatus outStatus)
Parameters
devicenintframeReadOnlySpan<byte>frameLennuintoutStatusPamojaLorawanRelayStatus
Returns
pamoja_lorawan_end_device_join(nint, ushort, ulong, out nint, out PamojaLorawanTransmission)
Builds a join request.
public static PamojaStatus pamoja_lorawan_end_device_join(nint device, ushort devNonce, ulong nowUs, out nint outFrame, out PamojaLorawanTransmission outTransmission)
Parameters
devicenintdevNonceushortnowUsulongoutFramenintoutTransmissionPamojaLorawanTransmission
Returns
pamoja_lorawan_end_device_new(nint, nint, in PamojaLorawanDeviceSettings, uint, byte, uint, out nint)
Makes a device that joins over the air.
public static PamojaStatus pamoja_lorawan_end_device_new(nint plan, nint credentials, in PamojaLorawanDeviceSettings settings, uint fcntUp, byte hasFcntDown, uint fcntDown, out nint outDevice)
Parameters
plannintcredentialsnintsettingsPamojaLorawanDeviceSettingsfcntUpuinthasFcntDownbytefcntDownuintoutDevicenint
Returns
pamoja_lorawan_end_device_no_wor_ack(nint, ulong, out byte, out PamojaLorawanRelayExchange)
Says what to do once the acknowledgment window closed empty.
public static PamojaStatus pamoja_lorawan_end_device_no_wor_ack(nint device, ulong nowUs, out byte outNext, out PamojaLorawanRelayExchange outExchange)
Parameters
devicenintnowUsulongoutNextbyteoutExchangePamojaLorawanRelayExchange
Returns
pamoja_lorawan_end_device_nothing_heard(nint, ulong, out PamojaLorawanNext)
Says what comes next once both receive windows closed empty.
public static PamojaStatus pamoja_lorawan_end_device_nothing_heard(nint device, ulong nowUs, out PamojaLorawanNext outNext)
Parameters
devicenintnowUsulongoutNextPamojaLorawanNext
Returns
pamoja_lorawan_end_device_personalized(nint, nint, in PamojaLorawanDeviceSettings, uint, byte, uint, out nint)
Makes a device activated by personalization.
public static PamojaStatus pamoja_lorawan_end_device_personalized(nint plan, nint session, in PamojaLorawanDeviceSettings settings, uint fcntUp, byte hasFcntDown, uint fcntDown, out nint outDevice)
Parameters
plannintsessionnintsettingsPamojaLorawanDeviceSettingsfcntUpuinthasFcntDownbytefcntDownuintoutDevicenint
Returns
pamoja_lorawan_end_device_relay_mode(nint, out byte, out byte, out byte, out uint)
Reports how a device uses a relay.
public static PamojaStatus pamoja_lorawan_end_device_relay_mode(nint device, out byte outRelaying, out byte outActivation, out byte outSync, out uint outWorCounter)
Parameters
Returns
pamoja_lorawan_end_device_relay_status(nint, out PamojaLorawanRelayStatus)
Returns what the relay's last acknowledgment said about itself.
public static PamojaStatus pamoja_lorawan_end_device_relay_status(nint device, out PamojaLorawanRelayStatus outStatus)
Parameters
devicenintoutStatusPamojaLorawanRelayStatus
Returns
pamoja_lorawan_end_device_repeat(nint, ulong, out nint, out PamojaLorawanTransmission)
Sends the last uplink again.
public static PamojaStatus pamoja_lorawan_end_device_repeat(nint device, ulong nowUs, out nint outFrame, out PamojaLorawanTransmission outTransmission)
Parameters
devicenintnowUsulongoutFramenintoutTransmissionPamojaLorawanTransmission
Returns
pamoja_lorawan_end_device_request_device_time(nint)
Asks the network, with the next uplink, for the time.
public static extern PamojaStatus pamoja_lorawan_end_device_request_device_time(nint device)
Parameters
devicenint
Returns
pamoja_lorawan_end_device_request_link_check(nint)
Asks the network, with the next uplink, how well it hears the device.
public static extern PamojaStatus pamoja_lorawan_end_device_request_link_check(nint device)
Parameters
devicenint
Returns
pamoja_lorawan_end_device_resume(nint, ReadOnlySpan<byte>, nuint, ulong)
Puts a saved state back on a device.
public static PamojaStatus pamoja_lorawan_end_device_resume(nint device, ReadOnlySpan<byte> saved, nuint savedLen, ulong nowUs)
Parameters
devicenintsavedReadOnlySpan<byte>savedLennuintnowUsulong
Returns
pamoja_lorawan_end_device_save(nint, ulong, Span<byte>, nuint)
Saves a joined device's state.
public static PamojaStatus pamoja_lorawan_end_device_save(nint device, ulong nowUs, Span<byte> outSaved, nuint len)
Parameters
Returns
pamoja_lorawan_end_device_send(nint, byte, ReadOnlySpan<byte>, nuint, byte, ulong, out nint, out PamojaLorawanTransmission)
Builds an uplink carrying a payload.
public static PamojaStatus pamoja_lorawan_end_device_send(nint device, byte port, ReadOnlySpan<byte> payload, nuint payloadLen, byte confirmed, ulong nowUs, out nint outFrame, out PamojaLorawanTransmission outTransmission)
Parameters
devicenintportbytepayloadReadOnlySpan<byte>payloadLennuintconfirmedbytenowUsulongoutFramenintoutTransmissionPamojaLorawanTransmission
Returns
pamoja_lorawan_end_device_send_empty(nint, ulong, out nint, out PamojaLorawanTransmission)
Builds an uplink with no payload.
public static PamojaStatus pamoja_lorawan_end_device_send_empty(nint device, ulong nowUs, out nint outFrame, out PamojaLorawanTransmission outTransmission)
Parameters
devicenintnowUsulongoutFramenintoutTransmissionPamojaLorawanTransmission
Returns
pamoja_lorawan_end_device_set_battery(nint, byte, byte)
Sets what the device reports its battery as.
public static extern PamojaStatus pamoja_lorawan_end_device_set_battery(nint device, byte kind, byte level)
Parameters
Returns
pamoja_lorawan_end_device_status(nint, out PamojaLorawanEndDeviceStatus)
Reads where a device stands.
public static PamojaStatus pamoja_lorawan_end_device_status(nint device, out PamojaLorawanEndDeviceStatus outStatus)
Parameters
devicenintoutStatusPamojaLorawanEndDeviceStatus
Returns
pamoja_lorawan_end_device_use_relay(nint, byte, out byte)
Turns an end device's relay mode on or off.
public static PamojaStatus pamoja_lorawan_end_device_use_relay(nint device, byte on, out byte outTaken)
Parameters
Returns
pamoja_lorawan_firmware_free(nint)
Releases a firmware manager.
public static extern void pamoja_lorawan_firmware_free(nint manager)
Parameters
managernint
pamoja_lorawan_firmware_heard(nint, ReadOnlySpan<byte>, nuint, uint, byte, Span<byte>, nuint, out nuint)
Reads a downlink on the firmware port and writes the answers.
public static PamojaStatus pamoja_lorawan_firmware_heard(nint manager, ReadOnlySpan<byte> payload, nuint payloadLen, uint nowS, byte hasNow, Span<byte> outAnswers, nuint capacity, out nuint outLen)
Parameters
managernintpayloadReadOnlySpan<byte>payloadLennuintnowSuinthasNowbyteoutAnswersSpan<byte>capacitynuintoutLennuint
Returns
pamoja_lorawan_firmware_image(nint, out byte, out uint, out byte)
Reads back what the device is holding.
public static PamojaStatus pamoja_lorawan_firmware_image(nint manager, out byte outStatus, out uint outNextVersion, out byte outHasNextVersion)
Parameters
Returns
pamoja_lorawan_firmware_new(uint, uint, out nint)
Starts the firmware management package on a device.
public static PamojaStatus pamoja_lorawan_firmware_new(uint firmware, uint hardware, out nint outManager)
Parameters
Returns
pamoja_lorawan_firmware_reboot(nint, out uint, out byte, out uint, out byte, out byte)
Reports the one reboot the device keeps.
public static PamojaStatus pamoja_lorawan_firmware_reboot(nint manager, out uint outAtS, out byte outHasAt, out uint outInS, out byte outHasIn, out byte outNow)
Parameters
Returns
pamoja_lorawan_firmware_rebooted(nint)
Forgets the programmed reboot, for a device that carried it out.
public static extern PamojaStatus pamoja_lorawan_firmware_rebooted(nint manager)
Parameters
managernint
Returns
pamoja_lorawan_firmware_set_image(nint, byte, uint)
Says what firmware upgrade image the device is holding.
public static extern PamojaStatus pamoja_lorawan_firmware_set_image(nint manager, byte status, uint version)
Parameters
Returns
pamoja_lorawan_frag_fragment(ReadOnlySpan<byte>, nuint, byte, ushort, Span<byte>, nuint)
Builds one fragment of a session out of a block held whole.
public static PamojaStatus pamoja_lorawan_frag_fragment(ReadOnlySpan<byte> block, nuint blockLen, byte fragSize, ushort n, Span<byte> outFragment, nuint outLen)
Parameters
Returns
pamoja_lorawan_frag_parity_line(ushort, ushort, Span<byte>, nuint, out nuint)
Writes the bitmap of the fragments one coded fragment is made of.
public static PamojaStatus pamoja_lorawan_frag_parity_line(ushort coded, ushort nbFrag, Span<byte> outLine, nuint lineLen, out nuint outOnes)
Parameters
Returns
pamoja_lorawan_frag_prbs23(uint)
Steps the pseudo-random sequence the parity matrix is drawn from.
public static extern uint pamoja_lorawan_frag_prbs23(uint x)
Parameters
xuint
Returns
pamoja_lorawan_frag_session(nuint, byte, out ushort, out byte)
Says how many fragments a block takes and how much padding it needs.
public static PamojaStatus pamoja_lorawan_frag_session(nuint blockLen, byte fragSize, out ushort outNbFrag, out byte outPadding)
Parameters
Returns
pamoja_lorawan_grant_accept(PamojaLorawanGrant, ReadOnlySpan<byte>, nuint, ReadOnlySpan<byte>, nuint, ushort, out nint)
Builds the signed join-accept a network sends to admit a device.
public static PamojaStatus pamoja_lorawan_grant_accept(PamojaLorawanGrant grant, ReadOnlySpan<byte> cflist, nuint cflistLen, ReadOnlySpan<byte> appKey, nuint appKeyLen, ushort devNonce, out nint outFrame)
Parameters
grantPamojaLorawanGrantcflistReadOnlySpan<byte>cflistLennuintappKeyReadOnlySpan<byte>appKeyLennuintdevNonceushortoutFramenint
Returns
pamoja_lorawan_grant_session(PamojaLorawanGrant, ReadOnlySpan<byte>, nuint, ReadOnlySpan<byte>, nuint, ushort, out nint)
Derives the session a grant activates.
public static PamojaStatus pamoja_lorawan_grant_session(PamojaLorawanGrant grant, ReadOnlySpan<byte> cflist, nuint cflistLen, ReadOnlySpan<byte> appKey, nuint appKeyLen, ushort devNonce, out nint outSession)
Parameters
grantPamojaLorawanGrantcflistReadOnlySpan<byte>cflistLennuintappKeyReadOnlySpan<byte>appKeyLennuintdevNonceushortoutSessionnint
Returns
pamoja_lorawan_header_parse(ReadOnlySpan<byte>, nuint, out PamojaLorawanHeader)
Reads a frame far enough to route it, without any key.
public static PamojaStatus pamoja_lorawan_header_parse(ReadOnlySpan<byte> bytes, nuint bytesLen, out PamojaLorawanHeader outHeader)
Parameters
bytesReadOnlySpan<byte>bytesLennuintoutHeaderPamojaLorawanHeader
Returns
pamoja_lorawan_join_accept_cflist(nint, Span<byte>)
Copies the channel list a join accept carried.
public static bool pamoja_lorawan_join_accept_cflist(nint accept, Span<byte> outCflist)
Parameters
Returns
pamoja_lorawan_join_accept_dev_addr(nint)
Returns the device address a join grants.
public static extern uint pamoja_lorawan_join_accept_dev_addr(nint accept)
Parameters
acceptnint
Returns
pamoja_lorawan_join_accept_dl_settings(nint)
Returns the downlink settings byte a join grants.
public static extern byte pamoja_lorawan_join_accept_dl_settings(nint accept)
Parameters
acceptnint
Returns
pamoja_lorawan_join_accept_free(nint)
Releases an accepted join handle. Passing null is a no-op.
public static extern void pamoja_lorawan_join_accept_free(nint accept)
Parameters
acceptnint
pamoja_lorawan_join_accept_net_id(nint)
Returns the identifier of the network that accepted a join.
public static extern uint pamoja_lorawan_join_accept_net_id(nint accept)
Parameters
acceptnint
Returns
pamoja_lorawan_join_accept_receive_delay_us(nint)
Returns the delay to the first receive window, in microseconds.
public static extern uint pamoja_lorawan_join_accept_receive_delay_us(nint accept)
Parameters
acceptnint
Returns
pamoja_lorawan_join_accept_rx1_dr_offset(nint)
Returns how far below the uplink's data rate the first window listens.
public static extern byte pamoja_lorawan_join_accept_rx1_dr_offset(nint accept)
Parameters
acceptnint
Returns
pamoja_lorawan_join_accept_rx2_data_rate(nint)
Returns the data rate the second receive window listens at.
public static extern byte pamoja_lorawan_join_accept_rx2_data_rate(nint accept)
Parameters
acceptnint
Returns
pamoja_lorawan_join_accept_rx_delay(nint)
Returns the delay before the first receive window, in seconds.
public static extern byte pamoja_lorawan_join_accept_rx_delay(nint accept)
Parameters
acceptnint
Returns
pamoja_lorawan_join_accept_session(nint, out nint)
Takes the activated session a join grants.
public static PamojaStatus pamoja_lorawan_join_accept_session(nint accept, out nint outSession)
Parameters
Returns
pamoja_lorawan_join_request_app_eui(nint, Span<byte>)
Copies the application identifier out of a verified join-request.
public static bool pamoja_lorawan_join_request_app_eui(nint request, Span<byte> outAppEui)
Parameters
Returns
pamoja_lorawan_join_request_dev_eui(nint, Span<byte>)
Copies the device identifier out of a verified join-request.
public static bool pamoja_lorawan_join_request_dev_eui(nint request, Span<byte> outDevEui)
Parameters
Returns
pamoja_lorawan_join_request_dev_nonce(nint)
Returns the nonce a verified join-request carried.
public static extern ushort pamoja_lorawan_join_request_dev_nonce(nint request)
Parameters
requestnint
Returns
pamoja_lorawan_join_request_free(nint)
Releases a verified join-request handle. Passing null is a no-op.
public static extern void pamoja_lorawan_join_request_free(nint request)
Parameters
requestnint
pamoja_lorawan_join_request_parse(ReadOnlySpan<byte>, nuint, ReadOnlySpan<byte>, nuint, out nint)
Verifies a join-request and reads the identifiers out of it.
public static PamojaStatus pamoja_lorawan_join_request_parse(ReadOnlySpan<byte> bytes, nuint bytesLen, ReadOnlySpan<byte> appKey, nuint appKeyLen, out nint outRequest)
Parameters
bytesReadOnlySpan<byte>bytesLennuintappKeyReadOnlySpan<byte>appKeyLennuintoutRequestnint
Returns
pamoja_lorawan_mac_at(PamojaLorawanDirection, ReadOnlySpan<byte>, nuint, nuint, out PamojaLorawanMacCommand)
Reads one of the commands packed into a frame options field.
public static PamojaStatus pamoja_lorawan_mac_at(PamojaLorawanDirection direction, ReadOnlySpan<byte> bytes, nuint len, nuint index, out PamojaLorawanMacCommand outCommand)
Parameters
directionPamojaLorawanDirectionbytesReadOnlySpan<byte>lennuintindexnuintoutCommandPamojaLorawanMacCommand
Returns
pamoja_lorawan_mac_count(PamojaLorawanDirection, ReadOnlySpan<byte>, nuint, out nuint)
Counts the commands packed into a frame options field.
public static PamojaStatus pamoja_lorawan_mac_count(PamojaLorawanDirection direction, ReadOnlySpan<byte> bytes, nuint len, out nuint outCount)
Parameters
directionPamojaLorawanDirectionbytesReadOnlySpan<byte>lennuintoutCountnuint
Returns
pamoja_lorawan_mac_encode(ref PamojaLorawanMacCommand, Span<byte>, nuint, out nuint)
Writes one command out.
public static PamojaStatus pamoja_lorawan_mac_encode(ref PamojaLorawanMacCommand command, Span<byte> outBytes, nuint capacity, out nuint outWritten)
Parameters
commandPamojaLorawanMacCommandoutBytesSpan<byte>capacitynuintoutWrittennuint
Returns
pamoja_lorawan_mc_app_s_key(ReadOnlySpan<byte>, uint, Span<byte>)
Derives the key that reads a multicast group's payloads.
public static PamojaStatus pamoja_lorawan_mc_app_s_key(ReadOnlySpan<byte> mcKey, uint mcAddr, Span<byte> outKey)
Parameters
mcKeyReadOnlySpan<byte>mcAddruintoutKeySpan<byte>
Returns
pamoja_lorawan_mc_ke_key(ReadOnlySpan<byte>, Span<byte>)
Derives the key a multicast group's key travels under.
public static PamojaStatus pamoja_lorawan_mc_ke_key(ReadOnlySpan<byte> mcRootKey, Span<byte> outKey)
Parameters
mcRootKeyReadOnlySpan<byte>outKeySpan<byte>
Returns
pamoja_lorawan_mc_key(ReadOnlySpan<byte>, ReadOnlySpan<byte>, Span<byte>)
Unwraps the group key a setup command carried.
public static PamojaStatus pamoja_lorawan_mc_key(ReadOnlySpan<byte> mcKeKey, ReadOnlySpan<byte> wrapped, Span<byte> outKey)
Parameters
mcKeKeyReadOnlySpan<byte>wrappedReadOnlySpan<byte>outKeySpan<byte>
Returns
pamoja_lorawan_mc_nwk_s_key(ReadOnlySpan<byte>, uint, Span<byte>)
Derives the key that verifies a multicast group's frames.
public static PamojaStatus pamoja_lorawan_mc_nwk_s_key(ReadOnlySpan<byte> mcKey, uint mcAddr, Span<byte> outKey)
Parameters
mcKeyReadOnlySpan<byte>mcAddruintoutKeySpan<byte>
Returns
pamoja_lorawan_mc_root_key(ReadOnlySpan<byte>, byte, Span<byte>)
Derives a device's multicast root key.
public static PamojaStatus pamoja_lorawan_mc_root_key(ReadOnlySpan<byte> rootKey, byte lorawan11, Span<byte> outKey)
Parameters
rootKeyReadOnlySpan<byte>lorawan11byteoutKeySpan<byte>
Returns
pamoja_lorawan_package_encode(in PamojaLorawanPackageCommand, ReadOnlySpan<byte>, nuint, Span<byte>, nuint, out nuint)
Writes one command of an application layer package.
public static PamojaStatus pamoja_lorawan_package_encode(in PamojaLorawanPackageCommand command, ReadOnlySpan<byte> data, nuint dataLen, Span<byte> outPayload, nuint capacity, out nuint outLen)
Parameters
commandPamojaLorawanPackageCommanddataReadOnlySpan<byte>dataLennuintoutPayloadSpan<byte>capacitynuintoutLennuint
Returns
pamoja_lorawan_package_parse(byte, byte, ReadOnlySpan<byte>, nuint, out PamojaLorawanPackageCommand, out nuint)
Reads one command of an application layer package.
public static PamojaStatus pamoja_lorawan_package_parse(byte port, byte uplink, ReadOnlySpan<byte> payload, nuint payloadLen, out PamojaLorawanPackageCommand outCommand, out nuint outTaken)
Parameters
portbyteuplinkbytepayloadReadOnlySpan<byte>payloadLennuintoutCommandPamojaLorawanPackageCommandoutTakennuint
Returns
pamoja_lorawan_package_status_item(ReadOnlySpan<byte>, nuint, out PamojaLorawanPackageCommand)
Reads one group record of a multicast status answer.
public static PamojaStatus pamoja_lorawan_package_status_item(ReadOnlySpan<byte> payload, nuint payloadLen, out PamojaLorawanPackageCommand outCommand)
Parameters
payloadReadOnlySpan<byte>payloadLennuintoutCommandPamojaLorawanPackageCommand
Returns
pamoja_lorawan_relay_error(nint)
Returns why the last relay call failed, or null.
public static extern nint pamoja_lorawan_relay_error(nint relay)
Parameters
relaynint
Returns
pamoja_lorawan_relay_forward(nint, ulong, out nint, out PamojaLorawanTransmission)
Sends the uplink the relay is holding, in one of its own.
public static PamojaStatus pamoja_lorawan_relay_forward(nint relay, ulong nowUs, out nint outFrame, out PamojaLorawanTransmission outTransmission)
Parameters
relaynintnowUsulongoutFramenintoutTransmissionPamojaLorawanTransmission
Returns
pamoja_lorawan_relay_forward_due(nint, out ulong)
Reports when the forwarded uplink waiting to go out is due.
public static byte pamoja_lorawan_relay_forward_due(nint relay, out ulong outDueUs)
Parameters
Returns
pamoja_lorawan_relay_forward_encode(in PamojaLorawanUplinkMetadata, uint, ReadOnlySpan<byte>, nuint, out nint)
Writes an uplink a relay forwards.
public static PamojaStatus pamoja_lorawan_relay_forward_encode(in PamojaLorawanUplinkMetadata metadata, uint frequencyHz, ReadOnlySpan<byte> phyPayload, nuint phyPayloadLen, out nint outPayload)
Parameters
metadataPamojaLorawanUplinkMetadatafrequencyHzuintphyPayloadReadOnlySpan<byte>phyPayloadLennuintoutPayloadnint
Returns
pamoja_lorawan_relay_forward_parse(ReadOnlySpan<byte>, nuint, out PamojaLorawanUplinkMetadata, out uint, out nint)
Reads an uplink a relay forwarded.
public static PamojaStatus pamoja_lorawan_relay_forward_parse(ReadOnlySpan<byte> payload, nuint payloadLen, out PamojaLorawanUplinkMetadata outMetadata, out uint outFrequencyHz, out nint outPhyPayload)
Parameters
payloadReadOnlySpan<byte>payloadLennuintoutMetadataPamojaLorawanUplinkMetadataoutFrequencyHzuintoutPhyPayloadnint
Returns
pamoja_lorawan_relay_free(nint)
Releases a relay handle. Passing null is a no-op.
public static extern void pamoja_lorawan_relay_free(nint relay)
Parameters
relaynint
pamoja_lorawan_relay_heard_in(nint, byte, ReadOnlySpan<byte>, nuint, sbyte, out byte, out PamojaLorawanHeard, out nint, out nint, out PamojaLorawanRxr)
Reads a frame the relay's own device heard.
public static PamojaStatus pamoja_lorawan_relay_heard_in(nint relay, byte window, ReadOnlySpan<byte> frame, nuint frameLen, sbyte snrDb, out byte outKind, out PamojaLorawanHeard outHeard, out nint outPayload, out nint outFrame, out PamojaLorawanRxr outDownlink)
Parameters
relaynintwindowbyteframeReadOnlySpan<byte>frameLennuintsnrDbsbyteoutKindbyteoutHeardPamojaLorawanHeardoutPayloadnintoutFramenintoutDownlinkPamojaLorawanRxr
Returns
pamoja_lorawan_relay_heard_uplink(nint, ReadOnlySpan<byte>, nuint, short, sbyte, ulong, out ulong)
Reads the uplink a wake-on-radio frame announced.
public static PamojaStatus pamoja_lorawan_relay_heard_uplink(nint relay, ReadOnlySpan<byte> frame, nuint frameLen, short rssiDbm, sbyte snrDb, ulong endedUs, out ulong outDueUs)
Parameters
relaynintframeReadOnlySpan<byte>frameLennuintrssiDbmshortsnrDbsbyteendedUsulongoutDueUsulong
Returns
pamoja_lorawan_relay_heard_wor(nint, in PamojaLorawanScan, ReadOnlySpan<byte>, nuint, short, sbyte, ulong, out PamojaLorawanWake)
Reads a wake-on-radio frame a scan heard.
public static PamojaStatus pamoja_lorawan_relay_heard_wor(nint relay, in PamojaLorawanScan scan, ReadOnlySpan<byte> frame, nuint frameLen, short rssiDbm, sbyte snrDb, ulong endedUs, out PamojaLorawanWake outWake)
Parameters
relaynintscanPamojaLorawanScanframeReadOnlySpan<byte>frameLennuintrssiDbmshortsnrDbsbyteendedUsulongoutWakePamojaLorawanWake
Returns
pamoja_lorawan_relay_join(nint, ushort, ulong, out nint, out PamojaLorawanTransmission)
Makes the relay's own join request.
public static PamojaStatus pamoja_lorawan_relay_join(nint relay, ushort devNonce, ulong nowUs, out nint outFrame, out PamojaLorawanTransmission outTransmission)
Parameters
relaynintdevNonceushortnowUsulongoutFramenintoutTransmissionPamojaLorawanTransmission
Returns
pamoja_lorawan_relay_new(nint, nint, in PamojaLorawanDeviceSettings, byte, byte, out nint)
Makes a relay whose own device joins over the air.
public static PamojaStatus pamoja_lorawan_relay_new(nint plan, nint credentials, in PamojaLorawanDeviceSettings settings, byte xtalAccuracy, byte cadToRx, out nint outRelay)
Parameters
plannintcredentialsnintsettingsPamojaLorawanDeviceSettingsxtalAccuracybytecadToRxbyteoutRelaynint
Returns
pamoja_lorawan_relay_next_scan(nint, ulong, out PamojaLorawanScan)
Says when and where to scan next.
public static PamojaStatus pamoja_lorawan_relay_next_scan(nint relay, ulong nowUs, out PamojaLorawanScan outScan)
Parameters
relaynintnowUsulongoutScanPamojaLorawanScan
Returns
pamoja_lorawan_relay_next_wor(in PamojaLorawanSynchronization, ulong, uint, ulong, byte, out PamojaLorawanWorSlot, out byte)
Picks the relay scan a synchronized end device aims its next WOR frame at.
public static PamojaStatus pamoja_lorawan_relay_next_wor(in PamojaLorawanSynchronization synchronization, ulong nowUs, uint deviceXtalPpm, ulong symbolUs, byte otherChannel, out PamojaLorawanWorSlot outSlot, out byte outSynchronized)
Parameters
synchronizationPamojaLorawanSynchronizationnowUsulongdeviceXtalPpmuintsymbolUsulongotherChannelbyteoutSlotPamojaLorawanWorSlotoutSynchronizedbyte
Returns
pamoja_lorawan_relay_nothing_heard(nint, ulong, out byte, out ulong)
Says what comes next once the relay's own windows closed empty.
public static PamojaStatus pamoja_lorawan_relay_nothing_heard(nint relay, ulong nowUs, out byte outNext, out ulong outNotBeforeUs)
Parameters
Returns
pamoja_lorawan_relay_personalized(nint, nint, in PamojaLorawanDeviceSettings, byte, byte, out nint)
Makes a relay whose own device is activated by personalization.
public static PamojaStatus pamoja_lorawan_relay_personalized(nint plan, nint session, in PamojaLorawanDeviceSettings settings, byte xtalAccuracy, byte cadToRx, out nint outRelay)
Parameters
plannintsessionnintsettingsPamojaLorawanDeviceSettingsxtalAccuracybytecadToRxbyteoutRelaynint
Returns
pamoja_lorawan_relay_root_wor_s_key(ReadOnlySpan<byte>, nuint, Span<byte>)
Derives a root relay session key from a network session key.
public static PamojaStatus pamoja_lorawan_relay_root_wor_s_key(ReadOnlySpan<byte> networkKey, nuint networkKeyLen, Span<byte> outKey)
Parameters
networkKeyReadOnlySpan<byte>networkKeyLennuintoutKeySpan<byte>
Returns
pamoja_lorawan_relay_running(nint)
Reports whether the relay is scanning.
public static extern byte pamoja_lorawan_relay_running(nint relay)
Parameters
relaynint
Returns
pamoja_lorawan_relay_second_channel(byte, byte, byte, uint, out PamojaLoraRelayChannel)
Reads the second channel a relay or end device configuration describes.
public static PamojaStatus pamoja_lorawan_relay_second_channel(byte secondChannelIndex, byte dataRate, byte ackOffset, uint frequencyHz, out PamojaLoraRelayChannel outChannel)
Parameters
secondChannelIndexbytedataRatebyteackOffsetbytefrequencyHzuintoutChannelPamojaLoraRelayChannel
Returns
pamoja_lorawan_relay_send(nint, byte, ReadOnlySpan<byte>, nuint, byte, ulong, out nint, out PamojaLorawanTransmission)
Sends one of the relay's own uplinks.
public static PamojaStatus pamoja_lorawan_relay_send(nint relay, byte port, ReadOnlySpan<byte> payload, nuint payloadLen, byte confirmed, ulong nowUs, out nint outFrame, out PamojaLorawanTransmission outTransmission)
Parameters
relaynintportbytepayloadReadOnlySpan<byte>payloadLennuintconfirmedbytenowUsulongoutFramenintoutTransmissionPamojaLorawanTransmission
Returns
pamoja_lorawan_relay_start(nint, byte, byte, byte, uint, uint, byte)
Starts scanning, or changes what a running relay scans.
public static extern PamojaStatus pamoja_lorawan_relay_start(nint relay, byte cadPeriodicity, byte defaultChannelIndex, byte hasSecondChannel, uint secondWorFrequencyHz, uint secondAckFrequencyHz, byte secondDataRate)
Parameters
relaynintcadPeriodicitybytedefaultChannelIndexbytehasSecondChannelbytesecondWorFrequencyHzuintsecondAckFrequencyHzuintsecondDataRatebyte
Returns
pamoja_lorawan_relay_status(nint, out PamojaLorawanEndDeviceStatus)
Reads where the relay's own device stands.
public static PamojaStatus pamoja_lorawan_relay_status(nint relay, out PamojaLorawanEndDeviceStatus outStatus)
Parameters
relaynintoutStatusPamojaLorawanEndDeviceStatus
Returns
pamoja_lorawan_relay_stop(nint)
Stops scanning.
public static extern void pamoja_lorawan_relay_stop(nint relay)
Parameters
relaynint
pamoja_lorawan_relay_synchronization(ulong, ushort, ulong, in PamojaLorawanStateSync, out PamojaLorawanSynchronization)
Works out when a relay scanned from the WOR ACK that answered a frame.
public static PamojaStatus pamoja_lorawan_relay_synchronization(ulong worStartUs, ushort preambleSymbols, ulong symbolUs, in PamojaLorawanStateSync state, out PamojaLorawanSynchronization outSynchronization)
Parameters
worStartUsulongpreambleSymbolsushortsymbolUsulongstatePamojaLorawanStateSyncoutSynchronizationPamojaLorawanSynchronization
Returns
pamoja_lorawan_relay_t_offset_ms(ulong, ulong, out ushort)
Works out the offset a relay reports in a WOR ACK.
public static PamojaStatus pamoja_lorawan_relay_t_offset_ms(ulong scanStartUs, ulong preambleEndUs, out ushort outOffsetMs)
Parameters
Returns
pamoja_lorawan_relay_trust(nint, byte, uint, ReadOnlySpan<byte>, uint, byte, byte)
Trusts an end device, as an UpdateUplinkListReq does.
public static PamojaStatus pamoja_lorawan_relay_trust(nint relay, byte index, uint devAddr, ReadOnlySpan<byte> rootWorSKey, uint nextWfcnt, byte reloadRate, byte bucketSize)
Parameters
relaynintindexbytedevAddruintrootWorSKeyReadOnlySpan<byte>nextWfcntuintreloadRatebytebucketSizebyte
Returns
pamoja_lorawan_relay_unsynchronized_preamble(byte, ulong, byte, out ushort)
Works out an unsynchronized WOR preamble.
public static PamojaStatus pamoja_lorawan_relay_unsynchronized_preamble(byte cadPeriodicity, ulong symbolUs, byte cadToRx, out ushort outSymbols)
Parameters
Returns
pamoja_lorawan_relay_uplink_missed(nint)
Clears the uplink a wake-on-radio frame announced.
public static extern void pamoja_lorawan_relay_uplink_missed(nint relay)
Parameters
relaynint
pamoja_lorawan_relay_wor_ack(in PamojaLorawanWorKeys, uint, uint, in PamojaLorawanCarrier, in PamojaLorawanCarrier, in PamojaLorawanStateSync, Span<byte>)
Builds a relay's WOR ACK.
public static PamojaStatus pamoja_lorawan_relay_wor_ack(in PamojaLorawanWorKeys keys, uint devAddr, uint wfcnt, in PamojaLorawanCarrier ack, in PamojaLorawanCarrier uplink, in PamojaLorawanStateSync state, Span<byte> outFrame)
Parameters
keysPamojaLorawanWorKeysdevAddruintwfcntuintackPamojaLorawanCarrieruplinkPamojaLorawanCarrierstatePamojaLorawanStateSyncoutFrameSpan<byte>
Returns
pamoja_lorawan_relay_wor_ack_open(ReadOnlySpan<byte>, nuint, in PamojaLorawanWorKeys, uint, uint, in PamojaLorawanCarrier, in PamojaLorawanCarrier, out PamojaLorawanStateSync)
Checks and reads a WOR ACK.
public static PamojaStatus pamoja_lorawan_relay_wor_ack_open(ReadOnlySpan<byte> frame, nuint frameLen, in PamojaLorawanWorKeys keys, uint devAddr, uint wfcnt, in PamojaLorawanCarrier ack, in PamojaLorawanCarrier uplink, out PamojaLorawanStateSync outState)
Parameters
frameReadOnlySpan<byte>frameLennuintkeysPamojaLorawanWorKeysdevAddruintwfcntuintackPamojaLorawanCarrieruplinkPamojaLorawanCarrieroutStatePamojaLorawanStateSync
Returns
pamoja_lorawan_relay_wor_join_request(in PamojaLorawanCarrier, Span<byte>)
Builds the WOR frame ahead of a join request.
public static PamojaStatus pamoja_lorawan_relay_wor_join_request(in PamojaLorawanCarrier uplink, Span<byte> outFrame)
Parameters
uplinkPamojaLorawanCarrieroutFrameSpan<byte>
Returns
pamoja_lorawan_relay_wor_keys(ReadOnlySpan<byte>, nuint, uint, out PamojaLorawanWorKeys)
Derives an end device's wake-on-radio keys from its root key.
public static PamojaStatus pamoja_lorawan_relay_wor_keys(ReadOnlySpan<byte> rootKey, nuint rootKeyLen, uint devAddr, out PamojaLorawanWorKeys outKeys)
Parameters
rootKeyReadOnlySpan<byte>rootKeyLennuintdevAddruintoutKeysPamojaLorawanWorKeys
Returns
pamoja_lorawan_relay_wor_open(ReadOnlySpan<byte>, nuint, in PamojaLorawanWorKeys, uint, in PamojaLorawanCarrier, out PamojaLorawanCarrier)
Checks a WOR frame ahead of a Class A uplink and reads its carrier.
public static PamojaStatus pamoja_lorawan_relay_wor_open(ReadOnlySpan<byte> frame, nuint frameLen, in PamojaLorawanWorKeys keys, uint wfcnt, in PamojaLorawanCarrier wor, out PamojaLorawanCarrier outUplink)
Parameters
frameReadOnlySpan<byte>frameLennuintkeysPamojaLorawanWorKeyswfcntuintworPamojaLorawanCarrieroutUplinkPamojaLorawanCarrier
Returns
pamoja_lorawan_relay_wor_parse(ReadOnlySpan<byte>, nuint, out PamojaLorawanWor)
Reads a WOR frame.
public static PamojaStatus pamoja_lorawan_relay_wor_parse(ReadOnlySpan<byte> frame, nuint frameLen, out PamojaLorawanWor outWor)
Parameters
frameReadOnlySpan<byte>frameLennuintoutWorPamojaLorawanWor
Returns
pamoja_lorawan_relay_wor_uplink(in PamojaLorawanWorKeys, uint, uint, in PamojaLorawanCarrier, in PamojaLorawanCarrier, Span<byte>)
Builds the WOR frame ahead of a Class A uplink.
public static PamojaStatus pamoja_lorawan_relay_wor_uplink(in PamojaLorawanWorKeys keys, uint devAddr, uint wfcnt, in PamojaLorawanCarrier uplink, in PamojaLorawanCarrier wor, Span<byte> outFrame)
Parameters
keysPamojaLorawanWorKeysdevAddruintwfcntuintuplinkPamojaLorawanCarrierworPamojaLorawanCarrieroutFrameSpan<byte>
Returns
pamoja_lorawan_rx_ack(nint)
Reports whether a decoded frame acknowledges the last confirmed one.
public static bool pamoja_lorawan_rx_ack(nint rx)
Parameters
rxnint
Returns
pamoja_lorawan_rx_adr(nint)
Reports whether a decoded frame takes part in adaptive data rate.
public static bool pamoja_lorawan_rx_adr(nint rx)
Parameters
rxnint
Returns
pamoja_lorawan_rx_adr_ack_req(nint)
Reports whether a decoded uplink asks the network to answer.
public static bool pamoja_lorawan_rx_adr_ack_req(nint rx)
Parameters
rxnint
Returns
pamoja_lorawan_rx_class_b(nint)
Reports whether a decoded uplink came from a device running Class B.
public static bool pamoja_lorawan_rx_class_b(nint rx)
Parameters
rxnint
Returns
pamoja_lorawan_rx_confirmed(nint)
Reports whether a decoded frame asks to be acknowledged.
public static bool pamoja_lorawan_rx_confirmed(nint rx)
Parameters
rxnint
Returns
pamoja_lorawan_rx_dev_addr(nint)
Returns the device address a decoded frame carries.
public static extern uint pamoja_lorawan_rx_dev_addr(nint rx)
Parameters
rxnint
Returns
pamoja_lorawan_rx_direction(nint)
Returns the direction a decoded frame traveled.
public static extern PamojaLorawanDirection pamoja_lorawan_rx_direction(nint rx)
Parameters
rxnint
Returns
pamoja_lorawan_rx_fcnt(nint)
Returns the low 16 bits of the frame counter.
public static extern ushort pamoja_lorawan_rx_fcnt(nint rx)
Parameters
rxnint
Returns
pamoja_lorawan_rx_fopts(nint)
Returns a pointer to the frame options a decoded frame carries.
public static extern nint pamoja_lorawan_rx_fopts(nint rx)
Parameters
rxnint
Returns
pamoja_lorawan_rx_fopts_len(nint)
Returns the length of the frame options a decoded frame carries.
public static extern nuint pamoja_lorawan_rx_fopts_len(nint rx)
Parameters
rxnint
Returns
pamoja_lorawan_rx_fpending(nint)
Reports whether the network has more downlink data waiting.
public static bool pamoja_lorawan_rx_fpending(nint rx)
Parameters
rxnint
Returns
pamoja_lorawan_rx_fport(nint, out byte)
Returns the port a decoded frame was sent on.
public static bool pamoja_lorawan_rx_fport(nint rx, out byte outFport)
Parameters
Returns
pamoja_lorawan_rx_free(nint)
Releases a decoded frame handle. Passing null is a no-op.
public static extern void pamoja_lorawan_rx_free(nint rx)
Parameters
rxnint
pamoja_lorawan_rx_payload(nint)
Returns a pointer to the decrypted payload of a decoded frame.
public static extern nint pamoja_lorawan_rx_payload(nint rx)
Parameters
rxnint
Returns
pamoja_lorawan_rx_payload_len(nint)
Returns the length of the decrypted payload of a decoded frame.
public static extern nuint pamoja_lorawan_rx_payload_len(nint rx)
Parameters
rxnint
Returns
pamoja_lorawan_session_decode(nint, ReadOnlySpan<byte>, nuint, uint, out nint)
Verifies a received frame, then decrypts it.
public static PamojaStatus pamoja_lorawan_session_decode(nint session, ReadOnlySpan<byte> bytes, nuint bytesLen, uint fcnt, out nint outRx)
Parameters
Returns
pamoja_lorawan_session_dev_addr(nint)
Returns the device address a session is bound to.
public static extern uint pamoja_lorawan_session_dev_addr(nint session)
Parameters
sessionnint
Returns
pamoja_lorawan_session_encode_downlink(nint, uint, byte, ReadOnlySpan<byte>, nuint, ReadOnlySpan<byte>, nuint, PamojaLorawanFlags, out nint)
Encodes a downlink data frame.
public static PamojaStatus pamoja_lorawan_session_encode_downlink(nint session, uint fcnt, byte fport, ReadOnlySpan<byte> payload, nuint payloadLen, ReadOnlySpan<byte> fopts, nuint foptsLen, PamojaLorawanFlags flags, out nint outFrame)
Parameters
sessionnintfcntuintfportbytepayloadReadOnlySpan<byte>payloadLennuintfoptsReadOnlySpan<byte>foptsLennuintflagsPamojaLorawanFlagsoutFramenint
Returns
pamoja_lorawan_session_encode_uplink(nint, uint, byte, ReadOnlySpan<byte>, nuint, ReadOnlySpan<byte>, nuint, PamojaLorawanFlags, out nint)
Encodes an uplink data frame.
public static PamojaStatus pamoja_lorawan_session_encode_uplink(nint session, uint fcnt, byte fport, ReadOnlySpan<byte> payload, nuint payloadLen, ReadOnlySpan<byte> fopts, nuint foptsLen, PamojaLorawanFlags flags, out nint outFrame)
Parameters
sessionnintfcntuintfportbytepayloadReadOnlySpan<byte>payloadLennuintfoptsReadOnlySpan<byte>foptsLennuintflagsPamojaLorawanFlagsoutFramenint
Returns
pamoja_lorawan_session_free(nint)
Releases a session handle. Passing null is a no-op.
public static extern void pamoja_lorawan_session_free(nint session)
Parameters
sessionnint
pamoja_lorawan_session_new(uint, ReadOnlySpan<byte>, nuint, ReadOnlySpan<byte>, nuint, out nint)
Creates a LoRaWAN session from a device address and its keys.
public static PamojaStatus pamoja_lorawan_session_new(uint devAddr, ReadOnlySpan<byte> nwkSKey, nuint nwkSKeyLen, ReadOnlySpan<byte> appSKey, nuint appSKeyLen, out nint outSession)
Parameters
devAddruintnwkSKeyReadOnlySpan<byte>nwkSKeyLennuintappSKeyReadOnlySpan<byte>appSKeyLennuintoutSessionnint
Returns
pamoja_lorawan_session_root_wor_s_key(nint, Span<byte>)
Returns the root relay session key of a session's device.
public static PamojaStatus pamoja_lorawan_session_root_wor_s_key(nint session, Span<byte> outKey)
Parameters
Returns
pamoja_lorawan_session_wor_keys(nint, out PamojaLorawanWorKeys)
Returns the wake-on-radio keys of a session's device.
public static PamojaStatus pamoja_lorawan_session_wor_keys(nint session, out PamojaLorawanWorKeys outKeys)
Parameters
sessionnintoutKeysPamojaLorawanWorKeys
Returns
pamoja_lorawan_wrap_mc_key(ReadOnlySpan<byte>, ReadOnlySpan<byte>, Span<byte>)
Wraps a group key for a device, which is what a server does.
public static PamojaStatus pamoja_lorawan_wrap_mc_key(ReadOnlySpan<byte> mcKeKey, ReadOnlySpan<byte> mcKey, Span<byte> outWrapped)
Parameters
mcKeKeyReadOnlySpan<byte>mcKeyReadOnlySpan<byte>outWrappedSpan<byte>
Returns
pamoja_manifest_decode(ReadOnlySpan<byte>, nuint, out PamojaManifest)
Reads a manifest body back from its bytes.
public static PamojaStatus pamoja_manifest_decode(ReadOnlySpan<byte> bytes, nuint len, out PamojaManifest outManifest)
Parameters
bytesReadOnlySpan<byte>lennuintoutManifestPamojaManifest
Returns
pamoja_manifest_encode(PamojaManifest)
Encodes the body of a manifest.
public static extern nint pamoja_manifest_encode(PamojaManifest manifest)
Parameters
manifestPamojaManifest
Returns
pamoja_manifest_sign(PamojaManifest, nint)
Signs a manifest into the envelope offered to a device.
public static extern nint pamoja_manifest_sign(PamojaManifest manifest, nint author)
Parameters
manifestPamojaManifestauthornint
Returns
pamoja_mavlink_command_confirmation(nint)
Returns the confirmation count to stamp on the command being sent.
public static extern byte pamoja_mavlink_command_confirmation(nint command)
Parameters
commandnint
Returns
pamoja_mavlink_command_free(nint)
Releases a command tracker.
public static extern void pamoja_mavlink_command_free(nint command)
Parameters
commandnint
pamoja_mavlink_command_id(nint)
Returns the command id being tracked.
public static extern ushort pamoja_mavlink_command_id(nint command)
Parameters
commandnint
Returns
pamoja_mavlink_command_new(ushort, byte)
Starts tracking a command.
public static extern nint pamoja_mavlink_command_new(ushort command, byte maxRetries)
Parameters
Returns
pamoja_mavlink_command_on_frame(nint, nint, out uint, out byte)
Classifies an incoming frame against the command in flight.
public static PamojaStatus pamoja_mavlink_command_on_frame(nint command, nint frame, out uint outKind, out byte outValue)
Parameters
Returns
pamoja_mavlink_command_on_timeout(nint, out byte)
Records a timeout and reports whether the command may be resent.
public static byte pamoja_mavlink_command_on_timeout(nint command, out byte outConfirmation)
Parameters
Returns
pamoja_mavlink_crc16_mcrf4xx(ReadOnlySpan<byte>, nuint)
Returns the CRC-16/MCRF4XX checksum of a byte string.
public static ushort pamoja_mavlink_crc16_mcrf4xx(ReadOnlySpan<byte> bytes, nuint bytesLen)
Parameters
bytesReadOnlySpan<byte>bytesLennuint
Returns
pamoja_mavlink_dialect_add(nint, uint, byte)
Adds or replaces the seed for a message id.
public static extern PamojaStatus pamoja_mavlink_dialect_add(nint dialect, uint msgid, byte crcExtra)
Parameters
Returns
pamoja_mavlink_dialect_add_schema(nint, nint)
Adds a schema's message to a dialect table.
public static extern PamojaStatus pamoja_mavlink_dialect_add_schema(nint dialect, nint schema)
Parameters
Returns
pamoja_mavlink_dialect_crc_extra(nint, uint, out byte)
Returns the seed a dialect resolves a message id to.
public static PamojaStatus pamoja_mavlink_dialect_crc_extra(nint dialect, uint msgid, out byte outCrcExtra)
Parameters
Returns
pamoja_mavlink_dialect_free(nint)
Releases a dialect table.
public static extern void pamoja_mavlink_dialect_free(nint dialect)
Parameters
dialectnint
pamoja_mavlink_dialect_new()
Creates an empty dialect table.
public static extern nint pamoja_mavlink_dialect_new()
Returns
pamoja_mavlink_enum_at(nuint, out nint)
Returns the name of the enumeration at a position in the table.
public static PamojaStatus pamoja_mavlink_enum_at(nuint index, out nint outName)
Parameters
Returns
pamoja_mavlink_enum_count()
Returns how many enumerations the dialect table holds.
public static extern nuint pamoja_mavlink_enum_count()
Returns
pamoja_mavlink_enum_entry(string, ulong, out nint)
Names the entry of an enumeration that stands for a value, or null.
public static PamojaStatus pamoja_mavlink_enum_entry(string enumeration, ulong value, out nint outName)
Parameters
Returns
pamoja_mavlink_enum_entry_at(string, nuint, out nint, out ulong)
Returns an enumeration's entry at a position, with its value.
public static PamojaStatus pamoja_mavlink_enum_entry_at(string enumeration, nuint index, out nint outName, out ulong outValue)
Parameters
Returns
pamoja_mavlink_enum_is_bitmask(string, out bool)
Reports whether an enumeration's values combine as bits.
public static PamojaStatus pamoja_mavlink_enum_is_bitmask(string enumeration, out bool outBitmask)
Parameters
Returns
pamoja_mavlink_enum_len(string, out nuint)
Returns how many entries an enumeration names.
public static PamojaStatus pamoja_mavlink_enum_len(string enumeration, out nuint outLen)
Parameters
Returns
pamoja_mavlink_enum_names(string, ulong, out nint)
Names the entries a value is made of, joined by a vertical bar.
public static PamojaStatus pamoja_mavlink_enum_names(string enumeration, ulong value, out nint outNames)
Parameters
Returns
pamoja_mavlink_enum_value(string, out ulong)
Looks up the value a dialect entry name stands for.
public static PamojaStatus pamoja_mavlink_enum_value(string entry, out ulong outValue)
Parameters
Returns
pamoja_mavlink_frame_bytes(nint, out nuint)
Returns a pointer to a frame's bytes.
public static nint pamoja_mavlink_frame_bytes(nint frame, out nuint outLen)
Parameters
Returns
pamoja_mavlink_frame_encode(byte, PamojaMavlinkHeader, uint, ReadOnlySpan<byte>, nuint, byte, out nint)
Assembles a frame carrying a message.
public static PamojaStatus pamoja_mavlink_frame_encode(byte version, PamojaMavlinkHeader header, uint msgid, ReadOnlySpan<byte> payload, nuint payloadLen, byte crcExtra, out nint outFrame)
Parameters
versionbyteheaderPamojaMavlinkHeadermsgiduintpayloadReadOnlySpan<byte>payloadLennuintcrcExtrabyteoutFramenint
Returns
pamoja_mavlink_frame_free(nint)
Releases a frame.
public static extern void pamoja_mavlink_frame_free(nint frame)
Parameters
framenint
pamoja_mavlink_frame_header(nint, out PamojaMavlinkHeader)
Returns the addressing fields a frame carries.
public static PamojaStatus pamoja_mavlink_frame_header(nint frame, out PamojaMavlinkHeader outHeader)
Parameters
framenintoutHeaderPamojaMavlinkHeader
Returns
pamoja_mavlink_frame_incompat_flags(nint)
Returns the incompatibility flags a v2 frame declares.
public static extern byte pamoja_mavlink_frame_incompat_flags(nint frame)
Parameters
framenint
Returns
pamoja_mavlink_frame_is_signed(nint)
Reports whether a frame carries a signature.
public static extern byte pamoja_mavlink_frame_is_signed(nint frame)
Parameters
framenint
Returns
pamoja_mavlink_frame_message_id(nint)
Returns the id of the message a frame carries.
public static extern uint pamoja_mavlink_frame_message_id(nint frame)
Parameters
framenint
Returns
pamoja_mavlink_frame_parse(ReadOnlySpan<byte>, nuint, byte, out nint)
Parses one frame against a known CRC_EXTRA.
public static PamojaStatus pamoja_mavlink_frame_parse(ReadOnlySpan<byte> bytes, nuint bytesLen, byte crcExtra, out nint outFrame)
Parameters
bytesReadOnlySpan<byte>bytesLennuintcrcExtrabyteoutFramenint
Returns
pamoja_mavlink_frame_parse_known(ReadOnlySpan<byte>, nuint, nint, out nint)
Parses one frame, looking its CRC_EXTRA up as it goes.
public static PamojaStatus pamoja_mavlink_frame_parse_known(ReadOnlySpan<byte> bytes, nuint bytesLen, nint dialect, out nint outFrame)
Parameters
bytesReadOnlySpan<byte>bytesLennuintdialectnintoutFramenint
Returns
pamoja_mavlink_frame_payload(nint, out nuint)
Returns a pointer to a frame's payload.
public static nint pamoja_mavlink_frame_payload(nint frame, out nuint outLen)
Parameters
Returns
pamoja_mavlink_frame_signature(nint, Span<byte>)
Copies a frame's signature block out.
public static PamojaStatus pamoja_mavlink_frame_signature(nint frame, Span<byte> outSignature)
Parameters
Returns
pamoja_mavlink_frame_version(nint)
Returns the wire format a frame uses.
public static extern byte pamoja_mavlink_frame_version(nint frame)
Parameters
framenint
Returns
pamoja_mavlink_known_crc_extra(uint, out byte)
Returns the CRC_EXTRA the common dialect publishes for a message id.
public static PamojaStatus pamoja_mavlink_known_crc_extra(uint msgid, out byte outCrcExtra)
Parameters
Returns
pamoja_mavlink_message_crc_extra(string, ReadOnlySpan<PamojaMavlinkField>, nuint, out byte)
Derives the CRC_EXTRA seed of a message from its definition.
public static PamojaStatus pamoja_mavlink_message_crc_extra(string name, ReadOnlySpan<PamojaMavlinkField> fields, nuint fieldCount, out byte outCrcExtra)
Parameters
namestringfieldsReadOnlySpan<PamojaMavlinkField>fieldCountnuintoutCrcExtrabyte
Returns
pamoja_mavlink_message_decode(nint, ReadOnlySpan<byte>, nuint, out nint)
Reads a message out of a frame payload.
public static PamojaStatus pamoja_mavlink_message_decode(nint schema, ReadOnlySpan<byte> payload, nuint payloadLen, out nint outMessage)
Parameters
schemanintpayloadReadOnlySpan<byte>payloadLennuintoutMessagenint
Returns
pamoja_mavlink_message_free(nint)
Releases a message.
public static extern void pamoja_mavlink_message_free(nint message)
Parameters
messagenint
pamoja_mavlink_message_get_bytes(nint, string, Span<byte>, nuint)
Copies the raw bytes of a byte-wide array field out.
public static PamojaStatus pamoja_mavlink_message_get_bytes(nint message, string field, Span<byte> outBytes, nuint outBytesLen)
Parameters
Returns
pamoja_mavlink_message_get_float(nint, string, nuint, out double)
Reads a floating-point field.
public static PamojaStatus pamoja_mavlink_message_get_float(nint message, string field, nuint index, out double outValue)
Parameters
Returns
pamoja_mavlink_message_get_int(nint, string, nuint, out long)
Reads a field as a signed integer.
public static PamojaStatus pamoja_mavlink_message_get_int(nint message, string field, nuint index, out long outValue)
Parameters
Returns
pamoja_mavlink_message_get_number(nint, string, nuint, out double)
Reads a field as a double, whatever its type.
public static PamojaStatus pamoja_mavlink_message_get_number(nint message, string field, nuint index, out double outValue)
Parameters
Returns
pamoja_mavlink_message_get_uint(nint, string, nuint, out ulong)
Reads a field as an unsigned integer.
public static PamojaStatus pamoja_mavlink_message_get_uint(nint message, string field, nuint index, out ulong outValue)
Parameters
Returns
pamoja_mavlink_message_new(nint, out nint)
Creates a message with every field zero.
public static PamojaStatus pamoja_mavlink_message_new(nint schema, out nint outMessage)
Parameters
Returns
pamoja_mavlink_message_payload(nint, out nuint)
Returns a pointer to a message's payload bytes.
public static nint pamoja_mavlink_message_payload(nint message, out nuint outLen)
Parameters
Returns
pamoja_mavlink_message_set_bytes(nint, string, ReadOnlySpan<byte>, nuint)
Writes the raw bytes of a byte-wide array field.
public static PamojaStatus pamoja_mavlink_message_set_bytes(nint message, string field, ReadOnlySpan<byte> bytes, nuint bytesLen)
Parameters
messagenintfieldstringbytesReadOnlySpan<byte>bytesLennuint
Returns
pamoja_mavlink_message_set_float(nint, string, nuint, double)
Writes a floating-point field.
public static PamojaStatus pamoja_mavlink_message_set_float(nint message, string field, nuint index, double value)
Parameters
Returns
pamoja_mavlink_message_set_int(nint, string, nuint, long)
Writes a signed integer into a field.
public static PamojaStatus pamoja_mavlink_message_set_int(nint message, string field, nuint index, long value)
Parameters
Returns
pamoja_mavlink_message_set_number(nint, string, nuint, double)
Writes a double into a field, converting it to the field's type.
public static PamojaStatus pamoja_mavlink_message_set_number(nint message, string field, nuint index, double value)
Parameters
Returns
pamoja_mavlink_message_set_uint(nint, string, nuint, ulong)
Writes an unsigned integer into a field.
public static PamojaStatus pamoja_mavlink_message_set_uint(nint message, string field, nuint index, ulong value)
Parameters
Returns
pamoja_mavlink_message_to_frame(nint, PamojaMavlinkHeader, out nint)
Builds a v2 frame carrying a message.
public static PamojaStatus pamoja_mavlink_message_to_frame(nint message, PamojaMavlinkHeader header, out nint outFrame)
Parameters
messagenintheaderPamojaMavlinkHeaderoutFramenint
Returns
pamoja_mavlink_mission_receiver_expected(nint)
Returns the next sequence number the receiver expects.
public static extern ushort pamoja_mavlink_mission_receiver_expected(nint receiver)
Parameters
receivernint
Returns
pamoja_mavlink_mission_receiver_free(nint)
Releases a receiver.
public static extern void pamoja_mavlink_mission_receiver_free(nint receiver)
Parameters
receivernint
pamoja_mavlink_mission_receiver_is_complete(nint)
Reports whether the transfer has finished.
public static extern byte pamoja_mavlink_mission_receiver_is_complete(nint receiver)
Parameters
receivernint
Returns
pamoja_mavlink_mission_receiver_new(byte, byte, byte)
Creates a receiver for a plan from a target vehicle.
public static extern nint pamoja_mavlink_mission_receiver_new(byte targetSystem, byte targetComponent, byte missionType)
Parameters
Returns
pamoja_mavlink_mission_receiver_on_frame(nint, nint, PamojaMavlinkHeader, out uint, out nint, out nint)
Handles an incoming frame, if it is one the transfer is waiting for.
public static PamojaStatus pamoja_mavlink_mission_receiver_on_frame(nint receiver, nint frame, PamojaMavlinkHeader header, out uint outKind, out nint outAccepted, out nint outReply)
Parameters
Returns
pamoja_mavlink_mission_receiver_request_list(nint, PamojaMavlinkHeader, out nint)
Builds the frame that starts a download.
public static PamojaStatus pamoja_mavlink_mission_receiver_request_list(nint receiver, PamojaMavlinkHeader header, out nint outFrame)
Parameters
receivernintheaderPamojaMavlinkHeaderoutFramenint
Returns
pamoja_mavlink_mission_sender_add_item(nint, ReadOnlySpan<byte>, nuint)
Appends an item to the plan.
public static PamojaStatus pamoja_mavlink_mission_sender_add_item(nint sender, ReadOnlySpan<byte> payload, nuint payloadLen)
Parameters
sendernintpayloadReadOnlySpan<byte>payloadLennuint
Returns
pamoja_mavlink_mission_sender_count(nint, PamojaMavlinkHeader, out nint)
Builds the frame that opens an upload.
public static PamojaStatus pamoja_mavlink_mission_sender_count(nint sender, PamojaMavlinkHeader header, out nint outFrame)
Parameters
sendernintheaderPamojaMavlinkHeaderoutFramenint
Returns
pamoja_mavlink_mission_sender_free(nint)
Releases a sender.
public static extern void pamoja_mavlink_mission_sender_free(nint sender)
Parameters
sendernint
pamoja_mavlink_mission_sender_len(nint)
Returns the number of items in the plan.
public static extern ushort pamoja_mavlink_mission_sender_len(nint sender)
Parameters
sendernint
Returns
pamoja_mavlink_mission_sender_new(byte, byte, byte)
Creates a sender for a plan bound for a target vehicle.
public static extern nint pamoja_mavlink_mission_sender_new(byte targetSystem, byte targetComponent, byte missionType)
Parameters
Returns
pamoja_mavlink_mission_sender_on_frame(nint, nint, PamojaMavlinkHeader, out uint, out byte, out nint)
Handles an incoming frame, if it is one the transfer answers.
public static PamojaStatus pamoja_mavlink_mission_sender_on_frame(nint sender, nint frame, PamojaMavlinkHeader header, out uint outKind, out byte outResult, out nint outReply)
Parameters
Returns
pamoja_mavlink_offboard_global_position(PamojaMavlinkHeader, uint, byte, byte, byte, int, int, float, out nint)
Builds a global-frame position setpoint frame.
public static PamojaStatus pamoja_mavlink_offboard_global_position(PamojaMavlinkHeader header, uint timeBootMs, byte coordinateFrame, byte targetSystem, byte targetComponent, int latInt, int lonInt, float alt, out nint outFrame)
Parameters
headerPamojaMavlinkHeadertimeBootMsuintcoordinateFramebytetargetSystembytetargetComponentbytelatIntintlonIntintaltfloatoutFramenint
Returns
pamoja_mavlink_offboard_local_position(PamojaMavlinkHeader, uint, byte, byte, byte, float, float, float, out nint)
Builds a local-frame position setpoint frame.
public static PamojaStatus pamoja_mavlink_offboard_local_position(PamojaMavlinkHeader header, uint timeBootMs, byte coordinateFrame, byte targetSystem, byte targetComponent, float x, float y, float z, out nint outFrame)
Parameters
headerPamojaMavlinkHeadertimeBootMsuintcoordinateFramebytetargetSystembytetargetComponentbytexfloatyfloatzfloatoutFramenint
Returns
pamoja_mavlink_offboard_local_velocity(PamojaMavlinkHeader, uint, byte, byte, byte, float, float, float, out nint)
Builds a local-frame velocity setpoint frame.
public static PamojaStatus pamoja_mavlink_offboard_local_velocity(PamojaMavlinkHeader header, uint timeBootMs, byte coordinateFrame, byte targetSystem, byte targetComponent, float vx, float vy, float vz, out nint outFrame)
Parameters
headerPamojaMavlinkHeadertimeBootMsuintcoordinateFramebytetargetSystembytetargetComponentbytevxfloatvyfloatvzfloatoutFramenint
Returns
pamoja_mavlink_offboard_type_mask(uint)
Builds a setpoint type_mask from the fields to use.
public static extern ushort pamoja_mavlink_offboard_type_mask(uint flags)
Parameters
flagsuint
Returns
pamoja_mavlink_parser_free(nint)
Releases a parser.
public static extern void pamoja_mavlink_parser_free(nint parser)
Parameters
parsernint
pamoja_mavlink_parser_new()
Creates a parser with an empty buffer.
public static extern nint pamoja_mavlink_parser_new()
Returns
pamoja_mavlink_parser_next(nint, out nint)
Takes the next completed frame out of the parser.
public static PamojaStatus pamoja_mavlink_parser_next(nint parser, out nint outFrame)
Parameters
Returns
pamoja_mavlink_parser_pending(nint)
Returns how many completed frames are waiting.
public static extern nuint pamoja_mavlink_parser_pending(nint parser)
Parameters
parsernint
Returns
pamoja_mavlink_parser_push(nint, ReadOnlySpan<byte>, nuint, nint)
Feeds bytes off a link into the parser.
public static PamojaStatus pamoja_mavlink_parser_push(nint parser, ReadOnlySpan<byte> bytes, nuint bytesLen, nint dialect)
Parameters
parsernintbytesReadOnlySpan<byte>bytesLennuintdialectnint
Returns
pamoja_mavlink_raw_message_to_frame(PamojaMavlinkHeader, uint, byte, ReadOnlySpan<byte>, nuint, out nint)
Assembles a v2 frame carrying a message this build does not type.
public static PamojaStatus pamoja_mavlink_raw_message_to_frame(PamojaMavlinkHeader header, uint msgid, byte crcExtra, ReadOnlySpan<byte> payload, nuint payloadLen, out nint outFrame)
Parameters
headerPamojaMavlinkHeadermsgiduintcrcExtrabytepayloadReadOnlySpan<byte>payloadLennuintoutFramenint
Returns
pamoja_mavlink_schema_at(nuint, out nint)
Returns the shape at a position in the built-in registry.
public static PamojaStatus pamoja_mavlink_schema_at(nuint index, out nint outSchema)
Parameters
Returns
pamoja_mavlink_schema_builder_build(nint, out nint)
Puts the declared fields in wire order and finishes the shape.
public static PamojaStatus pamoja_mavlink_schema_builder_build(nint builder, out nint outSchema)
Parameters
Returns
pamoja_mavlink_schema_builder_extension(nint, string, uint, byte)
Adds a MAVLink 2 extension field, in declared order.
public static PamojaStatus pamoja_mavlink_schema_builder_extension(nint builder, string name, uint fieldType, byte arrayLen)
Parameters
Returns
pamoja_mavlink_schema_builder_field(nint, string, uint, byte)
Adds a base field, in the order the definition declares it.
public static PamojaStatus pamoja_mavlink_schema_builder_field(nint builder, string name, uint fieldType, byte arrayLen)
Parameters
Returns
pamoja_mavlink_schema_builder_free(nint)
Releases a builder that was never built.
public static extern void pamoja_mavlink_schema_builder_free(nint builder)
Parameters
buildernint
pamoja_mavlink_schema_builder_new(uint, string)
Starts describing a message.
public static nint pamoja_mavlink_schema_builder_new(uint msgid, string name)
Parameters
Returns
pamoja_mavlink_schema_count()
Returns how many messages this build types.
public static extern nuint pamoja_mavlink_schema_count()
Returns
pamoja_mavlink_schema_crc_extra(nint)
Returns the CRC_EXTRA seed a schema implies.
public static extern byte pamoja_mavlink_schema_crc_extra(nint schema)
Parameters
schemanint
Returns
pamoja_mavlink_schema_field(nint, nuint, out PamojaMavlinkFieldInfo)
Describes one field of a message.
public static PamojaStatus pamoja_mavlink_schema_field(nint schema, nuint index, out PamojaMavlinkFieldInfo outField)
Parameters
schemanintindexnuintoutFieldPamojaMavlinkFieldInfo
Returns
pamoja_mavlink_schema_field_count(nint)
Returns how many fields a message has.
public static extern nuint pamoja_mavlink_schema_field_count(nint schema)
Parameters
schemanint
Returns
pamoja_mavlink_schema_for_id(uint, out nint)
Returns the shape of a message the engine types, by id.
public static PamojaStatus pamoja_mavlink_schema_for_id(uint msgid, out nint outSchema)
Parameters
Returns
pamoja_mavlink_schema_for_name(string, out nint)
Returns the shape of a message the engine types, by name.
public static PamojaStatus pamoja_mavlink_schema_for_name(string name, out nint outSchema)
Parameters
Returns
pamoja_mavlink_schema_free(nint)
Releases a schema.
public static extern void pamoja_mavlink_schema_free(nint schema)
Parameters
schemanint
pamoja_mavlink_schema_id(nint)
Returns the id of the message a schema describes.
public static extern uint pamoja_mavlink_schema_id(nint schema)
Parameters
schemanint
Returns
pamoja_mavlink_schema_name(nint)
Returns the name of the message a schema describes.
public static extern nint pamoja_mavlink_schema_name(nint schema)
Parameters
schemanint
Returns
pamoja_mavlink_schema_wire_len(nint)
Returns the length of the message on the wire, in bytes.
public static extern nuint pamoja_mavlink_schema_wire_len(nint schema)
Parameters
schemanint
Returns
pamoja_mavlink_signer_free(nint)
Releases a signer.
public static extern void pamoja_mavlink_signer_free(nint signer)
Parameters
signernint
pamoja_mavlink_signer_link_id(nint)
Returns the link a signer signs on.
public static extern byte pamoja_mavlink_signer_link_id(nint signer)
Parameters
signernint
Returns
pamoja_mavlink_signer_new(ReadOnlySpan<byte>, byte, ulong, out nint)
Creates a signer.
public static PamojaStatus pamoja_mavlink_signer_new(ReadOnlySpan<byte> key, byte linkId, ulong timestamp, out nint outSigner)
Parameters
keyReadOnlySpan<byte>linkIdbytetimestampulongoutSignernint
Returns
pamoja_mavlink_signer_sign(nint, PamojaMavlinkHeader, uint, ReadOnlySpan<byte>, nuint, byte, out nint)
Signs a message into a v2 frame.
public static PamojaStatus pamoja_mavlink_signer_sign(nint signer, PamojaMavlinkHeader header, uint msgid, ReadOnlySpan<byte> payload, nuint payloadLen, byte crcExtra, out nint outFrame)
Parameters
signernintheaderPamojaMavlinkHeadermsgiduintpayloadReadOnlySpan<byte>payloadLennuintcrcExtrabyteoutFramenint
Returns
pamoja_mavlink_timestamp_from_unix_micros(ulong)
Converts Unix time into the timestamp MAVLink signing counts in.
public static extern ulong pamoja_mavlink_timestamp_from_unix_micros(ulong unixMicros)
Parameters
unixMicrosulong
Returns
pamoja_mavlink_verifier_free(nint)
Releases a verifier.
public static extern void pamoja_mavlink_verifier_free(nint verifier)
Parameters
verifiernint
pamoja_mavlink_verifier_new(ReadOnlySpan<byte>, out nint)
Creates a verifier.
public static PamojaStatus pamoja_mavlink_verifier_new(ReadOnlySpan<byte> key, out nint outVerifier)
Parameters
keyReadOnlySpan<byte>outVerifiernint
Returns
pamoja_mavlink_verifier_set_window(nint, ulong)
Sets how far a timestamp may run ahead of the last accepted.
public static extern PamojaStatus pamoja_mavlink_verifier_set_window(nint verifier, ulong window)
Parameters
Returns
pamoja_mavlink_verifier_verify(nint, nint)
Checks a frame's signature and its place in the sequence.
public static extern PamojaStatus pamoja_mavlink_verifier_verify(nint verifier, nint frame)
Parameters
Returns
pamoja_mecanum_body_motion(PamojaMecanum, PamojaWheelSpeeds)
Returns the body twist a mecanum base makes from measured wheel speeds.
public static extern PamojaTwist pamoja_mecanum_body_motion(PamojaMecanum mecanum, PamojaWheelSpeeds wheels)
Parameters
mecanumPamojaMecanumwheelsPamojaWheelSpeeds
Returns
pamoja_mecanum_wheel_speeds(PamojaMecanum, PamojaTwist)
Returns the four wheel speeds a mecanum base needs for a body twist.
public static extern PamojaWheelSpeeds pamoja_mecanum_wheel_speeds(PamojaMecanum mecanum, PamojaTwist twist)
Parameters
mecanumPamojaMecanumtwistPamojaTwist
Returns
pamoja_median_capacity(nint)
Returns how many readings a median filter keeps.
public static extern nuint pamoja_median_capacity(nint median)
Parameters
mediannint
Returns
pamoja_median_free(nint)
Releases a median filter handle. Passing null is a no-op.
public static extern void pamoja_median_free(nint median)
Parameters
mediannint
pamoja_median_new()
Creates an empty median filter.
public static extern nint pamoja_median_new()
Returns
pamoja_median_update(nint, float)
Folds a reading in and returns the median of the window.
public static extern float pamoja_median_update(nint median, float reading)
Parameters
Returns
pamoja_median_value(nint, out float)
Reads the current median, if the filter has a reading.
public static bool pamoja_median_value(nint median, out float outValue)
Parameters
Returns
pamoja_median_with_capacity(nuint)
Creates an empty median filter keeping up to a capacity, or null for one out of range.
public static extern nint pamoja_median_with_capacity(nuint capacity)
Parameters
capacitynuint
Returns
pamoja_mesh_crc16(ReadOnlySpan<byte>, nuint)
Computes the CRC-16 a mesh frame carries.
public static ushort pamoja_mesh_crc16(ReadOnlySpan<byte> data, nuint dataLen)
Parameters
dataReadOnlySpan<byte>dataLennuint
Returns
pamoja_mesh_frame_broadcast(uint, ushort, ReadOnlySpan<byte>, nuint, out nint)
Builds a mesh frame addressed to every node.
public static PamojaStatus pamoja_mesh_frame_broadcast(uint src, ushort id, ReadOnlySpan<byte> payload, nuint payloadLen, out nint outFrame)
Parameters
Returns
pamoja_mesh_frame_bytes(nint)
Returns a pointer to the whole frame as it goes on the air.
public static extern nint pamoja_mesh_frame_bytes(nint frame)
Parameters
framenint
Returns
pamoja_mesh_frame_bytes_len(nint)
Returns the length of the whole frame.
public static extern nuint pamoja_mesh_frame_bytes_len(nint frame)
Parameters
framenint
Returns
pamoja_mesh_frame_dst(nint)
Returns the address a frame is addressed to.
public static extern uint pamoja_mesh_frame_dst(nint frame)
Parameters
framenint
Returns
pamoja_mesh_frame_free(nint)
Releases a mesh frame handle. Passing null is a no-op.
public static extern void pamoja_mesh_frame_free(nint frame)
Parameters
framenint
pamoja_mesh_frame_hop_limit(nint)
Returns how many further relays a frame may take.
public static extern byte pamoja_mesh_frame_hop_limit(nint frame)
Parameters
framenint
Returns
pamoja_mesh_frame_id(nint)
Returns the sequence number a frame carries.
public static extern ushort pamoja_mesh_frame_id(nint frame)
Parameters
framenint
Returns
pamoja_mesh_frame_is_broadcast(nint)
Reports whether a frame is addressed to every node.
public static bool pamoja_mesh_frame_is_broadcast(nint frame)
Parameters
framenint
Returns
pamoja_mesh_frame_new(uint, uint, ushort, ReadOnlySpan<byte>, nuint, out nint)
Builds a mesh frame addressed to one node.
public static PamojaStatus pamoja_mesh_frame_new(uint src, uint dst, ushort id, ReadOnlySpan<byte> payload, nuint payloadLen, out nint outFrame)
Parameters
Returns
pamoja_mesh_frame_parse(ReadOnlySpan<byte>, nuint, out nint)
Parses a mesh frame received off a radio.
public static PamojaStatus pamoja_mesh_frame_parse(ReadOnlySpan<byte> bytes, nuint bytesLen, out nint outFrame)
Parameters
bytesReadOnlySpan<byte>bytesLennuintoutFramenint
Returns
pamoja_mesh_frame_payload(nint)
Returns a pointer to the payload a frame carries.
public static extern nint pamoja_mesh_frame_payload(nint frame)
Parameters
framenint
Returns
pamoja_mesh_frame_payload_len(nint)
Returns the length of the payload a frame carries.
public static extern nuint pamoja_mesh_frame_payload_len(nint frame)
Parameters
framenint
Returns
pamoja_mesh_frame_relayed(nint, out nint)
Returns the same frame with one hop spent, ready to forward.
public static bool pamoja_mesh_frame_relayed(nint frame, out nint outFrame)
Parameters
Returns
pamoja_mesh_frame_set_hop_limit(nint, byte)
Sets the number of relays a frame may still take.
public static extern void pamoja_mesh_frame_set_hop_limit(nint frame, byte hopLimit)
Parameters
pamoja_mesh_frame_src(nint)
Returns the address of the node a frame came from.
public static extern uint pamoja_mesh_frame_src(nint frame)
Parameters
framenint
Returns
pamoja_mesh_frame_version(nint)
Returns the protocol version a frame declares.
public static extern byte pamoja_mesh_frame_version(nint frame)
Parameters
framenint
Returns
pamoja_mesh_seen_capacity(nint)
Returns how many packets a duplicate cache remembers.
public static extern nuint pamoja_mesh_seen_capacity(nint cache)
Parameters
cachenint
Returns
pamoja_mesh_seen_contains(nint, uint, ushort)
Reports whether a packet is remembered, without recording it.
public static bool pamoja_mesh_seen_contains(nint cache, uint src, ushort id)
Parameters
Returns
pamoja_mesh_seen_free(nint)
Releases a duplicate cache handle. Passing null is a no-op.
public static extern void pamoja_mesh_seen_free(nint cache)
Parameters
cachenint
pamoja_mesh_seen_new(nuint)
Creates an empty duplicate cache of the size given.
public static extern nint pamoja_mesh_seen_new(nuint capacity)
Parameters
capacitynuint
Returns
pamoja_mesh_seen_record(nint, uint, ushort)
Records a packet and reports whether it was new.
public static bool pamoja_mesh_seen_record(nint cache, uint src, ushort id)
Parameters
Returns
pamoja_message_free(nint)
Releases a message handle.
public static extern void pamoja_message_free(nint message)
Parameters
messagenint
pamoja_message_new(nint, ReadOnlySpan<byte>, nuint)
Builds a message for a host to deliver.
public static nint pamoja_message_new(nint topic, ReadOnlySpan<byte> payload, nuint payloadLen)
Parameters
topicnintpayloadReadOnlySpan<byte>payloadLennuint
Returns
pamoja_message_payload(nint)
Returns a pointer to a message payload.
public static extern nint pamoja_message_payload(nint message)
Parameters
messagenint
Returns
pamoja_message_payload_len(nint)
Returns the length in bytes of a message payload.
public static extern nuint pamoja_message_payload_len(nint message)
Parameters
messagenint
Returns
pamoja_message_topic(nint)
Returns the topic a message arrived on.
public static extern nint pamoja_message_topic(nint message)
Parameters
messagenint
Returns
pamoja_modbus_client_free(nint)
Releases a client. Passing null is a no-op.
public static extern void pamoja_modbus_client_free(nint client)
Parameters
clientnint
pamoja_modbus_client_new(nint, out nint)
Makes a client on a port.
public static PamojaStatus pamoja_modbus_client_new(nint port, out nint outClient)
Parameters
Returns
pamoja_modbus_client_read_coils(nint, byte, ushort, ushort, Span<byte>, out PamojaModbusClientError)
Reads coils, one byte per coil.
public static PamojaStatus pamoja_modbus_client_read_coils(nint client, byte unit, ushort start, ushort quantity, Span<byte> outValues, out PamojaModbusClientError outError)
Parameters
clientnintunitbytestartushortquantityushortoutValuesSpan<byte>outErrorPamojaModbusClientError
Returns
pamoja_modbus_client_read_discrete_inputs(nint, byte, ushort, ushort, Span<byte>, out PamojaModbusClientError)
Reads discrete inputs, one byte per input.
public static PamojaStatus pamoja_modbus_client_read_discrete_inputs(nint client, byte unit, ushort start, ushort quantity, Span<byte> outValues, out PamojaModbusClientError outError)
Parameters
clientnintunitbytestartushortquantityushortoutValuesSpan<byte>outErrorPamojaModbusClientError
Returns
pamoja_modbus_client_read_holding_registers(nint, byte, ushort, ushort, Span<ushort>, out PamojaModbusClientError)
Reads holding registers.
public static PamojaStatus pamoja_modbus_client_read_holding_registers(nint client, byte unit, ushort start, ushort quantity, Span<ushort> outValues, out PamojaModbusClientError outError)
Parameters
clientnintunitbytestartushortquantityushortoutValuesSpan<ushort>outErrorPamojaModbusClientError
Returns
pamoja_modbus_client_read_input_registers(nint, byte, ushort, ushort, Span<ushort>, out PamojaModbusClientError)
Reads input registers.
public static PamojaStatus pamoja_modbus_client_read_input_registers(nint client, byte unit, ushort start, ushort quantity, Span<ushort> outValues, out PamojaModbusClientError outError)
Parameters
clientnintunitbytestartushortquantityushortoutValuesSpan<ushort>outErrorPamojaModbusClientError
Returns
pamoja_modbus_client_response_timeout_micros(nint)
Returns a client's response timeout, in microseconds.
public static extern ulong pamoja_modbus_client_response_timeout_micros(nint client)
Parameters
clientnint
Returns
pamoja_modbus_client_set_response_timeout(nint, ulong)
Sets how long a client waits for a whole reply, in microseconds.
public static extern void pamoja_modbus_client_set_response_timeout(nint client, ulong micros)
Parameters
pamoja_modbus_client_set_turnaround(nint, ulong)
Sets how long a client leaves the line quiet after a broadcast, in microseconds.
public static extern void pamoja_modbus_client_set_turnaround(nint client, ulong micros)
Parameters
pamoja_modbus_client_turnaround_micros(nint)
Returns a client's turnaround delay, in microseconds.
public static extern ulong pamoja_modbus_client_turnaround_micros(nint client)
Parameters
clientnint
Returns
pamoja_modbus_client_write_multiple_coils(nint, byte, ushort, ReadOnlySpan<byte>, nuint, out PamojaModbusClientError)
Writes a run of coils, one byte per coil.
public static PamojaStatus pamoja_modbus_client_write_multiple_coils(nint client, byte unit, ushort start, ReadOnlySpan<byte> values, nuint len, out PamojaModbusClientError outError)
Parameters
clientnintunitbytestartushortvaluesReadOnlySpan<byte>lennuintoutErrorPamojaModbusClientError
Returns
pamoja_modbus_client_write_multiple_registers(nint, byte, ushort, ReadOnlySpan<ushort>, nuint, out PamojaModbusClientError)
Writes a run of holding registers.
public static PamojaStatus pamoja_modbus_client_write_multiple_registers(nint client, byte unit, ushort start, ReadOnlySpan<ushort> values, nuint len, out PamojaModbusClientError outError)
Parameters
clientnintunitbytestartushortvaluesReadOnlySpan<ushort>lennuintoutErrorPamojaModbusClientError
Returns
pamoja_modbus_client_write_single_coil(nint, byte, ushort, bool, out PamojaModbusClientError)
Writes one coil.
public static PamojaStatus pamoja_modbus_client_write_single_coil(nint client, byte unit, ushort address, bool on, out PamojaModbusClientError outError)
Parameters
clientnintunitbyteaddressushortonbooloutErrorPamojaModbusClientError
Returns
pamoja_modbus_client_write_single_register(nint, byte, ushort, ushort, out PamojaModbusClientError)
Writes one holding register.
public static PamojaStatus pamoja_modbus_client_write_single_register(nint client, byte unit, ushort address, ushort value, out PamojaModbusClientError outError)
Parameters
clientnintunitbyteaddressushortvalueushortoutErrorPamojaModbusClientError
Returns
pamoja_modbus_crc16(ReadOnlySpan<byte>, nuint)
Computes the CRC-16/MODBUS that every RTU frame ends with.
public static ushort pamoja_modbus_crc16(ReadOnlySpan<byte> bytes, nuint bytesLen)
Parameters
bytesReadOnlySpan<byte>bytesLennuint
Returns
pamoja_modbus_frame_address(nint)
Returns the unit address a frame is addressed to or came from.
public static extern byte pamoja_modbus_frame_address(nint frame)
Parameters
framenint
Returns
pamoja_modbus_frame_coils(nint, ushort, out nint)
Reads the coils out of a read-bits response, one byte per coil.
public static PamojaStatus pamoja_modbus_frame_coils(nint frame, ushort count, out nint outBuffer)
Parameters
Returns
pamoja_modbus_frame_exception(nint)
Returns the exception code a device reported, or 0 for none.
public static extern byte pamoja_modbus_frame_exception(nint frame)
Parameters
framenint
Returns
pamoja_modbus_frame_free(nint)
Releases a parsed frame handle. Passing null is a no-op.
public static extern void pamoja_modbus_frame_free(nint frame)
Parameters
framenint
pamoja_modbus_frame_function(nint)
Returns a frame's function code as it appeared on the wire.
public static extern byte pamoja_modbus_frame_function(nint frame)
Parameters
framenint
Returns
pamoja_modbus_frame_gap_nanos(PamojaSerialSettings, out ulong)
Returns the silence that separates two frames, in nanoseconds.
public static PamojaStatus pamoja_modbus_frame_gap_nanos(PamojaSerialSettings settings, out ulong outNanos)
Parameters
settingsPamojaSerialSettingsoutNanosulong
Returns
pamoja_modbus_frame_parse(ReadOnlySpan<byte>, nuint, out nint)
Parses a received RTU frame, verifying its CRC.
public static PamojaStatus pamoja_modbus_frame_parse(ReadOnlySpan<byte> bytes, nuint bytesLen, out nint outFrame)
Parameters
bytesReadOnlySpan<byte>bytesLennuintoutFramenint
Returns
pamoja_modbus_frame_pdu(nint)
Returns a pointer to a frame's PDU.
public static extern nint pamoja_modbus_frame_pdu(nint frame)
Parameters
framenint
Returns
pamoja_modbus_frame_pdu_len(nint)
Returns the length in bytes of a frame's PDU.
public static extern nuint pamoja_modbus_frame_pdu_len(nint frame)
Parameters
framenint
Returns
pamoja_modbus_frame_registers(nint, out nint)
Reads the 16-bit registers out of a read-registers response.
public static PamojaStatus pamoja_modbus_frame_registers(nint frame, out nint outRegisters)
Parameters
Returns
pamoja_modbus_line_attach(nint, nint)
Puts a device on a line, which shares it.
public static extern PamojaStatus pamoja_modbus_line_attach(nint line, nint server)
Parameters
Returns
pamoja_modbus_line_free(nint)
Releases the caller's handle to a line. Passing null is a no-op.
public static extern void pamoja_modbus_line_free(nint line)
Parameters
linenint
pamoja_modbus_line_len(nint)
Returns how many devices are on a line.
public static extern nuint pamoja_modbus_line_len(nint line)
Parameters
linenint
Returns
pamoja_modbus_line_new()
Makes a line with no devices on it.
public static extern nint pamoja_modbus_line_new()
Returns
pamoja_modbus_line_port(nint, PamojaSerialSettings, out nint)
Makes a serial port with a line on its far end.
public static PamojaStatus pamoja_modbus_line_port(nint line, PamojaSerialSettings settings, out nint outPort)
Parameters
linenintsettingsPamojaSerialSettingsoutPortnint
Returns
pamoja_modbus_raw(byte, byte, ReadOnlySpan<byte>, nuint, out nint)
Builds a request frame from a raw function code and data.
public static PamojaStatus pamoja_modbus_raw(byte address, byte function, ReadOnlySpan<byte> data, nuint dataLen, out nint outBuffer)
Parameters
Returns
pamoja_modbus_read_coils(byte, ushort, ushort, out nint)
Builds a read-coils request frame (function 0x01).
public static PamojaStatus pamoja_modbus_read_coils(byte address, ushort start, ushort count, out nint outBuffer)
Parameters
Returns
pamoja_modbus_read_discrete_inputs(byte, ushort, ushort, out nint)
Builds a read-discrete-inputs request frame (function 0x02).
public static PamojaStatus pamoja_modbus_read_discrete_inputs(byte address, ushort start, ushort count, out nint outBuffer)
Parameters
Returns
pamoja_modbus_read_holding_registers(byte, ushort, ushort, out nint)
Builds a read-holding-registers request frame (function 0x03).
public static PamojaStatus pamoja_modbus_read_holding_registers(byte address, ushort start, ushort count, out nint outBuffer)
Parameters
Returns
pamoja_modbus_read_holding_registers_reply(byte, ReadOnlySpan<ushort>, nuint, out nint)
Builds the reply to a read-holding-registers request.
public static PamojaStatus pamoja_modbus_read_holding_registers_reply(byte address, ReadOnlySpan<ushort> values, nuint valuesLen, out nint outBuffer)
Parameters
addressbytevaluesReadOnlySpan<ushort>valuesLennuintoutBuffernint
Returns
pamoja_modbus_read_input_registers(byte, ushort, ushort, out nint)
Builds a read-input-registers request frame (function 0x04).
public static PamojaStatus pamoja_modbus_read_input_registers(byte address, ushort start, ushort count, out nint outBuffer)
Parameters
Returns
pamoja_modbus_read_input_registers_reply(byte, ReadOnlySpan<ushort>, nuint, out nint)
Builds the reply to a read-input-registers request.
public static PamojaStatus pamoja_modbus_read_input_registers_reply(byte address, ReadOnlySpan<ushort> values, nuint valuesLen, out nint outBuffer)
Parameters
addressbytevaluesReadOnlySpan<ushort>valuesLennuintoutBuffernint
Returns
pamoja_modbus_server_answer(nint, ReadOnlySpan<byte>, nuint, out nint)
Answers one RTU frame, leaving the buffer null when the device stays silent.
public static PamojaStatus pamoja_modbus_server_answer(nint server, ReadOnlySpan<byte> frame, nuint len, out nint outBuffer)
Parameters
servernintframeReadOnlySpan<byte>lennuintoutBuffernint
Returns
pamoja_modbus_server_coil(nint, ushort, out bool)
Reads a coil, reporting whether the device has it.
public static bool pamoja_modbus_server_coil(nint server, ushort address, out bool outOn)
Parameters
Returns
pamoja_modbus_server_discrete_input(nint, ushort, out bool)
Reads a discrete input, reporting whether the device has it.
public static bool pamoja_modbus_server_discrete_input(nint server, ushort address, out bool outOn)
Parameters
Returns
pamoja_modbus_server_free(nint)
Releases the caller's handle to a device. Passing null is a no-op.
public static extern void pamoja_modbus_server_free(nint server)
Parameters
servernint
pamoja_modbus_server_holding_register(nint, ushort, out ushort)
Reads a holding register, reporting whether the device has it.
public static bool pamoja_modbus_server_holding_register(nint server, ushort address, out ushort outValue)
Parameters
Returns
pamoja_modbus_server_input_register(nint, ushort, out ushort)
Reads an input register, reporting whether the device has it.
public static bool pamoja_modbus_server_input_register(nint server, ushort address, out ushort outValue)
Parameters
Returns
pamoja_modbus_server_new(byte, out nint)
Makes a device at a unit address, with every table empty.
public static PamojaStatus pamoja_modbus_server_new(byte unit, out nint outServer)
Parameters
Returns
pamoja_modbus_server_served(nint)
Returns how many requests a device has carried out.
public static extern nuint pamoja_modbus_server_served(nint server)
Parameters
servernint
Returns
pamoja_modbus_server_set_coils(nint, ushort, ReadOnlySpan<byte>, nuint)
Sets coils from an address on, one byte per coil.
public static PamojaStatus pamoja_modbus_server_set_coils(nint server, ushort start, ReadOnlySpan<byte> values, nuint len)
Parameters
servernintstartushortvaluesReadOnlySpan<byte>lennuint
Returns
pamoja_modbus_server_set_discrete_inputs(nint, ushort, ReadOnlySpan<byte>, nuint)
Sets discrete inputs from an address on, one byte per input.
public static PamojaStatus pamoja_modbus_server_set_discrete_inputs(nint server, ushort start, ReadOnlySpan<byte> values, nuint len)
Parameters
servernintstartushortvaluesReadOnlySpan<byte>lennuint
Returns
pamoja_modbus_server_set_holding_registers(nint, ushort, ReadOnlySpan<ushort>, nuint)
Sets holding registers from an address on.
public static PamojaStatus pamoja_modbus_server_set_holding_registers(nint server, ushort start, ReadOnlySpan<ushort> values, nuint len)
Parameters
servernintstartushortvaluesReadOnlySpan<ushort>lennuint
Returns
pamoja_modbus_server_set_input_registers(nint, ushort, ReadOnlySpan<ushort>, nuint)
Sets input registers from an address on.
public static PamojaStatus pamoja_modbus_server_set_input_registers(nint server, ushort start, ReadOnlySpan<ushort> values, nuint len)
Parameters
servernintstartushortvaluesReadOnlySpan<ushort>lennuint
Returns
pamoja_modbus_server_unit(nint)
Returns a device's unit address.
public static extern byte pamoja_modbus_server_unit(nint server)
Parameters
servernint
Returns
pamoja_modbus_write_multiple_coils(byte, ushort, ReadOnlySpan<byte>, nuint, out nint)
Builds a write-multiple-coils request frame (function 0x0F).
public static PamojaStatus pamoja_modbus_write_multiple_coils(byte address, ushort start, ReadOnlySpan<byte> values, nuint count, out nint outBuffer)
Parameters
Returns
pamoja_modbus_write_multiple_registers(byte, ushort, ReadOnlySpan<ushort>, nuint, out nint)
Builds a write-multiple-registers request frame (function 0x10).
public static PamojaStatus pamoja_modbus_write_multiple_registers(byte address, ushort start, ReadOnlySpan<ushort> values, nuint count, out nint outBuffer)
Parameters
Returns
pamoja_modbus_write_single_coil(byte, ushort, bool, out nint)
Builds a write-single-coil request frame (function 0x05).
public static PamojaStatus pamoja_modbus_write_single_coil(byte address, ushort coil, bool on, out nint outBuffer)
Parameters
Returns
pamoja_modbus_write_single_register(byte, ushort, ushort, out nint)
Builds a write-single-register request frame (function 0x06).
public static PamojaStatus pamoja_modbus_write_single_register(byte address, ushort register, ushort value, out nint outBuffer)
Parameters
Returns
pamoja_mqtt_client_connect(nint)
Connects to the broker and starts the background event loop.
public static extern PamojaStatus pamoja_mqtt_client_connect(nint client)
Parameters
clientnint
Returns
pamoja_mqtt_client_disconnect(nint)
Closes the connection and stops the background event loop.
public static extern PamojaStatus pamoja_mqtt_client_disconnect(nint client)
Parameters
clientnint
Returns
pamoja_mqtt_client_free(nint)
Releases a client handle. Passing null is a no-op.
public static extern void pamoja_mqtt_client_free(nint client)
Parameters
clientnint
pamoja_mqtt_client_is_connected(nint)
Reports whether the client currently holds an active connection.
public static bool pamoja_mqtt_client_is_connected(nint client)
Parameters
clientnint
Returns
pamoja_mqtt_client_new(ref PamojaMqttConfig)
Creates a disconnected MQTT client, or returns null on failure.
public static nint pamoja_mqtt_client_new(ref PamojaMqttConfig config)
Parameters
configPamojaMqttConfig
Returns
pamoja_mqtt_client_publish(nint, nint, nint, nuint)
Publishes a payload to a topic.
public static extern PamojaStatus pamoja_mqtt_client_publish(nint client, nint topic, nint payload, nuint payloadLen)
Parameters
Returns
pamoja_mqtt_client_publish_with(nint, nint, nint, nuint, PamojaQos, bool, bool)
Publishes with a quality of service and retain flag of its own, waiting for the
broker's acknowledgment when confirmed is set.
public static PamojaStatus pamoja_mqtt_client_publish_with(nint client, nint topic, nint payload, nuint payloadLen, PamojaQos qos, bool retain, bool confirmed)
Parameters
Returns
pamoja_mqtt_client_recv(nint, out nint)
Awaits the next message; sets outMessage to null at end of stream.
public static PamojaStatus pamoja_mqtt_client_recv(nint client, out nint outMessage)
Parameters
Returns
pamoja_mqtt_client_recv_within(nint, ulong, out nint, out bool)
Waits a limited time for the next message; outTimedOut says whether
the time ran out.
public static PamojaStatus pamoja_mqtt_client_recv_within(nint client, ulong timeoutMs, out nint outMessage, out bool outTimedOut)
Parameters
Returns
pamoja_mqtt_client_subscribe(nint, nint)
Subscribes to a topic filter.
public static extern PamojaStatus pamoja_mqtt_client_subscribe(nint client, nint topic)
Parameters
Returns
pamoja_mqtt_message_free(nint)
Releases a message handle. Passing null is a no-op.
public static extern void pamoja_mqtt_message_free(nint message)
Parameters
messagenint
pamoja_mqtt_message_payload(nint)
Returns a pointer to a message's payload bytes.
public static extern nint pamoja_mqtt_message_payload(nint message)
Parameters
messagenint
Returns
pamoja_mqtt_message_payload_len(nint)
Returns the length in bytes of a message's payload.
public static extern nuint pamoja_mqtt_message_payload_len(nint message)
Parameters
messagenint
Returns
pamoja_mqtt_message_topic(nint)
Returns a pointer to a message's null-terminated UTF-8 topic.
public static extern nint pamoja_mqtt_message_topic(nint message)
Parameters
messagenint
Returns
pamoja_obstacle_stop(PamojaTwist, float, float)
Cuts forward and sideways motion when an obstacle is within the stopping distance.
public static extern PamojaTwist pamoja_obstacle_stop(PamojaTwist twist, float rangeM, float stopDistanceM)
Parameters
twistPamojaTwistrangeMfloatstopDistanceMfloat
Returns
pamoja_odometry_free(nint)
Releases an odometry handle. Passing null is a no-op.
public static extern void pamoja_odometry_free(nint odometry)
Parameters
odometrynint
pamoja_odometry_fuse_heading(nint, float, float)
Nudges an odometry estimate's heading toward an absolute measurement.
public static extern void pamoja_odometry_fuse_heading(nint odometry, float measured, float weight)
Parameters
pamoja_odometry_integrate(nint, float, float, float)
Integrates a body motion over a time step onto an odometry estimate.
public static extern PamojaPose pamoja_odometry_integrate(nint odometry, float linear, float angular, float dt)
Parameters
Returns
pamoja_odometry_integrate_wheels(nint, float, float, PamojaDiffDrive)
Integrates the distances two wheels rolled onto an odometry estimate.
public static extern PamojaPose pamoja_odometry_integrate_wheels(nint odometry, float left, float right, PamojaDiffDrive drive)
Parameters
odometrynintleftfloatrightfloatdrivePamojaDiffDrive
Returns
pamoja_odometry_new(PamojaPose)
Creates an odometry estimate starting from a known pose.
public static extern nint pamoja_odometry_new(PamojaPose start)
Parameters
startPamojaPose
Returns
pamoja_odometry_pose(nint)
Reads an odometry estimate's pose.
public static extern PamojaPose pamoja_odometry_pose(nint odometry)
Parameters
odometrynint
Returns
pamoja_odometry_reset(nint, PamojaPose)
Sets an odometry estimate to a known pose.
public static extern void pamoja_odometry_reset(nint odometry, PamojaPose pose)
Parameters
odometrynintposePamojaPose
pamoja_opt3001_config_bits(PamojaOpt3001Config)
Assembles the 16-bit OPT3001 configuration register value. # Returns The register value to write, with the read-only status bits written as zero.
public static extern ushort pamoja_opt3001_config_bits(PamojaOpt3001Config config)
Parameters
configPamojaOpt3001Config
Returns
pamoja_opt3001_config_from_bits(ushort, out PamojaOpt3001Config)
Parses a 16-bit OPT3001 configuration register value. # Returns [PamojaStatus::Ok], with *out_config filled in. Every register value decodes, so this fails only on a null pointer. # Safety out_config must point to a writable PamojaOpt3001Config.
public static PamojaStatus pamoja_opt3001_config_from_bits(ushort bits, out PamojaOpt3001Config outConfig)
Parameters
bitsushortoutConfigPamojaOpt3001Config
Returns
pamoja_opt3001_configuration(nint, out PamojaOpt3001Config)
Copies the configuration an OPT3001 driver writes.
public static PamojaStatus pamoja_opt3001_configuration(nint sensor, out PamojaOpt3001Config outConfig)
Parameters
sensornintoutConfigPamojaOpt3001Config
Returns
pamoja_opt3001_conversion_millis(bool)
Returns the conversion time an OPT3001 setting selects. # Returns The time in milliseconds: 800 for the long conversion, 100 otherwise.
public static ushort pamoja_opt3001_conversion_millis(bool longConversion)
Parameters
longConversionbool
Returns
pamoja_opt3001_fault_count(byte)
Returns how many consecutive faults an OPT3001 fault-count code requires. # Returns The fault count: 1, 2, 4, or 8.
public static extern byte pamoja_opt3001_fault_count(byte code)
Parameters
codebyte
Returns
pamoja_opt3001_free(nint)
Releases an OPT3001 driver. Passing null is a no-op.
public static extern void pamoja_opt3001_free(nint sensor)
Parameters
sensornint
pamoja_opt3001_full_scale_milli_lux(byte, out uint)
Returns the full scale an OPT3001 range number covers. # Returns true when the range is one the part defines, with *out_milli_lux set to the full scale; false for a reserved range number, which has none. # Safety out_milli_lux must point to a writable uint32_t.
public static bool pamoja_opt3001_full_scale_milli_lux(byte rangeNumber, out uint outMilliLux)
Parameters
Returns
pamoja_opt3001_init(nint)
Identifies and configures an OPT3001.
public static extern PamojaStatus pamoja_opt3001_init(nint sensor)
Parameters
sensornint
Returns
pamoja_opt3001_is_automatic_range(byte)
Reports whether an OPT3001 range number sets the full scale automatically. # Returns true for the automatic range number, which has no fixed full scale.
public static bool pamoja_opt3001_is_automatic_range(byte rangeNumber)
Parameters
rangeNumberbyte
Returns
pamoja_opt3001_lsb_milli_lux(byte, out uint)
Returns the illuminance one count carries at an OPT3001 exponent. # Returns true when the exponent is one the part defines, with *out_milli_lux set to the step; false for a reserved exponent. # Safety out_milli_lux must point to a writable uint32_t.
public static bool pamoja_opt3001_lsb_milli_lux(byte exponent, out uint outMilliLux)
Parameters
Returns
pamoja_opt3001_lux(ushort)
Converts a raw OPT3001 result register to lux. # Returns The illuminance.
public static extern float pamoja_opt3001_lux(ushort raw)
Parameters
rawushort
Returns
pamoja_opt3001_measure(nint, out PamojaOpt3001Reading)
Runs one OPT3001 conversion and reads the illuminance.
public static PamojaStatus pamoja_opt3001_measure(nint sensor, out PamojaOpt3001Reading outReading)
Parameters
sensornintoutReadingPamojaOpt3001Reading
Returns
pamoja_opt3001_milli_lux(ushort)
Converts a raw OPT3001 result register to milli-lux. # Returns The illuminance, exact in integer arithmetic.
public static extern uint pamoja_opt3001_milli_lux(ushort raw)
Parameters
rawushort
Returns
pamoja_opt3001_new(nint, byte, PamojaOpt3001Settings, out nint)
Creates an OPT3001 driver on a bus.
public static PamojaStatus pamoja_opt3001_new(nint bus, byte address, PamojaOpt3001Settings settings, out nint outSensor)
Parameters
busnintaddressbytesettingsPamojaOpt3001SettingsoutSensornint
Returns
pamoja_opt3001_raw_from_milli_lux(uint)
Builds the OPT3001 result register that decodes to an illuminance. # Returns The register value, using the smallest exponent that fits and saturating at full scale.
public static extern ushort pamoja_opt3001_raw_from_milli_lux(uint milliLux)
Parameters
milliLuxuint
Returns
pamoja_opt3001_set_limits(nint, uint, uint)
Writes the OPT3001's low and high limits, in millilux.
public static extern PamojaStatus pamoja_opt3001_set_limits(nint sensor, uint lowMilliLux, uint highMilliLux)
Parameters
Returns
pamoja_opt3001_settings_default()
Returns the settings an OPT3001 driver starts with.
public static extern PamojaOpt3001Settings pamoja_opt3001_settings_default()
Returns
pamoja_opt3001_sim_part(byte)
Creates a simulated OPT3001 reading its default illuminance.
public static extern nint pamoja_opt3001_sim_part(byte address)
Parameters
addressbyte
Returns
pamoja_opt3001_sim_reporting(byte, float)
Creates a simulated OPT3001 that reads what it is asked to.
public static extern nint pamoja_opt3001_sim_reporting(byte address, float lux)
Parameters
Returns
pamoja_opt3001_word_from_bytes(ReadOnlySpan<byte>, nuint, out ushort)
Reads the two bytes an OPT3001 sends for a register, most significant first. # Returns [PamojaStatus::Ok] on success, with *out_word set, or [PamojaStatus::InvalidArgument] if the buffer is not two bytes. # Safety bytes must point to at least bytes_len readable bytes, and out_word must point to a writable uint16_t.
public static PamojaStatus pamoja_opt3001_word_from_bytes(ReadOnlySpan<byte> bytes, nuint bytesLen, out ushort outWord)
Parameters
bytesReadOnlySpan<byte>bytesLennuintoutWordushort
Returns
pamoja_opt3001_word_to_bytes(ushort, Span<byte>)
Builds the two bytes an OPT3001 sends for a register, most significant first. # Returns [PamojaStatus::Ok] on success, with the two bytes written to out_bytes, or [PamojaStatus::InvalidArgument] if out_bytes is null. # Safety out_bytes must point to at least two writable bytes.
public static PamojaStatus pamoja_opt3001_word_to_bytes(ushort word, Span<byte> outBytes)
Parameters
Returns
pamoja_pca9685_channel(nint, byte, out PamojaPwm)
Reads one channel's four register bytes back from the part.
public static PamojaStatus pamoja_pca9685_channel(nint driver, byte channel, out PamojaPwm pwm)
Parameters
Returns
pamoja_pca9685_channel_register(byte, out byte)
Returns the first of a PCA9685 channel's four registers.
public static PamojaStatus pamoja_pca9685_channel_register(byte channel, out byte outRegister)
Parameters
Returns
pamoja_pca9685_free(nint)
Releases a driver and its share of the bus.
public static extern void pamoja_pca9685_free(nint driver)
Parameters
drivernint
pamoja_pca9685_frequency(nint)
Returns the frequency the part runs at after the prescaler rounds.
public static extern float pamoja_pca9685_frequency(nint driver)
Parameters
drivernint
Returns
pamoja_pca9685_frequency_for_prescale(byte, uint)
Returns the update rate a PCA9685 prescale value produces.
public static extern float pamoja_pca9685_frequency_for_prescale(byte prescale, uint oscHz)
Parameters
Returns
pamoja_pca9685_init(nint)
Programs the prescale and the output wiring, and wakes the oscillator.
public static extern PamojaStatus pamoja_pca9685_init(nint driver)
Parameters
drivernint
Returns
pamoja_pca9685_new(nint, byte, PamojaPca9685Settings, out nint)
Creates a PCA9685 driver on a bus.
public static PamojaStatus pamoja_pca9685_new(nint bus, byte address, PamojaPca9685Settings settings, out nint outDriver)
Parameters
busnintaddressbytesettingsPamojaPca9685SettingsoutDrivernint
Returns
pamoja_pca9685_prescale(nint)
Returns the prescale value the driver writes.
public static extern byte pamoja_pca9685_prescale(nint driver)
Parameters
drivernint
Returns
pamoja_pca9685_prescale_for_frequency(uint, uint)
Returns the prescale value that sets a PCA9685 update rate.
public static extern byte pamoja_pca9685_prescale_for_frequency(uint updateRateHz, uint oscHz)
Parameters
Returns
pamoja_pca9685_set_all(nint, PamojaPwm)
Loads every channel with the same four bytes.
public static extern PamojaStatus pamoja_pca9685_set_all(nint driver, PamojaPwm pwm)
Parameters
Returns
pamoja_pca9685_set_channel(nint, byte, PamojaPwm)
Loads one channel's four register bytes.
public static extern PamojaStatus pamoja_pca9685_set_channel(nint driver, byte channel, PamojaPwm pwm)
Parameters
Returns
pamoja_pca9685_settings_default()
Returns the settings a PCA9685 driver takes when given none.
public static extern PamojaPca9685Settings pamoja_pca9685_settings_default()
Returns
pamoja_pca9685_sim_part(byte)
Creates a simulated PCA9685 as it powers up.
public static extern nint pamoja_pca9685_sim_part(byte address)
Parameters
addressbyte
Returns
pamoja_pca9685_sleep(nint)
Stops the oscillator.
public static extern PamojaStatus pamoja_pca9685_sleep(nint driver)
Parameters
drivernint
Returns
pamoja_pca9685_software_reset(nint)
Sends the general-call software reset.
public static extern PamojaStatus pamoja_pca9685_software_reset(nint driver)
Parameters
drivernint
Returns
pamoja_pca9685_wake(nint)
Wakes the oscillator and restarts the channels.
public static extern PamojaStatus pamoja_pca9685_wake(nint driver)
Parameters
drivernint
Returns
pamoja_pid_free(nint)
Releases a PID handle. Passing null is a no-op.
public static extern void pamoja_pid_free(nint pid)
Parameters
pidnint
pamoja_pid_new(float, float, float)
Creates a PID controller with no output limits.
public static extern nint pamoja_pid_new(float kp, float ki, float kd)
Parameters
Returns
pamoja_pid_new_with_limits(float, float, float, float, float)
Creates a PID controller clamped to the given output range.
public static extern nint pamoja_pid_new_with_limits(float kp, float ki, float kd, float min, float max)
Parameters
Returns
pamoja_pid_reset(nint)
Clears a PID controller's integral, last error, and last output.
public static extern void pamoja_pid_reset(nint pid)
Parameters
pidnint
pamoja_pid_update(nint, float, float, float)
Advances a PID controller by one step.
public static extern float pamoja_pid_update(nint pid, float setpoint, float measurement, float dt)
Parameters
Returns
pamoja_pin_edge_triggered_by(PamojaPinEdge, PamojaPinLevel, PamojaPinLevel)
Reports whether a transition fires an interrupt trigger.
public static bool pamoja_pin_edge_triggered_by(PamojaPinEdge edge, PamojaPinLevel from, PamojaPinLevel to)
Parameters
edgePamojaPinEdgefromPamojaPinLeveltoPamojaPinLevel
Returns
pamoja_pin_level_from_bool(bool)
Returns the level a boolean names.
public static PamojaPinLevel pamoja_pin_level_from_bool(bool high)
Parameters
highbool
Returns
pamoja_pin_level_inverted(PamojaPinLevel)
Returns the opposite level.
public static extern PamojaPinLevel pamoja_pin_level_inverted(PamojaPinLevel level)
Parameters
levelPamojaPinLevel
Returns
pamoja_pin_polarity_is_asserted(PamojaPinPolarity, PamojaPinLevel)
Reports whether a physical level means the signal is asserted.
public static bool pamoja_pin_polarity_is_asserted(PamojaPinPolarity polarity, PamojaPinLevel level)
Parameters
polarityPamojaPinPolaritylevelPamojaPinLevel
Returns
pamoja_pin_polarity_level(PamojaPinPolarity, bool)
Returns the physical level representing a logical state.
public static PamojaPinLevel pamoja_pin_polarity_level(PamojaPinPolarity polarity, bool asserted)
Parameters
polarityPamojaPinPolarityassertedbool
Returns
pamoja_power_plan_interval_for_us(PamojaPowerPlan, PamojaPowerMode)
Returns the work interval a plan uses in a mode.
public static extern ulong pamoja_power_plan_interval_for_us(PamojaPowerPlan plan, PamojaPowerMode mode)
Parameters
planPamojaPowerPlanmodePamojaPowerMode
Returns
pamoja_power_plan_interval_us(PamojaPowerPlan, float)
Returns the work interval a plan calls for at a state of charge.
public static extern ulong pamoja_power_plan_interval_us(PamojaPowerPlan plan, float soc)
Parameters
planPamojaPowerPlansocfloat
Returns
pamoja_power_plan_mode(PamojaPowerPlan, float)
Returns the mode a plan calls for at a state of charge.
public static extern PamojaPowerMode pamoja_power_plan_mode(PamojaPowerPlan plan, float soc)
Parameters
planPamojaPowerPlansocfloat
Returns
pamoja_power_plan_mode_while_charging(PamojaPowerPlan, float, byte)
Returns the mode, eased one step toward full duty while charging.
public static extern PamojaPowerMode pamoja_power_plan_mode_while_charging(PamojaPowerPlan plan, float soc, byte charging)
Parameters
planPamojaPowerPlansocfloatchargingbyte
Returns
pamoja_power_plan_new(ulong, ulong, ulong)
Creates a power plan with the default thresholds.
public static extern PamojaPowerPlan pamoja_power_plan_new(ulong activeUs, ulong saverUs, ulong criticalUs)
Parameters
Returns
pamoja_power_plan_next_mode(PamojaPowerPlan, PamojaPowerMode, float)
Returns the mode a node in a given mode moves to at a new state of charge.
public static extern PamojaPowerMode pamoja_power_plan_next_mode(PamojaPowerPlan plan, PamojaPowerMode current, float soc)
Parameters
planPamojaPowerPlancurrentPamojaPowerModesocfloat
Returns
pamoja_power_plan_next_mode_while_charging(PamojaPowerPlan, PamojaPowerMode, float, byte)
Returns the mode a node in a given mode moves to, eased one step while charging.
public static extern PamojaPowerMode pamoja_power_plan_next_mode_while_charging(PamojaPowerPlan plan, PamojaPowerMode current, float soc, byte charging)
Parameters
planPamojaPowerPlancurrentPamojaPowerModesocfloatchargingbyte
Returns
pamoja_power_plan_with_hysteresis(PamojaPowerPlan, float)
Returns a plan with the hysteresis margin moved.
public static extern PamojaPowerPlan pamoja_power_plan_with_hysteresis(PamojaPowerPlan plan, float margin)
Parameters
planPamojaPowerPlanmarginfloat
Returns
pamoja_power_plan_with_thresholds(PamojaPowerPlan, float, float)
Returns a plan with the state-of-charge thresholds moved.
public static extern PamojaPowerPlan pamoja_power_plan_with_thresholds(PamojaPowerPlan plan, float saverBelow, float criticalBelow)
Parameters
planPamojaPowerPlansaverBelowfloatcriticalBelowfloat
Returns
pamoja_profile_control(nint, out PamojaControlSpec)
Returns the control policy a profile applies.
public static PamojaStatus pamoja_profile_control(nint profile, out PamojaControlSpec control)
Parameters
profilenintcontrolPamojaControlSpec
Returns
pamoja_profile_control_kind(nint)
Returns the control kind a profile names, as its manifest writes it.
public static extern nint pamoja_profile_control_kind(nint profile)
Parameters
profilenint
Returns
pamoja_profile_control_params_json(nint)
Returns a custom kind's parameters as JSON, or null for a built-in kind.
public static extern nint pamoja_profile_control_params_json(nint profile)
Parameters
profilenint
Returns
pamoja_profile_controller(nint)
Builds the decision logic a profile describes.
public static extern nint pamoja_profile_controller(nint profile)
Parameters
profilenint
Returns
pamoja_profile_description(nint)
Returns what a profile is for, or null when its manifest says nothing.
public static extern nint pamoja_profile_description(nint profile)
Parameters
profilenint
Returns
pamoja_profile_flood_sensor()
Creates a flood sensor.
public static extern nint pamoja_profile_flood_sensor()
Returns
pamoja_profile_free(nint)
Releases a profile handle.
public static extern void pamoja_profile_free(nint profile)
Parameters
profilenint
pamoja_profile_from_json(string)
Loads a profile from its JSON manifest.
public static nint pamoja_profile_from_json(string manifest)
Parameters
manifeststring
Returns
pamoja_profile_irrigation_node()
Creates an irrigation node.
public static extern nint pamoja_profile_irrigation_node()
Returns
pamoja_profile_name(nint)
Returns a profile's stable name.
public static extern nint pamoja_profile_name(nint profile)
Parameters
profilenint
Returns
pamoja_profile_new(string, string, in PamojaControlSpec, in PamojaPowerSchedule)
Creates a profile of the caller's own from its parts.
public static nint pamoja_profile_new(string name, string topic, in PamojaControlSpec control, in PamojaPowerSchedule power)
Parameters
namestringtopicstringcontrolPamojaControlSpecpowerPamojaPowerSchedule
Returns
pamoja_profile_new_custom(string, string, string, string, in PamojaPowerSchedule)
Creates a profile whose control is a custom kind, its parameters a JSON object.
public static nint pamoja_profile_new_custom(string name, string topic, string kind, string parameters, in PamojaPowerSchedule power)
Parameters
namestringtopicstringkindstringparametersstringpowerPamojaPowerSchedule
Returns
pamoja_profile_power(nint, out PamojaPowerSchedule)
Returns the sampling schedule a profile keeps.
public static PamojaStatus pamoja_profile_power(nint profile, out PamojaPowerSchedule schedule)
Parameters
profilenintschedulePamojaPowerSchedule
Returns
pamoja_profile_power_plan(nint, out PamojaPowerPlan)
Assembles a profile's schedule into a power governor.
public static PamojaStatus pamoja_profile_power_plan(nint profile, out PamojaPowerPlan plan)
Parameters
profilenintplanPamojaPowerPlan
Returns
pamoja_profile_presentation_json(nint)
Returns a profile's dashboard presentation as JSON, or null when it declares none.
public static extern nint pamoja_profile_presentation_json(nint profile)
Parameters
profilenint
Returns
pamoja_profile_reads_quantity(nint)
Returns the quantity a profile reads, or null when its manifest does not say.
public static extern nint pamoja_profile_reads_quantity(nint profile)
Parameters
profilenint
Returns
pamoja_profile_reads_unit(nint)
Returns the unit a profile's numbers are in, or null when its manifest does not say.
public static extern nint pamoja_profile_reads_unit(nint profile)
Parameters
profilenint
Returns
pamoja_profile_to_json(nint)
Serializes a profile to its JSON manifest.
public static extern nint pamoja_profile_to_json(nint profile)
Parameters
profilenint
Returns
pamoja_profile_topic(nint)
Returns the topic a profile publishes each reading to.
public static extern nint pamoja_profile_topic(nint profile)
Parameters
profilenint
Returns
pamoja_profile_vaccine_fridge_monitor()
Creates a cold-chain fridge monitor.
public static extern nint pamoja_profile_vaccine_fridge_monitor()
Returns
pamoja_profile_well_level()
Creates a well-level monitor.
public static extern nint pamoja_profile_well_level()
Returns
pamoja_profile_with_description(nint, string)
Returns a copy of a profile carrying a description.
public static nint pamoja_profile_with_description(nint profile, string description)
Parameters
Returns
pamoja_profile_with_presentation_json(nint, string)
Returns a copy of a profile carrying the presentation the JSON describes.
public static nint pamoja_profile_with_presentation_json(nint profile, string presentation)
Parameters
Returns
pamoja_profile_with_reads(nint, string, string)
Returns a copy of a profile that says what it reads.
public static nint pamoja_profile_with_reads(nint profile, string quantity, string unit)
Parameters
Returns
pamoja_public_identity_fingerprint(ReadOnlySpan<byte>, Span<byte>)
Writes the 16-character hex fingerprint of a public key.
public static PamojaStatus pamoja_public_identity_fingerprint(ReadOnlySpan<byte> publicKey, Span<byte> outFingerprint)
Parameters
publicKeyReadOnlySpan<byte>outFingerprintSpan<byte>
Returns
pamoja_public_identity_verify(ReadOnlySpan<byte>, ReadOnlySpan<byte>, nuint, ReadOnlySpan<byte>)
Verifies that a signature covers a payload for a public key.
public static PamojaStatus pamoja_public_identity_verify(ReadOnlySpan<byte> publicKey, ReadOnlySpan<byte> payload, nuint payloadLen, ReadOnlySpan<byte> signature)
Parameters
publicKeyReadOnlySpan<byte>payloadReadOnlySpan<byte>payloadLennuintsignatureReadOnlySpan<byte>
Returns
pamoja_public_identity_verify_message(ReadOnlySpan<byte>, ReadOnlySpan<byte>, nuint, out nint)
Verifies a signed message, returning the payload it carries.
public static PamojaStatus pamoja_public_identity_verify_message(ReadOnlySpan<byte> publicKey, ReadOnlySpan<byte> message, nuint messageLen, out nint outBuffer)
Parameters
publicKeyReadOnlySpan<byte>messageReadOnlySpan<byte>messageLennuintoutBuffernint
Returns
pamoja_pwm_counts(PamojaPwm, out ushort, out ushort)
Reads the counts back out of a channel's four register bytes.
public static PamojaStatus pamoja_pwm_counts(PamojaPwm pwm, out ushort outOn, out ushort outOff)
Parameters
Returns
pamoja_pwm_duty(ushort)
Builds a PWM setting with no phase delay.
public static extern PamojaPwm pamoja_pwm_duty(ushort off)
Parameters
offushort
Returns
pamoja_pwm_from_counts(ushort, ushort)
Builds a PWM setting from explicit on and off counts.
public static extern PamojaPwm pamoja_pwm_from_counts(ushort on, ushort off)
Parameters
Returns
pamoja_pwm_full_off()
The setting that holds a channel continuously low.
public static extern PamojaPwm pamoja_pwm_full_off()
Returns
pamoja_pwm_full_on()
The setting that holds a channel continuously high.
public static extern PamojaPwm pamoja_pwm_full_on()
Returns
pamoja_pwm_servo(uint, uint)
Builds the PWM setting for a servo pulse width.
public static extern PamojaPwm pamoja_pwm_servo(uint pulseMicros, uint updateRateHz)
Parameters
Returns
pamoja_quadrature_count(nint)
Reads a quadrature decoder's signed count of steps.
public static extern long pamoja_quadrature_count(nint quadrature)
Parameters
quadraturenint
Returns
pamoja_quadrature_free(nint)
Releases a quadrature decoder handle. Passing null is a no-op.
public static extern void pamoja_quadrature_free(nint quadrature)
Parameters
quadraturenint
pamoja_quadrature_new(bool, bool)
Creates a quadrature decoder seeded with the encoder's current channel levels.
public static nint pamoja_quadrature_new(bool a, bool b)
Parameters
Returns
pamoja_quadrature_reset(nint)
Sets a quadrature decoder's count back to 0.
public static extern void pamoja_quadrature_reset(nint quadrature)
Parameters
quadraturenint
pamoja_quadrature_scale_distance(PamojaQuadratureScale, long)
Returns the distance a wheel rolled for a step count.
public static extern float pamoja_quadrature_scale_distance(PamojaQuadratureScale scale, long count)
Parameters
scalePamojaQuadratureScalecountlong
Returns
pamoja_quadrature_scale_velocity(PamojaQuadratureScale, long, float)
Returns a wheel's speed from the steps counted over a time step.
public static extern float pamoja_quadrature_scale_velocity(PamojaQuadratureScale scale, long deltaCount, float dt)
Parameters
scalePamojaQuadratureScaledeltaCountlongdtfloat
Returns
pamoja_quadrature_update(nint, bool, bool)
Feeds a quadrature decoder the channel levels it reads now.
public static sbyte pamoja_quadrature_update(nint quadrature, bool a, bool b)
Parameters
Returns
pamoja_radio_duty_cycle_earliest_us(nint)
Returns the earliest start for the next transmission, or the maximum when transmitting is forbidden.
public static extern ulong pamoja_radio_duty_cycle_earliest_us(nint guard)
Parameters
guardnint
Returns
pamoja_radio_duty_cycle_free(nint)
Releases a duty-cycle guard handle. Passing null is a no-op.
public static extern void pamoja_radio_duty_cycle_free(nint guard)
Parameters
guardnint
pamoja_radio_duty_cycle_new(uint)
Creates a duty-cycle guard, ready to transmit at once.
public static extern nint pamoja_radio_duty_cycle_new(uint permille)
Parameters
permilleuint
Returns
pamoja_radio_duty_cycle_ready(nint, ulong)
Reports whether a transmission may start now.
public static bool pamoja_radio_duty_cycle_ready(nint guard, ulong nowUs)
Parameters
Returns
pamoja_radio_duty_cycle_transmitted(nint, ulong, PamojaLoraLink, nuint)
Records a transmission and returns its time on air in microseconds.
public static extern ulong pamoja_radio_duty_cycle_transmitted(nint guard, ulong startedUs, PamojaLoraLink link, nuint payloadLen)
Parameters
guardnintstartedUsulonglinkPamojaLoraLinkpayloadLennuint
Returns
pamoja_radio_duty_cycle_wait_us(nint, ulong)
Returns the silence still owed in microseconds, or the maximum when transmitting is forbidden.
public static extern ulong pamoja_radio_duty_cycle_wait_us(nint guard, ulong nowUs)
Parameters
Returns
pamoja_ramp_free(nint)
Releases a ramp handle. Passing null is a no-op.
public static extern void pamoja_ramp_free(nint ramp)
Parameters
rampnint
pamoja_ramp_new(float, float)
Creates a rate limiter.
public static extern nint pamoja_ramp_new(float start, float maxStep)
Parameters
Returns
pamoja_ramp_set(nint, float)
Forces a ramp to a value without rate limiting.
public static extern void pamoja_ramp_set(nint ramp, float value)
Parameters
pamoja_ramp_update(nint, float)
Moves a ramp one step toward a target.
public static extern float pamoja_ramp_update(nint ramp, float target)
Parameters
Returns
pamoja_ramp_value(nint)
Reads a ramp's current value.
public static extern float pamoja_ramp_value(nint ramp)
Parameters
rampnint
Returns
pamoja_readings_data(nint)
Returns a pointer to a decoded float reading series.
public static extern nint pamoja_readings_data(nint readings)
Parameters
readingsnint
Returns
pamoja_readings_free(nint)
Releases a decoded reading series. Passing null is a no-op.
public static extern void pamoja_readings_free(nint readings)
Parameters
readingsnint
pamoja_readings_len(nint)
Returns the number of float readings in a decoded series.
public static extern nuint pamoja_readings_len(nint readings)
Parameters
readingsnint
Returns
pamoja_recording_actuator_apply(nint, float)
Applies a command, which is recorded rather than acted on.
public static extern PamojaStatus pamoja_recording_actuator_apply(nint actuator, float command)
Parameters
Returns
pamoja_recording_actuator_commands(nint, Span<float>, nuint)
Copies out the commands an actuator recorded.
public static nuint pamoja_recording_actuator_commands(nint actuator, Span<float> outCommands, nuint capacity)
Parameters
Returns
pamoja_recording_actuator_free(nint)
Releases a recording actuator handle.
public static extern void pamoja_recording_actuator_free(nint actuator)
Parameters
actuatornint
pamoja_recording_actuator_len(nint)
Reports how many commands an actuator has been given.
public static extern nuint pamoja_recording_actuator_len(nint actuator)
Parameters
actuatornint
Returns
pamoja_recording_actuator_new()
Creates an actuator that records every command.
public static extern nint pamoja_recording_actuator_new()
Returns
pamoja_registers_data(nint)
Returns a pointer to the registers a device returned.
public static extern nint pamoja_registers_data(nint registers)
Parameters
registersnint
Returns
pamoja_registers_free(nint)
Releases a register series. Passing null is a no-op.
public static extern void pamoja_registers_free(nint registers)
Parameters
registersnint
pamoja_registers_len(nint)
Returns how many registers a device returned.
public static extern nuint pamoja_registers_len(nint registers)
Parameters
registersnint
Returns
pamoja_replay_free(nint)
Releases a replay handle.
public static extern void pamoja_replay_free(nint replay)
Parameters
replaynint
pamoja_replay_new(ReadOnlySpan<float>, nuint, bool)
Creates a sensor that reads back a recorded series.
public static nint pamoja_replay_new(ReadOnlySpan<float> readings, nuint count, bool repeating)
Parameters
readingsReadOnlySpan<float>countnuintrepeatingbool
Returns
pamoja_replay_read(nint, out float)
Takes the next reading from a replay.
public static PamojaStatus pamoja_replay_read(nint replay, out float outReading)
Parameters
Returns
pamoja_reporter_adapt_to(nint, PamojaLinkCost)
Moves the threshold to match what the link now costs.
public static extern void pamoja_reporter_adapt_to(nint reporter, PamojaLinkCost cost)
Parameters
reporternintcostPamojaLinkCost
pamoja_reporter_count(nint, PamojaTelemetryLevel)
Returns how many events a reporter has seen at a level.
public static extern uint pamoja_reporter_count(nint reporter, PamojaTelemetryLevel level)
Parameters
reporternintlevelPamojaTelemetryLevel
Returns
pamoja_reporter_dropped(nint)
Returns how many events the threshold dropped.
public static extern uint pamoja_reporter_dropped(nint reporter)
Parameters
reporternint
Returns
pamoja_reporter_emitted(nint)
Returns how many events passed the threshold and were shipped.
public static extern uint pamoja_reporter_emitted(nint reporter)
Parameters
reporternint
Returns
pamoja_reporter_free(nint)
Releases a reporter handle.
public static extern void pamoja_reporter_free(nint reporter)
Parameters
reporternint
pamoja_reporter_new(PamojaTelemetryLevel)
Creates a reporter that ships events at or above a level.
public static extern nint pamoja_reporter_new(PamojaTelemetryLevel threshold)
Parameters
thresholdPamojaTelemetryLevel
Returns
pamoja_reporter_record(nint, PamojaTelemetryLevel)
Records an event and reports whether it is worth shipping.
public static bool pamoja_reporter_record(nint reporter, PamojaTelemetryLevel level)
Parameters
reporternintlevelPamojaTelemetryLevel
Returns
pamoja_reporter_set_threshold(nint, PamojaTelemetryLevel)
Moves the level a reporter ships from.
public static extern void pamoja_reporter_set_threshold(nint reporter, PamojaTelemetryLevel threshold)
Parameters
reporternintthresholdPamojaTelemetryLevel
pamoja_reporter_snapshot(nint)
Takes a snapshot of a reporter's counters.
public static extern PamojaTelemetrySnapshot pamoja_reporter_snapshot(nint reporter)
Parameters
reporternint
Returns
pamoja_reporter_threshold(nint)
Returns the level a reporter is currently shipping from.
public static extern PamojaTelemetryLevel pamoja_reporter_threshold(nint reporter)
Parameters
reporternint
Returns
pamoja_reporter_total(nint)
Returns how many events a reporter has seen across every level.
public static extern uint pamoja_reporter_total(nint reporter)
Parameters
reporternint
Returns
pamoja_ros2_dds_topic(string, PamojaEntityKind)
Returns the DDS topic a fully qualified name maps onto.
public static nint pamoja_ros2_dds_topic(string fqn, PamojaEntityKind kind)
Parameters
fqnstringkindPamojaEntityKind
Returns
pamoja_ros2_dds_type_name(string)
Returns the DDS type name an interface type maps onto.
public static nint pamoja_ros2_dds_type_name(string rosType)
Parameters
rosTypestring
Returns
pamoja_ros2_entity_key(uint, string, string, PamojaTypeHash)
Builds the Zenoh key an entity is published on.
public static nint pamoja_ros2_entity_key(uint domainId, string fqn, string rosType, PamojaTypeHash hash)
Parameters
domainIduintfqnstringrosTypestringhashPamojaTypeHash
Returns
pamoja_ros2_entity_kind_prefix(PamojaEntityKind)
Returns the DDS topic prefix a subsystem uses.
public static extern nint pamoja_ros2_entity_kind_prefix(PamojaEntityKind kind)
Parameters
kindPamojaEntityKind
Returns
pamoja_ros2_entity_kind_suffix(PamojaEntityKind)
Returns what the middleware appends to a name for a subsystem.
public static extern nint pamoja_ros2_entity_kind_suffix(PamojaEntityKind kind)
Parameters
kindPamojaEntityKind
Returns
pamoja_ros2_name_is_fully_qualified(string)
Reports whether a name is fully qualified.
public static bool pamoja_ros2_name_is_fully_qualified(string name)
Parameters
namestring
Returns
pamoja_ros2_name_is_valid(string)
Reports whether a string is a valid ROS 2 name.
public static bool pamoja_ros2_name_is_valid(string name)
Parameters
namestring
Returns
pamoja_ros2_percent_mangle(string)
Percent-mangles a name as rmw_zenoh writes it in a liveliness token.
public static nint pamoja_ros2_percent_mangle(string name)
Parameters
namestring
Returns
pamoja_ros2_twist_from_cdr(ReadOnlySpan<byte>, nuint, out PamojaRos2Twist)
Decodes a twist from its CDR representation.
public static PamojaStatus pamoja_ros2_twist_from_cdr(ReadOnlySpan<byte> data, nuint dataLen, out PamojaRos2Twist twist)
Parameters
dataReadOnlySpan<byte>dataLennuinttwistPamojaRos2Twist
Returns
pamoja_ros2_twist_to_cdr(PamojaRos2Twist)
Encodes a twist into its CDR representation.
public static extern nint pamoja_ros2_twist_to_cdr(PamojaRos2Twist twist)
Parameters
twistPamojaRos2Twist
Returns
pamoja_ros2_type_hash_parse(string, out PamojaTypeHash)
Parses a RIHS01 type hash string.
public static PamojaStatus pamoja_ros2_type_hash_parse(string text, out PamojaTypeHash hash)
Parameters
textstringhashPamojaTypeHash
Returns
pamoja_ros2_type_hash_to_string(PamojaTypeHash)
Renders a type hash back to its RIHS01 string.
public static extern nint pamoja_ros2_type_hash_to_string(PamojaTypeHash hash)
Parameters
hashPamojaTypeHash
Returns
pamoja_router_address(nint)
Returns the address a router answers for.
public static extern uint pamoja_router_address(nint router)
Parameters
routernint
Returns
pamoja_router_capacity(nint)
Returns how many routes a table can hold.
public static extern nuint pamoja_router_capacity(nint router)
Parameters
routernint
Returns
pamoja_router_cost(nint, uint, out ushort)
Returns what the known route to a node costs.
public static bool pamoja_router_cost(nint router, uint dst, out ushort outCost)
Parameters
Returns
pamoja_router_forget(nint, uint)
Forgets the route to a node.
public static extern void pamoja_router_forget(nint router, uint dst)
Parameters
pamoja_router_forward(nint, uint, out uint)
Decides what to do with a packet bound for a node.
public static PamojaForward pamoja_router_forward(nint router, uint dst, out uint outNextHop)
Parameters
Returns
pamoja_router_free(nint)
Releases a routing table handle. Passing null is a no-op.
public static extern void pamoja_router_free(nint router)
Parameters
routernint
pamoja_router_len(nint)
Returns how many routes a table currently holds.
public static extern nuint pamoja_router_len(nint router)
Parameters
routernint
Returns
pamoja_router_new(uint, nuint)
Creates an empty routing table of the size given.
public static extern nint pamoja_router_new(uint address, nuint capacity)
Parameters
Returns
pamoja_router_next_hop(nint, uint, out uint)
Returns the neighbor on the way to a node.
public static bool pamoja_router_next_hop(nint router, uint dst, out uint outNextHop)
Parameters
Returns
pamoja_router_observe(nint, uint, uint, ushort)
Learns a route from a packet that arrived.
public static bool pamoja_router_observe(nint router, uint origin, uint via, ushort cost)
Parameters
Returns
pamoja_router_route(nint, uint, out PamojaRoute)
Returns the whole route to a node.
public static bool pamoja_router_route(nint router, uint dst, out PamojaRoute outRoute)
Parameters
routernintdstuintoutRoutePamojaRoute
Returns
pamoja_router_route_at(nint, nuint, out PamojaRoute)
Returns one of the routes a table holds, by its position among them.
public static bool pamoja_router_route_at(nint router, nuint index, out PamojaRoute outRoute)
Parameters
routernintindexnuintoutRoutePamojaRoute
Returns
pamoja_rule_evaluator_actuators_json(nint)
Lists the actuators the rules drive, as a JSON array.
public static extern nint pamoja_rule_evaluator_actuators_json(nint rules)
Parameters
rulesnint
Returns
pamoja_rule_evaluator_evaluate(nint, string, float)
Judges one reading from one topic, returning what fired as JSON.
public static nint pamoja_rule_evaluator_evaluate(nint rules, string topic, float reading)
Parameters
Returns
pamoja_rule_evaluator_free(nint)
Releases a rule evaluator.
public static extern void pamoja_rule_evaluator_free(nint rules)
Parameters
rulesnint
pamoja_rule_evaluator_from_json(string)
Loads a rule file and arms its rules.
public static nint pamoja_rule_evaluator_from_json(string text)
Parameters
textstring
Returns
pamoja_rule_evaluator_is_set(nint, string, out bool)
Reports whether a rule's condition currently holds.
public static PamojaStatus pamoja_rule_evaluator_is_set(nint rules, string rule, out bool outSet)
Parameters
Returns
pamoja_rule_evaluator_to_json(nint)
Writes the rules back out as a rule file.
public static extern nint pamoja_rule_evaluator_to_json(nint rules)
Parameters
rulesnint
Returns
pamoja_rule_evaluator_topics_json(nint)
Lists the topics the rules watch, as a JSON array.
public static extern nint pamoja_rule_evaluator_topics_json(nint rules)
Parameters
rulesnint
Returns
pamoja_rule_evaluator_watches(nint, string)
Reports whether any rule watches a topic.
public static bool pamoja_rule_evaluator_watches(nint rules, string topic)
Parameters
Returns
pamoja_safety_gate_command(nint, PamojaTwist, float)
Returns the command that is safe to drive for a desired one over a time step.
public static extern PamojaTwist pamoja_safety_gate_command(nint gate, PamojaTwist desired, float dt)
Parameters
gatenintdesiredPamojaTwistdtfloat
Returns
pamoja_safety_gate_engage_estop(nint)
Engages a safety gate's e-stop.
public static extern void pamoja_safety_gate_engage_estop(nint gate)
Parameters
gatenint
pamoja_safety_gate_feed(nint)
Feeds a safety gate's watchdog.
public static extern void pamoja_safety_gate_feed(nint gate)
Parameters
gatenint
pamoja_safety_gate_free(nint)
Releases a safety gate handle. Passing null is a no-op.
public static extern void pamoja_safety_gate_free(nint gate)
Parameters
gatenint
pamoja_safety_gate_is_stopped(nint)
Reports whether a safety gate is forcing a stop.
public static bool pamoja_safety_gate_is_stopped(nint gate)
Parameters
gatenint
Returns
pamoja_safety_gate_new(nint, float)
Creates a safety gate from limits and a watchdog timeout, or null for null limits.
public static extern nint pamoja_safety_gate_new(nint limits, float watchdogTimeout)
Parameters
Returns
pamoja_safety_gate_reset_estop(nint)
Clears a safety gate's e-stop.
public static extern void pamoja_safety_gate_reset_estop(nint gate)
Parameters
gatenint
pamoja_samples_data(nint)
Returns a pointer to a decoded integer sample series.
public static extern nint pamoja_samples_data(nint samples)
Parameters
samplesnint
Returns
pamoja_samples_free(nint)
Releases a decoded sample series. Passing null is a no-op.
public static extern void pamoja_samples_free(nint samples)
Parameters
samplesnint
pamoja_samples_len(nint)
Returns the number of integer samples in a decoded series.
public static extern nuint pamoja_samples_len(nint samples)
Parameters
samplesnint
Returns
pamoja_scd4x_allowed_during_measurement(ushort)
Reports whether an SCD4x accepts a command while it is measuring. # Returns true when the command may be sent without stopping periodic measurements.
public static bool pamoja_scd4x_allowed_during_measurement(ushort command)
Parameters
commandushort
Returns
pamoja_scd4x_ambient_pressure_pascals(ushort)
Reads an SCD4x ambient-pressure word back as a pressure. # Returns The pressure in pascals.
public static extern uint pamoja_scd4x_ambient_pressure_pascals(ushort word)
Parameters
wordushort
Returns
pamoja_scd4x_ambient_pressure_word(uint)
Builds the SCD4x ambient-pressure word for a pressure. # Returns The word to write, at 100 pascals per count.
public static extern ushort pamoja_scd4x_ambient_pressure_word(uint pascals)
Parameters
pascalsuint
Returns
pamoja_scd4x_automatic_self_calibration_enabled(ushort)
Reports whether an SCD4x word says automatic self-calibration is on. # Returns true when the part recalibrates itself against clean air.
public static bool pamoja_scd4x_automatic_self_calibration_enabled(ushort word)
Parameters
wordushort
Returns
pamoja_scd4x_automatic_self_calibration_word(bool)
Builds the SCD4x word that turns automatic self-calibration on or off. # Returns The word to write.
public static ushort pamoja_scd4x_automatic_self_calibration_word(bool enabled)
Parameters
enabledbool
Returns
pamoja_scd4x_celsius(ushort)
Converts a raw SCD4x temperature word to degrees Celsius. # Returns The temperature.
public static extern float pamoja_scd4x_celsius(ushort raw)
Parameters
rawushort
Returns
pamoja_scd4x_command_frame(ushort, Span<byte>)
Builds the two bytes that address an SCD4x command, most significant first. # Returns [PamojaStatus::Ok] on success, with the two bytes written to out_bytes, or [PamojaStatus::InvalidArgument] if out_bytes is null. # Safety out_bytes must point to at least two writable bytes.
public static PamojaStatus pamoja_scd4x_command_frame(ushort command, Span<byte> outBytes)
Parameters
Returns
pamoja_scd4x_crc(ReadOnlySpan<byte>, nuint)
Computes the CRC-8 an SCD4x appends to every data word. # Returns The checksum over data, or 0 if the pointer is null with a non-zero length. # Safety data must point to at least data_len readable bytes, or be null when data_len is 0.
public static byte pamoja_scd4x_crc(ReadOnlySpan<byte> data, nuint dataLen)
Parameters
dataReadOnlySpan<byte>dataLennuint
Returns
pamoja_scd4x_data_ready(ushort)
Reports whether an SCD4x data-ready word says a fresh result is waiting. # Returns true when any of the low eleven bits is set.
public static bool pamoja_scd4x_data_ready(ushort word)
Parameters
wordushort
Returns
pamoja_scd4x_forced_recalibration_correction_ppm(ushort, out int)
Reads the correction a forced recalibration applied. # Returns true when the recalibration took, with *out_ppm set to the correction in parts per million; false when the part reported that it failed. # Safety out_ppm must point to a writable int32_t.
public static bool pamoja_scd4x_forced_recalibration_correction_ppm(ushort word, out int outPpm)
Parameters
Returns
pamoja_scd4x_forced_recalibration_word(bool, int)
Builds the word an SCD4x returns for a forced-recalibration outcome. # Returns The word, which is the failure sentinel when succeeded is false.
public static ushort pamoja_scd4x_forced_recalibration_word(bool succeeded, int correctionPpm)
Parameters
Returns
pamoja_scd4x_free(nint)
Releases an SCD4x driver. Passing null is a no-op.
public static extern void pamoja_scd4x_free(nint sensor)
Parameters
sensornint
pamoja_scd4x_humidity_milli_percent(ushort)
Converts a raw SCD4x humidity word to milli-percent. # Returns The relative humidity, exact in integer arithmetic.
public static extern uint pamoja_scd4x_humidity_milli_percent(ushort raw)
Parameters
rawushort
Returns
pamoja_scd4x_humidity_raw(uint)
Builds the SCD4x humidity word that decodes to a relative humidity. # Returns The raw word, saturating at full scale.
public static extern ushort pamoja_scd4x_humidity_raw(uint milliPercent)
Parameters
milliPercentuint
Returns
pamoja_scd4x_init(nint)
Reads the SCD4x serial number and starts periodic measurement.
public static extern PamojaStatus pamoja_scd4x_init(nint sensor)
Parameters
sensornint
Returns
pamoja_scd4x_max_duration_ms(ushort, out ushort)
Returns how long an SCD4x command may take before its result can be read. # Returns true when the command has a documented execution time, with *out_millis set to it; false when it completes as soon as it is acknowledged. # Safety out_millis must point to a writable uint16_t.
public static bool pamoja_scd4x_max_duration_ms(ushort command, out ushort outMillis)
Parameters
Returns
pamoja_scd4x_measure(nint, out PamojaScd4xMeasurement)
Waits for the next SCD4x periodic result and reads it.
public static PamojaStatus pamoja_scd4x_measure(nint sensor, out PamojaScd4xMeasurement outMeasurement)
Parameters
sensornintoutMeasurementPamojaScd4xMeasurement
Returns
pamoja_scd4x_measure_single_shot(nint, out PamojaScd4xMeasurement)
Runs one on-demand SCD41 measurement.
public static PamojaStatus pamoja_scd4x_measure_single_shot(nint sensor, out PamojaScd4xMeasurement outMeasurement)
Parameters
sensornintoutMeasurementPamojaScd4xMeasurement
Returns
pamoja_scd4x_measurement_bytes(ushort, ushort, ushort, Span<byte>)
Builds the nine bytes an SCD4x sends for a set of raw words, each CRC included. # Returns [PamojaStatus::Ok] on success, with the nine bytes written to out_bytes, or [PamojaStatus::InvalidArgument] if out_bytes is null. # Safety out_bytes must point to at least nine writable bytes.
public static PamojaStatus pamoja_scd4x_measurement_bytes(ushort co2Ppm, ushort temperatureRaw, ushort humidityRaw, Span<byte> outBytes)
Parameters
Returns
pamoja_scd4x_measurement_from_physical(ushort, int, uint, out PamojaScd4xMeasurement)
Builds the SCD4x measurement a sensor reporting these physical values would send. # Returns [PamojaStatus::Ok], with *out_measurement filled in, or [PamojaStatus::InvalidArgument] if the pointer is null. # Safety out_measurement must point to a writable PamojaScd4xMeasurement.
public static PamojaStatus pamoja_scd4x_measurement_from_physical(ushort co2Ppm, int milliCelsius, uint humidityMilliPercent, out PamojaScd4xMeasurement outMeasurement)
Parameters
co2PpmushortmilliCelsiusinthumidityMilliPercentuintoutMeasurementPamojaScd4xMeasurement
Returns
pamoja_scd4x_milli_celsius(ushort)
Converts a raw SCD4x temperature word to milli-degrees Celsius. # Returns The temperature, exact in integer arithmetic.
public static extern int pamoja_scd4x_milli_celsius(ushort raw)
Parameters
rawushort
Returns
pamoja_scd4x_new(nint, out nint)
Creates an SCD4x driver on a bus.
public static PamojaStatus pamoja_scd4x_new(nint bus, out nint outSensor)
Parameters
Returns
pamoja_scd4x_parse_measurement(ReadOnlySpan<byte>, nuint, out PamojaScd4xMeasurement)
Parses and CRC-checks a nine-byte SCD4x measurement frame. # Returns [PamojaStatus::Ok] on success, with *out_measurement filled in, or [PamojaStatus::Codec] if any word fails its checksum, which means the read was corrupted on the bus and should be repeated. # Safety frame must point to at least frame_len readable bytes, and out_measurement must point to a writable PamojaScd4xMeasurement.
public static PamojaStatus pamoja_scd4x_parse_measurement(ReadOnlySpan<byte> frame, nuint frameLen, out PamojaScd4xMeasurement outMeasurement)
Parameters
frameReadOnlySpan<byte>frameLennuintoutMeasurementPamojaScd4xMeasurement
Returns
pamoja_scd4x_poll_ready(nint, out bool)
Asks an SCD4x whether a periodic result is waiting.
public static PamojaStatus pamoja_scd4x_poll_ready(nint sensor, out bool outReady)
Parameters
Returns
pamoja_scd4x_relative_humidity_percent(ushort)
Converts a raw SCD4x humidity word to a relative humidity percentage. # Returns The relative humidity.
public static extern float pamoja_scd4x_relative_humidity_percent(ushort raw)
Parameters
rawushort
Returns
pamoja_scd4x_self_test_passed(ushort)
Reports whether an SCD4x self-test word says the part is healthy. # Returns true when the self test found no malfunction.
public static bool pamoja_scd4x_self_test_passed(ushort word)
Parameters
wordushort
Returns
pamoja_scd4x_serial(nint, out ulong)
Reports the serial number an SCD4x driver read at initialization.
public static bool pamoja_scd4x_serial(nint sensor, out ulong outSerial)
Parameters
Returns
pamoja_scd4x_serial_number(ReadOnlySpan<byte>, nuint, out ulong)
Reads the 48-bit serial number out of a nine-byte SCD4x frame. # Returns [PamojaStatus::Ok] on success, with *out_serial set, or [PamojaStatus::Codec] if any word fails its checksum. # Safety frame must point to at least frame_len readable bytes, and out_serial must point to a writable uint64_t.
public static PamojaStatus pamoja_scd4x_serial_number(ReadOnlySpan<byte> frame, nuint frameLen, out ulong outSerial)
Parameters
frameReadOnlySpan<byte>frameLennuintoutSerialulong
Returns
pamoja_scd4x_serial_number_frame(ulong, Span<byte>)
Builds the nine bytes an SCD4x sends for a serial number, each CRC included. # Returns [PamojaStatus::Ok] on success, with the nine bytes written to out_bytes, or [PamojaStatus::InvalidArgument] if out_bytes is null. # Safety out_bytes must point to at least nine writable bytes.
public static PamojaStatus pamoja_scd4x_serial_number_frame(ulong serial, Span<byte> outBytes)
Parameters
Returns
pamoja_scd4x_set_sensor_altitude(nint, ushort)
Sets the altitude an SCD4x corrects for, in meters.
public static extern PamojaStatus pamoja_scd4x_set_sensor_altitude(nint sensor, ushort meters)
Parameters
Returns
pamoja_scd4x_set_temperature_offset(nint, uint)
Sets the SCD4x temperature offset, in millidegrees.
public static extern PamojaStatus pamoja_scd4x_set_temperature_offset(nint sensor, uint milliCelsius)
Parameters
Returns
pamoja_scd4x_sim_part()
Creates a simulated SCD4x reading its default air.
public static extern nint pamoja_scd4x_sim_part()
Returns
pamoja_scd4x_sim_reporting(ushort, float, float)
Creates a simulated SCD4x that reads what it is asked to.
public static extern nint pamoja_scd4x_sim_reporting(ushort co2Ppm, float celsius, float relativeHumidity)
Parameters
Returns
pamoja_scd4x_start(nint)
Starts SCD4x periodic measurement.
public static extern PamojaStatus pamoja_scd4x_start(nint sensor)
Parameters
sensornint
Returns
pamoja_scd4x_stop(nint)
Stops SCD4x periodic measurement.
public static extern PamojaStatus pamoja_scd4x_stop(nint sensor)
Parameters
sensornint
Returns
pamoja_scd4x_temperature_offset_milli_celsius(ushort)
Reads an SCD4x temperature-offset word back as an offset. # Returns The offset in milli-degrees Celsius.
public static extern uint pamoja_scd4x_temperature_offset_milli_celsius(ushort word)
Parameters
wordushort
Returns
pamoja_scd4x_temperature_offset_word(uint)
Builds the SCD4x temperature-offset word for an offset. # Returns The word to write, which scales by 2^16 rather than by the 2^16 - 1 the measurement words use.
public static extern ushort pamoja_scd4x_temperature_offset_word(uint milliCelsius)
Parameters
milliCelsiusuint
Returns
pamoja_scd4x_temperature_raw(int)
Builds the SCD4x temperature word that decodes to a temperature. # Returns The raw word, saturating at the ends of the part's range.
public static extern ushort pamoja_scd4x_temperature_raw(int milliCelsius)
Parameters
milliCelsiusint
Returns
pamoja_scd4x_word(ReadOnlySpan<byte>, nuint, out ushort)
Reads a CRC-checked three-byte SCD4x word frame. # Returns [PamojaStatus::Ok] on success, with *out_word set, or [PamojaStatus::Codec] if the CRC does not match. # Safety frame must point to at least frame_len readable bytes, and out_word must point to a writable uint16_t.
public static PamojaStatus pamoja_scd4x_word(ReadOnlySpan<byte> frame, nuint frameLen, out ushort outWord)
Parameters
frameReadOnlySpan<byte>frameLennuintoutWordushort
Returns
pamoja_scd4x_word_frame(ushort, Span<byte>)
Builds the three bytes an SCD4x sends for a word: the word then its CRC. # Returns [PamojaStatus::Ok] on success, with the three bytes written to out_bytes, or [PamojaStatus::InvalidArgument] if out_bytes is null. # Safety out_bytes must point to at least three writable bytes.
public static PamojaStatus pamoja_scd4x_word_frame(ushort value, Span<byte> outBytes)
Parameters
Returns
pamoja_scd4x_write_frame(ushort, ushort, Span<byte>)
Builds the five bytes that write a word to an SCD4x: command, word, CRC. # Returns [PamojaStatus::Ok] on success, with the five bytes written to out_bytes, or [PamojaStatus::InvalidArgument] if out_bytes is null. # Safety out_bytes must point to at least five writable bytes.
public static PamojaStatus pamoja_scd4x_write_frame(ushort command, ushort value, Span<byte> outBytes)
Parameters
Returns
pamoja_serial_cobs_decode(ReadOnlySpan<byte>, nuint, out nint)
Reads the payload back out of a COBS frame.
public static PamojaStatus pamoja_serial_cobs_decode(ReadOnlySpan<byte> frame, nuint frameLen, out nint outBuffer)
Parameters
frameReadOnlySpan<byte>frameLennuintoutBuffernint
Returns
pamoja_serial_cobs_encode(ReadOnlySpan<byte>, nuint, out nint)
Frames a payload as a COBS packet.
public static PamojaStatus pamoja_serial_cobs_encode(ReadOnlySpan<byte> payload, nuint payloadLen, out nint outBuffer)
Parameters
payloadReadOnlySpan<byte>payloadLennuintoutBuffernint
Returns
pamoja_serial_cobs_max_encoded_len(nuint)
Returns the largest COBS frame a payload of this length can produce.
public static extern nuint pamoja_serial_cobs_max_encoded_len(nuint payloadLen)
Parameters
payloadLennuint
Returns
pamoja_serial_port_clone(nint)
Gives another holder the same port.
public static extern nint pamoja_serial_port_clone(nint port)
Parameters
portnint
Returns
pamoja_serial_port_discard_input(nint)
Drops whatever has arrived and not been read.
public static extern PamojaStatus pamoja_serial_port_discard_input(nint port)
Parameters
portnint
Returns
pamoja_serial_port_free(nint)
Releases a holder's share of a port. Passing null is a no-op.
public static extern void pamoja_serial_port_free(nint port)
Parameters
portnint
pamoja_serial_port_kind(nint)
Returns what is on the other end of a port.
public static extern byte pamoja_serial_port_kind(nint port)
Parameters
portnint
Returns
pamoja_serial_port_looped(PamojaSerialSettings)
Creates a line looped back on itself.
public static extern nint pamoja_serial_port_looped(PamojaSerialSettings settings)
Parameters
settingsPamojaSerialSettings
Returns
pamoja_serial_port_open(string, PamojaSerialSettings, out nint)
Opens the kernel's serial device raw.
public static PamojaStatus pamoja_serial_port_open(string path, PamojaSerialSettings settings, out nint outPort)
Parameters
pathstringsettingsPamojaSerialSettingsoutPortnint
Returns
pamoja_serial_port_pair(PamojaSerialSettings, out nint, out nint)
Creates the two ends of a null-modem pair.
public static PamojaStatus pamoja_serial_port_pair(PamojaSerialSettings settings, out nint outOne, out nint outOther)
Parameters
settingsPamojaSerialSettingsoutOnenintoutOthernint
Returns
pamoja_serial_port_read(nint, Span<byte>, nuint, ulong, out nuint)
Reads what has arrived, waiting up to a timeout for the first byte.
public static PamojaStatus pamoja_serial_port_read(nint port, Span<byte> outBytes, nuint capacity, ulong timeoutMicros, out nuint outLen)
Parameters
Returns
pamoja_serial_port_received(nint)
Returns how many bytes have been read through a port.
public static extern nuint pamoja_serial_port_received(nint port)
Parameters
portnint
Returns
pamoja_serial_port_remaining(nint, out nuint)
Reports how many steps a scripted port has left.
public static bool pamoja_serial_port_remaining(nint port, out nuint outRemaining)
Parameters
Returns
pamoja_serial_port_scripted(PamojaSerialSettings, nint)
Creates a port that plays a copy of a script.
public static extern nint pamoja_serial_port_scripted(PamojaSerialSettings settings, nint script)
Parameters
settingsPamojaSerialSettingsscriptnint
Returns
pamoja_serial_port_settings(nint)
Returns the speed and format a port runs at.
public static extern PamojaSerialSettings pamoja_serial_port_settings(nint port)
Parameters
portnint
Returns
pamoja_serial_port_wait(nint, ulong)
Waits, really on a device and anywhere else only counted.
public static extern void pamoja_serial_port_wait(nint port, ulong micros)
Parameters
pamoja_serial_port_waited_micros(nint)
Returns how long a port's reads and waits have waited, in microseconds.
public static extern ulong pamoja_serial_port_waited_micros(nint port)
Parameters
portnint
Returns
pamoja_serial_port_write(nint, ReadOnlySpan<byte>, nuint)
Writes bytes, waiting until they have left the UART on a real device.
public static PamojaStatus pamoja_serial_port_write(nint port, ReadOnlySpan<byte> bytes, nuint len)
Parameters
portnintbytesReadOnlySpan<byte>lennuint
Returns
pamoja_serial_port_written(nint)
Returns how many bytes have been written through a port.
public static extern nuint pamoja_serial_port_written(nint port)
Parameters
portnint
Returns
pamoja_serial_script_free(nint)
Releases a script. Passing null is a no-op.
public static extern void pamoja_serial_script_free(nint script)
Parameters
scriptnint
pamoja_serial_script_len(nint)
Returns how many steps a script holds.
public static extern nuint pamoja_serial_script_len(nint script)
Parameters
scriptnint
Returns
pamoja_serial_script_new()
Creates an empty script.
public static extern nint pamoja_serial_script_new()
Returns
pamoja_serial_script_read(nint, ReadOnlySpan<byte>, nuint)
Adds bytes the far end sends.
public static PamojaStatus pamoja_serial_script_read(nint script, ReadOnlySpan<byte> bytes, nuint len)
Parameters
scriptnintbytesReadOnlySpan<byte>lennuint
Returns
pamoja_serial_script_write(nint, ReadOnlySpan<byte>, nuint)
Adds a write the program is expected to make.
public static PamojaStatus pamoja_serial_script_write(nint script, ReadOnlySpan<byte> bytes, nuint len)
Parameters
scriptnintbytesReadOnlySpan<byte>lennuint
Returns
pamoja_serial_settings(uint)
Returns eight data bits, no parity, and one stop bit at a speed.
public static extern PamojaSerialSettings pamoja_serial_settings(uint baud)
Parameters
bauduint
Returns
pamoja_serial_settings_bits_per_character(PamojaSerialSettings)
Returns the bits one character takes on the wire.
public static extern uint pamoja_serial_settings_bits_per_character(PamojaSerialSettings settings)
Parameters
settingsPamojaSerialSettings
Returns
pamoja_serial_settings_character_nanos(PamojaSerialSettings)
Returns how long one character takes on the wire, in nanoseconds.
public static extern ulong pamoja_serial_settings_character_nanos(PamojaSerialSettings settings)
Parameters
settingsPamojaSerialSettings
Returns
pamoja_serial_slip_decode(ReadOnlySpan<byte>, nuint, out nint)
Reads the payload back out of a SLIP frame.
public static PamojaStatus pamoja_serial_slip_decode(ReadOnlySpan<byte> frame, nuint frameLen, out nint outBuffer)
Parameters
frameReadOnlySpan<byte>frameLennuintoutBuffernint
Returns
pamoja_serial_slip_encode(ReadOnlySpan<byte>, nuint, out nint)
Frames a payload as a SLIP packet (RFC 1055).
public static PamojaStatus pamoja_serial_slip_encode(ReadOnlySpan<byte> payload, nuint payloadLen, out nint outBuffer)
Parameters
payloadReadOnlySpan<byte>payloadLennuintoutBuffernint
Returns
pamoja_serial_slip_max_encoded_len(nuint)
Returns the largest SLIP frame a payload of this length can produce.
public static extern nuint pamoja_serial_slip_max_encoded_len(nuint payloadLen)
Parameters
payloadLennuint
Returns
pamoja_servo_map_angle(PamojaServoMap, ushort)
Returns the angle a servo pulse width sets.
public static extern float pamoja_servo_map_angle(PamojaServoMap servo, ushort pulseUs)
Parameters
servoPamojaServoMappulseUsushort
Returns
pamoja_servo_map_pulse(PamojaServoMap, float)
Returns the pulse width that sets a servo to an angle.
public static extern ushort pamoja_servo_map_pulse(PamojaServoMap servo, float angleDeg)
Parameters
servoPamojaServoMapangleDegfloat
Returns
pamoja_servo_map_standard()
Returns the standard hobby servo.
public static extern PamojaServoMap pamoja_servo_map_standard()
Returns
pamoja_session_establish(nint, ReadOnlySpan<byte>, ReadOnlySpan<byte>, nuint, PamojaSessionRole)
Establishes a session with a peer.
public static nint pamoja_session_establish(nint local, ReadOnlySpan<byte> peerPublicKey, ReadOnlySpan<byte> salt, nuint saltLen, PamojaSessionRole role)
Parameters
localnintpeerPublicKeyReadOnlySpan<byte>saltReadOnlySpan<byte>saltLennuintrolePamojaSessionRole
Returns
pamoja_session_free(nint)
Releases a session handle.
public static extern void pamoja_session_free(nint session)
Parameters
sessionnint
pamoja_session_hkdf_sha256(ReadOnlySpan<byte>, nuint, ReadOnlySpan<byte>, nuint, ReadOnlySpan<byte>, nuint, Span<byte>, nuint)
Expands input keying material into as many bytes as asked for.
public static PamojaStatus pamoja_session_hkdf_sha256(ReadOnlySpan<byte> salt, nuint saltLen, ReadOnlySpan<byte> ikm, nuint ikmLen, ReadOnlySpan<byte> info, nuint infoLen, Span<byte> outBytes, nuint outLen)
Parameters
saltReadOnlySpan<byte>saltLennuintikmReadOnlySpan<byte>ikmLennuintinfoReadOnlySpan<byte>infoLennuintoutBytesSpan<byte>outLennuint
Returns
pamoja_session_hmac_sha256(ReadOnlySpan<byte>, nuint, ReadOnlySpan<byte>, nuint, Span<byte>)
Computes a keyed hash over a message.
public static PamojaStatus pamoja_session_hmac_sha256(ReadOnlySpan<byte> key, nuint keyLen, ReadOnlySpan<byte> message, nuint messageLen, Span<byte> outDigest)
Parameters
keyReadOnlySpan<byte>keyLennuintmessageReadOnlySpan<byte>messageLennuintoutDigestSpan<byte>
Returns
pamoja_session_open(nint, PamojaSealed, Span<byte>, nuint, ReadOnlySpan<byte>, nuint)
Opens a message from the peer, decrypting it in place.
public static PamojaStatus pamoja_session_open(nint session, PamojaSealed sealedHeader, Span<byte> buf, nuint len, ReadOnlySpan<byte> aad, nuint aadLen)
Parameters
sessionnintsealedHeaderPamojaSealedbufSpan<byte>lennuintaadReadOnlySpan<byte>aadLennuint
Returns
pamoja_session_seal(nint, Span<byte>, nuint, ReadOnlySpan<byte>, nuint, out PamojaSealed)
Seals a message for the peer, encrypting it in place.
public static PamojaStatus pamoja_session_seal(nint session, Span<byte> buf, nuint len, ReadOnlySpan<byte> aad, nuint aadLen, out PamojaSealed outSealed)
Parameters
sessionnintbufSpan<byte>lennuintaadReadOnlySpan<byte>aadLennuintoutSealedPamojaSealed
Returns
pamoja_sht3x_celsius(ushort)
Converts a raw SHT3x temperature word to degrees Celsius. # Returns The temperature.
public static extern float pamoja_sht3x_celsius(ushort raw)
Parameters
rawushort
Returns
pamoja_sht3x_crc(ReadOnlySpan<byte>, nuint)
Computes the CRC-8 an SHT3x appends to every data word. # Returns The checksum over data, or 0 if the pointer is null with a non-zero length. # Safety data must point to at least data_len readable bytes, or be null when data_len is 0.
public static byte pamoja_sht3x_crc(ReadOnlySpan<byte> data, nuint dataLen)
Parameters
dataReadOnlySpan<byte>dataLennuint
Returns
pamoja_sht3x_fahrenheit(ushort)
Converts a raw SHT3x temperature word to degrees Fahrenheit. # Returns The temperature.
public static extern float pamoja_sht3x_fahrenheit(ushort raw)
Parameters
rawushort
Returns
pamoja_sht3x_free(nint)
Releases an SHT3x driver. Passing null is a no-op.
public static extern void pamoja_sht3x_free(nint sensor)
Parameters
sensornint
pamoja_sht3x_heater_off(nint)
Switches the SHT3x heater off.
public static extern PamojaStatus pamoja_sht3x_heater_off(nint sensor)
Parameters
sensornint
Returns
pamoja_sht3x_heater_on(nint)
Switches the SHT3x heater on.
public static extern PamojaStatus pamoja_sht3x_heater_on(nint sensor)
Parameters
sensornint
Returns
pamoja_sht3x_humidity_raw_from_milli_percent(uint)
Builds the SHT3x humidity word that decodes to a relative humidity. # Returns The raw word, saturating at full scale.
public static extern ushort pamoja_sht3x_humidity_raw_from_milli_percent(uint milliPercent)
Parameters
milliPercentuint
Returns
pamoja_sht3x_humidity_raw_from_relative_humidity(float)
Builds the SHT3x humidity word that decodes to a relative humidity percentage. # Returns The raw word, saturating at full scale.
public static extern ushort pamoja_sht3x_humidity_raw_from_relative_humidity(float percent)
Parameters
percentfloat
Returns
pamoja_sht3x_init(nint)
Resets an SHT3x and reads its status.
public static extern PamojaStatus pamoja_sht3x_init(nint sensor)
Parameters
sensornint
Returns
pamoja_sht3x_interval_micros(byte, out uint)
Returns the gap between SHT3x periodic measurements at a rate. # Returns [PamojaStatus::Ok] on success, with *out_micros set, or [PamojaStatus::InvalidArgument] if the code is out of range. # Safety out_micros must point to a writable uint32_t.
public static PamojaStatus pamoja_sht3x_interval_micros(byte rate, out uint outMicros)
Parameters
Returns
pamoja_sht3x_last_status(nint, out PamojaSht3xStatus)
Reports the status an SHT3x driver last read.
public static bool pamoja_sht3x_last_status(nint sensor, out PamojaSht3xStatus outStatus)
Parameters
sensornintoutStatusPamojaSht3xStatus
Returns
pamoja_sht3x_max_measurement_micros(byte, out uint)
Returns how long an SHT3x measurement may take at a repeatability. # Returns [PamojaStatus::Ok] on success, with *out_micros set to the datasheet's worst case, or [PamojaStatus::InvalidArgument] if the code is out of range. # Safety out_micros must point to a writable uint32_t.
public static PamojaStatus pamoja_sht3x_max_measurement_micros(byte repeatability, out uint outMicros)
Parameters
Returns
pamoja_sht3x_measure(nint, out PamojaSht3xMeasurement)
Runs one SHT3x single-shot measurement.
public static PamojaStatus pamoja_sht3x_measure(nint sensor, out PamojaSht3xMeasurement outMeasurement)
Parameters
sensornintoutMeasurementPamojaSht3xMeasurement
Returns
pamoja_sht3x_measurement_bytes(ushort, ushort, Span<byte>)
Builds the six bytes an SHT3x sends for a pair of raw words. # Returns [PamojaStatus::Ok] on success, with the six bytes written to out_bytes, or [PamojaStatus::InvalidArgument] if out_bytes is null. # Safety out_bytes must point to at least six writable bytes.
public static PamojaStatus pamoja_sht3x_measurement_bytes(ushort temperatureRaw, ushort humidityRaw, Span<byte> outBytes)
Parameters
Returns
pamoja_sht3x_milli_celsius(ushort)
Converts a raw SHT3x temperature word to milli-degrees Celsius. # Returns The temperature, exact in integer arithmetic.
public static extern int pamoja_sht3x_milli_celsius(ushort raw)
Parameters
rawushort
Returns
pamoja_sht3x_milli_fahrenheit(ushort)
Converts a raw SHT3x temperature word to milli-degrees Fahrenheit. # Returns The temperature, exact in integer arithmetic.
public static extern int pamoja_sht3x_milli_fahrenheit(ushort raw)
Parameters
rawushort
Returns
pamoja_sht3x_milli_percent(ushort)
Converts a raw SHT3x humidity word to milli-percent. # Returns The relative humidity, exact in integer arithmetic.
public static extern uint pamoja_sht3x_milli_percent(ushort raw)
Parameters
rawushort
Returns
pamoja_sht3x_new(nint, byte, byte, out nint)
Creates an SHT3x driver on a bus.
public static PamojaStatus pamoja_sht3x_new(nint bus, byte address, byte repeatability, out nint outSensor)
Parameters
Returns
pamoja_sht3x_parse_measurement(ReadOnlySpan<byte>, nuint, out PamojaSht3xMeasurement)
Parses and CRC-checks a six-byte SHT3x measurement frame. # Returns [PamojaStatus::Ok] on success, with *out_measurement filled in, or [PamojaStatus::Codec] if either word fails its checksum, which means the read was corrupted on the bus and should be repeated. # Safety frame must point to at least frame_len readable bytes, and out_measurement must point to a writable PamojaSht3xMeasurement.
public static PamojaStatus pamoja_sht3x_parse_measurement(ReadOnlySpan<byte> frame, nuint frameLen, out PamojaSht3xMeasurement outMeasurement)
Parameters
frameReadOnlySpan<byte>frameLennuintoutMeasurementPamojaSht3xMeasurement
Returns
pamoja_sht3x_parse_status(ReadOnlySpan<byte>, nuint, out PamojaSht3xStatus)
Parses and CRC-checks a three-byte SHT3x status frame. # Returns [PamojaStatus::Ok] on success, with *out_status filled in, or [PamojaStatus::Codec] if the CRC does not match. # Safety frame must point to at least frame_len readable bytes, and out_status must point to a writable PamojaSht3xStatus.
public static PamojaStatus pamoja_sht3x_parse_status(ReadOnlySpan<byte> frame, nuint frameLen, out PamojaSht3xStatus outStatus)
Parameters
frameReadOnlySpan<byte>frameLennuintoutStatusPamojaSht3xStatus
Returns
pamoja_sht3x_periodic(byte, byte, out ushort)
Returns the SHT3x periodic-mode command for a repeatability and rate. # Returns [PamojaStatus::Ok] on success, with *out_command set, or [PamojaStatus::InvalidArgument] if either code is outside its range. # Safety out_command must point to a writable uint16_t.
public static PamojaStatus pamoja_sht3x_periodic(byte repeatability, byte rate, out ushort outCommand)
Parameters
Returns
pamoja_sht3x_read_status(nint, out PamojaSht3xStatus)
Reads the SHT3x status register.
public static PamojaStatus pamoja_sht3x_read_status(nint sensor, out PamojaSht3xStatus outStatus)
Parameters
sensornintoutStatusPamojaSht3xStatus
Returns
pamoja_sht3x_relative_humidity(ushort)
Converts a raw SHT3x humidity word to a relative humidity percentage. # Returns The relative humidity.
public static extern float pamoja_sht3x_relative_humidity(ushort raw)
Parameters
rawushort
Returns
pamoja_sht3x_sim_part(byte)
Creates a simulated SHT3x reading its default temperature and humidity.
public static extern nint pamoja_sht3x_sim_part(byte address)
Parameters
addressbyte
Returns
pamoja_sht3x_sim_reporting(byte, float, float)
Creates a simulated SHT3x that reads what it is asked to.
public static extern nint pamoja_sht3x_sim_reporting(byte address, float celsius, float relativeHumidity)
Parameters
Returns
pamoja_sht3x_single_shot(byte, bool, out ushort)
Returns the SHT3x single-shot command for a repeatability and clock mode. # Returns [PamojaStatus::Ok] on success, with *out_command set, or [PamojaStatus::InvalidArgument] if repeatability is not 0, 1, or 2. # Safety out_command must point to a writable uint16_t.
public static PamojaStatus pamoja_sht3x_single_shot(byte repeatability, bool clockStretching, out ushort outCommand)
Parameters
Returns
pamoja_sht3x_status_bytes(ushort, Span<byte>)
Builds the three bytes an SHT3x sends for a status word, CRC last. # Returns [PamojaStatus::Ok] on success, with the three bytes written to out_bytes, or [PamojaStatus::InvalidArgument] if out_bytes is null. # Safety out_bytes must point to at least three writable bytes.
public static PamojaStatus pamoja_sht3x_status_bytes(ushort bits, Span<byte> outBytes)
Parameters
Returns
pamoja_sht3x_status_from_bits(ushort, out PamojaSht3xStatus)
Splits an SHT3x status word into its flags. # Returns [PamojaStatus::Ok], with *out_status filled in. Every word decodes, so this fails only on a null pointer. # Safety out_status must point to a writable PamojaSht3xStatus.
public static PamojaStatus pamoja_sht3x_status_from_bits(ushort bits, out PamojaSht3xStatus outStatus)
Parameters
bitsushortoutStatusPamojaSht3xStatus
Returns
pamoja_sht3x_temperature_raw_from_celsius(float)
Builds the SHT3x temperature word that decodes to a temperature in Celsius. # Returns The raw word, saturating at the ends of the part's range.
public static extern ushort pamoja_sht3x_temperature_raw_from_celsius(float celsius)
Parameters
celsiusfloat
Returns
pamoja_sht3x_temperature_raw_from_milli_celsius(int)
Builds the SHT3x temperature word that decodes to a temperature. # Returns The raw word, saturating at the ends of the part's range.
public static extern ushort pamoja_sht3x_temperature_raw_from_milli_celsius(int milliCelsius)
Parameters
milliCelsiusint
Returns
pamoja_sht3x_temperature_raw_from_milli_fahrenheit(int)
Builds the SHT3x temperature word that decodes to a temperature in Fahrenheit. # Returns The raw word, saturating at the ends of the part's range.
public static extern ushort pamoja_sht3x_temperature_raw_from_milli_fahrenheit(int milliFahrenheit)
Parameters
milliFahrenheitint
Returns
pamoja_sht3x_typical_measurement_micros(byte, out uint)
Returns how long an SHT3x measurement typically takes at a repeatability. # Returns [PamojaStatus::Ok] on success, with *out_micros set, or [PamojaStatus::InvalidArgument] if the code is out of range. # Safety out_micros must point to a writable uint32_t.
public static PamojaStatus pamoja_sht3x_typical_measurement_micros(byte repeatability, out uint outMicros)
Parameters
Returns
pamoja_sht3x_word(ReadOnlySpan<byte>, nuint, out ushort)
Reads a CRC-checked three-byte SHT3x word frame. # Returns [PamojaStatus::Ok] on success, with *out_word set, or [PamojaStatus::Codec] if the CRC does not match. # Safety frame must point to at least frame_len readable bytes, and out_word must point to a writable uint16_t.
public static PamojaStatus pamoja_sht3x_word(ReadOnlySpan<byte> frame, nuint frameLen, out ushort outWord)
Parameters
frameReadOnlySpan<byte>frameLennuintoutWordushort
Returns
pamoja_sht3x_word_bytes(ushort, Span<byte>)
Builds the three bytes an SHT3x sends for a word: the word then its CRC. # Returns [PamojaStatus::Ok] on success, with the three bytes written to out_bytes, or [PamojaStatus::InvalidArgument] if out_bytes is null. # Safety out_bytes must point to at least three writable bytes.
public static PamojaStatus pamoja_sht3x_word_bytes(ushort value, Span<byte> outBytes)
Parameters
Returns
pamoja_sim_robot_apply(nint, PamojaTwist)
Drives a simulated robot for one time step.
public static extern PamojaStatus pamoja_sim_robot_apply(nint robot, PamojaTwist command)
Parameters
robotnintcommandPamojaTwist
Returns
pamoja_sim_robot_free(nint)
Releases a simulated robot handle.
public static extern void pamoja_sim_robot_free(nint robot)
Parameters
robotnint
pamoja_sim_robot_new(PamojaPose, float)
Creates a robot that moves only in arithmetic.
public static extern nint pamoja_sim_robot_new(PamojaPose start, float dt)
Parameters
startPamojaPosedtfloat
Returns
pamoja_sim_robot_pose(nint)
Reads where a simulated robot has got to.
public static extern PamojaPose pamoja_sim_robot_pose(nint robot)
Parameters
robotnint
Returns
pamoja_sim_sensor_free(nint)
Releases a simulated sensor handle.
public static extern void pamoja_sim_sensor_free(nint sensor)
Parameters
sensornint
pamoja_sim_sensor_new(float, float, float, uint)
Creates a sensor that reads around a baseline.
public static extern nint pamoja_sim_sensor_new(float baseline, float driftPerRead, float noise, uint seed)
Parameters
Returns
pamoja_sim_sensor_read(nint, out float)
Takes the next reading from a simulated sensor.
public static PamojaStatus pamoja_sim_sensor_read(nint sensor, out float outReading)
Parameters
Returns
pamoja_skid_steer_body_motion(PamojaSkidSteer, float, float)
Returns the body motion a skid-steer drive makes from measured side speeds.
public static extern PamojaBodyMotion pamoja_skid_steer_body_motion(PamojaSkidSteer drive, float left, float right)
Parameters
drivePamojaSkidSteerleftfloatrightfloat
Returns
pamoja_skid_steer_wheel_speeds(PamojaSkidSteer, float, float)
Returns the side speeds a skid-steer drive needs for a body motion.
public static extern PamojaSideSpeeds pamoja_skid_steer_wheel_speeds(PamojaSkidSteer drive, float linear, float angular)
Parameters
drivePamojaSkidSteerlinearfloatangularfloat
Returns
pamoja_slip_decoder_discarded(nint)
Returns how many corrupt frames a SLIP decoder has discarded.
public static extern ulong pamoja_slip_decoder_discarded(nint decoder)
Parameters
decodernint
Returns
pamoja_slip_decoder_feed(nint, ReadOnlySpan<byte>, nuint, out nint)
Feeds a chunk of the byte stream to a SLIP decoder.
public static PamojaStatus pamoja_slip_decoder_feed(nint decoder, ReadOnlySpan<byte> bytes, nuint bytesLen, out nint outFrames)
Parameters
decodernintbytesReadOnlySpan<byte>bytesLennuintoutFramesnint
Returns
pamoja_slip_decoder_free(nint)
Releases a SLIP decoder handle. Passing null is a no-op.
public static extern void pamoja_slip_decoder_free(nint decoder)
Parameters
decodernint
pamoja_slip_decoder_new()
Creates a streaming SLIP decoder.
public static extern nint pamoja_slip_decoder_new()
Returns
pamoja_slip_decoder_reset(nint)
Discards any partly assembled SLIP frame.
public static extern void pamoja_slip_decoder_reset(nint decoder)
Parameters
decodernint
pamoja_smoother_free(nint)
Releases a smoother handle. Passing null is a no-op.
public static extern void pamoja_smoother_free(nint smoother)
Parameters
smoothernint
pamoja_smoother_new(float)
Creates an exponential smoother.
public static extern nint pamoja_smoother_new(float weight)
Parameters
weightfloat
Returns
pamoja_smoother_reset(nint)
Clears a smoother back to its initial state.
public static extern void pamoja_smoother_reset(nint smoother)
Parameters
smoothernint
pamoja_smoother_update(nint, float)
Folds a sample into a smoother and returns the smoothed value.
public static extern float pamoja_smoother_update(nint smoother, float sample)
Parameters
Returns
pamoja_smoother_value(nint, out float)
Reads a smoother's current value, if it has one.
public static bool pamoja_smoother_value(nint smoother, out float outValue)
Parameters
Returns
pamoja_spi_mode_cpol_cpha(byte, out bool, out bool)
Returns the clock polarity and phase an SPI mode number names.
public static PamojaStatus pamoja_spi_mode_cpol_cpha(byte mode, out bool outCpol, out bool outCpha)
Parameters
Returns
pamoja_spi_mode_from_cpol_cpha(bool, bool)
Returns the SPI mode number a clock polarity and phase name.
public static byte pamoja_spi_mode_from_cpol_cpha(bool cpol, bool cpha)
Parameters
Returns
pamoja_stepper_coils(nint)
Returns the coil pattern a stepper holds, without advancing.
public static extern byte pamoja_stepper_coils(nint stepper)
Parameters
steppernint
Returns
pamoja_stepper_free(nint)
Releases a stepper handle. Passing null is a no-op.
public static extern void pamoja_stepper_free(nint stepper)
Parameters
steppernint
pamoja_stepper_new(PamojaStepDrive)
Creates a stepper at the start of a drive pattern.
public static extern nint pamoja_stepper_new(PamojaStepDrive drive)
Parameters
drivePamojaStepDrive
Returns
pamoja_stepper_step(nint, PamojaStepDirection)
Advances a stepper and returns the coil pattern to apply.
public static extern byte pamoja_stepper_step(nint stepper, PamojaStepDirection direction)
Parameters
steppernintdirectionPamojaStepDirection
Returns
pamoja_stepper_step_count(PamojaStepDrive)
Returns how many steps one electrical cycle of a drive takes.
public static extern nuint pamoja_stepper_step_count(PamojaStepDrive drive)
Parameters
drivePamojaStepDrive
Returns
pamoja_stepper_steps(nint)
Returns how many steps a stepper has taken, signed by direction.
public static extern int pamoja_stepper_steps(nint stepper)
Parameters
steppernint
Returns
pamoja_stepper_steps_for_degrees(float, uint)
Returns how many steps a rotation of an angle takes.
public static extern int pamoja_stepper_steps_for_degrees(float degrees, uint stepsPerRevolution)
Parameters
Returns
pamoja_store_append(nint, ReadOnlySpan<byte>, nuint)
Adds a record to the end of a buffer.
public static PamojaStatus pamoja_store_append(nint store, ReadOnlySpan<byte> record, nuint recordLen)
Parameters
storenintrecordReadOnlySpan<byte>recordLennuint
Returns
pamoja_store_drain_to(nint, nint, nint, out nuint)
Sends every held record over a transport.
public static PamojaStatus pamoja_store_drain_to(nint store, nint transport, nint topic, out nuint outSent)
Parameters
Returns
pamoja_store_file(nint, nuint)
Opens a buffer backed by a directory.
public static extern nint pamoja_store_file(nint dir, nuint capacity)
Parameters
Returns
pamoja_store_free(nint)
Releases a store handle.
public static extern void pamoja_store_free(nint store)
Parameters
storenint
pamoja_store_len(nint, out nuint)
Reports how many records a buffer holds.
public static PamojaStatus pamoja_store_len(nint store, out nuint outLen)
Parameters
Returns
pamoja_store_memory(nuint)
Creates a buffer held in memory.
public static extern nint pamoja_store_memory(nuint capacity)
Parameters
capacitynuint
Returns
pamoja_store_peek(nint, out nint)
Reads the oldest record without removing it.
public static PamojaStatus pamoja_store_peek(nint store, out nint outRecord)
Parameters
Returns
pamoja_store_pop(nint, out nint)
Removes and returns the oldest record.
public static PamojaStatus pamoja_store_pop(nint store, out nint outRecord)
Parameters
Returns
pamoja_string_data(nint)
Returns a pointer to an owned string's bytes.
public static extern nint pamoja_string_data(nint text)
Parameters
textnint
Returns
pamoja_string_free(nint)
Releases an owned string.
public static extern void pamoja_string_free(nint text)
Parameters
textnint
pamoja_string_len(nint)
Returns the length in bytes of an owned string.
public static extern nuint pamoja_string_len(nint text)
Parameters
textnint
Returns
pamoja_surge_falling(float)
Creates a detector for falls of more than the given size.
public static extern nint pamoja_surge_falling(float limit)
Parameters
limitfloat
Returns
pamoja_surge_free(nint)
Releases a surge handle. Passing null is a no-op.
public static extern void pamoja_surge_free(nint surge)
Parameters
surgenint
pamoja_surge_rising(float)
Creates a detector for rises of more than the given size.
public static extern nint pamoja_surge_rising(float limit)
Parameters
limitfloat
Returns
pamoja_surge_update(nint, float, out float)
Feeds a value to a surge detector, reporting a step past the limit.
public static bool pamoja_surge_update(nint surge, float value, out float outDelta)
Parameters
Returns
pamoja_sx126x_calibrate_image(uint, uint)
Builds CalibrateImage for a band.
public static extern PamojaSx126xCommand pamoja_sx126x_calibrate_image(uint lowHz, uint highHz)
Parameters
Returns
pamoja_sx126x_clear_irq_status(ushort)
Builds ClearIrqStatus for a set of interrupts.
public static extern PamojaSx126xCommand pamoja_sx126x_clear_irq_status(ushort irq)
Parameters
irqushort
Returns
pamoja_sx126x_device_errors_from_bytes(byte, byte)
Decodes a GetDeviceErrors answer into its error bits.
public static extern ushort pamoja_sx126x_device_errors_from_bytes(byte high, byte low)
Parameters
Returns
pamoja_sx126x_frequency_word(uint)
Returns the RF frequency word for a frequency in hertz.
public static extern uint pamoja_sx126x_frequency_word(uint frequencyHz)
Parameters
frequencyHzuint
Returns
pamoja_sx126x_get_device_errors()
Builds GetDeviceErrors.
public static extern PamojaSx126xQuery pamoja_sx126x_get_device_errors()
Returns
pamoja_sx126x_get_irq_status()
Builds GetIrqStatus.
public static extern PamojaSx126xQuery pamoja_sx126x_get_irq_status()
Returns
pamoja_sx126x_get_packet_status()
Builds GetPacketStatus.
public static extern PamojaSx126xQuery pamoja_sx126x_get_packet_status()
Returns
pamoja_sx126x_get_rssi_inst()
Builds GetRssiInst.
public static extern PamojaSx126xQuery pamoja_sx126x_get_rssi_inst()
Returns
pamoja_sx126x_get_rx_buffer_status()
Builds GetRxBufferStatus.
public static extern PamojaSx126xQuery pamoja_sx126x_get_rx_buffer_status()
Returns
pamoja_sx126x_get_status()
Builds GetStatus.
public static extern PamojaSx126xQuery pamoja_sx126x_get_status()
Returns
pamoja_sx126x_image_calibration(uint, uint)
Returns the two CalibrateImage codes for a band, high byte first.
public static extern ushort pamoja_sx126x_image_calibration(uint lowHz, uint highHz)
Parameters
Returns
pamoja_sx126x_irq_from_bytes(byte, byte)
Decodes a GetIrqStatus answer into its interrupt bits.
public static extern ushort pamoja_sx126x_irq_from_bytes(byte high, byte low)
Parameters
Returns
pamoja_sx126x_llcc68_supports(PamojaLoraLink)
Reports whether an LLCC68 supports a link's spreading factor at its bandwidth.
public static bool pamoja_sx126x_llcc68_supports(PamojaLoraLink link)
Parameters
linkPamojaLoraLink
Returns
pamoja_sx126x_packet_status_from_bytes(byte, byte, byte)
Decodes a GetPacketStatus answer.
public static extern PamojaSx126xPacketStatus pamoja_sx126x_packet_status_from_bytes(byte rssiPkt, byte snrPkt, byte signalRssiPkt)
Parameters
Returns
pamoja_sx126x_ramp_time_us(uint)
Returns the shortest ramp time the chip offers at least as long as the one given.
public static extern uint pamoja_sx126x_ramp_time_us(uint atLeastUs)
Parameters
atLeastUsuint
Returns
pamoja_sx126x_read_buffer(byte, byte)
Builds ReadBuffer for a run of buffer bytes.
public static extern PamojaSx126xQuery pamoja_sx126x_read_buffer(byte offset, byte len)
Parameters
Returns
pamoja_sx126x_read_register(ushort, byte)
Builds ReadRegister for a run of registers.
public static extern PamojaSx126xQuery pamoja_sx126x_read_register(ushort address, byte len)
Parameters
Returns
pamoja_sx126x_rssi_inst_centi_dbm(byte)
Decodes a GetRssiInst answer, in hundredths of a dBm.
public static extern int pamoja_sx126x_rssi_inst_centi_dbm(byte value)
Parameters
valuebyte
Returns
pamoja_sx126x_rx_buffer_status_from_bytes(byte, byte)
Decodes a GetRxBufferStatus answer.
public static extern PamojaSx126xRxBufferStatus pamoja_sx126x_rx_buffer_status_from_bytes(byte payloadLen, byte start)
Parameters
Returns
pamoja_sx126x_set_dio_irq_params(ushort, ushort, ushort, ushort)
Builds SetDioIrqParams from an interrupt mask and the mask each DIO line raises.
public static extern PamojaSx126xCommand pamoja_sx126x_set_dio_irq_params(ushort irq, ushort dio1, ushort dio2, ushort dio3)
Parameters
Returns
pamoja_sx126x_set_lora_modulation_params(PamojaLoraLink, out PamojaSx126xCommand)
Builds SetModulationParams for a LoRa link.
public static PamojaStatus pamoja_sx126x_set_lora_modulation_params(PamojaLoraLink link, out PamojaSx126xCommand outCommand)
Parameters
linkPamojaLoraLinkoutCommandPamojaSx126xCommand
Returns
pamoja_sx126x_set_lora_packet_params(PamojaLoraLink, byte, bool)
Builds SetPacketParams for a LoRa link and a payload length.
public static PamojaSx126xCommand pamoja_sx126x_set_lora_packet_params(PamojaLoraLink link, byte payloadLen, bool invertIq)
Parameters
linkPamojaLoraLinkpayloadLenbyteinvertIqbool
Returns
pamoja_sx126x_set_pa_config(PamojaSx126xTxPower)
Builds SetPaConfig for an amplifier setting.
public static extern PamojaSx126xCommand pamoja_sx126x_set_pa_config(PamojaSx126xTxPower power)
Parameters
powerPamojaSx126xTxPower
Returns
pamoja_sx126x_set_packet_type_lora()
Builds SetPacketType for LoRa.
public static extern PamojaSx126xCommand pamoja_sx126x_set_packet_type_lora()
Returns
pamoja_sx126x_set_rf_frequency(uint)
Builds SetRfFrequency for a frequency in hertz.
public static extern PamojaSx126xCommand pamoja_sx126x_set_rf_frequency(uint frequencyHz)
Parameters
frequencyHzuint
Returns
pamoja_sx126x_set_rx(ulong)
Builds SetRx with a timeout in microseconds.
public static extern PamojaSx126xCommand pamoja_sx126x_set_rx(ulong timeoutUs)
Parameters
timeoutUsulong
Returns
pamoja_sx126x_set_rx_continuous()
Builds SetRx that listens until told otherwise.
public static extern PamojaSx126xCommand pamoja_sx126x_set_rx_continuous()
Returns
pamoja_sx126x_set_sleep(bool)
Builds SetSleep, keeping the configuration for a warm start or not.
public static PamojaSx126xCommand pamoja_sx126x_set_sleep(bool warmStart)
Parameters
warmStartbool
Returns
pamoja_sx126x_set_standby()
Builds SetStandby into the RC oscillator standby.
public static extern PamojaSx126xCommand pamoja_sx126x_set_standby()
Returns
pamoja_sx126x_set_tx(ulong)
Builds SetTx with a timeout in microseconds.
public static extern PamojaSx126xCommand pamoja_sx126x_set_tx(ulong timeoutUs)
Parameters
timeoutUsulong
Returns
pamoja_sx126x_set_tx_params(PamojaSx126xTxPower, uint)
Builds SetTxParams for an amplifier setting and a ramp time.
public static extern PamojaSx126xCommand pamoja_sx126x_set_tx_params(PamojaSx126xTxPower power, uint rampUs)
Parameters
powerPamojaSx126xTxPowerrampUsuint
Returns
pamoja_sx126x_status_from_byte(byte)
Decodes a status byte.
public static extern PamojaSx126xStatus pamoja_sx126x_status_from_byte(byte value)
Parameters
valuebyte
Returns
pamoja_sx126x_timeout_steps(ulong)
Returns a timeout in microseconds as the chip's 15.625 microsecond steps.
public static extern uint pamoja_sx126x_timeout_steps(ulong timeoutUs)
Parameters
timeoutUsulong
Returns
pamoja_sx126x_tx_power_for_output(bool, sbyte)
Returns the amplifier setting that delivers an output power.
public static PamojaSx126xTxPower pamoja_sx126x_tx_power_for_output(bool highPower, sbyte outputDbm)
Parameters
Returns
pamoja_sx126x_tx_power_under_ceiling(bool, PamojaLoraLinkBudget, int)
Returns the strongest amplifier setting that keeps a link under an EIRP ceiling.
public static PamojaSx126xTxPower pamoja_sx126x_tx_power_under_ceiling(bool highPower, PamojaLoraLinkBudget budget, int eirpCeilingCentiDbm)
Parameters
highPowerboolbudgetPamojaLoraLinkBudgeteirpCeilingCentiDbmint
Returns
pamoja_sx126x_write_buffer_header(byte)
Builds the WriteBuffer header the payload follows.
public static extern PamojaSx126xCommand pamoja_sx126x_write_buffer_header(byte offset)
Parameters
offsetbyte
Returns
pamoja_sx126x_write_register_header(ushort)
Builds the WriteRegister header the values follow.
public static extern PamojaSx126xCommand pamoja_sx126x_write_register_header(ushort address)
Parameters
addressushort
Returns
pamoja_sx127x_automatic_if(byte, bool)
Returns RegDetectOptimize with AutomaticIFOn set or clear.
public static byte pamoja_sx127x_automatic_if(byte current, bool automaticIf)
Parameters
Returns
pamoja_sx127x_frequency_from_word(uint)
Returns the frequency an SX127x RegFrf word selects.
public static extern uint pamoja_sx127x_frequency_from_word(uint word)
Parameters
worduint
Returns
pamoja_sx127x_frequency_word(uint)
Returns the 24-bit RegFrf word an SX127x takes for a frequency.
public static extern uint pamoja_sx127x_frequency_word(uint frequencyHz)
Parameters
frequencyHzuint
Returns
pamoja_sx127x_fsk_op_mode(byte)
Returns the RegOpMode value for an FSK operating mode code.
public static extern byte pamoja_sx127x_fsk_op_mode(byte mode)
Parameters
modebyte
Returns
pamoja_sx127x_high_bw_optimize(PamojaLoraLink, uint, out PamojaSx127xHighBwOptimize)
Returns the writes of the 500 kHz sensitivity erratum.
public static PamojaStatus pamoja_sx127x_high_bw_optimize(PamojaLoraLink link, uint frequencyHz, out PamojaSx127xHighBwOptimize outOptimize)
Parameters
linkPamojaLoraLinkfrequencyHzuintoutOptimizePamojaSx127xHighBwOptimize
Returns
pamoja_sx127x_image_cal_start(byte)
Returns RegImageCal to start a calibration.
public static extern byte pamoja_sx127x_image_cal_start(byte current)
Parameters
currentbyte
Returns
pamoja_sx127x_invert_iq(bool, bool)
Returns RegInvertIQ for the IQ polarity of each path.
public static byte pamoja_sx127x_invert_iq(bool receive, bool transmit)
Parameters
Returns
pamoja_sx127x_invert_iq_2(bool)
Returns RegInvertIQ2 for the path in use.
public static byte pamoja_sx127x_invert_iq_2(bool inverted)
Parameters
invertedbool
Returns
pamoja_sx127x_lora_op_mode(byte)
Returns the RegOpMode value for a LoRa operating mode code.
public static extern byte pamoja_sx127x_lora_op_mode(byte mode)
Parameters
modebyte
Returns
pamoja_sx127x_mode_from_op_mode(byte)
Returns the operating mode code a RegOpMode value holds.
public static extern byte pamoja_sx127x_mode_from_op_mode(byte opMode)
Parameters
opModebyte
Returns
pamoja_sx127x_modem(PamojaLoraLink, uint, ushort, out PamojaSx127xModem)
Returns the LoRa modem registers for a link at a carrier.
public static PamojaStatus pamoja_sx127x_modem(PamojaLoraLink link, uint frequencyHz, ushort symbolTimeout, out PamojaSx127xModem outModem)
Parameters
linkPamojaLoraLinkfrequencyHzuintsymbolTimeoutushortoutModemPamojaSx127xModem
Returns
pamoja_sx127x_modem_status_from_byte(byte)
Decodes RegModemStat.
public static extern PamojaSx127xModemStatus pamoja_sx127x_modem_status_from_byte(byte value)
Parameters
valuebyte
Returns
pamoja_sx127x_ocp_register(ushort)
Returns RegOcp for a current limit.
public static extern byte pamoja_sx127x_ocp_register(ushort milliamps)
Parameters
milliampsushort
Returns
pamoja_sx127x_packet_status_from_bytes(byte, byte, uint)
Decodes RegPktSnrValue and RegPktRssiValue for a carrier.
public static extern PamojaSx127xPacketStatus pamoja_sx127x_packet_status_from_bytes(byte pktSnr, byte pktRssi, uint frequencyHz)
Parameters
Returns
pamoja_sx127x_read_address(byte)
Returns the SX127x address byte that reads a register.
public static extern byte pamoja_sx127x_read_address(byte address)
Parameters
addressbyte
Returns
pamoja_sx127x_rssi_centi_dbm(byte, uint)
Decodes RegRssiValue for a carrier, in hundredths of a dBm.
public static extern int pamoja_sx127x_rssi_centi_dbm(byte value, uint frequencyHz)
Parameters
Returns
pamoja_sx127x_spurious_reception(PamojaLoraLink, out PamojaSx127xSpuriousReception)
Returns the receive settings of the spurious reception erratum.
public static PamojaStatus pamoja_sx127x_spurious_reception(PamojaLoraLink link, out PamojaSx127xSpuriousReception outErratum)
Parameters
linkPamojaLoraLinkoutErratumPamojaSx127xSpuriousReception
Returns
pamoja_sx127x_symbol_timeout(PamojaLoraLink, ulong)
Returns a single reception timeout in a link's symbols.
public static extern ushort pamoja_sx127x_symbol_timeout(PamojaLoraLink link, ulong timeoutUs)
Parameters
linkPamojaLoraLinktimeoutUsulong
Returns
pamoja_sx127x_tx_power_for_output(bool, sbyte)
Returns the SX127x amplifier settings for an output power.
public static PamojaSx127xTxPower pamoja_sx127x_tx_power_for_output(bool paBoost, sbyte outputDbm)
Parameters
Returns
pamoja_sx127x_tx_power_under_ceiling(bool, PamojaLoraLinkBudget, int)
Returns the SX127x amplifier settings that keep a link under an EIRP ceiling.
public static PamojaSx127xTxPower pamoja_sx127x_tx_power_under_ceiling(bool paBoost, PamojaLoraLinkBudget budget, int eirpCeilingCentiDbm)
Parameters
paBoostboolbudgetPamojaLoraLinkBudgeteirpCeilingCentiDbmint
Returns
pamoja_sx127x_write_address(byte)
Returns the SX127x address byte that writes a register.
public static extern byte pamoja_sx127x_write_address(byte address)
Parameters
addressbyte
Returns
pamoja_thermostat_cooling(float, float)
Creates a cooling thermostat.
public static extern nint pamoja_thermostat_cooling(float setpoint, float hysteresis)
Parameters
Returns
pamoja_thermostat_free(nint)
Releases a thermostat handle. Passing null is a no-op.
public static extern void pamoja_thermostat_free(nint thermostat)
Parameters
thermostatnint
pamoja_thermostat_heating(float, float)
Creates a heating thermostat.
public static extern nint pamoja_thermostat_heating(float setpoint, float hysteresis)
Parameters
Returns
pamoja_thermostat_is_on(nint)
Reports a thermostat's current load state.
public static bool pamoja_thermostat_is_on(nint thermostat)
Parameters
thermostatnint
Returns
pamoja_thermostat_update(nint, float)
Feeds a reading to a thermostat and returns the load state.
public static bool pamoja_thermostat_update(nint thermostat, float reading)
Parameters
Returns
pamoja_tmp117_alerts(nint, out PamojaTmp117Alerts)
Reads the TMP117's alert flags.
public static PamojaStatus pamoja_tmp117_alerts(nint sensor, out PamojaTmp117Alerts outAlerts)
Parameters
sensornintoutAlertsPamojaTmp117Alerts
Returns
pamoja_tmp117_averaging_conversions(byte)
Returns how many conversions a TMP117 averaging code folds into one result. # Returns The conversion count: 1, 8, 32, or 64.
public static extern byte pamoja_tmp117_averaging_conversions(byte code)
Parameters
codebyte
Returns
pamoja_tmp117_averaging_micros(byte)
Returns how long a TMP117 averaging code takes to convert. # Returns The conversion time in microseconds.
public static extern uint pamoja_tmp117_averaging_micros(byte code)
Parameters
codebyte
Returns
pamoja_tmp117_celsius(short)
Converts a raw TMP117 temperature register to degrees Celsius. # Returns The temperature.
public static extern float pamoja_tmp117_celsius(short raw)
Parameters
rawshort
Returns
pamoja_tmp117_config_bits(PamojaTmp117Config)
Assembles the 16-bit TMP117 configuration register value. # Returns The register value to write.
public static extern ushort pamoja_tmp117_config_bits(PamojaTmp117Config config)
Parameters
configPamojaTmp117Config
Returns
pamoja_tmp117_config_from_bits(ushort, out PamojaTmp117Config)
Parses a 16-bit TMP117 configuration register value. # Returns [PamojaStatus::Ok], with *out_config filled in. Every register value decodes, so this fails only on a null pointer. # Safety out_config must point to a writable PamojaTmp117Config.
public static PamojaStatus pamoja_tmp117_config_from_bits(ushort bits, out PamojaTmp117Config outConfig)
Parameters
bitsushortoutConfigPamojaTmp117Config
Returns
pamoja_tmp117_cycle_micros(byte, byte)
Returns how often a TMP117 updates its result for a cycle and averaging code. # Returns The longer of the nominal cycle and the time the averaging takes.
public static extern uint pamoja_tmp117_cycle_micros(byte cycle, byte averaging)
Parameters
Returns
pamoja_tmp117_cycle_nominal_micros(byte)
Returns the nominal cycle a TMP117 conversion-cycle code selects. # Returns The cycle in microseconds, before the averaging setting extends it.
public static extern uint pamoja_tmp117_cycle_nominal_micros(byte code)
Parameters
codebyte
Returns
pamoja_tmp117_data_ready(ushort)
Reports whether a TMP117 configuration register says a result is ready. # Returns true when a conversion completed since the register was last read.
public static bool pamoja_tmp117_data_ready(ushort config)
Parameters
configushort
Returns
pamoja_tmp117_device_id(ushort)
Reads the device identifier out of a TMP117 device-ID register. # Returns The low twelve bits, which are 0x117 for a TMP117.
public static extern ushort pamoja_tmp117_device_id(ushort raw)
Parameters
rawushort
Returns
pamoja_tmp117_eeprom_busy(ushort)
Reports whether a TMP117 configuration register says an EEPROM write is running. # Returns true while the write is in progress.
public static bool pamoja_tmp117_eeprom_busy(ushort config)
Parameters
configushort
Returns
pamoja_tmp117_eeprom_unlock_busy(ushort)
Reports whether a TMP117 EEPROM unlock register says a write is running. # Returns true while the write is in progress.
public static bool pamoja_tmp117_eeprom_unlock_busy(ushort unlock)
Parameters
unlockushort
Returns
pamoja_tmp117_free(nint)
Releases a TMP117 driver. Passing null is a no-op.
public static extern void pamoja_tmp117_free(nint sensor)
Parameters
sensornint
pamoja_tmp117_high_alert(ushort)
Reports whether a TMP117 configuration register flags a high alert. # Returns true when a result went above the high limit.
public static bool pamoja_tmp117_high_alert(ushort config)
Parameters
configushort
Returns
pamoja_tmp117_init(nint)
Identifies and configures a TMP117.
public static extern PamojaStatus pamoja_tmp117_init(nint sensor)
Parameters
sensornint
Returns
pamoja_tmp117_low_alert(ushort)
Reports whether a TMP117 configuration register flags a low alert. # Returns true when a result went below the low limit.
public static bool pamoja_tmp117_low_alert(ushort config)
Parameters
configushort
Returns
pamoja_tmp117_measure(nint, out PamojaTmp117Reading)
Runs one TMP117 conversion and reads the temperature.
public static PamojaStatus pamoja_tmp117_measure(nint sensor, out PamojaTmp117Reading outReading)
Parameters
sensornintoutReadingPamojaTmp117Reading
Returns
pamoja_tmp117_micro_celsius(short)
Converts a raw TMP117 temperature register to micro-degrees Celsius. # Returns The temperature, truncated toward zero at the last digit.
public static extern int pamoja_tmp117_micro_celsius(short raw)
Parameters
rawshort
Returns
pamoja_tmp117_nano_celsius(short)
Converts a raw TMP117 temperature register to nano-degrees Celsius. # Returns The temperature, exact in integer arithmetic at the part's 7.8125 m°C step.
public static extern long pamoja_tmp117_nano_celsius(short raw)
Parameters
rawshort
Returns
pamoja_tmp117_new(nint, byte, byte, out nint)
Creates a TMP117 driver on a bus.
public static PamojaStatus pamoja_tmp117_new(nint bus, byte address, byte averaging, out nint outSensor)
Parameters
Returns
pamoja_tmp117_raw_from_celsius(float)
Builds the TMP117 temperature register that decodes to a temperature in Celsius. # Returns The nearest register value, saturating at the ends of the part's range.
public static extern short pamoja_tmp117_raw_from_celsius(float celsius)
Parameters
celsiusfloat
Returns
pamoja_tmp117_raw_from_micro_celsius(int)
Builds the TMP117 temperature register that decodes to a temperature. # Returns The nearest register value, saturating at the ends of the part's range.
public static extern short pamoja_tmp117_raw_from_micro_celsius(int microCelsius)
Parameters
microCelsiusint
Returns
pamoja_tmp117_revision(ushort)
Reads the die revision out of a TMP117 device-ID register. # Returns The high four bits.
public static extern byte pamoja_tmp117_revision(ushort raw)
Parameters
rawushort
Returns
pamoja_tmp117_set_alert_limits(nint, float, float)
Writes the TMP117's high and low limits.
public static extern PamojaStatus pamoja_tmp117_set_alert_limits(nint sensor, float highCelsius, float lowCelsius)
Parameters
Returns
pamoja_tmp117_silicon_revision(nint, out byte)
Reports the silicon revision a TMP117 driver read at initialization.
public static bool pamoja_tmp117_silicon_revision(nint sensor, out byte outRevision)
Parameters
Returns
pamoja_tmp117_sim_part(byte)
Creates a simulated TMP117 reading its default temperature.
public static extern nint pamoja_tmp117_sim_part(byte address)
Parameters
addressbyte
Returns
pamoja_tmp117_sim_reporting(byte, float)
Creates a simulated TMP117 that reads what it is asked to.
public static extern nint pamoja_tmp117_sim_reporting(byte address, float celsius)
Parameters
Returns
pamoja_tmp117_temperature_bytes(short, Span<byte>)
Builds the two bytes a TMP117 sends for a temperature register. # Returns [PamojaStatus::Ok] on success, with the two bytes written to out_bytes, or [PamojaStatus::InvalidArgument] if out_bytes is null. # Safety out_bytes must point to at least two writable bytes.
public static PamojaStatus pamoja_tmp117_temperature_bytes(short raw, Span<byte> outBytes)
Parameters
Returns
pamoja_tmp117_temperature_from_bytes(ReadOnlySpan<byte>, nuint, out short)
Reads the two bytes a TMP117 sends for a temperature register. # Returns [PamojaStatus::Ok] on success, with *out_raw set, or [PamojaStatus::InvalidArgument] if the buffer is not two bytes. # Safety bytes must point to at least bytes_len readable bytes, and out_raw must point to a writable int16_t.
public static PamojaStatus pamoja_tmp117_temperature_from_bytes(ReadOnlySpan<byte> bytes, nuint bytesLen, out short outRaw)
Parameters
bytesReadOnlySpan<byte>bytesLennuintoutRawshort
Returns
pamoja_transform_identity()
Returns the identity transform.
public static extern PamojaTransform pamoja_transform_identity()
Returns
pamoja_transform_multiply(PamojaTransform, PamojaTransform)
Returns the product of two transforms.
public static extern PamojaTransform pamoja_transform_multiply(PamojaTransform first, PamojaTransform second)
Parameters
firstPamojaTransformsecondPamojaTransform
Returns
pamoja_transport_coap(ref PamojaCoapConfig)
Creates a CoAP transport for composing.
public static nint pamoja_transport_coap(ref PamojaCoapConfig config)
Parameters
configPamojaCoapConfig
Returns
pamoja_transport_connect(nint)
Connects a transport.
public static extern PamojaStatus pamoja_transport_connect(nint transport)
Parameters
transportnint
Returns
pamoja_transport_degraded(nint, uint, uint, uint)
Wraps a transport in a link that loses packets and goes down.
public static extern nint pamoja_transport_degraded(nint transport, uint dropEvery, uint up, uint down)
Parameters
Returns
pamoja_transport_faulty(nint, nuint)
Wraps a transport so a set number of its next sends fail.
public static extern nint pamoja_transport_faulty(nint transport, nuint failures)
Parameters
Returns
pamoja_transport_free(nint)
Releases a transport handle.
public static extern void pamoja_transport_free(nint transport)
Parameters
transportnint
pamoja_transport_from_callbacks(ref PamojaTransportCallbacks, nint)
Wraps host callbacks in a transport.
public static nint pamoja_transport_from_callbacks(ref PamojaTransportCallbacks callbacks, nint userData)
Parameters
callbacksPamojaTransportCallbacksuserDatanint
Returns
pamoja_transport_loopback(nint)
Creates a loopback transport for composing.
public static extern nint pamoja_transport_loopback(nint broker)
Parameters
brokernint
Returns
pamoja_transport_mqtt(ref PamojaMqttConfig)
Creates an MQTT transport for composing.
public static nint pamoja_transport_mqtt(ref PamojaMqttConfig config)
Parameters
configPamojaMqttConfig
Returns
pamoja_transport_recv(nint, out nint)
Waits for the next message a transport delivers.
public static PamojaStatus pamoja_transport_recv(nint transport, out nint outMessage)
Parameters
Returns
pamoja_transport_recv_within(nint, ulong, out nint, out bool)
Waits a limited time for the next message a transport delivers.
public static PamojaStatus pamoja_transport_recv_within(nint transport, ulong timeoutMs, out nint outMessage, out bool outTimedOut)
Parameters
Returns
pamoja_transport_send(nint, nint, ReadOnlySpan<byte>, nuint)
Sends a payload over a transport.
public static PamojaStatus pamoja_transport_send(nint transport, nint topic, ReadOnlySpan<byte> payload, nuint payloadLen)
Parameters
transportninttopicnintpayloadReadOnlySpan<byte>payloadLennuint
Returns
pamoja_transport_subscribe(nint, nint)
Subscribes a transport to a topic.
public static extern PamojaStatus pamoja_transport_subscribe(nint transport, nint topic)
Parameters
Returns
pamoja_trend_capacity(nint)
Returns how many readings a trend estimator keeps.
public static extern nuint pamoja_trend_capacity(nint trend)
Parameters
trendnint
Returns
pamoja_trend_free(nint)
Releases a trend estimator handle. Passing null is a no-op.
public static extern void pamoja_trend_free(nint trend)
Parameters
trendnint
pamoja_trend_new()
Creates an empty trend estimator.
public static extern nint pamoja_trend_new()
Returns
pamoja_trend_push(nint, float)
Adds a reading to a trend estimator.
public static extern void pamoja_trend_push(nint trend, float reading)
Parameters
pamoja_trend_slope(nint, out float)
Reads the slope a trend estimator has fitted, if it has enough readings.
public static bool pamoja_trend_slope(nint trend, out float outValue)
Parameters
Returns
pamoja_trend_with_capacity(nuint)
Creates an empty trend estimator keeping up to a capacity, or null for one out of range.
public static extern nint pamoja_trend_with_capacity(nuint capacity)
Parameters
capacitynuint
Returns
pamoja_trigger_above(float, float)
Creates a trigger that fires when a reading rises above a line.
public static extern nint pamoja_trigger_above(float threshold, float hysteresis)
Parameters
Returns
pamoja_trigger_below(float, float)
Creates a trigger that fires when a reading falls below a line.
public static extern nint pamoja_trigger_below(float threshold, float hysteresis)
Parameters
Returns
pamoja_trigger_free(nint)
Releases a trigger handle. Passing null is a no-op.
public static extern void pamoja_trigger_free(nint trigger)
Parameters
triggernint
pamoja_trigger_hysteresis(nint)
Reads the release band on the far side of a trigger's line.
public static extern float pamoja_trigger_hysteresis(nint trigger)
Parameters
triggernint
Returns
pamoja_trigger_is_set(nint)
Reports whether a trigger's condition currently holds.
public static bool pamoja_trigger_is_set(nint trigger)
Parameters
triggernint
Returns
pamoja_trigger_threshold(nint)
Reads the line a trigger watches.
public static extern float pamoja_trigger_threshold(nint trigger)
Parameters
triggernint
Returns
pamoja_trigger_update(nint, float)
Feeds a reading to a trigger and returns the edge it caused.
public static extern PamojaEdge pamoja_trigger_update(nint trigger, float reading)
Parameters
Returns
pamoja_trigger_watches_above(nint)
Reports whether a trigger watches a rising reading.
public static bool pamoja_trigger_watches_above(nint trigger)
Parameters
triggernint
Returns
pamoja_two_link_arm_joints_for(PamojaTwoLinkArm, float, float, PamojaElbow, out PamojaJoints)
Finds the joint angles that put a two-link arm's hand at a point.
public static bool pamoja_two_link_arm_joints_for(PamojaTwoLinkArm arm, float x, float y, PamojaElbow elbow, out PamojaJoints outJoints)
Parameters
armPamojaTwoLinkArmxfloatyfloatelbowPamojaElbowoutJointsPamojaJoints
Returns
pamoja_two_link_arm_reach(PamojaTwoLinkArm)
Returns how close and how far a two-link arm reaches.
public static extern PamojaReach pamoja_two_link_arm_reach(PamojaTwoLinkArm arm)
Parameters
armPamojaTwoLinkArm
Returns
pamoja_two_link_arm_tip(PamojaTwoLinkArm, float, float)
Returns where a two-link arm's hand is for its joint angles.
public static extern PamojaPoint pamoja_two_link_arm_tip(PamojaTwoLinkArm arm, float shoulder, float elbow)
Parameters
armPamojaTwoLinkArmshoulderfloatelbowfloat
Returns
pamoja_units_celsius_to_fahrenheit(float)
Converts degrees Celsius to degrees Fahrenheit.
public static extern float pamoja_units_celsius_to_fahrenheit(float celsius)
Parameters
celsiusfloat
Returns
pamoja_units_celsius_to_kelvin(float)
Converts degrees Celsius to kelvin.
public static extern float pamoja_units_celsius_to_kelvin(float celsius)
Parameters
celsiusfloat
Returns
pamoja_units_fahrenheit_to_celsius(float)
Converts degrees Fahrenheit to degrees Celsius.
public static extern float pamoja_units_fahrenheit_to_celsius(float fahrenheit)
Parameters
fahrenheitfloat
Returns
pamoja_units_hectopascals_to_pascals(float)
Converts hectopascals to pascals.
public static extern float pamoja_units_hectopascals_to_pascals(float hectopascals)
Parameters
hectopascalsfloat
Returns
pamoja_units_kelvin_to_celsius(float)
Converts kelvin to degrees Celsius.
public static extern float pamoja_units_kelvin_to_celsius(float kelvin)
Parameters
kelvinfloat
Returns
pamoja_units_kilopascals_to_pascals(float)
Converts kilopascals to pascals.
public static extern float pamoja_units_kilopascals_to_pascals(float kilopascals)
Parameters
kilopascalsfloat
Returns
pamoja_units_pascals_to_hectopascals(float)
Converts pascals to hectopascals.
public static extern float pamoja_units_pascals_to_hectopascals(float pascals)
Parameters
pascalsfloat
Returns
pamoja_units_pascals_to_kilopascals(float)
Converts pascals to kilopascals.
public static extern float pamoja_units_pascals_to_kilopascals(float pascals)
Parameters
pascalsfloat
Returns
pamoja_units_pascals_to_psi(float)
Converts pascals to pounds per square inch.
public static extern float pamoja_units_pascals_to_psi(float pascals)
Parameters
pascalsfloat
Returns
pamoja_units_percent_to_ratio(float)
Converts a percentage to a ratio from 0 to 1.
public static extern float pamoja_units_percent_to_ratio(float percent)
Parameters
percentfloat
Returns
pamoja_units_psi_to_pascals(float)
Converts pounds per square inch to pascals.
public static extern float pamoja_units_psi_to_pascals(float psi)
Parameters
psifloat
Returns
pamoja_units_ratio_to_percent(float)
Converts a ratio from 0 to 1 to a percentage.
public static extern float pamoja_units_ratio_to_percent(float ratio)
Parameters
ratiofloat
Returns
pamoja_update_block_frame(ReadOnlySpan<byte>, nuint, ReadOnlySpan<byte>, nuint, Span<byte>, nuint, out nuint)
Writes a signed update into one block, for a transport that moves blocks.
public static PamojaStatus pamoja_update_block_frame(ReadOnlySpan<byte> envelope, nuint envelopeLen, ReadOnlySpan<byte> image, nuint imageLen, Span<byte> outBlock, nuint capacity, out nuint outLen)
Parameters
envelopeReadOnlySpan<byte>envelopeLennuintimageReadOnlySpan<byte>imageLennuintoutBlockSpan<byte>capacitynuintoutLennuint
Returns
pamoja_update_block_split(ReadOnlySpan<byte>, nuint, out nuint, out nuint, out nuint, out nuint)
Reads a block back into the signed manifest and the image.
public static PamojaStatus pamoja_update_block_split(ReadOnlySpan<byte> block, nuint blockLen, out nuint outEnvelopeAt, out nuint outEnvelopeLen, out nuint outImageAt, out nuint outImageLen)
Parameters
blockReadOnlySpan<byte>blockLennuintoutEnvelopeAtnuintoutEnvelopeLennuintoutImageAtnuintoutImageLennuint
Returns
pamoja_updater_adopt(nint, ReadOnlySpan<byte>, nuint, bool, ulong, out PamojaDelegation)
Adopts a delegation naming a release key.
public static PamojaStatus pamoja_updater_adopt(nint updater, ReadOnlySpan<byte> bytes, nuint len, bool hasNow, ulong now, out PamojaDelegation outDelegation)
Parameters
updaternintbytesReadOnlySpan<byte>lennuinthasNowboolnowulongoutDelegationPamojaDelegation
Returns
pamoja_updater_begin(nint, ReadOnlySpan<byte>, nuint, bool, ulong, out byte)
Checks a manifest and opens its slot for a transfer in pieces.
public static PamojaStatus pamoja_updater_begin(nint updater, ReadOnlySpan<byte> envelope, nuint envelopeLen, bool hasNow, ulong now, out byte outSlot)
Parameters
Returns
pamoja_updater_confirm(nint, out byte)
Confirms the pending image.
public static PamojaStatus pamoja_updater_confirm(nint updater, out byte outSlot)
Parameters
Returns
pamoja_updater_delegation(nint, out PamojaDelegation)
Reads the delegation an updater currently honors.
public static bool pamoja_updater_delegation(nint updater, out PamojaDelegation outDelegation)
Parameters
updaternintoutDelegationPamojaDelegation
Returns
pamoja_updater_finish(nint, out byte)
Finishes an opened image and marks the slot bootable if it matched.
public static PamojaStatus pamoja_updater_finish(nint updater, out byte outSlot)
Parameters
Returns
pamoja_updater_free(nint)
Releases an updater handle.
public static extern void pamoja_updater_free(nint updater)
Parameters
updaternint
pamoja_updater_installed_sequence(nint, out ulong)
Reads the highest sequence number the device already holds.
public static PamojaStatus pamoja_updater_installed_sequence(nint updater, out ulong outSequence)
Parameters
Returns
pamoja_updater_new(PamojaDevice, byte, uint)
Creates an updater over a device's slots.
public static extern nint pamoja_updater_new(PamojaDevice device, byte slotCount, uint slotCapacity)
Parameters
devicePamojaDeviceslotCountbyteslotCapacityuint
Returns
pamoja_updater_on_boot(nint, out PamojaBoot)
Decides what to run, recording the decision before returning it.
public static PamojaStatus pamoja_updater_on_boot(nint updater, out PamojaBoot outBoot)
Parameters
updaternintoutBootPamojaBoot
Returns
pamoja_updater_progress(nint, out uint, out uint)
Reports how much of an opened image has arrived.
public static PamojaStatus pamoja_updater_progress(nint updater, out uint outWritten, out uint outTotal)
Parameters
Returns
pamoja_updater_provision(nint, byte, ulong)
Records that a slot holds a confirmed image at a sequence number.
public static extern PamojaStatus pamoja_updater_provision(nint updater, byte slot, ulong sequence)
Parameters
Returns
pamoja_updater_revert(nint, out byte)
Fails the pending image and goes back to the confirmed one.
public static PamojaStatus pamoja_updater_revert(nint updater, out byte outSlot)
Parameters
Returns
pamoja_updater_slot_count(nint)
Returns how many slots a device has.
public static extern byte pamoja_updater_slot_count(nint updater)
Parameters
updaternint
Returns
pamoja_updater_slot_record(nint, byte, out PamojaSlotRecord)
Reads what a device believes about one slot.
public static PamojaStatus pamoja_updater_slot_record(nint updater, byte slot, out PamojaSlotRecord outRecord)
Parameters
updaternintslotbyteoutRecordPamojaSlotRecord
Returns
pamoja_updater_stage(nint, ReadOnlySpan<byte>, nuint, ReadOnlySpan<byte>, nuint, bool, ulong, out byte)
Checks a manifest and stages an image held whole.
public static PamojaStatus pamoja_updater_stage(nint updater, ReadOnlySpan<byte> envelope, nuint envelopeLen, ReadOnlySpan<byte> image, nuint imageLen, bool hasNow, ulong now, out byte outSlot)
Parameters
updaternintenvelopeReadOnlySpan<byte>envelopeLennuintimageReadOnlySpan<byte>imageLennuinthasNowboolnowulongoutSlotbyte
Returns
pamoja_updater_write(nint, ReadOnlySpan<byte>, nuint)
Takes the next piece of an opened image.
public static PamojaStatus pamoja_updater_write(nint updater, ReadOnlySpan<byte> chunk, nuint len)
Parameters
updaternintchunkReadOnlySpan<byte>lennuint
Returns
pamoja_version()
Returns the version string of the native pamoja library.
public static extern nint pamoja_version()
Returns
pamoja_watchdog_feed(nint)
Feeds a watchdog.
public static extern void pamoja_watchdog_feed(nint watchdog)
Parameters
watchdognint
pamoja_watchdog_free(nint)
Releases a watchdog handle. Passing null is a no-op.
public static extern void pamoja_watchdog_free(nint watchdog)
Parameters
watchdognint
pamoja_watchdog_is_expired(nint)
Reports whether a watchdog has expired.
public static bool pamoja_watchdog_is_expired(nint watchdog)
Parameters
watchdognint
Returns
pamoja_watchdog_new(float)
Creates a watchdog that expires after a timeout without being fed.
public static extern nint pamoja_watchdog_new(float timeout)
Parameters
timeoutfloat
Returns
pamoja_watchdog_update(nint, float)
Advances a watchdog's timer and reports whether it has expired.
public static bool pamoja_watchdog_update(nint watchdog, float dt)
Parameters
Returns
pamoja_waypoint_follower_guide(PamojaWaypointFollower, PamojaCoordinate, float, PamojaCoordinate)
Produces the command from a robot's position and heading toward a target.
public static extern PamojaGuidance pamoja_waypoint_follower_guide(PamojaWaypointFollower follower, PamojaCoordinate here, float headingDeg, PamojaCoordinate target)
Parameters
followerPamojaWaypointFollowerherePamojaCoordinateheadingDegfloattargetPamojaCoordinate
Returns
pamoja_weather_dew_point(double, double)
Computes the dew point from the air temperature and relative humidity.
public static extern double pamoja_weather_dew_point(double celsius, double humidityPercent)
Parameters
Returns
pamoja_window_capacity(nint)
Returns how many readings a window holds before dropping.
public static extern nuint pamoja_window_capacity(nint window)
Parameters
windownint
Returns
pamoja_window_free(nint)
Releases a rolling window handle. Passing null is a no-op.
public static extern void pamoja_window_free(nint window)
Parameters
windownint
pamoja_window_is_full(nint)
Reports whether a window holds as many readings as it keeps.
public static bool pamoja_window_is_full(nint window)
Parameters
windownint
Returns
pamoja_window_latest(nint, out float)
Reads the most recent reading in a window, if it has any.
public static bool pamoja_window_latest(nint window, out float outValue)
Parameters
Returns
pamoja_window_len(nint)
Returns how many readings a window holds.
public static extern nuint pamoja_window_len(nint window)
Parameters
windownint
Returns
pamoja_window_max(nint, out float)
Reads the largest reading in a window, if it has any.
public static bool pamoja_window_max(nint window, out float outValue)
Parameters
Returns
pamoja_window_mean(nint, out float)
Reads the mean of a window's readings, if it has any.
public static bool pamoja_window_mean(nint window, out float outValue)
Parameters
Returns
pamoja_window_min(nint, out float)
Reads the smallest reading in a window, if it has any.
public static bool pamoja_window_min(nint window, out float outValue)
Parameters
Returns
pamoja_window_new()
Creates an empty rolling window.
public static extern nint pamoja_window_new()
Returns
pamoja_window_oldest(nint, out float)
Reads the oldest reading a window still holds, if it has any.
public static bool pamoja_window_oldest(nint window, out float outValue)
Parameters
Returns
pamoja_window_push(nint, float)
Adds a reading to a window, dropping the oldest once full.
public static extern void pamoja_window_push(nint window, float reading)
Parameters
pamoja_window_range(nint, out float)
Reads the spread across a window's readings, if it has any.
public static bool pamoja_window_range(nint window, out float outValue)
Parameters
Returns
pamoja_window_variance(nint, out float)
Reads the population variance of a window's readings, if it has any.
public static bool pamoja_window_variance(nint window, out float outValue)
Parameters
Returns
pamoja_window_with_capacity(nuint)
Creates an empty rolling window keeping up to a capacity, or null for one out of range.
public static extern nint pamoja_window_with_capacity(nuint capacity)
Parameters
capacitynuint