'Returns the contents of this event as a string, ready to
send over the network, or None in case of conversion problems.'

def serialize(self):

    (type_type, type_buf) = serialize(self.type)
    if (type_type == DATATYPE_UNKNOWN):
        return None
    type_size = len(type_buf)
    type_numel = (type_size / wordSize[type_type])
    (value_type, value_buf) = serialize(self.value)
    if (value_type == DATATYPE_UNKNOWN):
        return None
    value_size = len(value_buf)
    value_numel = (value_size / wordSize[value_type])
    bufsize = (type_size + value_size)
    S = struct.pack('IIIIIiiI', type_type, type_numel, value_type, value_numel, int(self.sample), int(self.offset), int(self.duration), bufsize)
    return ((S + type_buf) + value_buf)
