• R/O
  • SSH
  • HTTPS

qrobosdk: コミット


コミットメタ情報

リビジョン1935 (tree)
日時2010-10-19 19:16:21
作者satofumi

ログメッセージ

changed read write method name

変更サマリ

差分

--- branches/tsukuba_2010/libs/lidar/Urg_driver.cpp (revision 1934)
+++ branches/tsukuba_2010/libs/lidar/Urg_driver.cpp (revision 1935)
@@ -71,6 +71,12 @@
7171 }
7272
7373
74+bool Urg_driver::is_open(void) const
75+{
76+ return pimpl->is_opened_;
77+}
78+
79+
7480 bool Urg_driver::start_measurement(measurement_type_t type,
7581 int scan_times, int skip_scan)
7682 {
@@ -354,22 +360,19 @@
354360 }
355361
356362
357-bool Urg_driver::raw_write(const char* data, size_t data_size)
363+int Urg_driver::raw_write(const char* data, size_t data_size)
358364 {
359- int ret = urg_raw_write(&pimpl->urg_, data, data_size);
360- return (ret < 0) ? false : true;
365+ return urg_raw_write(&pimpl->urg_, data, data_size);
361366 }
362367
363368
364-bool Urg_driver::raw_read(char* data, size_t max_data_size, int timeout)
369+int Urg_driver::raw_read(char* data, size_t max_data_size, int timeout)
365370 {
366- int ret = urg_raw_read(&pimpl->urg_, data, max_data_size, timeout);
367- return (ret < 0) ? false : true;
371+ return urg_raw_read(&pimpl->urg_, data, max_data_size, timeout);
368372 }
369373
370374
371-bool Urg_driver::raw_readline(char* data, size_t max_data_size, int timeout)
375+int Urg_driver::raw_readline(char* data, size_t max_data_size, int timeout)
372376 {
373- int ret = urg_raw_readline(&pimpl->urg_, data, max_data_size, timeout);
374- return (ret < 0) ? false : true;
377+ return urg_raw_readline(&pimpl->urg_, data, max_data_size, timeout);
375378 }
--- branches/tsukuba_2010/libs/lidar/Urg_driver.h (revision 1934)
+++ branches/tsukuba_2010/libs/lidar/Urg_driver.h (revision 1935)
@@ -35,6 +35,7 @@
3535
3636 enum {
3737 Default_baudrate = 115200,
38+ Default_port = 10940,
3839 Infinity_times = -1,
3940 };
4041
@@ -48,6 +49,7 @@
4849 bool open(const char* device_name, long baudrate = Default_baudrate,
4950 connection_type_t type = Serial);
5051 void close(void);
52+ bool is_open(void) const;
5153
5254
5355 // !!! データ取得の開始
@@ -105,9 +107,9 @@
105107 const char* serial_id(void) const;
106108 const char* status(void) const;
107109
108- bool raw_write(const char* data, size_t data_size);
109- bool raw_read(char* data, size_t max_data_size, int timeout);
110- bool raw_readline(char* data, size_t max_data_size, int timeout);
110+ int raw_write(const char* data, size_t data_size);
111+ int raw_read(char* data, size_t max_data_size, int timeout);
112+ int raw_readline(char* data, size_t max_data_size, int timeout);
111113
112114 private:
113115 Urg_driver(const Urg_driver& rhs);
旧リポジトリブラウザで表示