libads icon indicating copy to clipboard operation
libads copied to clipboard

AdsRouter needs to be implemented

Open gass opened this issue 16 years ago • 5 comments

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

gass avatar May 20 '09 12:05 gass

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

martinlandung avatar Oct 15 '13 20:10 martinlandung

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.

gass avatar Oct 16 '13 09:10 gass

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

haakonnessjoen avatar Oct 16 '13 12:10 haakonnessjoen

Yes, i will contact the Original author.

gass avatar Oct 16 '13 15:10 gass

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

gass avatar Oct 20 '13 00:10 gass