예제 #1
0
def MAC_verification(connection, KeyId, Versus = None, Data = None, MACData = None):
        """
        Keyboard and Security, MAC verification (0x40, 0x07).
    
        :Parameters:
            -*connection* (PupySPOT): Object managing spot connection.
            - *KeyId* (integer): Slot ID of Master Key.
            - *Versus* (Enums.Versus):  Operation required.
            - *Data* (bytes array): Data block on which the operation is performed.
            - *MACData* (bytes array): MAC data buffer to verify.
        
        :Returns: Ack-Code indicating successful of the operation.  
    
        """
	Protocol.send_mac_verification(connection, key_id = KeyId, versus = Versus, data = Data, mac = MACData)
	ack = Protocol.recv_send_mac_verification(connection, timeout = 120)
	return ack['ack_code']