⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test.cp

📁 Garble is a C++ program for transferring data to and from Garmin GPS
💻 CP
字号:
// $Id: test.cp,v 1.1.1.1 2000/02/21 06:17:21 decouto Exp $#include <iostream>#include "../../serial-src/unix/serial.h"#include "garmin_serial_unix.h"#include "garmin_link.h"#include "garmin_application.h"#include "garmin_util.h"intmain(int argc, char **argv) {      garmin_serial gs("/dev/cua0", 750);  garmin::link_layer ll(&gs);  garmin::application_layer al(&ll);  try {    // get product data    garmin::product_data_type pd = al.get_product_data();    cout << "product data: " << pd.product_id 	 << " / " << pd.software_version 	 << " / " << pd.product_description << endl;    // get routes    typedef std::list<garmin::basic_waypt_type> route;    typedef std::list<route> route_list;    route_list *rl = al.get_routes();        for (route_list::iterator rli = rl->begin(); rli != rl->end(); rli++) {      route r = *rli;      for (route::iterator ri = r.begin(); ri != r.end(); ri++) {      garmin::basic_waypt_type wp = *ri;      garmin::degree_type deg_pos = garmin::semicircle2degree(wp.pos);      cout << "waypt " << wp.id << " / " 	   << deg_pos.lat << ", " 	   << deg_pos.lon << " / "	   << wp.comment << endl;      }      cout << endl;    }    // get waypoints    typedef std::vector<garmin::basic_waypt_type> wp_vec;    wp_vec *wv = al.get_waypoints();    for (wp_vec::iterator wvi = wv->begin(); wvi != wv->end(); wvi++) {      garmin::basic_waypt_type wp = *wvi;      garmin::degree_type deg_pos = garmin::semicircle2degree(wp.pos);      cout << "waypt " << wp.id << " / " 	   << deg_pos.lat << ", " 	   << deg_pos.lon << " / "	   << wp.comment << endl;      }  }  catch (garmin::error &ex) {    cerr << "caught exception: " << ex.m_msg << endl;    exit(-1);  }  return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -