Skip to content

Commit

Permalink
Merge pull request mavlink#408 from AndreasAntener/remove_jspack
Browse files Browse the repository at this point in the history
JS MAVLink: removed jspack submodule since it's not necessary anymore
  • Loading branch information
LorenzMeier committed Jun 25, 2015
2 parents 32fd16a + 6f6bc27 commit 6c2e54d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 14 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
@@ -1,3 +0,0 @@
[submodule "pymavlink/generator/javascript/lib/jspack"]
path = pymavlink/generator/javascript/lib/jspack
url = https://github.com/AndreasAntener/node-jspack
3 changes: 2 additions & 1 deletion pymavlink/generator/javascript/README.md
Expand Up @@ -46,7 +46,8 @@ Then, you can use the MAVLink module, as sketched below.
In your ```server.js``` script, you need to include the generated parser and instantiate it; you also need some kind of binary stream library that can read/write binary data and emit an event when new data is ready to be parsed (TCP, UDP, serial port all have appropriate libraries in the npm-o-sphere). The connection's "data is ready" event is bound to invoke the MAVLink parser to try and extract a valid message.

```javascript
// requires Underscore.js, can use Winston for logging ,
// requires Underscore.js and jspack
// can use Winston for logging
// see package.json for dependencies for the implementation
var mavlink = require('mavlink_ardupilotmega_v1.0'),
net = require('net');
Expand Down
1 change: 0 additions & 1 deletion pymavlink/generator/javascript/lib/jspack
Submodule jspack deleted from d89a46
3 changes: 2 additions & 1 deletion pymavlink/generator/javascript/package.json
Expand Up @@ -5,7 +5,8 @@
"repository": "private",
"dependencies" : {
"underscore" : "",
"winston": ""
"winston": "",
"jspack": "0.0.4"
},
"devDependencies" : {
"should" : "",
Expand Down
9 changes: 1 addition & 8 deletions pymavlink/generator/mavgen_javascript.py
Expand Up @@ -23,7 +23,7 @@ def generate_preamble(outf, msgs, args, xml):
Note: this file has been auto-generated. DO NOT EDIT
*/
jspack = require("./jspack.js").jspack,
jspack = require("jspack").jspack,
_ = require("underscore"),
events = require("events"),
util = require("util");
Expand Down Expand Up @@ -538,11 +538,6 @@ def generate_footer(outf):
def generate(basename, xml):
'''generate complete javascript implementation'''

if basename.rfind(os.sep) >= 0:
jspackFilename = basename[0:basename.rfind(os.sep)] + '/jspack.js'
else:
jspackFilename = 'jspack.js'

if basename.endswith('.js'):
filename = basename
else:
Expand Down Expand Up @@ -577,5 +572,3 @@ def generate(basename, xml):
generate_footer(outf)
outf.close()
print("Generated %s OK" % filename)
copyfile('./javascript/lib/jspack/jspack.js', jspackFilename)
print("Copied jspack %s" % jspackFilename)

0 comments on commit 6c2e54d

Please sign in to comment.