]> rtime.felk.cvut.cz Git - eurobot/public.git/blob - src/lidars/hokuyo/lib/scip_handler.h
Create LIDAR lib for hadling both rangefinders - SICK and Hokuyo
[eurobot/public.git] / src / lidars / hokuyo / lib / scip_handler.h
1 #ifndef QRK_C_SCIP_HANDLER_H
2 #define QRK_C_SCIP_HANDLER_H
3
4 /*!
5   \file
6   \brief Process SKIP commands
7
8   \author Satofumi KAMIMURA
9
10   $Id: scip_handler.h 1714 2010-02-21 20:53:28Z satofumi $
11 */
12
13 #include "urg_parameter_t.h"
14 #include "serial_t.h"
15
16
17 enum {
18   ScipNoWaitReply = 0,          /*!< Dont wait for reply */
19   ScipWaitReply = 1,            /*!< Wait for reply */
20   ScipLineWidth = 64 + 1 + 1,   /*!< Maximum length of one line */
21 };
22
23
24 /*!
25   \brief Send command
26
27   \param[out] serial Structure of serial control
28   \param[in] send_command Command to be sent
29
30   \retval 0 Normal
31   \retval < 0 Error
32 */
33 extern int scip_send(serial_t *serial, const char *send_command);
34
35
36 /*!
37   \brief Receive command response
38
39   Store the response of the command if "ret" value is zero.\n
40
41   When the command response is included in expected_ret, the return value of this function becomes 0 (normality).
42
43   \param[out] serial Structure of serial control
44   \param[out] return_code Return value
45   \param[in] expected_ret Return value considered to be normal
46   \param[in] timeout Time out [msec]
47
48   \retval 0 Normal
49   \retval < 0 Error
50 */
51 extern int scip_recv(serial_t *serial, const char *command_first,
52                      int* return_code, int expected_ret[],
53                      int timeout);
54
55
56 /*!
57   \brief Transit to SCIP2.0 mode
58
59   Return 0(Normal) when changed to SCIP2.0 mode
60
61   \param[in,out] serial Structure of serial control
62
63   \retval 0 Normal
64   \retval < 0 Error
65 */
66 extern int scip_scip20(serial_t *serial);
67
68
69 /*!
70   \brief Stop measurement and turn off the laser.
71
72   If the purpose is to stop MD, then send QT command without waiting for the response from MD command.
73   Process the response of QT in urg_receiveData()
74
75   \param[in,out] serial Structure of serial control
76   \param[in] return_code Response from QT command
77   \param[in] wait_reply ScipNoWaitReply when response is not waited. ScipWaitReply when response is waited.
78
79   \retval 0 Normal
80   \retval < 0 Error
81 */
82 extern int scip_qt(serial_t *serial, int *return_code, int wait_reply);
83
84
85 /*!
86   \brief Get Parameter information
87
88   \param[in,out] serial Structure of serial control
89   \param[out] parameters urg_parameter_t Structure member
90
91   \retval 0 Normal
92   \retval < 0 Error
93
94 */
95 extern int scip_pp(serial_t *serial, urg_parameter_t *parameters);
96
97
98 /*!
99   \brief Get version information
100
101   \param[in,out] serial Structure of serial control
102   \param[out] lines Storage location of characters containing version information.
103   \param[in] lines_max Maximum number of character string
104
105   \retval 0 Normal
106   \retval < 0 Error
107 */
108 extern int scip_vv(serial_t *serial, char *lines[], int lines_max);
109
110
111 /*!
112   \brief Change baudrate
113
114   \param[in,out] serial Structure of serial control
115   \param[in] baudrate Baudrate
116
117   \retval 0 Normal
118   \retval < 0 Error
119 */
120 extern int scip_ss(serial_t *serial, long baudrate);
121
122 #endif /* !QRK_C_SCIP_HANDLER_H */