I need a simple C function :
uint8_t r[16] = ...;
int fab(uint8_t *r)
this functions open a external script (like a python script), wait until it finish, parse 3 variables from the output (stdout) and if everything is ok returns 0 , else 1.
the python script returns this output:
Testing ... ... ... INNI:XXXXXXXXXXXXXXX
NSSS:XXXXXXXX
KB:XXXXXXXXXXXXXXXX
These are the parameters needed to be parsed from the output :
p1 : between "INNI:" and "\n", 15 chars in hex to be return as : uint8_t inni[16]
p2 : between "NSSS:" and "\n", 8 chars in hex to be return as : uint8_t nsss[4]
p3 : between "KB:" and "\n", 16 chars in hex to be return as : uint8_t kb[8]
so the function is like this :
int fab(uint8_t *r) {
var stdout = ExecPythonScriptAndWaitUntilItFinish("python [login to view URL] -g -h " + r);
inni = parse(stdout);
nsss = parse(stdout);
kb = parse(stdout);
returns 0;
}
I need this quick.