@Override
public void protocolComplete(final DeviceDataType type, final Object result) {
switch (type) {
case PRODUCT_DATA:
_deviceData.put(DeviceDataType.PRODUCT_DATA, result);
_listener.connected(new GpsUnitEvent(this, GpsUnitEvent.GPS_CONNECTED));
break;
case PROTOCOL_CAPABILITIES:
parseCapabilities((ProtocolArray) result);
_listener.configured(new GpsUnitEvent(this, GpsUnitEvent.GPS_CONFIGURED));
break;
case PVT_DATA:
_pvtData = (PvtData) result;
_listener.pvtData(new GpsUnitEvent(this, GpsUnitEvent.GPS_PVT_DATA));
break;
default:
_deviceData.put(type, result);
_listener.dataAvailable(new GpsUnitEvent(this, GpsUnitEvent.GPS_DATA_AVAILABLE,
type));
}
}