KellerAg.Shared.IoT.Converters
1.0.0
kellerag.shared.iot.Conterters是一组.NET DLL,可从公司Keller Druckmesstechnik AG公司的IoT设备处理专有通信数据。
主要目的是展示一种可能实现FTP文件夹(通过2G/3G/4G/NB-iot/LTE-M)或JSON文本的文本数据的可能方法,来自/到Lorawan Network Network Server(ThethingsNingsnetwork/Thingspark(Actility)(Actility)/loriot.io)。
通信协议是公开的:
Kellerag.shared.iot.Converter是凯勒(Keller)压力云使用的通信协议实现的一个示例。 
nuget URL:https://www.nuget.org/packages/kellerag.shared.iot.converters/
PM > Install-Package KellerAg.Shared.IoT.Converters使用以下名称空间
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 ) ; 
请参阅:https://iotconverter.pressuresuite.com




问题:这是C#/。网库。您还有另一种语言,例如Java或Python吗?
答案:否。到目前为止,仅C#/。网络。
@cbashtn
随意潜水!打开问题或提交公关。