Hi Patrick,
> On Oct 6, 2017, at 2:04 AM, Thomas, Patrick <[email protected]> wrote:
>
> I am trying to understand how to use the 'long init(int after)' function in device support. Is it expected that I define a separate such function for each record type (there is a pointer to it in the dset for each record type)?
It is available for that purpose, but as with most functions it’s optional so you don’t have to use it. If you’re writing device support for multiple record types you can’t guarantee the order in which initialization happens though using this particular API. However...
> I would like to define a single function that gets called after all records of *all types* have been initialized. Is this possible? If so, is there an example available?
Take a look at the API described in initHooks.h which is designed to let you register a callback routine that gets called at various times during IOC initialization. In your case the initHookStates initHookAfterInitDevSup and initHookAfterInitDatabase might be the most interesting. There is an example showing how to use this API in the standard makeBaseAPp example template, exampleApp/src/initTrace.c has a function trace() which prints the name of each state when it gets called.
HTH,
- Andrew
- References:
- init function in device support Thomas, Patrick
- Navigate by Date:
- Prev:
init function in device support Thomas, Patrick
- Next:
Re: init function in device support Michael Davidsaver
- 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
- Navigate by Thread:
- Prev:
init function in device support Thomas, Patrick
- Next:
Re: init function in device support Michael Davidsaver
- 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
|