$ show xingshuangs/iot-communication
This repository is a Java library for industrial communication protocols, providing implementations for Siemens S7 PLC, Modbus, Mitsubishi Melsec, RTSP/RTP/RTCP media streaming, and MP4 file format handling. The library features a modular architecture with clear separation by protocol, annotation-based serialization frameworks, and low-level utilities for binary data handling. It serves as an SDK for developers to integrate industrial device communication and media streaming capabilities into their applications. The code demonstrates consistent use of design patterns (builder, template method, annotation-based processing) and includes comprehensive test suites showing usage patterns.
The LLM identified 6 files worth highlighting for reuse:
Provides endian-aware reading of primitive types from byte arrays. Essential for binary protocol handling, this utility encapsulates the complexity of byte order conversion and buffer positioning, making it reusable in any project dealing with binary data formats.
Complements ByteReadBuff with endian-aware writing of primitive types to byte arrays. Together these classes form a self-contained, reusable pair for binary serialization that could be extracted and used independently in any Java project requiring precise control over binary data layout.
Annotation-based serialization engine that converts Java objects to/from byte arrays using @ByteArrayVariable annotations. This framework solves a common problem in protocol handling with minimal boilerplate, demonstrating non-obvious skill in reflection-based design while remaining loosely coupled and easily adaptable to other projects.
Marker annotation that defines how class fields map to byte array positions with customizable length, format, and byte order. This simple yet powerful annotation enables the serialization framework to work with minimal intrusion on domain objects, exemplifying clean separation of concerns.
Focused implementation of CRC calculation algorithms. This stateless utility solves a recurring problem in communication protocols with high reusability - it could be dropped into any project needing CRC validation or generation with zero dependencies.
Longitudinal Redundancy Check (LRC) implementation commonly used in industrial protocols like Modbus. Like CRCUtil, this represents a well-encapsulated, single-purpose utility that addresses a common need in protocol implementations with excellent reuse potential.