Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface INode

A node represents a physical or virtual Thymio

Hierarchy

Implemented by

Index

Events

onEvents

onEvents: function

Notify when one or several events are emmited by the robot.

Type declaration

    • Parameters

      Returns void

onEventsDescriptionsChanged

onEventsDescriptionsChanged: function

Notify changes in the event table of the group associated to this robot

see

IGroup.onEventsDescriptionsChanged

Type declaration

onGroupChanged

onGroupChanged: function

Emitted when the robot is associated to another group When a group change happens, it is the responsability of the application to rewire the group-monitoring callbacks such as onSharedVariablesChanged and onEventsDescriptionsChanged.

watchSharedVariablesAndEvents may also need to be reconfigured after a group change.

Type declaration

    • Parameters

      Returns void

onNameChanged

onNameChanged: function

Emitted when the name of the robot changes

see

rename, name

Type declaration

    • (newName: string): void
    • Parameters

      • newName: string

      Returns void

onSharedVariablesChanged

onSharedVariablesChanged: function

Notify of shared variables changes in the group associated to that robot

see

IGroup.onVariablesChanged

Type declaration

onStatusChanged

onStatusChanged: function

Emitted when the status of the robot changes

Type declaration

onVariablesChanged

onVariablesChanged: function

Notifiy of robot variables changes. These are both the variables of the robot and the variables defined in the currently executing programm.

Type declaration

onVmExecutionStateChanged

onVmExecutionStateChanged: function

Type declaration

    • (...args: any): void
    • Parameters

      • Rest ...args: any

      Returns void

Properties

eventsDescriptions

eventsDescriptions: EventDescription[]

Known events

see

IGroup.eventsDescriptions

group

group: Group

Group to which this robot belongs

id

id: NodeId

Unique Id of the node

isReady

isReady: boolean

Shorthand for status == NodeStatus.Ready, see type

name

name: string

Name of the robot

sharedVariables

sharedVariables: Variables

Known events

see

[[IGroup.variable]]

status

status: NodeStatus

Status of the robot

statusAsString

statusAsString: string

A string representaion of the type of the robot see type

type

type: NodeType

typeAsString

typeAsString: string

A string representaion of the status of the robot see type

Methods

asebaVMDescription

  • asebaVMDescription(): Promise<any>
  • Get the description from the device The device must be in the available state before requesting the VM.

    throws

    mobsya.fb.Error

    see

    lock

    Returns Promise<any>

emitEvents

  • emitEvents(events: Events): Promise<any>
  • emitEvents(key: string, value: any): Promise<any>
  • emitEvents(key: string): Promise<any>

lock

  • lock(): Promise<any>
  • Lock the device Locking a device is akin to take sole ownership of it until the connection is closed or the unlock method is explicitely called

    The device must be in the available state before it can be locked. Once a device is locked, all client will see the device becoming busy.

    If the device can not be locked, an mobsya.fb.Error is raised.

    throws

    mobsya.fb.Error

    Returns Promise<any>

rename

  • rename(newName: string): Promise<any>

runProgram

  • runProgram(): Promise<any>
  • Run the code currently loaded on the vm The device must be locked & ready before calling this function

    throws

    mobsya.fb.Error

    see

    lock

    Returns Promise<any>

sendAsebaProgram

  • sendAsebaProgram(code: string): Promise<any>
  • Load an aseba program on the VM The device must be locked & ready before calling this function The code is not directly executed. instead, {runProgram} must be call to start the execution

    throws

    mobsya.fb.Error

    see

    lock

    Parameters

    • code: string

      the aseba code to load

    Returns Promise<any>

setEventsDescriptions

  • Set the event descriptions on the group associated with this robot

    Overwrite all existing events descriptions the node must be locked.

    see

    lock

    Parameters

    Returns Promise<any>

setSharedVariables

  • setSharedVariables(variables: Variables): Promise<any>
  • Set the shared variables on the group associated with this robot

    Overwrite all existing shared variables the node must be locked.

    see

    lock

    Parameters

    Returns Promise<any>

setVariables

  • setVariables(variables: Variables): Promise<any>
  • Set the values of the specified variables. Unlike setSharedVariables, existing variables not modifieed by this function are left unmodified

    Parameters

    • variables: Variables

      the variables to modify

    Returns Promise<any>

unlock

  • unlock(): Promise<any>
  • Unlock the device Once a device is unlocked, all client will see the device becoming available. Once unlock, a device can't be written to until loc

    throws

    mobsya.fb.Error

    see

    lock

    Returns Promise<any>

watchSharedVariablesAndEvents

  • watchSharedVariablesAndEvents(flags: number): Promise<any>

Generated using TypeDoc