Recovering connections – Echelon ISI User Manual
Page 84
ISI Programmer’s Guide
82
break;
case
enrolling:
// Just one member for this example; close enrollment
ControlCommand(controlJob.host.neuronId,
isiCreate,
controlJob.host.assembly);
controlState
=
creating;
break;
case
creating:
// We're done; rport successful completion
//
to
the
user
...
controlState
=
idle;
break;
}
}
else
{
// This is a failure response. For this example, simply
// cancel the enrollment.
ControlCommand(controlJob.host.neuronId,
isiCancel,
controlJob.host.assembly);
// Indicate failure via user interface
...
controlState
=
idle;
}
}
}
}
// Open enrollment with a host device and host assembly, enroll one
// member device and assembly, and closes enrollment. The function
// initializes the description of the control job and kick-starts
// the process; the when (resp_arrives) task handles the
// completion, or cancellation, of the remaining steps.
void ConnectTwoDevices(unsigned* hostId, unsigned hostAssembly,
unsigned* memberId, unsigned memberAssembly) {
// Copy the job description
memcpy(controlJob.host.neuronId, hostId, NEURON_ID_LEN);
controlJob.host.assembly = hostAssembly;
memcpy(controlJob.member.neuronId, memberId, NEURON_ID_LEN);
controlJob.member.assembly = memberAssembly;
// Start the process by opening enrollment on the host
controlState = opening;
ControlCommand(hostId, isiOpen, hostAssembly);
}
Recovering Connections
You can recover existing connections so that a connection controller can display
connections not created by the connection controller, and display connections
created by the connection controller that are no longer in the connection
controller’s database. To recover connections, a connection controller must first
discover all the devices in the network as described in
Discovering Devices
. To
recover the connections, the controller uses the read connection table request
(RDCT) message, which allows reading a device’s connection table via the
network. Support for this message is optional (except for devices that support
controlled enrollment), and therefore this message can only be used with devices
that support it.