<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def send(self, message):
 """Send message to device."""

        serialized = message.SerializeToString()

        log_binary(_LOGGER, '>> Send', Data=serialized)
        if self._chacha:
            serialized = self._chacha.encrypt(serialized)
            log_binary(_LOGGER, '>> Send', Encrypted=serialized)

        data = write_variant(len(serialized)) + serialized
        self._transport.write(data)
        _LOGGER.debug('>> Send: Protobuf=%s', message)