Giter VIP home page Giter VIP logo

go-egts's Introduction

go-egts GoDoc Sourcegraph Go Report Card GitHub tag Build Status

EGTS (Era Glonass Telematics Standard) parsing via Golang

Table of Contents

About

This package provides parser for EGTS packets.

What is EGTS? This abbreviation stand for Era Glonass Telematics Standard.

This is standart protocol (over TCP) for Russian global navigation system. You can read description about it here: https://docs.cntd.ru/document/1200095098 (it's on Russian obviously).

You can check docs_rus folder for deailed workflow of packet sample.

PR's are welcome!

Installation

Simple.

go get github.com/LdDl/go-egts

Usage

See cmd directory of this library for examples.

  • Start server

    go run cmd/egts_server/main.go
  • Start client

    go run cmd/egts_client/main.go

After you start both server and client, you should see something like this

  • client side

    go run egts_client/main.go
    2021/12/16 21:18:15 Response code: {0 0      0 0 0 0 0 0 0 0 0 <nil> 0 0}
    2021/12/16 21:18:15 Packet: {1 0 00 11 0 00 0 11 0 16 1 0 0 0 0 245 0xc0000040c0 4587 0}
  • server side

    go run egts_server/main.go
    2021/12/16 21:18:08 Accept connection on port 8081
    2021/12/16 21:18:15 Calling handleConnection for remote address: [::1]:50840
    2021/12/16 21:18:15 PosData is:
            OID: 825791382 | Longitude: 48.362186 | Latitude: 54.287315 | Time: 2021-12-16 21:18:15.1412741 +0300 MSK m=+7.036938801
    2021/12/16 21:18:15 Result code has been sent to '[::1]:50840'

Tests

Run following command for testing library:

go test ./egts/packet_test/
go test ./egts/subrecord_test/

Support

If you have troubles or questions please open an issue.

License

It's MIT. You can check it here

go-egts's People

Contributors

lddl avatar makotoe avatar pavel7824 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

go-egts's Issues

subrecord.SRStateData.Decode() panics with certain input

This test case exhibits two cases that can crash subrecord.SRStateData.Decode().

func TestSRStateDataDecodingCrash(t *testing.T) {
	stateData := &subrecord.SRStateData{}
	stateData.Decode([]byte{0})
	stateData.Decode([]byte{1})
}

May I suggest doing some fuzz testing on the decode functions? It really helps uncover tricky bugs.

SRPosData Direction flag

There is <<7 shift for direction flag.

subr.Direction = subr.Direction | subr.DirhFlag<<7

But this is just uint8 (byte). So it is not actual value of bearing angle (from 0 to 360).
Need to add DirectionValue field to get bearing angle in uint16 representation.

subr.Direction = subr.Direction | subr.DirhFlag<<7

Авторизация

Ребята. мне не удается пройти процесс авторизации. Появляется ошибка Error Packet dataframe;
Можете помочь?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.