def __init__(self, entity_id, max_gem_payload_size=None): """ :param entity_id: (int) This attribute uniquely identifies each instance of this managed entity. (0..65535) :param max_gem_payload_size: (int) This attribute defines the maximum payload size generated in the associated GEM interworking termination point managed entity. (0..65535 """ MEFrame.check_type(max_gem_payload_size, (int, type(None))) if max_gem_payload_size is not None and not 0 <= max_gem_payload_size <= 0xFFFF: # TODO: verify min/max raise ValueError('max_gem_payload_size should be 0..0xFFFF') data = None if max_gem_payload_size is None else\ { 'max_gem_payload_size': max_gem_payload_size } super(GalEthernetProfileFrame, self).__init__(GalEthernetProfile, entity_id, data)
def __init__(self, single, slot_number, attributes): """ :param single:(bool) True if the ONU is a single piece of integrated equipment, False if the ONU contains pluggable equipment modules :param slot_number: (int) slot number (0..254) :param attributes: (basestring, list, set, dict) attributes. For gets a string, list, or set can be provided. For create/set operations, a dictionary should be provided, for deletes None may be specified. """ # Validate MEFrame.check_type(single, bool) MEFrame.check_type(slot_number, int) if not 0 <= slot_number <= 254: raise ValueError('slot_number should be 0..254') entity_id = 256 + slot_number if single else slot_number super(CardholderFrame, self).__init__(Cardholder, entity_id, MEFrame._attr_to_data(attributes))