This page contains information about implementing support for a new protocol in Traccar server.
The project is written in Java, using the Gradle build system. For more details on development environment setup please check the build documentation.
To implement a protocol you would need at least a class extending BaseProtocol and a class extending BaseProtocolDecoder. In some complicated cases you might also need a class extending FrameDecoder. In most cases for the frame decoder you can use classes provided by the Netty framework (e.g. LineBasedFrameDecoder).
There are two main types of protocols: text and binary.
As an example for a binary protocol you can use the GT02 protocol decoder: Gt02ProtocolDecoder.
As an example for a text protocol you can use the GPS103 protocol decoder: Gps103ProtocolDecoder.
To enable the protocol you also need to add the port to PortConfigSuffix or the configuration file.
To test that everything is working you can send a test message using our hex.sh shell script.