blob: 6a6d8e253dfa2df459f32f81784e937b37f0363b
1 | #define LOG_TAG "Tv-JNI" |
2 | |
3 | #include <utils/Log.h> |
4 | #include <include/Tv.h> |
5 | #include <binder/IMemory.h> |
6 | #include <binder/Parcel.h> |
7 | |
8 | using namespace android; |
9 | |
10 | |
11 | void usage(char *processname) |
12 | { |
13 | fprintf(stderr, "Usage: %s <cmd num> [arg1]... [argn]\n", processname); |
14 | return; |
15 | } |
16 | |
17 | |
18 | int main(int argc, char **argv) |
19 | { |
20 | if (argc < 2) |
21 | usage(argv[0]); |
22 | sp<Tv> tv = Tv::connect(); |
23 | int cmd = atoi(argv[1]); |
24 | int arg1 = atoi(argv[2]); |
25 | //send cmd |
26 | Parcel p, r; |
27 | p.writeInt32(cmd); |
28 | p.writeInt32(arg1); |
29 | tv->processCmd(p, &r); |
30 | //exit |
31 | tv.clear(); |
32 | return 0; |
33 | } |
34 |