Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gt06_server

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gt06_server

  • 0.1.6
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Server for gps tracker GT06(TK100)

Code Climate Test Coverage Issue Count Build Status

Installation

Add this line to your application's Gemfile:

gem 'gt06_server'

And then execute:

$ bundle

Usage

require 'gt06_server'

log_path = File.expand_path(File.join(File.dirname(__FILE__), 'log/server.log'))

Gt06Server::Server.run('0.0.0.0', 9000, options: { logger: Logger.new(log_path) }) do |message|
  p message
end

sleep

Status message:

{ 
  :packet_length       => 10,
  :protocol_number     => 19,
  :message_type        => :status_information,
  :terminal_id         => "0123456789012345",
  :information_content =>
    { 
      :terminal_information =>
        {
          :electricity_bit => 0,
          :gps_bit         => 0,
          :alarm_status    => :normal,
          :charge_bit      => 1,
          :acc_bit         => 0,
          :defense_bit     => 1
        },
      :voltage_level        => 0,
      :gsm_signal_strength  => 100,
      :alarm                => :normal,
      :language             => :english
    },
  :serial_number       => 48
}

Location message:

{
    :packet_length       => 31,
    :protocol_number     => 18,
    :message_type        => :location_data,
    :information_content =>
        {
            :date_time => '2011-08-29 17:46:16 +0400',
            :gps       =>
                {
                    :quantity_satellites =>
                        {
                            :length_gps => 12, :satellites => 12
                        },
                    :latitude            => 23.111668333333334,
                    :longitude           => 114.409285,
                    :speed               => 0,
                    :course_status       =>
                        {
                            :null_1               => 0,
                            :null_2               => 0,
                            :gps_positioning_type => 0,
                            :is_gps_positioning   => 1,
                            :longitude_bit        => 0,
                            :latitude_bit         => 1,
                            :course               => 143
                        }
                },
            :lbs       =>
                {
                    :mcc     => 460,
                    :mnc     => 0,
                    :lac     => 10365,
                    :cell_id => 8120
                }
        },
    :serial_number       => 3
}

The content of 'information_content' depends on 'message_type' See lib/gt06_server/messages for details

###Copyright

Copyright (c) 2016 CoolElvis and contributors.

MIT License. See LICENSE for details.

FAQs

Package last updated on 11 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc