Program Prog1;


Procedure ReadInfo;                                   
begin                                                 
  if not ReadDevice then       
   begin                                          
    MsgBox( 'Read Error', 'Error', MB_OK );       
   end                      
end;                                                                       
                                                                     
                              
Procedure DelCrash;                                                     
var 
n: integer;                                                    


begin
  SetProgramModifiedOnly( true );                                           
    begin                              
     for n:=$00 to $00 do    
     SetByteHexEdit( n,($00));   
     for n:=$01 to $01 do    
     SetByteHexEdit( n,($FF));             
     for n:=$02 to $05 do    
     SetByteHexEdit( n,($00)); 
     for n:=$06 to $06 do    
     SetByteHexEdit( n,($FF));
     for n:=$07 to $0A do
     SetByteHexEdit( n,($00));    
     for n:=$0B to $0B do                  
     SetByteHexEdit( n,($FF));     
     for n:=$0C to $0F  do  
     SetByteHexEdit( n,($00));                         
     for n:=$10 to $10  do    
     SetByteHexEdit( n,($FF));   
     for n:=$11 to $14  do    
     SetByteHexEdit( n,($00));  
     for n:=$15 to $15 do         
     SetByteHexEdit( n,($FF));                                                     
     for n:=$16 to $19 do    
     SetByteHexEdit( n,($00));  
     
     
     for n:=$1A to $1A  do    
     SetByteHexEdit( n,($FF));   
     for n:=$2A to $2D  do    
     SetByteHexEdit( n,($00));  
     for n:=$2E to $2E do         
     SetByteHexEdit( n,($FF));
     for n:=$2F to $3A do    
     SetByteHexEdit( n,($00));       
     
      
     for n:=$3B to $3B do    
     SetByteHexEdit( n,($D1));   
     for n:=$3C to $60  do    
     SetByteHexEdit( n,($00));              
  
     for n:=$61 to $61  do    
     SetByteHexEdit( n,($FF));  
     for n:=$62 to $8D do         
     SetByteHexEdit( n,($00));         
     for n:=$8E to $8E do             
     SetByteHexEdit( n,($FF));      
     for n:=$8F to $B8 do    
     SetByteHexEdit( n,($00));  
                                   
                                   
     
                                                                    
    end;                                                            
    RefreshHexEdit;
    if MsgBox( 'Program?', 'Confirm', MB_YESNO ) = IDYES then begin    
    ProgramDevice;
    VerifyDevice;
    ReadInfo;                                                                                
    end;                                                                   
end;  
                                                                                   
                                   
begin                                                                
  AddDeviceGroup( 'APLICAÇÃO AIRBAG', 'Select a Device' );        
  AddDevice( 'FIAT AIRBAG TRW 46807549_331271', 'I2C 24c08', 'APLICAÇÃO AIRBAG', '24C08' ); 
  AddAction( 'Read Info', 'ReadInfo', 'FIAT AIRBAG TRW 46807549_331271' );                                         
  AddAction( 'Del Crash', 'DelCrash', 'FIAT AIRBAG TRW 46807549_331271' );
  AddMsg('FIAT - AIRBAG 24C08 - Installed '#169' 2014 ALPHATEC AUTOMOTIVE - www.alphatecautomotive.com.br');
  SetProductInfo( 'Script', 'Device Script'#$D'Copyright'#169' 2014 ALPHATEC AUTOMOTIVE - www.alphatecautomotive.com.br' );             
end.                                                            

                                                     
                                                                                                             
