Skip to content

Splitting up the discovery and device controllers? #2

Description

@benfoxall

I think it might get confusing for people to understand the process of discovery and connecting to cars when they are first using the library.

It might be easier to split them up, so have a function that performs discovery:

WIRC.discover(function(device){
    // called for each device that responds to the broadcast

    console.log(device); // {deviceName:…,remoteAddress:…,localAddress:…};

});

Then access the car separately with the remote address.

var car = new Car('192.168.0.5', 'optional-serial-number');
car.takeControl();
car.speed(1);

I think the client code could be simplified if it was dealing with one device too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions