|
When the data of MeterBand class belongs to the branch MeterBandExperimenterCase,we should call the serialization function registered by the vendor, but the construction of the key is not refinement enough.
Code as follows:
if (meterBand instanceof MeterBandExperimenterCase)
{
MeterBandExperimenterCase experimenterBandCase = (MeterBandExperimenterCase) meterBand;
MeterBandExperimenter experimenterBand = experimenterBandCase.getMeterBandExperimenter();
long expId = experimenterBand.getAugmentation(ExperimenterIdMeterBand.class)
.getExperimenter().getValue();
OFSerializer<MeterBandExperimenterCase> serializer = registry.getSerializer(
ExperimenterSerializerKeyFactory.createMeterBandSerializerKey(
EncodeConstants.OF13_VERSION_ID, expId));
serializer.serialize(experimenterBandCase, outBuffer);
}
We can refer to the key of the serialization function of the action.
|