Commit Graph

298 Commits

Author SHA1 Message Date
Daniel Lamb ccebab4cc2 The register method should return existing modules 2015-02-20 11:25:31 -08:00
Andrew Stewart b17542061b Extract monkey-patches 2015-02-20 11:12:26 -08:00
Andrew Stewart 5ac95161e2 Correct edge case with 'module' key 2015-02-19 12:44:35 -08:00
edgarsilva 3d2842567b User API#start instead of API#listen in cylon#api 2015-01-30 14:45:50 -06:00
edgarsilva cfd37e9621 Updated README with cylon-api-socketio plugin reference. 2015-01-30 13:56:14 -06:00
edgarsilva e2f617c995 Fixes validation issue in initializer constructor, `!module` should be `mod` 2015-01-29 13:51:05 -06:00
deadprogram 64a0d76af1 Extract deprecation warning into separate function 2015-01-22 19:25:45 -08:00
Andrew Stewart 147816b366 First crack at removing seperate Device/Connection initialization 2015-01-22 14:41:58 -08:00
Andrew Stewart d56f9bc53f Add better error checking for Robot#halt 2015-01-21 08:56:13 -08:00
Andrew Stewart 8272efe060 Robot log messages should contain the bot name 2015-01-20 19:29:40 -08:00
Andrew Stewart 5354102c2e If bad start detected, shut down the Robot 2015-01-20 19:18:52 -08:00
deadprogram 6ac3cad7c1 Extract even more of function to DRY up code 2015-01-17 21:35:40 -08:00
deadprogram 5cea07602a Extract function to DRY up code 2015-01-17 21:29:07 -08:00
deadprogram a7e8caf19d Extract robot var init into separate function 2015-01-17 15:48:45 -08:00
Andrew Stewart 8fd6f8a99e Generate lodash script for only methods we use 2015-01-15 09:33:18 -08:00
Andrew Stewart 4b377b2e65 Streamline Logger a bit 2015-01-13 10:43:20 -08:00
Andrew Stewart b72864ca75 More specific log message for missing HTTP API 2015-01-13 10:13:16 -08:00
Andrew Stewart b8766c4607 Add custom Lo-Dash build, remove from dependencies 2015-01-08 12:04:52 -08:00
Andrew Stewart 9165ab36b4 Extract API from core 2015-01-08 10:02:14 -08:00
Andrew Stewart eccdde81a9 Update copyright years 2015-01-07 12:58:50 -08:00
Andrew Stewart 8065644b4e Add support for nested device details inside conn
e.g.
    connections: {
      loopback: {
        adaptor: "loopback",
        devices: {
          ping: { driver: "ping", pin: 1 }
        }
      }
    }

In the event of a name collision between the `devices` hash and a nested
device, the nested device will 'win'.
2015-01-07 10:21:51 -08:00
Andrew Stewart cf0d24f785 Add API event publication
This update gives Cylon support for the latest changes to the CPPP-IO
spec.
2015-01-05 12:20:53 -08:00
Loren West 34ba1fedc5 Fixed lint issues 2014-12-31 13:29:23 -08:00
Loren West 5d2fc21fab Support asynchronous commands 2014-12-31 13:29:23 -08:00
Andrew Stewart 13c388fbf7 Simplify path for method proxying in drivers 2014-12-18 13:19:58 -08:00
Andrew Stewart 280687099c Revert change to direct method binding, breaks stuff
This is Probably Bad and should be revisited in the future.
2014-12-18 13:15:30 -08:00
Andrew Stewart 7109a9d303 Fix API errors, add slight simplifications 2014-12-17 16:51:48 -08:00
Andrew Stewart b5907ccd36 Correct iteration key issue 2014-12-17 16:36:48 -08:00
Andrew Stewart 6ebbdf0eab Use forIn to ensure Object iteration is performed 2014-12-17 16:31:26 -08:00
Andrew Stewart c9e16fe8c2 Use _.result to get commands from options. 2014-12-17 15:07:03 -08:00
Andrew Stewart 6cbf2db122 Lodashify 2014-12-17 14:45:57 -08:00
Andrew Stewart 34ed6cea02 Add Lo-Dash + loader 2014-12-17 13:00:59 -08:00
Andrew Stewart ac6b09fe50 Clean up lib for JSHint 2014-12-15 11:15:29 -08:00
Andrew Stewart 9fe92967bb Make use of `thisArg` instead of #bind 2014-11-30 15:17:57 -08:00
Andrew Stewart 3eb1da8481 Simplify halt code in Robot slightly 2014-11-30 11:47:33 -08:00
Andrew Stewart 29583c0bd5 Add back debug logging for device/connection start 2014-11-28 14:42:26 -08:00
Andrew Stewart 4f850d5e9e Support passing config to Logger#setup again 2014-11-28 09:37:44 -08:00
Andrew Stewart ca8e22f1e2 Fluent #device/#connection update
Now pass name, then object of details

    #device({ name: 'ping', driver: 'ping' });
    // vs
    #device('ping', { driver: 'ping' });
2014-11-26 09:33:19 -08:00
Andrew Stewart 9047797c9f Deprecate 'connection' and 'device' Robot opts 2014-11-25 14:43:57 -08:00
Andrew Stewart 15c9b96333 Extract out Connection/Device initialization
Simple extraction out of Connection/Device initialization code inside
Robot.

This yields an interesting boon, however - this is now a valid Cylon
program:

    var Cylon = require('cylon');

    Cylon
      .robot()
      .connection({ name: 'loopback', adaptor: 'loopback' })
      .device({ name: 'ping', driver: 'ping' })
      .on('ready', function(bot) {
        console.log("Bot working!");

        every(1000, function() {
          console.log(bot.ping.ping());
        })
      });

    Cylon.start();

For those that prefer imperative programs with Cylon, this is a nice
syntax addition.
2014-11-20 08:43:08 -08:00
Andrew Stewart 668acf1e18 Add support for specifying API configuration to Cylon#api 2014-11-14 13:05:16 -08:00
Andrew Stewart 25119c170f Refer to correct element for proxying 2014-11-14 11:34:37 -08:00
Andrew Stewart 5ff743a4c5 Correct API inconsistency 2014-11-14 11:06:21 -08:00
Andrew Stewart 38bf5fdfed Refer to Adaptor instances as 'Connection' 2014-11-14 10:56:45 -08:00
Andrew Stewart 39f9c8b637 Fix up API errors 2014-11-11 13:41:09 -08:00
Andrew Stewart ce87a355f0 Modifications, fix test suite 2014-11-11 11:41:23 -08:00
Andrew Stewart e67ae19882 Remove Connection and Device classes
They are now functions that return instances of Adaptors and Drivers
respectively.
2014-11-10 16:06:10 -08:00
Andrew Stewart f1b982fedd Support providing connections/devices as an object
Before:

  connections: [
    { name: 'loopback', adaptor: 'loopback', port: 13 }
  ],

Now:

  connections: {
    loopback: { adaptor: 'loopback', port: 13 }
  }

Array syntax still works, but has been marked as deprecated.
2014-11-10 10:52:55 -08:00
Andrew Stewart 4c539ab9d1 Better configuration for TDR test mode 2014-11-06 09:48:21 -08:00
Andrew Stewart 277d4a51ee Correct API errors 2014-11-06 09:10:56 -08:00