Class ChirpstackUplinkEvent
An uplink as a ChirpStack network server reports it.
public sealed record ChirpstackUplinkEvent : IEquatable<ChirpstackUplinkEvent>
- Inheritance
-
ChirpstackUplinkEvent
- Implements
- Inherited Members
Remarks
ChirpStack publishes every uplink it deduplicates to an MQTT topic, as the JSON form of its
UplinkEvent message. Fields protobuf's JSON mapping leaves out when they hold their
default read as that default: a frame counter of zero, ADR off, unconfirmed.
Constructors
ChirpstackUplinkEvent(string, string?, string, string, string, uint?, bool, byte, uint, byte?, bool, byte[], uint?, IReadOnlyList<ChirpstackReception>, int?)
An uplink as a ChirpStack network server reports it.
public ChirpstackUplinkEvent(string DeduplicationId, string? Time, string ApplicationId, string DeviceName, string DevEui, uint? DevAddr, bool Adr, byte DataRate, uint Fcnt, byte? Fport, bool Confirmed, byte[] Data, uint? FrequencyHz, IReadOnlyList<ChirpstackReception> Receptions, int? BestReception)
Parameters
DeduplicationIdstringThe identifier ChirpStack gave the uplink once it deduplicated the gateways' copies.
TimestringWhen the uplink was received, as ChirpStack wrote it, or
null.ApplicationIdstringThe application the device belongs to.
DeviceNamestringThe name the device was given in ChirpStack.
DevEuistringThe device EUI, as lowercase hex.
DevAddruint?The device's address, or
nullwhen the event names none.AdrboolWhether the device had adaptive data rate on.
DataRatebyteThe data rate, as the region numbers them.
FcntuintThe uplink frame counter.
Fportbyte?The application port, or
nullfor a frame that carried none.ConfirmedboolWhether the uplink was confirmed.
Databyte[]The application payload, decoded from base64.
FrequencyHzuint?The carrier it was heard on, in hertz, or
null.ReceptionsIReadOnlyList<ChirpstackReception>Every gateway that heard it.
BestReceptionint?The position in
Receptionsof the gateway that heard it with the highest signal-to-noise ratio, ornullwhen none did.
Remarks
ChirpStack publishes every uplink it deduplicates to an MQTT topic, as the JSON form of its
UplinkEvent message. Fields protobuf's JSON mapping leaves out when they hold their
default read as that default: a frame counter of zero, ADR off, unconfirmed.
Fields
AllApplicationsTopic
The MQTT topic every application's uplink events are published on, with wildcards in place of the application and the device.
public const string AllApplicationsTopic = "application/+/device/+/event/up"
Field Value
Properties
Adr
Whether the device had adaptive data rate on.
public bool Adr { get; init; }
Property Value
ApplicationId
The application the device belongs to.
public string ApplicationId { get; init; }
Property Value
BestReception
The position in Receptions of the gateway that heard it with the highest
signal-to-noise ratio, or null when none did.
public int? BestReception { get; init; }
Property Value
- int?
Confirmed
Whether the uplink was confirmed.
public bool Confirmed { get; init; }
Property Value
Data
The application payload, decoded from base64.
public byte[] Data { get; init; }
Property Value
- byte[]
DataRate
The data rate, as the region numbers them.
public byte DataRate { get; init; }
Property Value
DeduplicationId
The identifier ChirpStack gave the uplink once it deduplicated the gateways' copies.
public string DeduplicationId { get; init; }
Property Value
DevAddr
The device's address, or null when the event names none.
public uint? DevAddr { get; init; }
Property Value
- uint?
DevEui
The device EUI, as lowercase hex.
public string DevEui { get; init; }
Property Value
DeviceName
The name the device was given in ChirpStack.
public string DeviceName { get; init; }
Property Value
Fcnt
The uplink frame counter.
public uint Fcnt { get; init; }
Property Value
Fport
The application port, or null for a frame that carried none.
public byte? Fport { get; init; }
Property Value
- byte?
FrequencyHz
The carrier it was heard on, in hertz, or null.
public uint? FrequencyHz { get; init; }
Property Value
- uint?
Receptions
Every gateway that heard it.
public IReadOnlyList<ChirpstackReception> Receptions { get; init; }
Property Value
Time
When the uplink was received, as ChirpStack wrote it, or null.
public string? Time { get; init; }
Property Value
Methods
FromJson(string)
Reads an uplink event from the JSON ChirpStack published.
public static ChirpstackUplinkEvent FromJson(string json)
Parameters
jsonstringThe MQTT message's payload.
Returns
- ChirpstackUplinkEvent
The event.
Exceptions
- PamojaException
The text is not a JSON object, the event names no device EUI, or a field does not read as what it should.
UplinkTopic(string)
Builds the MQTT topic an application's uplink events are published on.
public static string UplinkTopic(string applicationId)
Parameters
applicationIdstringThe application's identifier, as ChirpStack shows it.
Returns
- string
The topic,
application/<id>/device/+/event/up.