
Would be nice to have a USB dongle to interface decoded VAN data with a PC. Could have a LOT of fun with it...

Moderator: Moderators
You'll have fun trying to find a better language for writing device drivers inCaptain Jack wrote:Oh noes... C code....![]()
Heh don't expect a windows point-and-click app any time soonWould be nice to have a USB dongle to interface decoded VAN data with a PC. Could have a LOT of fun with it...
point & click is overrated... ---auldy gets busy coding a nice terminal front end for bus decoding---mjb wrote:Heh don't expect a windows point-and-click app any time soon
FreeBSD, aye. I try to avoid Linux wherever I can as it's just messy crap with too much random shite haphazardly piled on top and has far too many completely clueless zealots advocating its use everywhere. I can rant for weeks on the subjectauldy wrote:those FTDI chips are fairly well supported, which OS are you using? Mac/BSD I guess?
Good job I never got round to finishing off the order eh?BOM for my design is below - note C5&C6 are mistakenly 100nF in the schematic on my website! They should be 47pF or so.
Code: Select all
my %ident_lookup = ( '4D4' => { pos=>2, name=>'Audio Settings'},
'4DC' => { pos=>3, name=>'Air Con'},
'4EC' => { pos=>4, name=>'CDC Info'},
...
'9C4' => { pos=>23, name=>'Radio Remote', handler=>\&decode9C4},
...
'unk' => { pos=>27, name=>'Unknown Ident'}
);
...
$this_ident = $ident_lookup{$ident} || $ident_lookup{'unk'};
difprint($this_ident{pos}, $linecol, $this_ident{name},$ident,$atr,$data,$ack);
...
sub focusdecode {
...
if($ident_lookup{$ident}{'handler'}) {
&{$ident_lookup{$ident}{'handler'}}($dataToPassIn)
}
...
I'll try to remember to send it tomorrow....auldy wrote:ha ha, firstly I have a package ready to post for you, haven't checked my PP account yet.
*cough*4. yeah, strict comes and goes in my code depending on how much of a hack-it-together-hurry I'm in, I'll get to that. It does of course spoil one of the 'features' of perl - allowing you to throw together some pretty nasty but functional code.
Code: Select all
perl -e 'use Time::HiRes qw{usleep};@states=("usr","nic","sys","idl","io","irq","softirq");while(1){
open S,"/proc/stat";@c=<S>;close S;(undef,$usr,$nic,$sys,$idl,$io,$irq,$softirq)=split/\s+/,$c[0];$t=0;
foreach(@states){${"d".$_}=$$_-${"o".$_};$t+=${"d".$_}}foreach(@states){
printf("%-50s|","*"x(int((${"d".$_}/$t)*50)));${"o".$_}=$$_}print"\n";usleep 5000}'