Common use of Methods Clause in Contracts

Methods. isMultiDevice, canBlock, getAddr, getPortName, isConnected, isEnabled, isAutoConnect These methods can be called by any code that has access to the asynUser • Connection services Methods: enable,autoConnect,setAutoConnectTimeout These methods can be called by any code that has access to the asynUser. These methods can be called to set the enable and autoConnect settings for a port and/or device. If autoConnect is true then asynManager does the following: ♦ When the port registers its asynCommon interface, asynManager queues a connection request. It then waits for a short time for the connection callback to complete. The default time is 0.5 seconds, but this time can be changed with a call to the function pasynManager->setAutoConnectTimeout(double timeout). This function can be accessed from the iocsh shell with the asynSetAutoConnectTimeout(double timeout) command. This short timeout is designed to allow devices time to connect if they are available, but not to excessively slow down booting of the IOC by waiting, for example, for the system timeout on TCP connections. Note that this means that it is very likely that the pasynCommon->connect() call will occur as soon as the asynCommon interface is registered, which means that the driver must have already done all initialization required for the asynCommon->connect() callback before it registers the asynCommon interface. If the port does not connect initially, or if it subsequently disconnects, then asynManager will queue a connection request every 20 seconds. If autoConnect is true and port/device is enabled but the device is not connected, then queueManager calls calling asynCommon:connect just before it calls processCallback. • Exception services Methods: exceptionCallbackAdd, exceptionCallbackRemove, exceptionConnect, exceptionDisconnect Device support code calls exceptionCallbackAdd and exceptionCallbackRemove. The complete list of exceptions is defined in asynDriver.h as "enum asynException". Whenever a port driver connects or disconnects, normally as a result of a call to asynCommon:connect or asynCommon:disconnect, it must also call exceptionConnect or exceptionDisconnect. • Interrupt services Methods: registerInterruptSource, getInterruptPvt, createInterruptNode, freeInterruptNode, addInterruptUser, removeInterruptUser, interruptStart, interruptEnd Interrupt just means: "I have a new value." Many asyn interfaces, e.g. asynInt32, provide interrupt support. These interfaces provide methods addInterruptUser and removeInterruptUser. Device support calls addInterruptUser if it wants to be called whenever an interrupt occurs. Drivers or other code that implements the interface calls the registered users when it has new data. asynManager provides services that help drivers implement thread-safe support for interrupts. asynManager 11 A driver that supports interrupts calls registerInterruptSource for each interface that has associated interrupts. It calls interruptStart to obtain a list of all registered users and interruptEnd after it calls the registered users. The driver is also responsible for calling addInterruptUser and removeInterruptUser. If any calls are made to addInterruptUser or removeInterruptUser between the calls to interruptStart and interruptEnd, asynManager puts the request on a list and processes the request after interruptEnd is called. Many standard interfaces, e.g. asynInt32, provide methods registerInterruptUser, cancelInterruptUser. These interfaces also provide an auxilliary interface, e.g. asynInt32Base, and code which implements registerInterruptUser and cancelInterruptUser. On operating systems like vxWorks or RTEMS interruptStart,interruptEnd MUST NOT be called from interupt level. • Timestamp services Methods: updateTimeStamp, getTimeStamp, setTimeStamp, registerTimeStampSource, unregisterTimeStampSource. These methods provide support for setting a timestamp for a port. This timestamp is typically used to set the pasynUser->timestamp field that is passed to device support on read or callback operations. Device support uses the pasynUser->timestamp field to set the record TIME field. This will then be the record timestamp if the record TSE field is -2. asynManager provides a default timestamp source function which just calls epicsTimeGetCurrent(). However, registerTimeStampSource can be used to supply a different user-provided timestamp source function, for example one that calls epicsTimeGetEvent(), or some other site-specific timestamp source. unregisterTimeStampSource reverts to the default timestamp source in pasynManager. • General purpose freelist service Methods: memMalloc, memFree These methods do not require an asynUser. They are provided for code that must continually allocate and free memory. Since memFree puts the memory on a free list instead of calling free, they are more efficient that calloc/free and also help prevent memory fragmentation. • Interpose service Method: interposeInterface Code that calls interposeInterface implements an interface which is either not supported by a port driver or that is "interposed" between the caller and the port driver. For example asynInterposeEos interposes asynOctet. It performs end of string processing for port drivers that do not support it. interposeInterface is recursive, i.e. an arbitrary number of interpose layers can exist above a single port,addr.

Appears in 7 contracts

Samples: epics-modules.github.io, epics-modules.github.io, epics-modules.github.io

AutoNDA by SimpleDocs

Methods. isMultiDevice, canBlock, getAddr, getPortName, isConnected, isEnabled, isAutoConnect These methods can be called by any code that has access to the asynUser 10 asynManager • Connection services Methods: enable,autoConnect,setAutoConnectTimeout These methods can be called by any code that has access to the asynUser. These methods can be called to set the enable and autoConnect settings for a port and/or device. If autoConnect is true then asynManager does the following: ♦ When the port registers its asynCommon interface, asynManager queues a connection request. It then waits for a short time for the connection callback to complete. The default time is 0.5 seconds, but this time can be changed with a call to the function pasynManager->setAutoConnectTimeout(double timeout). This function can be accessed from the iocsh shell with the asynSetAutoConnectTimeout(double timeout) command. This short timeout is designed to allow devices time to connect if they are available, but not to excessively slow down booting of the IOC by waiting, for example, for the system timeout on TCP connections. Note that this means that it is very likely that the pasynCommon->connect() call will occur as soon as the asynCommon interface is registered, which means that the driver must have already done all initialization required for the asynCommon->connect() callback before it registers the asynCommon interface. If the port does not connect initially, or if it subsequently disconnects, then asynManager will queue a connection request every 20 seconds. If autoConnect is true and port/device is enabled but the device is not connected, then queueManager calls calling asynCommon:connect just before it calls processCallback. • Exception services Methods: exceptionCallbackAdd, exceptionCallbackRemove, exceptionConnect, exceptionDisconnect Device support code calls exceptionCallbackAdd and exceptionCallbackRemove. The complete list of exceptions is defined in asynDriver.h as "enum asynException". Whenever a port driver connects or disconnects, normally as a result of a call to asynCommon:connect or asynCommon:disconnect, it must also call exceptionConnect or exceptionDisconnect. • Interrupt services Methods: registerInterruptSource, getInterruptPvt, createInterruptNode, freeInterruptNode, addInterruptUser, removeInterruptUser, interruptStart, interruptEnd Interrupt just means: "I have a new value." Many asyn interfaces, e.g. asynInt32, provide interrupt support. These interfaces provide methods addInterruptUser and removeInterruptUser. Device support calls addInterruptUser if it wants to be called whenever an interrupt occurs. Drivers or other code that implements the interface calls the registered users when it has new data. asynManager provides services that help drivers implement thread-safe support for interrupts. asynManager 11 A driver that supports interrupts calls registerInterruptSource for each interface that has associated interrupts. It calls interruptStart to obtain a list of all registered users and interruptEnd after it calls the registered users. The driver is also responsible for calling addInterruptUser and removeInterruptUser. If any calls are made to addInterruptUser or removeInterruptUser between the calls to interruptStart and interruptEnd, asynManager puts the request on a list and processes the request after interruptEnd is called. Many standard interfaces, e.g. asynInt32, provide methods registerInterruptUser, cancelInterruptUser. These interfaces also provide an auxilliary interface, e.g. asynInt32Base, and code which implements registerInterruptUser and cancelInterruptUser. On operating systems like vxWorks or RTEMS interruptStart,interruptEnd MUST NOT be called from interupt level. • Timestamp services Methods: updateTimeStamp, getTimeStamp, setTimeStamp, registerTimeStampSource, unregisterTimeStampSource. These methods provide support for setting a timestamp for a port. This timestamp is typically used to set the pasynUser->timestamp field that is passed to device support on read or callback operations. Device support uses the pasynUser->timestamp field to set the record TIME field. This will then be the record timestamp if the record TSE field is -2. asynManager provides a default timestamp source function which just calls epicsTimeGetCurrent(). However, registerTimeStampSource can be used to supply a different user-provided timestamp source function, for example one that calls epicsTimeGetEvent(), or some other site-specific timestamp source. unregisterTimeStampSource reverts to the default timestamp source in pasynManager. • General purpose freelist service Methods: memMalloc, memFree These methods do not require an asynUser. They are provided for code that must continually allocate and free memory. Since memFree puts the memory on a free list instead of calling free, they are more efficient that calloc/free and also help prevent memory fragmentation. • Interpose service Method: interposeInterface Code that calls interposeInterface implements an interface which is either not supported by a port driver or that is "interposed" between the caller and the port driver. For example asynInterposeEos interposes asynOctet. It performs end of string processing for port drivers that do not support it. interposeInterface is recursive, i.e. an arbitrary number of interpose layers can exist above a single port,addr.

Appears in 2 contracts

Samples: epics.anl.gov, epics-modules.github.io

AutoNDA by SimpleDocs
Draft better contracts in just 5 minutes Get the weekly Law Insider newsletter packed with expert videos, webinars, ebooks, and more!