예제 #1
0
def get_platform(connection):
        """
        Gets the platform type.
    
        :Parameters:
            -*connection* (PupySPOT): Object managing spot connection.
            
        :Returns: A string containing the platform type.  
    
        """
	Protocol.send_hardware_configuration(connection, [0x01, 0x42])
	hw_conf_ack = Protocol.recv_hardware_configuration(connection, 0)
	connection.platform = None
	if hw_conf_ack['Entry'][str(int(0x42))].startswith('MCF532x'):
		connection.platform = 'M3'
	elif hw_conf_ack['Entry'][str(int(0x42))].startswith('OMAP35xx'):
		connection.platform = 'NGP'
	elif hw_conf_ack['Entry'][str(int(0x42))].startswith('UPMxxxxx'):
		connection.platform = 'VGD'
	return connection.platform
예제 #2
0
def get_card_reader_type(connection):
        """
        Gets the card reader type.
    
        :Parameters:
            -*connection* (PupySPOT): Object managing spot connection.
            
        :Returns: A string containing the card reader type.  
        """
	Protocol.send_hardware_configuration(connection, [0x34])
	hw_conf_ack = Protocol.recv_hardware_configuration(connection, 0)
	connection.cr_type = None
	if hw_conf_ack['Entry']['52'].startswith('ZU-'):
		connection.cr_type = 'PANASONIC'
	elif hw_conf_ack['Entry']['52'].startswith('MAGTEK-HCR'):
		connection.cr_type = 'HCR2'
	elif hw_conf_ack['Entry']['52'].startswith('Sankyo'):
		connection.cr_type = 'SANKYO'
	elif hw_conf_ack['Entry']['52'].startswith('SANKYO-HCR2'):
		connection.cr_type = 'SANKYO-HCR2'
	elif hw_conf_ack['Entry']['52'].startswith('Omron'):
		connection.cr_type = 'OMRON'
	return connection.cr_type