Quote:
Originally Posted by gczobel
But I don't known how to detect if the device is a 500 or 505...
|
In the loadDict method in the autorun.js file add the following command.
Code:
this.trace("Device INFO:[" + this.runCommandResult("uname -a")+ "]");
This will tell you the computer name, OS, kernel, processor, all in a single line. Then you can use JavaScript regular expression to find the actual text you are looking for. The output will be stored in the log files where the libfskLoad.so file exists.
After you find the string replace the code above with the following code.
Say your looking for 'PRS500' in the uname string (it's not there I've check uname on the PRS-505, but let's pretend it is)
Code:
var prsRegEx= /PRS500/gi;
var szUnameResults = this.runCommandResult("uname -a");
if (szUnameResults.match(prsRegEx)){
//DO THE PRS 500 code here
} else{
//DO THE PRS 505 CODE HERE
}
Again the only code that changes is what is string between 'PRS500' between the two backslashs "//" in the first line above. The text you replace it with should be within the string returned from running the uname command.