00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef BRICKLET_GPS_H
00012 #define BRICKLET_GPS_H
00013
00014 #include "ip_connection.h"
00015
00016 #ifdef __cplusplus
00017 extern "C" {
00018 #endif
00019
00029 typedef Device GPS;
00030
00034 #define GPS_FUNCTION_GET_COORDINATES 1
00035
00039 #define GPS_FUNCTION_GET_STATUS 2
00040
00044 #define GPS_FUNCTION_GET_ALTITUDE 3
00045
00049 #define GPS_FUNCTION_GET_MOTION 4
00050
00054 #define GPS_FUNCTION_GET_DATE_TIME 5
00055
00059 #define GPS_FUNCTION_RESTART 6
00060
00064 #define GPS_FUNCTION_SET_COORDINATES_CALLBACK_PERIOD 7
00065
00069 #define GPS_FUNCTION_GET_COORDINATES_CALLBACK_PERIOD 8
00070
00074 #define GPS_FUNCTION_SET_STATUS_CALLBACK_PERIOD 9
00075
00079 #define GPS_FUNCTION_GET_STATUS_CALLBACK_PERIOD 10
00080
00084 #define GPS_FUNCTION_SET_ALTITUDE_CALLBACK_PERIOD 11
00085
00089 #define GPS_FUNCTION_GET_ALTITUDE_CALLBACK_PERIOD 12
00090
00094 #define GPS_FUNCTION_SET_MOTION_CALLBACK_PERIOD 13
00095
00099 #define GPS_FUNCTION_GET_MOTION_CALLBACK_PERIOD 14
00100
00104 #define GPS_FUNCTION_SET_DATE_TIME_CALLBACK_PERIOD 15
00105
00109 #define GPS_FUNCTION_GET_DATE_TIME_CALLBACK_PERIOD 16
00110
00114 #define GPS_FUNCTION_GET_IDENTITY 255
00115
00129 #define GPS_CALLBACK_COORDINATES 17
00130
00143 #define GPS_CALLBACK_STATUS 18
00144
00158 #define GPS_CALLBACK_ALTITUDE 19
00159
00173 #define GPS_CALLBACK_MOTION 20
00174
00187 #define GPS_CALLBACK_DATE_TIME 21
00188
00189
00193 #define GPS_FIX_NO_FIX 1
00194
00198 #define GPS_FIX_2D_FIX 2
00199
00203 #define GPS_FIX_3D_FIX 3
00204
00208 #define GPS_RESTART_TYPE_HOT_START 0
00209
00213 #define GPS_RESTART_TYPE_WARM_START 1
00214
00218 #define GPS_RESTART_TYPE_COLD_START 2
00219
00223 #define GPS_RESTART_TYPE_FACTORY_RESET 3
00224
00234 #define GPS_DEVICE_IDENTIFIER 222
00235
00242 void gps_create(GPS *gps, const char *uid, IPConnection *ipcon);
00243
00250 void gps_destroy(GPS *gps);
00251
00271 int gps_get_response_expected(GPS *gps, uint8_t function_id, bool *ret_response_expected);
00272
00288 int gps_set_response_expected(GPS *gps, uint8_t function_id, bool response_expected);
00289
00296 int gps_set_response_expected_all(GPS *gps, bool response_expected);
00297
00304 void gps_register_callback(GPS *gps, uint8_t id, void *callback, void *user_data);
00305
00312 int gps_get_api_version(GPS *gps, uint8_t ret_api_version[3]);
00313
00336 int gps_get_coordinates(GPS *gps, uint32_t *ret_latitude, char *ret_ns, uint32_t *ret_longitude, char *ret_ew, uint16_t *ret_pdop, uint16_t *ret_hdop, uint16_t *ret_vdop, uint16_t *ret_epe);
00337
00357 int gps_get_status(GPS *gps, uint8_t *ret_fix, uint8_t *ret_satellites_view, uint8_t *ret_satellites_used);
00358
00369 int gps_get_altitude(GPS *gps, uint32_t *ret_altitude, uint32_t *ret_geoidal_separation);
00370
00384 int gps_get_motion(GPS *gps, uint32_t *ret_course, uint32_t *ret_speed);
00385
00394 int gps_get_date_time(GPS *gps, uint32_t *ret_date, uint32_t *ret_time);
00395
00410 int gps_restart(GPS *gps, uint8_t restart_type);
00411
00423 int gps_set_coordinates_callback_period(GPS *gps, uint32_t period);
00424
00430 int gps_get_coordinates_callback_period(GPS *gps, uint32_t *ret_period);
00431
00443 int gps_set_status_callback_period(GPS *gps, uint32_t period);
00444
00450 int gps_get_status_callback_period(GPS *gps, uint32_t *ret_period);
00451
00463 int gps_set_altitude_callback_period(GPS *gps, uint32_t period);
00464
00470 int gps_get_altitude_callback_period(GPS *gps, uint32_t *ret_period);
00471
00483 int gps_set_motion_callback_period(GPS *gps, uint32_t period);
00484
00490 int gps_get_motion_callback_period(GPS *gps, uint32_t *ret_period);
00491
00503 int gps_set_date_time_callback_period(GPS *gps, uint32_t period);
00504
00510 int gps_get_date_time_callback_period(GPS *gps, uint32_t *ret_period);
00511
00524 int gps_get_identity(GPS *gps, char ret_uid[8], char ret_connected_uid[8], char *ret_position, uint8_t ret_hardware_version[3], uint8_t ret_firmware_version[3], uint16_t *ret_device_identifier);
00525
00526 #ifdef __cplusplus
00527 }
00528 #endif
00529
00530 #endif