Die Kellerag.shared.iot.Converters sind eine Reihe von .NET -DLLs, um proprietäre Kommunikationsdaten von IoT -Geräten des Unternehmens Keller Druckmesstechnik AG zu verarbeiten.
Der Hauptzweck besteht darin, eine mögliche Möglichkeit zu demonstrieren, die in FTP-Ordnern gespeicherten Textdaten (über 2G/3G/4G/NB-IOT/LTE-M) oder JSON-Text von/bis Lorawan Network Server (theThingsNetwork/ThingsPark (Actility)/Loriot.io) zu implementieren.
Die Kommunikationsprotokolle sind öffentlich:
Die Kellerag.Shared.iot.Converters sind ein Beispiel für die Implementierung der Kommunikationsprotokolle, die von Kellers Druckwolkenwolke verwendet werden. 
NUGET URL: https://www.nuget.org/packages/kellerag.shared.iot.converters/
PM > Install-Package KellerAg.Shared.IoT.ConvertersVerwenden Sie die folgenden Namespaces
using KellerAg . Shared . IoT . Converters ; //for the converters
using Entities . Data ; //for the DeviceSettings-DTO
using JsonToBusinessObjects . Conversion ; //for some used entities/DTOs
using JsonToBusinessObjects . DataContainers ; //for some used entities/DTOs // Have a look at the examples in https://github.com/KELLERAGfuerDruckmesstechnik/KellerAg.Shared.IoT.Converters/blob/master/DemoBlazorApp/FtpConversions.cs
IConvert converter = new KellerAg . Shared . IoT . Converters . IoTConvert ( ) ;
string gsmCommunicationJsonText = converter . GsmCommunicationToJson ( text_content ) ; // Gets the text content in Json format
ConversionResult conversionResult = converter . GsmCommunicationJsonToBusinessObject ( gsmCommunicationJsonText ) ;
JsonToBusinessObjects . DataContainers . BusinessObject businessObject = conversionResult . BusinessObjectRoot ;
Console . WriteLine ( $ "The battery's capacity is { BusinessObject . DeviceInformation . BatteryCapacity } %" )
//or from DTO to a valid text file
var deviceConfiguration = new Entites . Data . DeviceSettings { GeneralNetworkName = "My Network Name" , GeneralLocationName = "My Device Name" , GeneralAltitudeText = "555" , HardwareConnectionType = ( byte ? ) 5 , MeasurementInterval = 48000 } ;
gsmCommunicationJsonText = converter . DeviceConfigurationToGsmCommunication ( deviceConfiguration ) ; 
// Have a look at the examples in https://github.com/KELLERAGfuerDruckmesstechnik/KellerAg.Shared.IoT.Converters/blob/master/DemoBlazorApp/Pages/DemoLora.razor
IConvert converter = new KellerAg . Shared . IoT . Converters . IoTConvert ( ) ;
KellerAg . Shared . LoRaPayloadConverter . PayloadInformation extractedInformation = converter . LoRaPayloadToLoRaMessage ( "1F011302000313042F0DFF0E000F00100115051603" , 4 ) ;
Console . WriteLine ( $ "There are { extractedInformation . Measurements . Count } measurements stored." )
//or directly the whole JSON from the network server
// Example with a JSON from TheThingsNetwork:
string exampleLoRaTransmissionTTNText = @"{""app_id"":""ldtapplication"",""dev_id"":""ldtdevice1"",""hardware_serial"":""0004A30B001EC250"",""port"":1,""counter"":0,""payload_raw"":""AQUB03/AAAB/wAAAf8AAAD94px5BxdcKAAAAAA=="",""payload_fields"":{""Channel_1"":5.104235503814077e+38,""Channel_2"":5.104235503814077e+38,""Channel_3"":5.104235503814077e+38,""Channel_4"":0.9713000059127808,""channel"":""0000000111010011"",""ct"":5,""func"":1,""payload"":""AQswAD93JxNBu1wp""},""metadata"":{""time"":""2017-10-30T11:18:25.511380476Z"",""frequency"":867.1,""modulation"":""LORA"",""data_rate"":""SF12BW125"",""coding_rate"":""4/5"",""gateways"":[{""gtw_id"":""eui-c0ee40ffff29356b"",""timestamp"":300640588,""time"":"""",""channel"":3,""rssi"":-42,""snr"":9,""latitude"":47.49873,""longitude"":8.746949},{""gtw_id"":""kellergw2"",""gtw_trusted"":true,""timestamp"":509643924,""time"":""2017-10-30T11:17:44Z"",""channel"":3,""rssi"":-61,""snr"":9.5,""latitude"":47.498688,""longitude"":8.747711}]},""downlink_url"":""https://integrations.thethingsnetwork.org/ttn-eu/api/v2/down/ldtapplication/httpldttest?key=ttn-account-v2.4vThJdZ2ISzcdwppUzCaLWsBmF1_GszPXEOglkR3AfA""}" ;
JsonToBusinessObjects . DataContainers . BusinessObjectRoot businessObject = Converter . LoRaJsonMessageToBusinessObject ( exampleLoRaTransmissionTTNText ) ;
Console . WriteLine ( $ "There are { businessObject . LoRaData . Measurements . Count } measurements stored from the device with the EUI { businessObject . LoRaData . EUI } ." )
//or from DTO to a valid KELLER payload whereas there can be multiple payloads
List < string > payloads = Converter . DeviceConfigurationToLoRaPayloads ( DeviceSettings deviceConfigurationDifference ) ; // Properties that are not null/empty will be used for generating the payloads
//alternative:
List < string > payloads = Converter . DeviceConfigurationToLoRaPayloads ( string deviceConfigurationDifference ) ; // JSON string with properties to change (not listed properties shall not be changed)
// or directly from a PayloadInfo object to a list of KELLER LoRa-Payload strings
var payloadInfo = JsonConvert . DeserializeObject < PayloadInformation > ( payloadInfoJson ) ;
List < string > payloads = PayloadConverter . ConvertToTheThingsNetwork ( payloadInfo ) ;
// alternative
List < string > payloads = PayloadConverter . ConvertToActility ( payloadInfo ) ;
// alternative
List < string > payloads = PayloadConverter . ConvertToLoriot ( payloadInfo ) ; 
Siehe: https://iotconverter.pressuresuite.com




FRAGE: Dies ist C#/. Netzbibliothek. Haben Sie auch eine andere Sprache wie Java oder Python?
Antwort: Nein. Nur C#/. NET bisher.
@Cbashtn
Fühlen Sie sich frei zu tauchen! Ein Problem öffnen oder PRS einreichen.