MessageHandler

exception cqc.MessageHandler.UnknownQubitError(message)[source]
cqc.MessageHandler.has_extra(cmd)[source]

Check whether this command includes an extra header with additional information.

class cqc.MessageHandler.CQCMessageHandler(factory)[source]
handle_cqc_message(header, message, transport=None)[source]

This calls the correct method to handle the cqcmessage, based on the type specified in the header

retrieve_return_messages(app_id)[source]

Retrieve the return messages of a given app_id

static create_return_message(app_id, msg_type, length=0, cqc_version=2)[source]

Creates a messaage that the protocol should send back :param app_id: the app_id to which the message should be send :param msg_type: the type of message to return :param length: the length of additional message :param cqc_version: The cqc version of the message :return: a new header message to be send back

static create_extra_header(cmd, cmd_data, cqc_version=2)[source]

Create the extra header (communication header, rotation header, etc) based on the command

handle_command(header, data)[source]

Handle incoming command requests.

handle_mix(header: cqc.cqcHeader.CQCHeader, data: bytes)[source]

Handler for messages of TP_MIX. Notice that header is the CQC Header, and data is the complete body, excluding the CQC Header.

handle_conditional(header: cqc.cqcHeader.CQCHeader, data: bytes)[source]

Handler for messages of TP_IF.