Lens.Machines allows you interact with the LuXoR device your app is running on, as well as discover and interact with nearby machines.
LuXoR devices have capabilities, which you can turn on and off from your apps. In addition, apps can define RPCs, which can be invoked by apps running on nearby machines.
See RPCs for more information on defining and calling RPCs.
Static Properties
-
Lens.Machines.localhost ARCore/machines.js, line 208
-
The local LuminAR machine.
Static Methods
-
Lens.Machines.all() → {Machine[]} ARCore/machines.js, line 113
-
Returns a list of all nearby machines.
-
Lens.Machines.findByCapability(name) → {Array.<Machine>} ARCore/machines.js, line 164
-
Finds all machines with the given capability.
Returns:Argument Type Description nameString Name of the capability
Array of matching
Machines -
Lens.Machines.findByDB(name) → {Array.<Machine>} ARCore/machines.js, line 194
-
Finds all machines with the given DB.
Returns:Argument Type Description nameString Name of the DB
Array of matching
Machines -
Lens.Machines.findById(id) → {Machine} ARCore/machines.js, line 146
-
Finds a machine, given its id.
Returns:Argument Type Description idString The Machine with the given id, or null if no such machine exists.
-
Lens.Machines.findByRPC(name) → {Array.<Machine>} ARCore/machines.js, line 179
-
Finds all machines with the given RPC.
Returns:Argument Type Description nameString Name of the RPC
Array of matching
Machines -
Lens.Machines.machine(name) → {Machine} ARCore/machines.js, line 125
-
Finds a machine, given its name.
Returns:Argument Type Description nameString The Machine with the given name, or null if no such machine exists.
-
Lens.Machines.subscribe(fn, filter) → {Binding} ARCore/machines.js, line 86
-
Subscribes a function to be called when capabilities or RPCs are added and/or removed.
Returns:Argument Type Attributes Description fnfunction A callback function, invoked when a capability is added or removed. Gets the
Capability,Machine, orLens.DBas the first argument, the state (either "added" or "removed") as the second argument, and the type ("rpc", "db" or "capability") as the third argument.filterObject <optional>
Filters to limit which capability additions/removals the subscriber function is called for.
Properties
Argument Type Attributes Description machineMachine | String | RegExp <optional>
A
Machine, or a string or RegExp to match the machine name against.nameString | RegExp <optional>
A string or RegExp to match the capability name against.
stateString <optional>
Either "added" or "removed", if you only want to be notified of that state.
typeString <optional>
"rpc", "db", or "capability", if you only want to be notified of that type.
A binding that can be used to unsubscribe.