2024-12-01 19:35:24 +00:00
|
|
|
//| Copyright: (C) 2020-2024 Kevin Larke <contact AT larke DOT org>
|
|
|
|
//| License: GNU GPL version 3.0 or above. See the accompanying LICENSE file.
|
2019-12-24 15:05:24 +00:00
|
|
|
#ifndef cwSerialPortSrv_H
|
|
|
|
#define cwSerialPortSrv_H
|
|
|
|
|
|
|
|
namespace cw
|
|
|
|
{
|
|
|
|
namespace serialPortSrv
|
|
|
|
{
|
|
|
|
typedef handle<struct this_str> handle_t;
|
|
|
|
|
2020-03-06 03:04:53 +00:00
|
|
|
rc_t create( handle_t& h, unsigned pollPeriodMs=50, unsigned recvBufByteN=512 );
|
2019-12-24 15:05:24 +00:00
|
|
|
rc_t destroy(handle_t& h );
|
|
|
|
|
2020-03-06 03:04:53 +00:00
|
|
|
serialPort::handle_t serialHandle( handle_t h );
|
2020-01-27 22:48:59 +00:00
|
|
|
thread::handle_t threadHandle( handle_t h );
|
2019-12-24 15:05:24 +00:00
|
|
|
|
|
|
|
rc_t start( handle_t h );
|
|
|
|
rc_t pause( handle_t h );
|
|
|
|
|
2020-03-06 03:04:53 +00:00
|
|
|
rc_t send( handle_t h, unsigned portId, const void* byteA, unsigned byteN );
|
2019-12-24 15:05:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
rc_t serialPortSrvTest();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|