phidgets_native 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. data/Gemfile +3 -0
  2. data/Gemfile.lock +12 -0
  3. data/README.rdoc +176 -0
  4. data/Rakefile +31 -0
  5. data/examples/gps.rb +25 -0
  6. data/examples/interface_kit.rb +61 -0
  7. data/examples/lib/common.rb +51 -0
  8. data/examples/lib/console_table.rb +38 -0
  9. data/examples/list_all.rb +16 -0
  10. data/examples/spatial.rb +53 -0
  11. data/ext/phidgets_native/accelerometer_ruby.c +36 -0
  12. data/ext/phidgets_native/advancedservo_ruby.c +33 -0
  13. data/ext/phidgets_native/analog_ruby.c +34 -0
  14. data/ext/phidgets_native/bridge_ruby.c +32 -0
  15. data/ext/phidgets_native/device.c +68 -0
  16. data/ext/phidgets_native/device_ruby.c +404 -0
  17. data/ext/phidgets_native/encoder_ruby.c +34 -0
  18. data/ext/phidgets_native/extconf.rb +18 -0
  19. data/ext/phidgets_native/frequencycounter_ruby.c +32 -0
  20. data/ext/phidgets_native/gps.c +102 -0
  21. data/ext/phidgets_native/gps_ruby.c +212 -0
  22. data/ext/phidgets_native/interfacekit.c +203 -0
  23. data/ext/phidgets_native/interfacekit_ruby.c +507 -0
  24. data/ext/phidgets_native/ir_ruby.c +33 -0
  25. data/ext/phidgets_native/led_ruby.c +33 -0
  26. data/ext/phidgets_native/motorcontrol_ruby.c +32 -0
  27. data/ext/phidgets_native/phidgets_native.c +197 -0
  28. data/ext/phidgets_native/phidgets_native.h +320 -0
  29. data/ext/phidgets_native/phidgets_native_ruby.c +468 -0
  30. data/ext/phidgets_native/phsensor_ruby.c +32 -0
  31. data/ext/phidgets_native/rfid_ruby.c +31 -0
  32. data/ext/phidgets_native/servo_ruby.c +31 -0
  33. data/ext/phidgets_native/spatial.c +168 -0
  34. data/ext/phidgets_native/spatial_ruby.c +533 -0
  35. data/ext/phidgets_native/stepper_ruby.c +32 -0
  36. data/ext/phidgets_native/temperaturesensor_ruby.c +31 -0
  37. data/ext/phidgets_native/textlcd_ruby.c +31 -0
  38. data/ext/phidgets_native/textled_ruby.c +31 -0
  39. data/ext/phidgets_native/weightsensor_ruby.c +32 -0
  40. data/phidgets_native.gemspec +21 -0
  41. metadata +96 -0
@@ -0,0 +1,197 @@
1
+ #include "phidgets_native.h"
2
+
3
+ /* This converts an array of doubles into a ruby array of numbers, or into
4
+ * nil for the case of an invalid dbl_array
5
+ */
6
+ VALUE double_array_to_rb(double *dbl_array, int length) {
7
+ if (!dbl_array) return Qnil;
8
+ VALUE rb_ary = rb_ary_new2(length);
9
+ for(int i=0; i<length; i++) rb_ary_store(rb_ary, i, DBL2NUM(dbl_array[i]));
10
+ return rb_ary;
11
+ }
12
+
13
+ /* This converts an array of ints into a ruby array of fixnums, or into
14
+ * nil for the case of an invalid int_array
15
+ */
16
+ VALUE int_array_to_rb(int *int_array, int length) {
17
+ if (!int_array) return Qnil;
18
+ VALUE rb_ary = rb_ary_new2(length);
19
+ for(int i=0; i<length; i++) rb_ary_store(rb_ary, i, INT2NUM(int_array[i]));
20
+ return rb_ary;
21
+ }
22
+
23
+ /* This converts an array of ints into a ruby array of fixnums. If an element
24
+ * of the array is 0, this converts to Qnil. nil is returned for the case of an
25
+ * invalid int_array.
26
+ */
27
+ VALUE int_array_zeronils_to_rb(int *int_array, int length) {
28
+ if (!int_array) return Qnil;
29
+ VALUE rb_ary = rb_ary_new2(length);
30
+ for(int i=0; i<length; i++)
31
+ rb_ary_store(rb_ary, i, (int_array[i] == 0) ? Qnil : INT2NUM(int_array[i]));
32
+ return rb_ary;
33
+ }
34
+
35
+ /* This converts an array of phidget bools into a ruby array of booleans. If an
36
+ * element of the array is 0, this converts to Qnil. nil is returned for the case
37
+ * of an invalid bool_array.
38
+ */
39
+ VALUE phidgetbool_array_to_rb(int *bool_array, int length) {
40
+ if (!bool_array) return Qnil;
41
+ VALUE rb_ary = rb_ary_new2(length);
42
+ for(int i=0; i<length; i++)
43
+ rb_ary_store(rb_ary, i, (bool_array[i] == PTRUE) ? Qtrue : Qfalse);
44
+ return rb_ary;
45
+ }
46
+
47
+ // The name is ambiguous, but the main purpose here is dry things out a bit
48
+ // and let us do a better job of reporting errors to ruby
49
+ int ensure(int result) {
50
+ if ( result == EPHIDGET_OK ) return 0;
51
+
52
+ const char *exception_name;
53
+
54
+ switch(result) {
55
+ case EPHIDGET_NOTFOUND:
56
+ exception_name = "NotFoundError";
57
+ break;
58
+ case EPHIDGET_NOMEMORY:
59
+ exception_name = "NoMemoryError";
60
+ break;
61
+ case EPHIDGET_UNEXPECTED:
62
+ exception_name = "UnexpectedError";
63
+ break;
64
+ case EPHIDGET_INVALIDARG:
65
+ exception_name = "InvalidArgError";
66
+ break;
67
+ case EPHIDGET_NOTATTACHED:
68
+ exception_name = "NotAttachedError";
69
+ break;
70
+ case EPHIDGET_INTERRUPTED:
71
+ exception_name = "InterruptedError";
72
+ break;
73
+ case EPHIDGET_INVALID:
74
+ exception_name = "InvalidError";
75
+ break;
76
+ case EPHIDGET_NETWORK:
77
+ exception_name = "NetworkError";
78
+ break;
79
+ case EPHIDGET_UNKNOWNVAL:
80
+ exception_name = "UnknownValError";
81
+ break;
82
+ case EPHIDGET_BADPASSWORD:
83
+ exception_name = "BadPasswordError";
84
+ break;
85
+ case EPHIDGET_UNSUPPORTED:
86
+ exception_name = "UnsupportedError";
87
+ break;
88
+ case EPHIDGET_DUPLICATE:
89
+ exception_name = "DuplicateError";
90
+ break;
91
+ case EPHIDGET_TIMEOUT:
92
+ exception_name = "TimeoutError";
93
+ break;
94
+ case EPHIDGET_OUTOFBOUNDS:
95
+ exception_name = "OutOfBoundsError";
96
+ break;
97
+ case EPHIDGET_EVENT:
98
+ exception_name = "EventError";
99
+ break;
100
+ case EPHIDGET_NETWORK_NOTCONNECTED:
101
+ exception_name = "NetworkNotConnectedError";
102
+ break;
103
+ case EPHIDGET_WRONGDEVICE:
104
+ exception_name = "WrongDeviceError";
105
+ break;
106
+ case EPHIDGET_CLOSED:
107
+ exception_name = "ClosedError";
108
+ break;
109
+ case EPHIDGET_BADVERSION:
110
+ exception_name = "BadVersionError";
111
+ break;
112
+ default:
113
+ exception_name = "UnhandledError";
114
+ break;
115
+ }
116
+
117
+ const char *description;
118
+ CPhidget_getErrorDescription(result, &description);
119
+
120
+ VALUE m_Phidget = rb_const_get(rb_cObject, rb_intern("PhidgetsNative"));
121
+ VALUE c_Exception = rb_const_get(m_Phidget, rb_intern(exception_name));
122
+
123
+ rb_raise(c_Exception, "%s", description);
124
+
125
+ return result;
126
+ }
127
+
128
+ // The name is ambiguous, but the main purpose here is dry things out a bit
129
+ // and let us do a better job of reporting errors albeit not halting.
130
+ // This is necessary in the threaded callbacks where access to the interpreter
131
+ // is unavailable:
132
+ int report(int result) {
133
+ if (result == EPHIDGET_OK) return result;
134
+
135
+ const char *description;
136
+ CPhidget_getErrorDescription(result, &description);
137
+
138
+ CPhidget_log(PHIDGET_LOG_ERROR, "N/A", "PhidgetNative report error: %s", description);
139
+
140
+ return result;
141
+ }
142
+
143
+ SampleRate *sample_create() {
144
+ SampleRate *ret = ALLOC(SampleRate);
145
+ if (ret)
146
+ sample_zero(ret);
147
+
148
+ return ret;
149
+ }
150
+
151
+ int sample_zero(SampleRate *sample_rate) {
152
+ memset(sample_rate, 0, sizeof(SampleRate));
153
+
154
+ return 0;
155
+ }
156
+
157
+ int sample_free(SampleRate *sample_rate) {
158
+ xfree(sample_rate);
159
+ sample_rate = 0;
160
+ return 0;
161
+ }
162
+
163
+ /*
164
+ * The first time this is called, we're a little inadequate. Mostly this is because
165
+ * we're not including microseconds. If we included microseconds, then we could
166
+ * process a block if the seconds component were different than the last, and our
167
+ * microseconds were greater than the starting microsecond amount.
168
+ */
169
+ int sample_tick(SampleRate *sample_rate, CPhidget_Timestamp *ts) {
170
+ unsigned long now_seconds;
171
+
172
+ sample_rate->samples_in_second++;
173
+
174
+ if (ts == NULL) {
175
+ // We can pull this ourself using the system times:
176
+ struct timeval now;
177
+ gettimeofday(&now, NULL);
178
+
179
+ now_seconds = (unsigned long) now.tv_sec;
180
+ } else
181
+ // Seems like the module has a timestamp for us to use:
182
+ now_seconds = (unsigned long) ts->seconds;
183
+
184
+ // Sample tracking
185
+ // We need the > 0 for the case of the first time we've ever entered this loop
186
+ if (sample_rate->last_second == 0)
187
+ sample_rate->last_second = now_seconds;
188
+ else if (sample_rate->last_second != now_seconds ) {
189
+ sample_rate->in_hz = (double)sample_rate->samples_in_second /
190
+ (double) (now_seconds -sample_rate->last_second);
191
+ sample_rate->samples_in_second = 0;
192
+ sample_rate->last_second = now_seconds;
193
+ }
194
+
195
+ return 0;
196
+ }
197
+
@@ -0,0 +1,320 @@
1
+ #include <stdio.h>
2
+ #include <stdbool.h>
3
+ #include <math.h>
4
+ #include <time.h>
5
+ #include <unistd.h>
6
+
7
+ #include <ruby.h>
8
+ #include <phidget21.h>
9
+
10
+ // We needed a define here since some compilers won't let you set an array size
11
+ // via a const.
12
+ #define COMPASS_CORRECTION_LENGTH 13
13
+
14
+ static double const MICROSECONDS_IN_SECOND = 1000000.0;
15
+ static int const DEGREES_IN_CIRCLE = 360;
16
+ static int const DEFAULT_SPATIAL_DATA_RATE = 16;
17
+
18
+ // Make sure one of these is non-zero and the other is 0
19
+ static int const DEFAULT_INTERFACEKIT_DATA_RATE = 8;
20
+ static int const DEFAULT_INTERFACEKIT_CHANGE_TRIGGER = 0;
21
+ // /Make-sure
22
+
23
+ // 50 milliseconds:
24
+ static int const INTERFACEKIT_RATIOMETRIC_RESET_USECS = 50000;
25
+
26
+ typedef struct sample_rate {
27
+ int in_hz; // This is really the finished product
28
+ int samples_in_second; // A counter which resets when the second changes
29
+
30
+ // This is used for calculating the deltas
31
+ unsigned long last_second;
32
+ } SampleRate;
33
+
34
+ typedef struct phidget_info {
35
+ CPhidgetHandle handle;
36
+ int serial;
37
+ const char *type;
38
+ const char *name;
39
+ const char *label;
40
+ int version;
41
+ CPhidget_DeviceClass device_class;
42
+ CPhidget_DeviceID device_id;
43
+
44
+ // Attachment Tracking:
45
+ bool is_attached;
46
+
47
+ // This is expressed in the number of seconds and microseconds since the epoch:
48
+ struct timeval attached_at;
49
+ struct timezone attached_at_tz;
50
+
51
+ // Used by the device drivers to track state:
52
+ void *type_info;
53
+
54
+ // Event Handlers
55
+ int (*on_type_attach)(CPhidgetHandle phid, void *userptr);
56
+ int (*on_type_detach)(CPhidgetHandle phid, void *userptr);
57
+ void (*on_type_free)(void *type_info);
58
+
59
+ } PhidgetInfo;
60
+
61
+ typedef struct spatial_info {
62
+ // Compass Correction Params:
63
+ bool is_compass_correction_known;
64
+ double compass_correction[COMPASS_CORRECTION_LENGTH];
65
+
66
+ SampleRate *sample_rate;
67
+
68
+ // Poll interval
69
+ int data_rate;
70
+
71
+ // Device limits:
72
+ int accelerometer_axes;
73
+ int compass_axes;
74
+ int gyro_axes;
75
+ int data_rate_max;
76
+ int data_rate_min;
77
+ double *acceleration_min;
78
+ double *acceleration_max;
79
+ double *compass_min;
80
+ double *compass_max;
81
+ double *gyroscope_min;
82
+ double *gyroscope_max;
83
+
84
+ // Runtime Values
85
+ bool is_acceleration_known;
86
+ double *acceleration;
87
+
88
+ bool is_compass_known;
89
+ double *compass;
90
+
91
+ bool is_gyroscope_known;
92
+ double *gyroscope;
93
+
94
+ // This is used by the gyro:
95
+ double last_microsecond;
96
+ } SpatialInfo;
97
+
98
+ typedef struct gps_info {
99
+ SampleRate *sample_rate;
100
+
101
+ bool is_fixed;
102
+
103
+ bool is_latitude_known;
104
+ double latitude;
105
+
106
+ bool is_longitude_known;
107
+ double longitude;
108
+
109
+ bool is_altitude_known;
110
+ double altitude;
111
+
112
+ bool is_heading_known;
113
+ double heading;
114
+
115
+ bool is_velocity_known;
116
+ double velocity;
117
+
118
+ bool is_now_at_utc_known;
119
+ struct tm now_at_utc;
120
+ short now_at_utc_ms;
121
+
122
+ } GpsInfo;
123
+
124
+ typedef struct interfacekit_info {
125
+ // For the inputs:
126
+ SampleRate *analog_sample_rates;
127
+ SampleRate *digital_sample_rates;
128
+
129
+ bool is_digital_input_count_known;
130
+ int digital_input_count;
131
+
132
+ bool is_digital_output_count_known;
133
+ int digital_output_count;
134
+
135
+ bool is_analog_input_count_known;
136
+ int analog_input_count;
137
+
138
+ // This is kind of a weird thing to track, probably it will never be needed.
139
+ // I use it to determine whether the input counts have changed between device
140
+ // plug events.
141
+ int analog_input_count_prior;
142
+
143
+ bool is_ratiometric;
144
+ int rationmetric_changed_usec;
145
+
146
+
147
+ // This flag works for all of the below properties
148
+ bool is_data_rates_known;
149
+ int *data_rates_max;
150
+ int *data_rates_min;
151
+ int *sensor_change_triggers;
152
+ int *data_rates;
153
+ // /is_data_rates_known
154
+
155
+ int *digital_input_states;
156
+ int *digital_output_states;
157
+ int *analog_input_states;
158
+
159
+ } InterfaceKitInfo;
160
+
161
+ void Init_phidgets_native();
162
+ void Init_phidgets_native_module();
163
+ void Init_phidgets_native_device(VALUE m_Phidget);
164
+ void Init_phidgets_native_accelerometer(VALUE m_Phidget);
165
+ void Init_phidgets_native_advancedservo(VALUE m_Phidget);
166
+ void Init_phidgets_native_analog(VALUE m_Phidget);
167
+ void Init_phidgets_native_bridge(VALUE m_Phidget);
168
+ void Init_phidgets_native_encoder(VALUE m_Phidget);
169
+ void Init_phidgets_native_frequencycounter(VALUE m_Phidget);
170
+ void Init_phidgets_native_gps(VALUE m_Phidget);
171
+ void Init_phidgets_native_interfacekit(VALUE m_Phidget);
172
+ void Init_phidgets_native_ir(VALUE m_Phidget);
173
+ void Init_phidgets_native_led(VALUE m_Phidget);
174
+ void Init_phidgets_native_motorcontrol(VALUE m_Phidget);
175
+ void Init_phidgets_native_phsensor(VALUE m_Phidget);
176
+ void Init_phidgets_native_rfid(VALUE m_Phidget);
177
+ void Init_phidgets_native_servo(VALUE m_Phidget);
178
+ void Init_phidgets_native_spatial(VALUE m_Phidget);
179
+ void Init_phidgets_native_stepper(VALUE m_Phidget);
180
+ void Init_phidgets_native_temperaturesensor(VALUE m_Phidget);
181
+ void Init_phidgets_native_textlcd(VALUE m_Phidget);
182
+ void Init_phidgets_native_textled(VALUE m_Phidget);
183
+ void Init_phidgets_native_weightsensor(VALUE m_Phidget);
184
+
185
+ // Common:
186
+ VALUE double_array_to_rb(double *dbl_array, int length);
187
+ VALUE int_array_to_rb(int *int_array, int length);
188
+ VALUE int_array_zeronils_to_rb(int *int_array, int length);
189
+ VALUE phidgetbool_array_to_rb(int *bool_array, int length);
190
+ int ensure(int result);
191
+ int report(int result);
192
+ SampleRate *sample_create();
193
+ int sample_free(SampleRate *sample_rate);
194
+ int sample_zero(SampleRate *sample_rate);
195
+ int sample_tick(SampleRate *sample_rate, CPhidget_Timestamp *ts);
196
+
197
+ // Phidget Module
198
+ VALUE phidget_enable_logging(int argc, VALUE *argv, VALUE class);
199
+ VALUE phidget_disable_logging(VALUE class);
200
+ VALUE phidget_log(VALUE class, VALUE log_level, VALUE message);
201
+ VALUE phidget_all(VALUE class);
202
+
203
+ // Phidget::Device
204
+ PhidgetInfo *device_info(VALUE self);
205
+ void *device_type_info(VALUE self);
206
+ void device_free(PhidgetInfo *info);
207
+ int CCONV device_on_attach(CPhidgetHandle phid, void *userptr);
208
+ int CCONV device_on_detach(CPhidgetHandle phid, void *userptr);
209
+ int CCONV device_on_error(CPhidgetHandle phid, void *userptr, int ErrorCode, const char *unknown);
210
+
211
+ VALUE device_allocate(VALUE class);
212
+ VALUE device_initialize(VALUE self, VALUE serial);
213
+ VALUE device_close(VALUE self);
214
+ VALUE device_wait_for_attachment(VALUE self, VALUE timeout);
215
+ VALUE device_is_attached(VALUE self);
216
+ VALUE device_device_class(VALUE self);
217
+ VALUE device_device_id(VALUE self);
218
+ VALUE device_type(VALUE self);
219
+ VALUE device_name(VALUE self);
220
+ VALUE device_label(VALUE self);
221
+ VALUE device_serial_number(VALUE self);
222
+ VALUE device_version(VALUE self);
223
+
224
+ // Phidget::Spatial
225
+ void spatial_on_free(void *type_info);
226
+ int CCONV spatial_on_attach(CPhidgetHandle phid, void *userptr);
227
+ int CCONV spatial_on_detach(CPhidgetHandle phid, void *userptr);
228
+ int CCONV spatial_on_data(CPhidgetSpatialHandle spatial, void *userptr, CPhidgetSpatial_SpatialEventDataHandle *data, int count);
229
+ int spatial_set_compass_correction_by_array(CPhidgetSpatialHandle phid, double *correction);
230
+ VALUE spatial_initialize(VALUE self, VALUE serial);
231
+ VALUE spatial_close(VALUE self);
232
+ VALUE spatial_sample_rate(VALUE self);
233
+ VALUE spatial_accelerometer_axes(VALUE self);
234
+ VALUE spatial_compass_axes(VALUE self);
235
+ VALUE spatial_gyro_axes(VALUE self);
236
+
237
+ VALUE spatial_accelerometer_min(VALUE self);
238
+ VALUE spatial_accelerometer_max(VALUE self);
239
+ VALUE spatial_compass_min(VALUE self);
240
+ VALUE spatial_compass_max(VALUE self);
241
+ VALUE spatial_gyro_min(VALUE self);
242
+ VALUE spatial_gyro_max(VALUE self);
243
+
244
+ VALUE spatial_accelerometer(VALUE self);
245
+ VALUE spatial_compass(VALUE self);
246
+ VALUE spatial_gyro(VALUE self);
247
+
248
+ VALUE spatial_zero_gyro(VALUE self);
249
+ VALUE spatial_compass_correction_set(VALUE self, VALUE compass_correction);
250
+ VALUE spatial_compass_correction_get(VALUE self);
251
+ VALUE spatial_reset_compass_correction(VALUE self);
252
+
253
+ VALUE spatial_data_rate_min(VALUE self);
254
+ VALUE spatial_data_rate_max(VALUE self);
255
+ VALUE spatial_data_rate_set(VALUE self, VALUE data_rate);
256
+ VALUE spatial_data_rate_get(VALUE self);
257
+
258
+ // Phidget::InterfaceKit
259
+ void interfacekit_on_free(void *type_info);
260
+ int CCONV interfacekit_on_attach(CPhidgetHandle phid, void *userptr);
261
+ int CCONV interfacekit_on_detach(CPhidgetHandle phid, void *userptr);
262
+ int interfacekit_on_digital_change(CPhidgetInterfaceKitHandle interfacekit, void *userptr, int index, int inputState);
263
+ int interfacekit_on_analog_change(CPhidgetInterfaceKitHandle interfacekit, void *userptr, int index, int sensorValue);
264
+ int interfacekit_assert_ratiometric_state(PhidgetInfo *info);
265
+ VALUE interfacekit_initialize(VALUE self, VALUE serial);
266
+ VALUE interfacekit_close(VALUE self);
267
+ VALUE interfacekit_sensor_sample_rates(VALUE self);
268
+ VALUE interfacekit_input_sample_rates(VALUE self);
269
+ VALUE interfacekit_input_count(VALUE self);
270
+ VALUE interfacekit_output_count(VALUE self);
271
+ VALUE interfacekit_sensor_count(VALUE self);
272
+ VALUE interfacekit_is_ratiometric(VALUE self);
273
+ VALUE interfacekit_ratiometric_set(VALUE self, VALUE is_ratiometric);
274
+ VALUE interfacekit_data_rates_max(VALUE self);
275
+ VALUE interfacekit_data_rates_min(VALUE self);
276
+ VALUE interfacekit_data_rates(VALUE self);
277
+ VALUE interfacekit_change_triggers(VALUE self);
278
+ VALUE interfacekit_inputs(VALUE self);
279
+ VALUE interfacekit_outputs(VALUE self);
280
+ VALUE interfacekit_sensors(VALUE self);
281
+ VALUE interfacekit_sensor_raw(VALUE self, VALUE index);
282
+ VALUE interfacekit_output_set(VALUE self, VALUE index, VALUE is_on);
283
+ VALUE interfacekit_data_rate_set(VALUE self, VALUE index, VALUE rate);
284
+ VALUE interfacekit_change_trigger_set(VALUE self, VALUE index, VALUE rate_thresh);
285
+
286
+ // Phidget::Gps
287
+ void gps_on_free(void *type_info);
288
+ int CCONV gps_on_attach(CPhidgetHandle phid, void *userptr);
289
+ int CCONV gps_on_detach(CPhidgetHandle phidget, void *userptr);
290
+ int CCONV gps_on_position_change(CPhidgetGPSHandle gps, void *userptr, double latitude, double longitude, double altitude);
291
+ int CCONV gps_on_fix_change(CPhidgetGPSHandle gps, void *userptr, int status);
292
+ VALUE gps_initialize(VALUE self, VALUE serial);
293
+ VALUE gps_close(VALUE self);
294
+ VALUE gps_sample_rate(VALUE self);
295
+ VALUE gps_latitude(VALUE self);
296
+ VALUE gps_longitude(VALUE self);
297
+ VALUE gps_altitude(VALUE self);
298
+ VALUE gps_heading(VALUE self);
299
+ VALUE gps_velocity(VALUE self);
300
+ VALUE gps_is_fixed(VALUE self);
301
+ VALUE gps_now_at_utc(VALUE self);
302
+
303
+ // Stub initializers:
304
+ VALUE accelerometer_initialize(VALUE self, VALUE serial);
305
+ VALUE advancedservo_initialize(VALUE self, VALUE serial);
306
+ VALUE encoder_initialize(VALUE self, VALUE serial);
307
+ VALUE ir_initialize(VALUE self, VALUE serial);
308
+ VALUE led_initialize(VALUE self, VALUE serial);
309
+ VALUE motorcontrol_initialize(VALUE self, VALUE serial);
310
+ VALUE phsensor_initialize(VALUE self, VALUE serial);
311
+ VALUE rfid_initialize(VALUE self, VALUE serial);
312
+ VALUE servo_initialize(VALUE self, VALUE serial);
313
+ VALUE stepper_initialize(VALUE self, VALUE serial);
314
+ VALUE temperaturesensor_initialize(VALUE self, VALUE serial);
315
+ VALUE textlcd_initialize(VALUE self, VALUE serial);
316
+ VALUE textled_initialize(VALUE self, VALUE serial);
317
+ VALUE weightsensor_initialize(VALUE self, VALUE serial);
318
+ VALUE analog_initialize(VALUE self, VALUE serial);
319
+ VALUE bridge_initialize(VALUE self, VALUE serial);
320
+ VALUE frequencycounter_initialize(VALUE self, VALUE serial);