Skip to content

derwu/teltonika-parser-ex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

Parsing teltonika binary data from device FMB0XX. Right now supported Codec8, Codec8 Extended and Codec7 format, Codec 16 yet in process.

Source

Forked from: https://www.npmjs.com/package/teltonika-parser

Installation

Run console command

npm i teltonika-parser-ex

Usage example

 const Parser = require('teltonika-parser-ex');
 const binutils = require('binutils64');


 let server = net.createServer((c) => {
     console.log("client connected");
     c.on('end', () => {
         console.log("client disconnected");
     });

     c.on('data', (data) => {

         let buffer = data;
         let parser = new Parser(buffer);
         if(parser.isImei){
             c.write(Buffer.alloc(1, 1));
         }else {
             let avl = parser.getAvl();

             let writer = new binutils.BinaryWriter();
             writer.WriteInt32(avl.number_of_data);

             let response = writer.ByteBuffer;
             c.write(response);
         }
     });
 });

 server.listen(5000, () => {
     console.log("Server started");
 });

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published