Skip to content

HonestLiu/ProtocolStudio

Repository files navigation

Protocol Studio

Schema-driven embedded protocol development platform. Design protocols, define device models, generate SDKs, and debug communication — all from one tool.

Quick Start

# Install dependencies
npm install

# Development
cargo tauri dev

# Build
cargo tauri build

Tech Stack

  • Frontend: React 19 + TypeScript + Vite + TailwindCSS + Monaco Editor
  • Backend: Rust (Tauri v2)
  • State: Zustand
  • Protocol Engine: Custom binary parser/serializer

Project Structure

ProtocolStudio/
├── src/                          # Frontend (React + TypeScript)
│   ├── components/
│   │   ├── layout/               # Navigation, TabBar, StatusBar
│   │   ├── protocol/             # Protocol Designer, Packet Builder, Analyzer
│   │   ├── device/               # Device Model Designer
│   │   ├── debug/                # Debug Console
│   │   ├── sdk/                  # SDK Generator, API Generator
│   │   └── common/               # Virtual Device, Settings, Plugin Manager
│   ├── stores/                   # Zustand state management
│   ├── types/                    # TypeScript type definitions
│   └── lib/                      # Utilities
├── src-tauri/                    # Backend (Rust)
│   └── src/
│       ├── core/                 # Schema, Device, Error types
│       ├── engine/               # Protocol parser/encoder
│       ├── transport/            # Transport abstraction (Mock, TCP, Serial)
│       ├── plugins/              # Plugin system
│       └── commands/             # Tauri IPC commands
└── package.json

Features

Panel Description
Protocol Designer YAML/JSON editor for binary protocol structure
Device Model Define properties, commands, events for devices
Packet Builder Encode JSON to HEX / Decode HEX to fields
Analyzer HEX decode with byte visualization and history
Debug Console Transport connection, send/receive, repeat mode
SDK Generator Generate C, Python, TypeScript, Rust SDK code
API Generator Generate REST, WebSocket, MQTT API code
Virtual Device Simulate devices with property control and event generation
Plugin Manager Manage built-in plugins
Settings Theme, language, shortcuts, data management

Protocol Format

Default protocol structure (TLV-style):

┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐
│  Magic  │ Version │ Command │ Length  │ DeviceID│ Payload │   CRC   │
│ 2 bytes │ 1 byte  │ 2 bytes │ 2 bytes │ 2 bytes │ N bytes │ 2 bytes │
└─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘
  0x55AA    0x01      CMD      LEN       DEVID     DATA      CRC16

Development

# Type check
npx tsc --noEmit

# Build frontend
npx vite build

# Run Rust tests
cd src-tauri && cargo test

# Full app
cargo tauri dev

License

MIT

About

Schema-driven embedded protocol development platform. Design protocols, define device models, generate SDKs, and debug communication — all from one tool.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors