revert example piiodevice
This commit is contained in:
@@ -26,17 +26,23 @@ void _() {
|
||||
};
|
||||
REGISTER_DEVICE(SomeIO)
|
||||
//! [0]
|
||||
|
||||
// clang-format off
|
||||
|
||||
//! [configure]
|
||||
// file example.conf
|
||||
dev.reopenEnabled = false dev.device = / dev / ttyS0 dev.speed = 9600
|
||||
// end example.conf
|
||||
// code
|
||||
PISerial ser;
|
||||
dev.reopenEnabled = false
|
||||
dev.device = /dev/ttyS0
|
||||
dev.speed = 9600
|
||||
// end example.conf
|
||||
// code
|
||||
PISerial ser;
|
||||
ser.configure("example.conf", "dev");
|
||||
//! [configure]
|
||||
//! [configureDevice]
|
||||
class SomeIO: public PIIODevice {
|
||||
... bool configureDevice(const void * e_main, const void * e_parent) override {
|
||||
...
|
||||
bool configureDevice(const void * e_main, const void * e_parent) override {
|
||||
PIConfig::Entry * em = (PIConfig::Entry *)e_main;
|
||||
PIConfig::Entry * ep = (PIConfig::Entry *)e_parent;
|
||||
setStringParam(readDeviceSetting<PIString>("stringParam", stringParam(), em, ep));
|
||||
@@ -46,4 +52,6 @@ void _() {
|
||||
...
|
||||
};
|
||||
//! [configureDevice]
|
||||
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user