Coder Social home page Coder Social logo

hplus_log_parser's People

Contributors

jpbarraca avatar

Stargazers

 avatar

Watchers

 avatar  avatar

hplus_log_parser's Issues

half of gps track data

Hi

Items (except the first) of track data contain 2 pair GPS cordinates. Function parseMessage_GPSCoordinates need to be extended for example:


def parseMessage_GPSCoordinates(payload):
    index = payload[1]
    total = payload[2]
    current = payload[3]

    if current == 1:
        year = getShort(payload[5], payload[4])
        month = payload[6]
        day = payload[7]
        hour = payload[8]
        minute = payload[9]
        second = payload[10]
        latitude = getFloat(payload[15], payload[14], payload[13], payload[12])
        longitude = getFloat(payload[19], payload[18], payload[17], payload[16])
        print "GPS Index=%d Total=%d Curr=%d Date=%4d-%02i-%02i Time=%02d:%02d:%02d Latitude=%f Longitude=%f" % (index, total, current, year, month, day, hour, minute, second, latitude, longitude)
    else:
        latitude = getFloat(payload[7], payload[6], payload[5], payload[4])
        longitude = getFloat(payload[11], payload[10], payload[9], payload[8])
        latitude2 = getFloat(payload[15], payload[14], payload[13], payload[12])
        longitude2 = getFloat(payload[19], payload[18], payload[17], payload[16])
        if latitude2==0 and longitude2==0:
            print "GPS Index=%d Total=%d Curr=%d Latitude=%f Longitude=%f" % (index, total, current, latitude, longitude)
        else:  
            print "GPS Index=%d Total=%d Curr=%d Latitude=%f Longitude=%f Latitude=%f Longitude=%f" % (index, total, current, latitude, longitude, latitude2, longitude2)

Migration to Kaitai

Just wanted to say Hello )))
I suggest that protocol exploring/parsing/visualizing is better done in Kaitai. And I plan to try it myself. I'll post the link when the 1st version is available.

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.