Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017 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
<== Date ==> <== Thread ==>

Subject: RE: Listen on UDP socket for device message
From: Mark Rivers <rivers@cars.uchicago.edu>
To: Jörn Dreyer <j.dreyer@hzdr.de>, "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Tue, 25 Jul 2017 13:19:53 +0000
Hi Jörn,

Yes, you should be able to use drvAsynIPServerPort.  You need to write a driver that calls pasynOctet->registerInterruptUser.  In that call you specify a callback function.

This is documented here: http://www.aps.anl.gov/epics/modules/soft/asyn/R4-31/asynDriver.html#drvAsynIPServerPort

In asyn/testIPServerApp/src there are 3 examples of code.

ipEchoServer.c, ipEchoServer2.c, ipSNCServer.st.

asyn/iocBoot/ioctestIPServer is the test IOC for that example.  It has a README that explains how they work.

That being said, it is also easy to write a driver that directly calls bind(), accept(), etc. without using drvAsynIPServerPort.  You can look at drvAsynIPServerPort to see how to do that in an OS-independent way.

Mark



________________________________________
From: tech-talk-bounces@aps.anl.gov [tech-talk-bounces@aps.anl.gov] on behalf of Jörn Dreyer [j.dreyer@hzdr.de]
Sent: Tuesday, July 25, 2017 7:33 AM
To: tech-talk@aps.anl.gov
Subject: Listen on UDP socket for device message

Hi,

I have a device, that sends to a dedicated IP address and port combination
(10.0.0.1:2036) a message at startup. It then expects a message back,
specifying the port number of the host to send further messages to.
The device is connected to a second ethernet interface of a computer that has
the 10.0.0.1 address assigned to it.

Can one use drvAsynIPServerPort for that? And if yes how do I connect a
callbackfuntion, that gets called if there is a connection from my device. I
need to reset the connection to the device in case of a reset/reboot of the
device.
To communicate with the device I want to use drvAsynIPPort Which I would open
in the callback function.

Regards

Jörn

References:
Listen on UDP socket for device message Jörn Dreyer

Navigate by Date:
Prev: Listen on UDP socket for device message Jörn Dreyer
Next: Possible error in EPICS Application Developer Guide Iain Marcuson
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
Navigate by Thread:
Prev: Listen on UDP socket for device message Jörn Dreyer
Next: Possible error in EPICS Application Developer Guide Iain Marcuson
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
ANJ, 25 Jul 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·