hydro serial package stopbits enum is showing duplicate values
I am writing node to publish several sonar readings in a skirt being driven by an arduino. My node listens on the serial port and advertises an array of sensor_msgs/Range. I am depending on the ros-hydro-serial package to drive the serial port. I wanted to handle communications between the arduino and the node with parameter values. Therefore I am trying to look for and set all possibilities using ROS parameters. (Note: issuetracker does not seem to have anything on the serial package so I thought I would post here first. I have taken out support for stopbits_one_point_five and am not being held up. No urgency but would like to know if I am doing something wrong)
I was using the attributes of a serial connection in a switch and received a compiler error. "error: duplicate case value".
<snip of code>
switch (foo) {
. . .
case serial::stopbits_one_point_five :
this;
that;
break;
case serial::stopbits_two : //compiler issues the duplicate case value error for this line
the other;
break;
. . .
}
</snip>
I note in looking at the header it contains.
<snip of the ROS hydro serial.h header>
/*!
* Enumeration defines the possible stopbit types for the serial port.
*/
typedef enum {
stopbits_one = 1,
stopbits_one_point_five,
stopbits_two = 2
} stopbits_t;
</snip>
This has the affect of assigning the same value for the stopbits_one_point_five and the stopbits_two values.
My environment: Ubuntu 12.04 gcc 4.6.3