Voltaney.ZigSimInterpreter 0.1.1

dotnet add package Voltaney.ZigSimInterpreter --version 0.1.1
                    
NuGet\Install-Package Voltaney.ZigSimInterpreter -Version 0.1.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Voltaney.ZigSimInterpreter" Version="0.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Voltaney.ZigSimInterpreter" Version="0.1.1" />
                    
Directory.Packages.props
<PackageReference Include="Voltaney.ZigSimInterpreter" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Voltaney.ZigSimInterpreter --version 0.1.1
                    
#r "nuget: Voltaney.ZigSimInterpreter, 0.1.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Voltaney.ZigSimInterpreter@0.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Voltaney.ZigSimInterpreter&version=0.1.1
                    
Install as a Cake Addin
#tool nuget:?package=Voltaney.ZigSimInterpreter&version=0.1.1
                    
Install as a Cake Tool

ZigSimInterpreter

License: MIT NuGet Version CI dotnet Version

Parser library for data sent from the ZigSim mobile application. Currently supports only JSON format.

Usage

Example of receiving data from a ZigSim app via UDP and parsing its contents to display Gyro sensor values.

using System.Net;
using System.Net.Sockets;
using ZigSimInterpreter;

namespace ConsoleApp1;

class Program
{
    static void Main(string[] args)
    {
        int port = 50000;
        IPEndPoint? senderEP = null;
        var interpreter = new ZigSimJsonInterpreter();

        // Ctrl + C to quit
        using (var udpClient = new UdpClient(port))
        {
            while (true)
            {
                var recievedData = udpClient.Receive(ref senderEP);
                // parse recieved data of ZigSim
                var zigSimResult = interpreter.Read(recievedData);
                if (zigSimResult.IsSuccess)
                {
                    // print Gyro data
                    Console.WriteLine(zigSimResult.Payload?.SensorData?.Gyro);
                }
                else
                {
                    // possibly recieved other format (ex. OSC)
                    Console.WriteLine("Failed to parse ZigSim data");
                    Console.WriteLine(zigSimResult.ErrorMessage);
                }
            }
        }
    }
}

Payload Structure

If parsing is successful, data is stored in the Payload member.

var interpreter = new ZigSimJsonInterpreter();
var zigSimResult = interpreter.Read(recievedData);
var payload = zigSimResult.Payload;

The structure of Payload is as follows. If the parameter does not exist, its attribute is NULL.

{
  "Device": {
    "OS": "ios",
    "OSVersion": "XXX",
    "Name": "iPhone XXX",
    "UUID": "XXX",
    "DisplayWidth": 750,
    "DisplayHeight": 1334
  },
  "TimeStamp": "2025_02_21_15:46:34.574",
  "SensorData": {
    "Accel": {
      "X": -0.013299062848091125,
      "Y": 0.0030906200408935547,
      "Z": -0.008916616439819336
    },
    "Gravity": {
      "X": -0.024832651019096375,
      "Y": -0.36426615715026855,
      "Z": -0.9309637546539307
    },
    "Gyro": {
      "X": 0.006727981381118298,
      "Y": -0.02589605376124382,
      "Z": 0.008115466684103012
    },
    "Quaternion": {
      "X": 0.18086875635035513,
      "Y": 0.042480770317941945,
      "Z": 0.28920687803832174,
      "W": 0.939064016845464
    },
    "Touch": [
      {
        "X": 0.3866666555404663,
        "Y": -0.03598201274871826,
        "Radius": 38.47137451171875,
        "Force": 2.5
      },
      {
        "X": -0.40533334016799927,
        "Y": 0.2353823184967041,
        "Radius": 38.47137451171875,
        "Force": 3.8499999046325684
      }
    ],
    "Compass": {
      "Compass": 214.3119659423828,
      "Faceup": 1,
      "IsFaceup": true
    },
    "GPS": {
      "Latitude": 11.11111111111,
      "Longitude": 22.22222222222
    },
    "Light": {
      "Light": 43
    },
    "ProximityMonitor": {
      "ProximityMonitor": false
    },
    "Pressure": {
      "Altitude": 1.9341773986816406,
      "Pressure": 1015.1840209960938
    },
    "MicLevel": {
      "Max": -37.1226921081543,
      "Average": -40.96709060668945
    }
  }
}

TODO

  • Support for OSC format
  • Support for all data attributes. (Currently limited to implementation of only those attributes that could be tested)
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.1 204 2/21/2025
0.1.0 174 2/21/2025