Protocol management
1. Protocol Management Module
Version 2.0 adds a protocol management module to manage hardware device protocols, as shown below:
fastbee-protocol-base: the protocol parsing base module. This module is the core module that implements decoding and encoding through annotations; users do not need to care about how it is implemented.
fastbee-protocol-collect: the protocol collection module, which currently bundles decoding and encoding for JSON, modbus-rtu, and the encapsulated modbus-rtu.

2. Protocol Definition
Displayed on the frontend as shown below:
If you need to add a protocol in the protocol management module, the system implements it through annotations. The annotation is defined as follows:
Below is an example of adding code for the modbus-rtu protocol:
The fields are explained as follows:
- name: the protocol name
- protocolCode: the protocol code, used by the system to identify the protocol and associate it with products; one product corresponds to one protocol code.
- description: the protocol description (optional)

When a device has data to decode or encode, the device matches a protocol in the system based on the protocol code in the product, and uses that protocol for decoding and encoding.
A defined decoding example is as follows:
The class that actually performs decoding is: ModbusMessageDecoder
A defined encoding example is as follows:
The class that actually performs encoding is: ModbusMessageEncoder
3. Annotation-Based Protocol Decoding and Encoding
The platform encapsulates a base package for decoding and encoding hardware device messages through annotations, namely the fastbee-protocol-base module. For all kinds of hardware device messages, this annotation-based approach can be used to implement decoding and encoding,
reducing the tedious work of backend developers in message data decoding and encoding.
Field definitions of the @Column annotation:

