use of com.qualcomm.hardware.lynx.commands.standard.LynxDiscoveryResponse in project robotcode by OutoftheBoxFTC.
the class LynxUsbDeviceImpl method onLynxDiscoveryResponseReceived.
protected void onLynxDiscoveryResponseReceived(LynxDatagram datagram) {
LynxDiscoveryResponse incomingResponse = new LynxDiscoveryResponse();
incomingResponse.setSerialization(datagram);
incomingResponse.loadFromSerialization();
RobotLog.vv(TAG, "onLynxDiscoveryResponseReceived()... module#=%d isParent=%s", incomingResponse.getDiscoveredModuleAddress(), Boolean.toString(incomingResponse.isParent()));
try {
// Be paranoid about duplicates
synchronized (this.discoveredModules) {
if (!this.discoveredModules.containsKey(datagram.getSourceModuleAddress())) {
RobotLog.vv(TAG, "discovered lynx module#=%d isParent=%s", incomingResponse.getDiscoveredModuleAddress(), Boolean.toString(incomingResponse.isParent()));
LynxModuleMeta meta = new LynxModuleMeta(incomingResponse.getDiscoveredModuleAddress(), incomingResponse.isParent());
discoveredModules.put(meta.getModuleAddress(), meta);
}
}
} finally {
RobotLog.vv(TAG, "...onLynxDiscoveryResponseReceived()");
}
}
Aggregations