![]() |
¿Como conseguir leer este ATR con V3? 3F 7F 13 25 02 40 B0 12 69 FF 4A 50 90 41 55 00
Tengo un unlooper rojo V3, estoy intenado de conseguir leer este atr 3F 7F 13 25 02 40 B0 12 69 FF 4A 50 90 41 55 00 00 00 00 00 (mejor no pongo a quien me refiero).
En el atmel he grabado el ND13 y utlizo este script un poquito modificado. ¿Necesito grabar otro firmn en el atmel o cambiar el comando 06 10 01 xx xx xx xx ? Este es el script. Y muchas gracias. ' 'LEE LA VERSION DEL DEL ATMEL DEL UNLOOPER ' Global Variable Definitions Option Explicit ' Constants used throughout script Const ScriptName=" Identify Unlooper " Const ScriptVer=" v1.0 " Dim UnlooperID,i,RetVal Dim RetValue Dim ATR Call UnlooperSettings() ' configure WinExplorer for unlooper settings Sub Main() ' Main Program Loop and Menu Dim MenuChoice Dim MsgPrompt Dim ErrorValue ' [Do not] suppress window output Sc.Verbose=1 MsgPrompt=" === "+ScriptName+" "+ScriptVer+" ==="+vbCr+vbCr+ "This Identifies the Atmel Hex on your Unlooper or gets the card ATR. "+vbCr MenuChoice=Sc.ButtonBox(MsgPrompt,vbDefaultButton1,ScriptName+" "+ScriptVer+" ","Get Atmel Info","Get ATR","Exit") Select Case MenuChoice Case 1: ErrorValue=ResetVer() 'Go to ResetVer Case 2: ErrorValue=GetATR() 'Go to GetATR Case 3: Sc.Write("A0") ' turn LEDs off Sc.Write("02") ' power down card Exit Sub End Select End Sub ' '¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ Function ResetVer() Sc.Reset() ' Reset the unlooper RetVal=Sc.Flush() ' Flush the receive buffer Sc.Write("90") ' We should receive 4 bytes from unlooper Sc.Write("90") ' We should receive 4 bytes from unlooper Sc.Write("90") ' We should receive 4 bytes from unlooper Sc.Write("90") ' We should receive 4 bytes from unlooper If Sc.Read(4)=4 Then For i=0 to 3 ' Assemble the unlooper version string UnlooperID=UnlooperID+Chr(Sc.GetByte(i)) Next End If Sc.Print"Atmel Hex is type : "&(UnlooperID)&VBcr If UnlooperID = "V5.0" then : Sc.Print "This is a WTX/WT2 hex." end if If UnlooperID = "UL4S" then : Sc.Print "This is a HU card hex." end if If UnlooperID = "SU-2" then : Sc.Print "This is a H card hex." end if If UnlooperID = "U5.1" then : Sc.Print "This is a P4 card hex." end if If UnlooperID = "ECHO" then : Sc.Print "This is a Nagra card hex." end if If UnlooperID = "MrGo" then : Sc.Print "This is a UL4S28 DTV card hex." end if If UnlooperID = "V5B4" then : Sc.Print "This is a V7 Seca card hex." end if If UnlooperID = "NDS2" then : Sc.Print "This is a Sky Italia card hex." end if If UnlooperID = "XYZ " then : Sc.Print "This is a XOR16 hex." end if End Function Function GetATR() dim uno,dos,tres,cuatro,cinco,seis,siete dim respuesta sc.write("A2") 'Sc.Write("06 10 0E 10 01 BF 00") ' this command receives the ATR of an Sky card 'Sc.Write("06 10 0E 07 02 93 00") 'nos devuelve 05 00 cercanoa 08 00 ' Sc.Read(&h02) ' see if command was accepted 'for uno = 6 to 255 ' for dos = 32 to 255 ' for tres = 26 to 255 for cuatro = 0 to 255 for cinco = 0 to 255 for seis = 0 to 255 for siete = 0 to 255 'Sc.Write(hexstring(uno,2) & hexstring(dos,2) & hexstring(tres,2) & hexstring(cuatro,2) & hexstring(cinco,2) & hexstring(seis,2) & hexstring(siete,2) ) 'Sc.Write("06 10 0E 07 " & hexstring(cinco,2) & hexstring(seis,2) & hexstring(siete,2) ) 'Sc.Write("08 10 01 81 26 80 00 91 00") 'Sc.Write("07 01 81 26 00 00 91 00") 'sc.write("A2") 'Sc.Write("06 10 02 00 00 01 93 00") Sc.Write("06 10 01 " & hexstring(cuatro,2) & hexstring(cinco,2) & hexstring(seis,2) & hexstring(siete,2) ) Sc.Delay(300) Sc.Read(&h02) ' see if command was accepted RetValue = Sc.GetByte(&h01) sc.print("------------" & vbcr) Sc.Read (RetValue) ' read the bytes of ATR For i = 0 to RetValue-1 ATR = ATR & HexString(Sc.GetByte(i), 2) & " " ' all bytes of ATR Next Sc.Print "ATR = " & ATR & vbcr Sc.Print "RetValue " & RetValue & vbcr if left(ATR,20) = "3F 7F 13 25 02 40 B0" then Sc.Print "ATR = " & ATR exit function end if next next next next ' next ' next 'next End Function Function HexString(Number,Length) ' This function takes 2 arguments, a number and a length. It converts the decimal ' number given by the first argument to a Hexidecimal string with its length ' equal to the number of digits given by the second argument Dim RetVal Dim CurLen RetVal=Hex(Number) CurLen=Len(RetVal) If CurLen<Length Then RetVal=String(Length-CurLen,"0") & RetVal End If HexString=RetVal End Function '__________________________________________________________________________ ' Configures Unlooper Sub UnlooperSettings() Wx.CommPort = "com1:" Wx.BaudRate = 115200 Wx.ResetBaudRate = 115200 Wx.Parity = 0 ' 0 = None, 1 = Odd, 2 = Even, 3 = Mark, 4 = Space Wx.StopBits = 0 ' 0 = 1 stop bit, 1 = 1.5 stop bits, 2 = 2 stop bits Wx.DTRControl = 0 ' Initial state of DTR 0 = off, 1 = on Wx.RTSControl = 1 ' Initial state of RTS 0 = off, 1 = on Wx.ResetDelay = 0 ' In microseconds Wx.ByteDelay = 0 ' In microseconds Wx.RxByteTimeout = 1000 ' In milliseconds Wx.ResetMode = 2 ' 0 = No Resets, 1 = ISO Reset (Expect a ATR), 2 = Device Reset (No ATR) Wx.ResetLine = 1 ' 0 = Toggle RTS for Reset, 1 = Toggle DTR for Reset Wx.ByteConvention = 1 ' 0 = Inverse, 1 = Direct Wx.FlushEchoByte = 0 ' 0 = no flush, 1 = flush - A Phoenix interface will echo each byte transmitted. Wx.FlushBeforeWrite = 0 ' 0 = no flush, 1 = flush - Flush the receive buffer before each write to strip off Null bytes. Wx.IgnoreTimeouts = 0 ' 0 = Abort script on a receive timeout, 1 = Ignore all receive timeouts Wx.ResetAfterTimeout = 0 ' 0 = Don't reset after a timeout, 1 = do a reset after a timeout - Not used if "IgnoreTimeouts=0" Wx.LogTransactions = 0 ' 0 = Don't log transactions, 1 = log transactions Wx.DisplayUSW = 0 ' Display USW after script complete 0 = no, 1 = yes Wx.DisplayFuse = 0 ' Display Fuse after script complete 0 = no, 1 = yes End Sub '---------- ' Inverts a byte Function HexInv(Number,Length) Dim CurLen Dim NumLow Dim NumHigh dim Number1 NumLow=Int(Number/16) NumHigh=Number-NumLow*16 Select Case NumHigh Case 0 NumHigh=15 Case 1 NumHigh=7 Case 2 NumHigh=11 Case 4 NumHigh=13 Case 6 NumHigh=9 Case 7 NumHigh=1 Case 8 NumHigh=14 Case 9 NumHigh=6 Case 11 NumHigh=2 Case 13 NumHigh=4 Case 14 NumHigh=8 Case 15 NumHigh=0 End Select Select Case NumLow Case 0 NumLow=15 Case 1 NumLow=7 Case 2 NumLow=11 Case 4 NumLow=13 Case 6 NumLow=9 Case 7 NumLow=1 Case 8 NumLow=14 Case 9 NumLow=6 Case 11 NumLow=2 Case 13 NumLow=4 Case 14 NumLow=8 Case 15 NumLow=0 End Select Number1=NumHigh*16+NumLow RetValue=Hex(Number1) CurLen=Len(RetValue) If CurLen<Length Then RetValue=String(Length-CurLen,"0") & RetValue End If HexInv=RetValue End Function |
algo conseguido, poero sigo necesitando ayuda
con este script he conseguido 2 respuestas buenas:
' ' New VB Script File - Created 13/11/2006 ' ' 'LEE LA VERSION DEL DEL ATMEL DEL UNLOOPER ' Global Variable Definitions Option Explicit ' Constants used throughout script Const ScriptName=" Identify Unlooper " Const ScriptVer=" v1.0 " Dim UnlooperID,i,RetVal Dim RetValue Dim ATR Call UnlooperSettings() ' configure WinExplorer for unlooper settings Sub Main() ' Main Program Loop and Menu Dim MenuChoice Dim MsgPrompt Dim ErrorValue ' [Do not] suppress window output Sc.Verbose=1 MsgPrompt=" === "+ScriptName+" "+ScriptVer+" ==="+vbCr+vbCr+ "This Identifies the Atmel Hex on your Unlooper or gets the card ATR. "+vbCr MenuChoice=Sc.ButtonBox(MsgPrompt,vbDefaultButton1,ScriptName+" "+ScriptVer+" ","Get Atmel Info","Get ATR","Exit") Select Case MenuChoice Case 1: ErrorValue=ResetVer() 'Go to ResetVer Case 2: ErrorValue=GetATR() 'Go to GetATR Case 3: Sc.Write("A0") ' turn LEDs off Sc.Write("02") ' power down card Exit Sub End Select End Sub ' '¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ Function ResetVer() Sc.Reset() ' Reset the unlooper RetVal=Sc.Flush() ' Flush the receive buffer Sc.Write("90") ' We should receive 4 bytes from unlooper Sc.Write("90") ' We should receive 4 bytes from unlooper Sc.Write("90") ' We should receive 4 bytes from unlooper Sc.Write("90") ' We should receive 4 bytes from unlooper If Sc.Read(4)=4 Then For i=0 to 3 ' Assemble the unlooper version string UnlooperID=UnlooperID+Chr(Sc.GetByte(i)) Next End If Sc.Print"Atmel Hex is type : "&(UnlooperID)&VBcr If UnlooperID = "V5.0" then : Sc.Print "This is a WTX/WT2 hex." end if If UnlooperID = "UL4S" then : Sc.Print "This is a HU card hex." end if If UnlooperID = "SU-2" then : Sc.Print "This is a H card hex." end if If UnlooperID = "U5.1" then : Sc.Print "This is a P4 card hex." end if If UnlooperID = "ECHO" then : Sc.Print "This is a Nagra card hex." end if If UnlooperID = "MrGo" then : Sc.Print "This is a UL4S28 DTV card hex." end if If UnlooperID = "V5B4" then : Sc.Print "This is a V7 Seca card hex." end if If UnlooperID = "NDS2" then : Sc.Print "This is a Sky Italia card hex." end if If UnlooperID = "XYZ " then : Sc.Print "This is a XOR16 hex." end if End Function Function GetATR() dim uno,dos,tres,cuatro,cinco,seis,siete dim respuesta 'ResetVer() sc.write("A2") sc.write("b0 30") 'Sc.Write("06 10 0E 07 02 93 00") 'nos devuelve 05 00 cercanoa 08 00 ' Sc.Read(&h02) ' see if command was accepted 'for uno = 6 to 255 ' for dos = 32 to 255 ' for tres = 26 to 255 for cuatro = 3 to 3 '255 for cinco = 80 to 80 '255 for seis = 0 to 0 '255 for siete = 0 to 255 '136 Sc.Write("06 10 01 " & hexstring(cuatro,2) & hexstring(cinco,2) & hexstring(seis,2) & hexstring(siete,2) ) Sc.Delay(300) '300 Sc.Read(&h02) ' see if command was accepted RetValue = Sc.GetByte(1) '(&h01) 'tiene que ser 127 SC.PRINT("RETVALUE " & RETVALUE & VBCR) if retvalue = &h7f then Sc.Read(RetValue) ' read the bytes of ATR For i = 0 to RetValue-1 ATR = ATR & HexString(Sc.GetByte(i), 2) & " " ' all bytes of ATR Next Sc.Print "ATR = " & LEFT(ATR,53) & vbcr sc.print("---------------------------------------" & vbcr) end if next next next next ' next ' next 'next End Function Function HexString(Number,Length) ' This function takes 2 arguments, a number and a length. It converts the decimal ' number given by the first argument to a Hexidecimal string with its length ' equal to the number of digits given by the second argument Dim RetVal Dim CurLen RetVal=Hex(Number) CurLen=Len(RetVal) If CurLen<Length Then RetVal=String(Length-CurLen,"0") & RetVal End If HexString=RetVal End Function '__________________________________________________________________________ ' Configures Unlooper Sub UnlooperSettings() Wx.CommPort = "com1:" Wx.BaudRate = 115200 Wx.ResetBaudRate = 115200 Wx.Parity = 0 ' 0 = None, 1 = Odd, 2 = Even, 3 = Mark, 4 = Space Wx.StopBits = 0 ' 0 = 1 stop bit, 1 = 1.5 stop bits, 2 = 2 stop bits Wx.DTRControl = 0 ' Initial state of DTR 0 = off, 1 = on Wx.RTSControl = 1 ' Initial state of RTS 0 = off, 1 = on Wx.ResetDelay = 0 ' In microseconds Wx.ByteDelay = 0 ' In microseconds Wx.RxByteTimeout = 1000 ' In milliseconds Wx.ResetMode = 2 ' 0 = No Resets, 1 = ISO Reset (Expect a ATR), 2 = Device Reset (No ATR) Wx.ResetLine = 1 ' 0 = Toggle RTS for Reset, 1 = Toggle DTR for Reset Wx.ByteConvention = 1 ' 0 = Inverse, 1 = Direct Wx.FlushEchoByte = 0 ' 0 = no flush, 1 = flush - A Phoenix interface will echo each byte transmitted. Wx.FlushBeforeWrite = 0 ' 0 = no flush, 1 = flush - Flush the receive buffer before each write to strip off Null bytes. Wx.IgnoreTimeouts = 0 ' 0 = Abort script on a receive timeout, 1 = Ignore all receive timeouts Wx.ResetAfterTimeout = 0 ' 0 = Don't reset after a timeout, 1 = do a reset after a timeout - Not used if "IgnoreTimeouts=0" Wx.LogTransactions = 0 ' 0 = Don't log transactions, 1 = log transactions Wx.DisplayUSW = 0 ' Display USW after script complete 0 = no, 1 = yes Wx.DisplayFuse = 0 ' Display Fuse after script complete 0 = no, 1 = yes End Sub '---------- ' Inverts a byte Function HexInv(Number,Length) Dim CurLen Dim NumLow Dim NumHigh dim Number1 NumLow=Int(Number/16) NumHigh=Number-NumLow*16 Select Case NumHigh Case 0 NumHigh=15 Case 1 NumHigh=7 Case 2 NumHigh=11 Case 4 NumHigh=13 Case 6 NumHigh=9 Case 7 NumHigh=1 Case 8 NumHigh=14 Case 9 NumHigh=6 Case 11 NumHigh=2 Case 13 NumHigh=4 Case 14 NumHigh=8 Case 15 NumHigh=0 End Select Select Case NumLow Case 0 NumLow=15 Case 1 NumLow=7 Case 2 NumLow=11 Case 4 NumLow=13 Case 6 NumLow=9 Case 7 NumLow=1 Case 8 NumLow=14 Case 9 NumLow=6 Case 11 NumLow=2 Case 13 NumLow=4 Case 14 NumLow=8 Case 15 NumLow=0 End Select Number1=NumHigh*16+NumLow RetValue=Hex(Number1) CurLen=Len(RetValue) If CurLen<Length Then RetValue=String(Length-CurLen,"0") & RetValue End If HexInv=RetValue End Function que son los siguientes: X Data : 06 10 01 03 50 00 88 RX Data : 3F 7F RETVALUE 127 RX Data : 13 25 02 40 B0 12 69 FF 4A 50 90 41 55 00 00 00 00 00 52 65 76 41 43 33 00 01 E2 01 EB 01 54 50 50 00 80 3F FF 00 03 C9 00 01 7C 7C 83 3E 00 00 01 00 76 00 1D 00 07 01 8D 8D 8D 8D 8D 8D 8D 8D 00 04 18 40 02 8D 8D 8D 15 3A 12 8D 8D 8D 22 4F 02 8D 8D 8D 00 00 00 8D 8D 00 8D 8D 33 00 8D 8D 8D 8D 30 00 94 00 01 81 8D 8D 5A 05 03 00 8D 8D C8 02 00 00 8D DF 8D 21 10 01 03 50 00 02 3F ATR = 13 25 02 40 B0 12 69 FF 4A 50 90 41 55 00 00 00 00 00 --------------------------------------- si aplico a un script nuevo el comando visto 06 10 01 03 50 00 88 asi: sc.write("A2") sc.write("b0 30") Sc.Write("06 10 10 01 03 50 88") Sc.Delay(300) '300 Sc.Read(&h02) ' see if command was accepted AQUI DA EL ERROR NO LEE NINGUN BYTE RetValue = Sc.GetByte(1) '(&h01) 'tiene que ser 127 SC.PRINT("RETVALUE " & RETVALUE & VBCR) if retvalue = &h7f then Sc.Read(RetValue) ' read the bytes of ATR For i = 0 to RetValue-1 ATR = ATR & HexString(Sc.GetByte(i), 2) & " " ' all bytes of ATR Next Sc.Print "ATR = " & LEFT(ATR,53) & vbcr sc.print("---------------------------------------" & vbcr) end if Por favor una ayudita de los maestros.muchas gracias |
La franja horaria es GMT +2. Ahora son las 10:51. |
Powered por vBulletin™ Version 3.8.10
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.
Traducido por vBsoporte - vBulletin en español
ZackYFileS - Foros de Debate