traccar / traccar

Traccar GPS Tracking System
https://www.traccar.org
Apache License 2.0
5.16k stars 2.56k forks source link

# feat: Add a new protocol, zr, listening on port 5257. #5309

Open keDaYao opened 4 months ago

keDaYao commented 4 months ago

Trak-iot.protocol.TC04-9.20220817.docx Support device - "TC-01、TC-02、TC-03、TC-04" | Protocol - zr Protocol | Port - 5257

tananaev commented 4 months ago

It doesn't look like all of the comments from last PR were addressed.

tananaev commented 4 months ago

Also maybe it would be easier to split it into several PRs. For example encoder can be separate from the main decoding.

keDaYao commented 4 months ago

Hi, I think this is difficult to split because when the server receives a message from the device, it must reply with different response messages, which requires the encoder to encode the corresponding response messages. Therefore, the encoder code cannot be split.

tananaev commented 4 months ago

And where exactly are you using encoder for responses? I don't see it.

keDaYao commented 4 months ago

In ZrProtocolDecoder.java, at lines 89, 92, 96,and 99.

keDaYao commented 4 months ago

Could you please re-label the suggestions for code modifications? I'm not sure what needs to be changed, and I would greatly appreciate it.

tananaev commented 4 months ago

In ZrProtocolDecoder.java, at lines 89, 92, 96,and 99.

It doesn't use encoder. It's the other way around. Did you write this code yourself?

Could you please re-label the suggestions for code modifications? I'm not sure what needs to be changed, and I would greatly appreciate it.

Unfortunately I don't have time. Please check the original PR.

keDaYao commented 4 months ago

Yes, I wrote the code.When you mentioned encoder, are you referring to ZrProtocolEncoder.java?I just deleted that part of the file.

tananaev commented 4 months ago

Thanks. Let me know once all the other issues are resolved, so we can review it again.