1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 <2025> | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 <2025> |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: Re: write and read functions in asyn |
From: | Mark Rivers via Tech-talk <tech-talk at aps.anl.gov> |
To: | 高振华 <gaozh at ihep.ac.cn> |
Cc: | "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov> |
Date: | Sat, 12 Apr 2025 16:46:26 +0000 |
No, the drvAsynSerialPort driver does not implement the asynInt32 interface.
It implements the asynCommon inteface here. All drivers must implement asynCommon:
It implements the asynOption interface here:
It implements the asynOctet interface here:
Those are the only interfaces that it implements.
This is a simple example driver that implements the asynInt32 interface:
Many drivers now use the asynPortDriver base class. It greatly simplifies the code required to register and implement asyn interfaces. This is the code:
This is the documentation:
This is a real driver for a simple device that implements the asynInt32 interface using asynPortDriver.
Mark
From: 高振华 <gaozh at ihep.ac.cn>
Sent: Saturday, April 12, 2025 6:39 AM To: Mark Rivers <rivers at cars.uchicago.edu> Cc: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov> Subject: Re: Re: write and read functions in asyn Hi Mark, Thanks, Does the (* write) function in asynInt32.h inherit from the writeIt function in drvAsynSerialPort.c (when accessing a serial port)?
static asynStatus writeIt(void *drvPvt, asynUser *pasynUser, const char *data, size_t numchars,size_t *nbytesTransfered) {
ttyController_t *tty = (ttyController_t *)drvPvt; int thisWrite; int nleft = numchars; int timerStarted = 0; asynStatus status = asynSuccess; assert(tty); ...
Gao Zhenhua
祝好!
高振华
电话:010-88235426
Email:gaozh at ihep.ac.cn
|