gass / libads

Implementation of BECKHOFF's ADS protocol.
http://github.com/gass/libads/
GNU Lesser General Public License v3.0
33 stars 9 forks source link

AdsRouter needs to be implemented #1

Open gass opened 15 years ago

gass commented 15 years ago

A notification and connection management, similar to the oficial AdsRouter should be implemented

martinlandung commented 10 years ago

As i can see the callback function is not used. You pass it to the AdsSyncAddDeviceNotificationReq function but nothing happens with it. Also there is a general problem with the adsAPI. Every Call of an Method of the adsAPI will create a new connection (a new socket is opened) That makes it impossible to get a AdsSyncAddDeviceNotificationReq work. You will need a callback function. But as you can see in the AdsAPI.c this callback function is never used.

That means that as you can read in the doc of libads:

Currently, libads does not have a router, so the api it self manages (badly) the connections. The best approach is to use the lower level api.

I dont know exactly what a ads router does. But i think it is exactly that what you (and also me) is looking for to use the AdsSyncAddDeviceNotificationReq Method.

I wanted to make an ADS client for Android devices using android-ndk with QT. I was not able to compile it on the android device so i decided to use an "dispatcher" that runs on a server (linux,windows,mac). This dispatcher holds PLC Items (ADS,OPC, own not yet finished protokoll for arduino). You then can connect to this dispatcher and will get the PLC Items.

I think, to get this librarie work with interrupted/event driven notifications we would need to change some things in the lower level api and create something like an router. This would be some work.

I am not part of the libads team but i would like to add some code to the lower level api. maybe anybody is out there that would like to do this task with me ?

bye

gass commented 10 years ago

To implement this we need a manager to the connection: and ADSRouter like to manage the connections and events. Every device should have only one connection and all access go trough it. If you manage to port this code to other platforms, please tell us so.

The easiest way to contribute is to fork libads on github and then create merge requests. You can contribute with patches or any other way ( the important here is to contribute).

To get some help, i suggest that you propose some changes and then create an issue, for example, to track and get suggestions to continue.

Thanks.

haakonnessjoen commented 10 years ago

Would it be possible for you to relicense libads to lgpl? It would be more interesting to contribute with code in that case.

gass commented 10 years ago

Yes, i will contact the Original author.

gass commented 10 years ago

License is changed from GPL to LGPL. Please discuss here only the ADSRouter