root / branches / library_refactor / projects / libwireless / jni / lib / org_roboticsclub_colony_TokenRing.c @ 1390
History | View | Annotate | Download (3.64 KB)
1 | 940 | rcahoon | #include "org_roboticsclub_colony_TokenRing.h" |
---|---|---|---|
2 | #include "wl_token_ring.h" |
||
3 | |||
4 | /*
|
||
5 | * Class: org_roboticsclub_colony_TokenRing
|
||
6 | * Method: wl_token_ring_register
|
||
7 | * Signature: ()I
|
||
8 | */
|
||
9 | JNIEXPORT jint JNICALL Java_org_roboticsclub_colony_TokenRing_wl_1token_1ring_1register |
||
10 | (JNIEnv *env, jclass class) |
||
11 | { |
||
12 | return wl_token_ring_register();
|
||
13 | } |
||
14 | |||
15 | /*
|
||
16 | * Class: org_roboticsclub_colony_TokenRing
|
||
17 | * Method: wl_token_ring_unregister
|
||
18 | * Signature: ()V
|
||
19 | */
|
||
20 | JNIEXPORT void JNICALL Java_org_roboticsclub_colony_TokenRing_wl_1token_1ring_1unregister
|
||
21 | (JNIEnv *env, jclass class) |
||
22 | { |
||
23 | wl_token_ring_register(); |
||
24 | } |
||
25 | |||
26 | /*
|
||
27 | * Class: org_roboticsclub_colony_TokenRing
|
||
28 | * Method: wl_token_ring_join
|
||
29 | * Signature: ()I
|
||
30 | */
|
||
31 | JNIEXPORT jint JNICALL Java_org_roboticsclub_colony_TokenRing_wl_1token_1ring_1join |
||
32 | (JNIEnv *env, jclass class) |
||
33 | { |
||
34 | return wl_token_ring_join();
|
||
35 | } |
||
36 | |||
37 | /*
|
||
38 | * Class: org_roboticsclub_colony_TokenRing
|
||
39 | * Method: wl_token_ring_leave
|
||
40 | * Signature: ()V
|
||
41 | */
|
||
42 | JNIEXPORT void JNICALL Java_org_roboticsclub_colony_TokenRing_wl_1token_1ring_1leave
|
||
43 | (JNIEnv *env, jclass class) |
||
44 | { |
||
45 | wl_token_ring_leave(); |
||
46 | } |
||
47 | |||
48 | /*
|
||
49 | * Class: org_roboticsclub_colony_TokenRing
|
||
50 | * Method: wl_token_get_robots_in_ring
|
||
51 | * Signature: ()I
|
||
52 | */
|
||
53 | JNIEXPORT jint JNICALL Java_org_roboticsclub_colony_TokenRing_wl_1token_1get_1robots_1in_1ring |
||
54 | (JNIEnv *env, jclass class) |
||
55 | { |
||
56 | return wl_token_get_robots_in_ring();
|
||
57 | } |
||
58 | |||
59 | /*
|
||
60 | * Class: org_roboticsclub_colony_TokenRing
|
||
61 | * Method: wl_token_is_robot_in_ring
|
||
62 | * Signature: (I)I
|
||
63 | */
|
||
64 | JNIEXPORT jint JNICALL Java_org_roboticsclub_colony_TokenRing_wl_1token_1is_1robot_1in_1ring |
||
65 | (JNIEnv *env, jclass class, jint robot) |
||
66 | { |
||
67 | return wl_token_is_robot_in_ring((int)robot); |
||
68 | } |
||
69 | |||
70 | /*
|
||
71 | * Class: org_roboticsclub_colony_TokenRing
|
||
72 | * Method: wl_token_iterator_begin
|
||
73 | * Signature: ()V
|
||
74 | */
|
||
75 | JNIEXPORT void JNICALL Java_org_roboticsclub_colony_TokenRing_wl_1token_1iterator_1begin
|
||
76 | (JNIEnv *env, jclass class) |
||
77 | { |
||
78 | wl_token_iterator_begin(); |
||
79 | } |
||
80 | |||
81 | /*
|
||
82 | * Class: org_roboticsclub_colony_TokenRing
|
||
83 | * Method: wl_token_iterator_has_next
|
||
84 | * Signature: ()I
|
||
85 | */
|
||
86 | JNIEXPORT jint JNICALL Java_org_roboticsclub_colony_TokenRing_wl_1token_1iterator_1has_1next |
||
87 | (JNIEnv *env, jclass class) |
||
88 | { |
||
89 | return wl_token_iterator_has_next();
|
||
90 | } |
||
91 | |||
92 | /*
|
||
93 | * Class: org_roboticsclub_colony_TokenRing
|
||
94 | * Method: wl_token_iterator_next
|
||
95 | * Signature: ()I
|
||
96 | */
|
||
97 | JNIEXPORT jint JNICALL Java_org_roboticsclub_colony_TokenRing_wl_1token_1iterator_1next |
||
98 | (JNIEnv *env, jclass class) |
||
99 | { |
||
100 | return wl_token_iterator_next();
|
||
101 | } |
||
102 | |||
103 | /*
|
||
104 | * Class: org_roboticsclub_colony_TokenRing
|
||
105 | * Method: wl_token_get_sensor_reading
|
||
106 | * Signature: (II)I
|
||
107 | */
|
||
108 | JNIEXPORT jint JNICALL Java_org_roboticsclub_colony_TokenRing_wl_1token_1get_1sensor_1reading |
||
109 | (JNIEnv *env, jclass class, jint source, jint dest) |
||
110 | { |
||
111 | return wl_token_get_sensor_reading((int)source, (int)dest); |
||
112 | } |
||
113 | |||
114 | /*
|
||
115 | * Class: org_roboticsclub_colony_TokenRing
|
||
116 | * Method: wl_token_get_my_sensor_reading
|
||
117 | * Signature: (I)I
|
||
118 | */
|
||
119 | JNIEXPORT jint JNICALL Java_org_roboticsclub_colony_TokenRing_wl_1token_1get_1my_1sensor_1reading |
||
120 | (JNIEnv *env, jclass class, jint dest) |
||
121 | { |
||
122 | return wl_token_get_my_sensor_reading(dest);
|
||
123 | } |
||
124 | |||
125 | /*
|
||
126 | * Class: org_roboticsclub_colony_TokenRing
|
||
127 | * Method: wl_token_get_num_robots
|
||
128 | * Signature: ()I
|
||
129 | */
|
||
130 | JNIEXPORT jint JNICALL Java_org_roboticsclub_colony_TokenRing_wl_1token_1get_1num_1robots |
||
131 | (JNIEnv *env, jclass class) |
||
132 | { |
||
133 | return wl_token_get_num_robots();
|
||
134 | } |
||
135 | |||
136 | /*
|
||
137 | * Class: org_roboticsclub_colony_TokenRing
|
||
138 | * Method: wl_token_get_matrix_size
|
||
139 | * Signature: ()I
|
||
140 | */
|
||
141 | JNIEXPORT jint JNICALL Java_org_roboticsclub_colony_TokenRing_wl_1token_1get_1matrix_1size |
||
142 | (JNIEnv *env, jclass class) |
||
143 | { |
||
144 | return wl_token_get_matrix_size();
|
||
145 | } |