Commit Graph

101 Commits

Author SHA1 Message Date
Andrew Stewart 43a9351921 Convert Cylon.Master to a plain JS object
Acts exactly the same with much, much less code complexity.

This also introduces a pattern for providing core modules to external libraries.

Whereas previously Cylon modules were able to rely on Cylon.Adaptor or
Cylon.Driver being present in the namespace (due to being required in
./lib/cylon), they will now need to require Cylon first, like this:

    var Cylon = require('cylon');

    var Driver = Cylon.Driver,
        Adaptor = Cylon.Adaptor,
        DigitalPin = Cylon.IO.DigitalPin;
2014-05-13 19:20:54 -07:00
Andrew Stewart 1e44224660 Refactor Logger 2014-05-13 19:05:01 -07:00
Andrew Stewart c99ce6571f Remove node-namespace from DigitalPin 2014-05-13 18:31:25 -07:00
Andrew Stewart 2cca04873d Remove node-namespace from Utils 2014-05-13 18:25:31 -07:00
Andrew Stewart 17a0a5d08f Remove node-namespace from Config 2014-05-13 18:14:36 -07:00
Andrew Stewart f20ae55bf6 Remove node-namespace from Robot 2014-05-08 08:57:20 -07:00
Andrew Stewart a3974f38b7 Remove node-namespace from API 2014-05-07 15:19:23 -07:00
Andrew Stewart 7bab3ff65f Remove node-namespace from Connection 2014-05-07 08:38:06 -07:00
Andrew Stewart f8e546a6e0 Remove node-namespace from Device 2014-05-06 19:18:13 -07:00
Andrew Stewart d46de63379 Remove node-namespace from Test Drivers/Adaptors 2014-05-06 18:56:13 -07:00
Andrew Stewart c8cb7f0e40 Remove node-namespace from Driver 2014-05-06 18:24:43 -07:00
Andrew Stewart 637bce0e6d Remove node-namespace from Adaptor 2014-05-06 18:19:56 -07:00
Andrew Stewart a9ae09bdce Remove Basestar from global scope 2014-04-24 16:31:58 -06:00
Andrew Stewart dc09be6bcc Remove class cruft and namespace from Basestar 2014-04-24 13:43:00 -06:00
Javier Cervantes 3caeb47b3a Removing unused requires 2014-04-24 11:25:56 -05:00
Javier Cervantes f05025ba68 Removing wrong conditional in api 2014-04-24 11:25:45 -05:00
Javier Cervantes 394691a8f2 Refactoring api optional ssl logic 2014-04-24 11:18:20 -05:00
Javier Cervantes 956e757e8e Updating ssl configuration keys and tests 2014-04-24 10:14:02 -05:00
Javier Cervantes 40b3db1dce Changing how ssl is configured
Expected configuration:

{
  ssl: {
    key: "/path/to/key",
    cert: "/path/to/cert"
  }
}

If ssl is false, use plain HTTP. If it's an empty object (the default)
use our self-signed certs. If it's set up like above, use the provided
certs.
2014-04-23 17:56:42 -05:00
Javier Cervantes 8f746f1d27 Renaming https to generic node 2014-04-23 17:55:42 -05:00
Javier Cervantes cc3dac9442 Adding optional ssl param in API
By default http is used for api, but you can pass a param to use ssl.

This is the same behaviour that we have currently in robot.
2014-04-23 17:02:25 -05:00
Andrew Stewart e66c1145d5 Simplify Master#api 2014-04-21 16:36:47 -07:00
edgarsilva 938c11872c Bumped version to 0.13.3 2014-04-21 18:15:30 -05:00
edgarsilva 283b05b08a Fixes bug with robot not halting, which caused connections, adaptors and devices to not disconnect. 2014-04-21 17:46:02 -05:00
Andrew Stewart d8152852a0 Correctly kill process 2014-04-14 15:11:07 -07:00
Andrew Stewart fcd771cadc Provide more indication where API is listening 2014-04-14 11:27:48 -07:00
Andrew Stewart c5428d89ab Allow Content-Type header to be set for CORS 2014-04-11 19:23:13 -07:00
Andrew Stewart 9e781a2ea1 Add basic tests for API server and routes 2014-04-11 12:33:32 -07:00
Andrew Stewart 1c56b5942f Implement Server-Sent-Events for device events 2014-04-08 13:21:03 -07:00
Andrew Stewart cf31cfa7b9 Switch from Express-IO to plain Express 2014-04-08 11:52:53 -07:00
Andrew Stewart 4b409f7777 Add CORS param for API config 2014-04-08 10:58:58 -07:00
Andrew Stewart c81740e339 Add basic auth support to API 2014-04-03 16:04:11 -07:00
Andrew Stewart 89a5bbae2f Support passing auth hash to API server 2014-04-03 15:49:13 -07:00
Andrew Stewart 29b7db0de8 Add support for manually specifying cert/key files 2014-04-03 15:03:21 -07:00
Andrew Stewart ea022d3880 Implement HTTPS API with self-signed cert
Switches API to serve all requests over HTTPS, using a self-signed SSL
certificate.
2014-04-03 14:32:56 -07:00
Andrew Stewart 34324dabd5 Clean up API logic 2014-04-03 12:28:27 -07:00
edgarsilva de360ba2b3 Add error handler for devices that fail to initialize.
Do not start work if devices fail to initialize and throw err insted.
2014-04-01 17:53:34 -06:00
Andrew Stewart 1cffa6067e Add Utils to global.Cylon namespace, add bootstrap
This commit moves Utils to live in the global Cylon namespace, so they can be
accessed in test suites. This is necessary because Mocha, when setting up for
tests, will override our #after method, making TDR not work if any robots
contain a #after call in their work block.

To fix this, in test setup you can call global.Cylon.Utils.bootstrap();
which will re-setup our globals.
2014-04-01 12:31:13 -07:00
Andrew Stewart 2563e62de4 Catch MODULE_NOT_FOUND errors, throw others 2014-04-01 10:30:14 -07:00
Andrew Stewart 2d11e75434 Remove CLI tooling from Cylon
It now lives in hybridgroup/cylon-cli.
2014-03-27 14:45:36 -07:00
Andrew Stewart 337074f34f Add friendlier errors when no adaptor/driver found 2014-03-26 14:32:52 -07:00
Andrew Stewart 2acc07b443 Fix error with /robots route in API 2014-03-25 10:16:11 -07:00
Andrew Stewart e4c43c0cd5 Remove Port class
Ultimately unnecessary with Cylon, as opposed to Artoo where we do some
interesting/tricky stuff with Socket-To-Serial to make everything work.
2014-03-18 13:41:12 -07:00
Andrew Stewart 70dde8148c Refactor and clean up Cylon.IO.DigitalPin class 2014-03-14 16:06:32 -07:00
Adrian Zankich 1ee0b8b87a Ensure toScale stays within defined range 2014-03-11 18:33:39 -07:00
Andrew Stewart f9537d9af8 Rename #stop to #halt to avoid potential conflicts 2014-03-11 10:44:11 -07:00
Andrew Stewart 4c464f0d88 Remove Math.ceil from #toScale, JS has no integers/floats anyways 2014-03-10 15:25:39 -07:00
Andrew Stewart 3c6696a78f Reorganize Utils for easier testing 2014-03-10 12:00:48 -07:00
Andrew Stewart 56b66bded4 Add/improve specs for Connection class 2014-03-10 09:49:46 -07:00
Andrew Stewart a1b230c62d Added specs for Cylon#findRobotConnection 2014-03-09 19:06:06 -07:00