Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e3e18b1
commit b38b341
Showing
3 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'use strict'; | ||
|
||
var lora_packet = require('..'); | ||
var expect = require("chai").expect; | ||
var assert = require('chai').assert; | ||
|
||
module.exports = function () { | ||
|
||
// TODO more variation on this | ||
|
||
describe('parse packets from github issue #18', function () { | ||
it('should parse packet #1', function () { | ||
|
||
var message_hex = "4084412505A3010009110308B33750F504D4B86A"; | ||
// console.log ("packet #1 message_hex = "+new Buffer(message_base64, 'base64').toString("hex")); | ||
|
||
var parsed = lora_packet.fromWire(new Buffer(message_hex, 'hex')); | ||
|
||
expect(parsed).to.not.be.undefined; | ||
expect(parsed.getBuffers()).to.not.be.undefined; | ||
expect(parsed.getBuffers().FOpts).to.not.be.undefined; | ||
expect(parsed.getBuffers().FOpts).to.deep.equal(new Buffer('091103', 'hex')); | ||
|
||
// var asString = parsed.toString(); | ||
// console.log(asString); | ||
}); | ||
|
||
|
||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters