23#define MAX_TIME_INTERVAL (5000000)
36 const char* startSentence) :
44 if (testFileFlag == 1) {
52 if (strlen(startSentence) > 0) {
101 printf(
"Serial not detected on reset. Try power cycle.\n");
159 printf(
"fail to read first bit\n");
161 }
else if (charRead == 0) {
177 sprintf(errmsg,
"While syncing (looking for '$', got '%c')",
buffer[0]);
206 }
else if (ret == 0) {
257 printf(
"GPS pos: %f, %f, %f\n",
pos[0],
pos[1],
pos[2]);
309 printf(
"GPS cannot determine position (empty fields). Wait for satellites or reposition GPS.\n");
318 printf(
"Sentence Invalid. Resetting tracker and resyncing.\n");
339 fprintf(stderr,
"calling server main\n");
346 fprintf(stderr,
"status in mainloop is %d\n\n",
status);
351 printf(
"tracker report ready\n",
status);
369 fprintf(stderr,
"Fastrak: cannot write message: tossing\n");
383 fprintf(stderr,
"Tracker Fastrak: No valid connection\n");
417 VRPN_MSG_WARNING(
"Tracking failed, trying to reset (try power cycle if more than 4 attempts made)");
vrpn_Connection * d_connection
Connection that this object talks to.
vrpn_int32 d_sender_id
Sender ID registered with the connection.
void server_mainloop(void)
Handles functions that all servers should provide in their mainloop() (ping/pong, for example) Should...
virtual void mainloop()=0
Called once through each main loop iteration to handle updates. Remote object mainloop() should call ...
Generic connection class not specific to the transport mechanism.
virtual int pack_message(vrpn_uint32 len, struct timeval time, vrpn_int32 type, vrpn_int32 sender, const char *buffer, vrpn_uint32 class_of_service)
Pack a message that will be sent the next time mainloop() is called. Turn off the RELIABLE flag if yo...
vrpn_Tracker_GPS(const char *name, vrpn_Connection *c, const char *port="/dev/ttyS1", long baud=4800, int utmFlag=1, int testFileFlag=0, const char *startStr="RMC")
virtual int get_report(void)
Gets a report if one is available, returns 0 if not, 1 if complete report.
virtual void reset()
Reset the tracker.
unsigned char buffer[VRPN_TRACKER_BUF_SIZE *10]
This function should be called each time through the main loop of the server code....
virtual int encode_to(char *buf)
int register_server_handlers(void)
All types of client/server/peer objects in VRPN should be derived from the vrpn_BaseClass type descri...
const vrpn_uint32 vrpn_CONNECTION_LOW_LATENCY
Header containing macros formerly duplicated in a lot of implementation files.
#define VRPN_MSG_INFO(msg)
#define VRPN_MSG_ERROR(msg)
#define VRPN_MSG_WARNING(msg)
int vrpn_set_rts(int comm)
int vrpn_close_commport(int comm)
int vrpn_flush_input_buffer(int comm)
Throw out any characters within the input buffer.
int vrpn_read_available_characters(int comm, unsigned char *buffer, size_t bytes)
vrpn_Serial: Pulls all the serial port routines into one file to make porting to new operating system...
#define vrpn_gettimeofday
#define VRPN_TRACKER_BUF_SIZE
const int vrpn_TRACKER_FAIL
const int vrpn_TRACKER_RESETTING
const int vrpn_TRACKER_SYNCING
const int vrpn_TRACKER_PARTIAL
const int vrpn_TRACKER_REPORT_READY
const int vrpn_TRACKER_AWAITING_STATION