

def _send_message(self, message, message_type):
    'Sends a message to the Google TV server.\n\n    Args:\n      message: A proto request message.\n      message_type: A polo_pb2.OuterMessage.MESSAGE_TYPE_* constant.\n\n    Returns:\n      The amount of data sent, in bytes.\n    '
    req = polo_pb2.OuterMessage()
    req.protocol_version = 1
    req.status = polo_pb2.OuterMessage.STATUS_OK
    req.type = message_type
    req.payload = message.SerializeToString()
    data = req.SerializeToString()
    return self.send(data)

dataset/ETHPy150Open stevenle/googletv-anymote/googletv/__init__.py PairingProtocol._send_message/original