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: [email protected] [[email protected]] on behalf of Jörn Dreyer [[email protected]]
Sent: Tuesday, July 25, 2017 7:33 AM
To: [email protected]
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>
2018
2019
2020
2021
2022
2023
2024
- 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>
2018
2019
2020
2021
2022
2023
2024
|