11 years, 5 months ago.

Serial Even Parity setting

mmlink.format( 8, Serial::Even, 1);

This fragment of code compiled with Rev 43 of the mbed library, with Rev 45 I get the error:-

Class "mbed::Serial" has no member "Even"

This seems to be the case for all the Parity setting.

Am I missing something at Rev 45?

Tim

Soo, this is still not fixed as I tried everything to set the mode to Parity Even. Nothing worked. Can someone post the code for setting up format(8bit, parityeven, 1 stopbit)? thanks

posted by Swedgin . 26 Oct 2015

I' m hitting the same block here

serial.format( 7, Even, 2);

Wether I use -Even, -even, -ParityEven, -E

I can' t get code to compile without the mentioned error

posted by Marout Yasuo Sluijter-Borms 18 Feb 2017

3 Answers

11 years, 5 months ago.

You dont have to add anything, rename "Even" to "ParityEven". Just a name change. Btw @ mbed people, you need to update documentation of serial class, format function doesnt give those new names.

Accepted Answer
11 years, 5 months ago.

As part of the complete refactoring of the mbed library we moved the parameter type definitions from the C++ API to the C API. The missing parity enum has been moved from Serial.h to serial_api.h: serial_api.h

11 years, 5 months ago.

You've lost me again, how do I use this serial_api.h, simply adding to my .cpp file still does not get rid of the compiler error.