Boost logo

Boost Users :

Subject: Re: [Boost-users] asio: serial ports and timeouts
From: KessiMC (pascal_kesseli_at_[hidden])
Date: 2009-06-17 12:42:03


Thanks, man, that was the problem :-) .

I do read them char-by-char because I need to specify the maximum delay
between each character using async_wait(). If I read all 10 characters at
once, I could only specify the maximum time for the transmission of all
characters, not the allowed delay between each one.

The protocol I am implementing strictly relies on a maximum character delay
between each subsequent character.

Thanks and greeets
Pascal

Igor R wrote:
>
>>
>> Well, if I transmit 9 characters (or less, whatever), e.g. "012345678",
>> these
>> characters are displayed, followed by a '\0'.
>>
>> Transmitting only 6 characters displays these 6 characters, e.g. "012345"
>> and 4 appended '\0' characters. That's not what I want, I want the
>> program
>> to block and wait for the 10th character in the first example or the 7th,
>> 8th, 9th and 10th character in the second example.
>>
>
> Ok, I see...
> I don't really understand why you wish to async_read() char-by-char and to
> re-run io_service each time, instead of reading N chars at once into a
> buffer, but if you prefer to do so, you have to call io_service::reset()
> before any subsequent call to run():
> //...
> io.reset();
>
> io.run();
> //....
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>

-- 
View this message in context: http://www.nabble.com/asio%3A-serial-ports-and-timeouts-tp24073127p24077539.html
Sent from the Boost - Users mailing list archive at Nabble.com.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net