예제 #1
0
			#SMARTCARD Test:##########################################################
			#Only testing card 1 in range below
			for i in range(1,2):
					val = read_smart_card(i)
					if val == -1:
						run = 0
						break
					if val == 0:
						smart_card_count+=1
			get_log_cm().info( "SmartCard Count = \t\t%d of %d", smart_card_count, total_count)
			#SMARTCARD Test end:#######################################################

			#TAMPER:####################################################################
			if tamper_flag != 0:
				get_log_cm().debug("\t\t\t Tamper Flag is %X\n\n", tamper_flag)
				ret = read_tamper_count()
				if ret < 0: #Read Failure
					get_log_cm().error("\t\t\tTAMPER Read Failed")
				elif ret > 0:
					get_log_cm().info("TAMPER Found")
				else:
					tamper_count += 1
				get_log_cm().info( "TAMPER Count = \t\t%d of %d", tamper_count, total_count)

				#RTC
				rtc_stamp = read_rtc_count()
				if rtc_stamp < 0:
					get_log_cm().error("\t\t\tPossible reset RTC")
				else:
					get_log_cm().info( "last RTC Event = \t\t%d", rtc_stamp)
			else:
예제 #2
0
            #Only testing card 1 in range below
            for i in range(1, 2):
                val = read_smart_card(i)
                if val == -1:
                    run = 0
                    break
                if val == 0:
                    smart_card_count += 1
            get_log_cm().info("SmartCard Count = \t\t%d of %d",
                              smart_card_count, total_count)
            #SMARTCARD Test end:#######################################################

            #TAMPER:####################################################################
            if tamper_flag != 0:
                get_log_cm().debug("\t\t\t Tamper Flag is %X\n\n", tamper_flag)
                ret = read_tamper_count()
                if ret < 0:  #Read Failure
                    get_log_cm().error("\t\t\tTAMPER Read Failed")
                elif ret > 0:
                    get_log_cm().info("TAMPER Found")
                else:
                    tamper_count += 1
                get_log_cm().info("TAMPER Count = \t\t%d of %d", tamper_count,
                                  total_count)

                #RTC
                rtc_stamp = read_rtc_count()
                if rtc_stamp < 0:
                    get_log_cm().error("\t\t\tPossible reset RTC")
                else:
                    get_log_cm().info("last RTC Event = \t\t%d", rtc_stamp)