UFFI with asynchronous callbacks

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

UFFI with asynchronous callbacks

Jan Čada-2
Hi,

I would like to connect fingerprint reader to pharo - so far I am able to use C library to connect to it using UFFI,
however the problem is that I can wait for fingerprint indefinitely ( blocking call to library) or register call-back for moment when fingerprint is available.
The registration function returns immediately, so it is clear that the callback will be called from another thread.

Is such situation supported by UFFI ?

Thanks for any tip,

Jan
Reply | Threaded
Open this post in threaded view
|

Re: UFFI with asynchronous callbacks

Ben Coman


On Mon, Oct 23, 2017 at 11:46 PM, Jan Cada <[hidden email]> wrote:
Hi,

I would like to connect fingerprint reader to pharo - so far I am able to use C library to connect to it using UFFI,
however the problem is that I can wait for fingerprint indefinitely ( blocking call to library) or register call-back for moment when fingerprint is available.
The registration function returns immediately, so it is clear that the callback will be called from another thread.

Is such situation supported by UFFI ?

Thanks for any tip,

Jan

Callbacks are supported. Here is an example...

@Todd, How did find working through this part?  
cheers -ben
Reply | Threaded
Open this post in threaded view
|

Re: UFFI with asynchronous callbacks

philippeback
I've callbacks all over in https://github.com/Pharophile/XmppTalk

They do work.

Phil

On Mon, Oct 23, 2017 at 8:13 PM, Ben Coman <[hidden email]> wrote:


On Mon, Oct 23, 2017 at 11:46 PM, Jan Cada <[hidden email]> wrote:
Hi,

I would like to connect fingerprint reader to pharo - so far I am able to use C library to connect to it using UFFI,
however the problem is that I can wait for fingerprint indefinitely ( blocking call to library) or register call-back for moment when fingerprint is available.
The registration function returns immediately, so it is clear that the callback will be called from another thread.

Is such situation supported by UFFI ?

Thanks for any tip,

Jan

Callbacks are supported. Here is an example...

@Todd, How did find working through this part?  
cheers -ben

Reply | Threaded
Open this post in threaded view
|

Re: UFFI with asynchronous callbacks

tblanchard
In reply to this post by Ben Coman
Just catching up....

I'm trying to work with 64 bit Pharo 6.(1? 2?).

I've run into some issues that I have not been able to resolve.  I've loaded up TalkFFI with the LibClang library and testLocation fails.  Anything that tries to deal with getting a code location fails and I cannot figure out what the issue is yet.

Also, callbacks do not work at all.  

One might say that this is only tested on 32 bit Pharo and that's fine, but I have a 64 bit computer loaded with 64 bit standard libraries and recompiling everything to get 32 bit versions is just not practical.  Its past time to do the 64 bit thing.

FWIW, my test library at this point is SQLite Amalgam header to see if I can automatically build a SQLite interface (should be easy as it is one file) but it is kind of frustrating that these libclang features are not working on 64 bit libs.  

I have been running in lldb to try to catch the crashes, and I have written a number of toy programs to make certain things are the sizes I expect.

Still stuck at this juncture.

Had to take a lil break and learn to program a Particle board for a work project but will resume next week.


On Oct 23, 2017, at 11:13 AM, Ben Coman <[hidden email]> wrote:



On Mon, Oct 23, 2017 at 11:46 PM, Jan Cada <[hidden email]> wrote:
Hi,

I would like to connect fingerprint reader to pharo - so far I am able to use C library to connect to it using UFFI,
however the problem is that I can wait for fingerprint indefinitely ( blocking call to library) or register call-back for moment when fingerprint is available.
The registration function returns immediately, so it is clear that the callback will be called from another thread.

Is such situation supported by UFFI ?

Thanks for any tip,

Jan

Callbacks are supported. Here is an example...

@Todd, How did find working through this part?  
cheers -ben

Reply | Threaded
Open this post in threaded view
|

Re: UFFI with asynchronous callbacks

Ben Coman
AFAIK, TalkFFI hasn't been updated to UFFI for Pharo 5.

cheers -ben

On Wed, Nov 8, 2017 at 4:07 PM, Todd Blanchard <[hidden email]> wrote:
Just catching up....

I'm trying to work with 64 bit Pharo 6.(1? 2?).

I've run into some issues that I have not been able to resolve.  I've loaded up TalkFFI with the LibClang library and testLocation fails.  Anything that tries to deal with getting a code location fails and I cannot figure out what the issue is yet.

Also, callbacks do not work at all.  

One might say that this is only tested on 32 bit Pharo and that's fine, but I have a 64 bit computer loaded with 64 bit standard libraries and recompiling everything to get 32 bit versions is just not practical.  Its past time to do the 64 bit thing.

FWIW, my test library at this point is SQLite Amalgam header to see if I can automatically build a SQLite interface (should be easy as it is one file) but it is kind of frustrating that these libclang features are not working on 64 bit libs.  

I have been running in lldb to try to catch the crashes, and I have written a number of toy programs to make certain things are the sizes I expect.

Still stuck at this juncture.

Had to take a lil break and learn to program a Particle board for a work project but will resume next week.


On Oct 23, 2017, at 11:13 AM, Ben Coman <[hidden email]> wrote:



On Mon, Oct 23, 2017 at 11:46 PM, Jan Cada <[hidden email]> wrote:
Hi,

I would like to connect fingerprint reader to pharo - so far I am able to use C library to connect to it using UFFI,
however the problem is that I can wait for fingerprint indefinitely ( blocking call to library) or register call-back for moment when fingerprint is available.
The registration function returns immediately, so it is clear that the callback will be called from another thread.

Is such situation supported by UFFI ?

Thanks for any tip,

Jan

Callbacks are supported. Here is an example...

@Todd, How did find working through this part?  
cheers -ben


Reply | Threaded
Open this post in threaded view
|

Re: UFFI with asynchronous callbacks

tblanchard
I know, but its closer to "done" than starting from scratch.



On Nov 8, 2017, at 1:13 AM, Ben Coman <[hidden email]> wrote:

AFAIK, TalkFFI hasn't been updated to UFFI for Pharo 5.

cheers -ben

On Wed, Nov 8, 2017 at 4:07 PM, Todd Blanchard <[hidden email]> wrote:
Just catching up....

I'm trying to work with 64 bit Pharo 6.(1? 2?).

I've run into some issues that I have not been able to resolve.  I've loaded up TalkFFI with the LibClang library and testLocation fails.  Anything that tries to deal with getting a code location fails and I cannot figure out what the issue is yet.

Also, callbacks do not work at all.  

One might say that this is only tested on 32 bit Pharo and that's fine, but I have a 64 bit computer loaded with 64 bit standard libraries and recompiling everything to get 32 bit versions is just not practical.  Its past time to do the 64 bit thing.

FWIW, my test library at this point is SQLite Amalgam header to see if I can automatically build a SQLite interface (should be easy as it is one file) but it is kind of frustrating that these libclang features are not working on 64 bit libs.  

I have been running in lldb to try to catch the crashes, and I have written a number of toy programs to make certain things are the sizes I expect.

Still stuck at this juncture.

Had to take a lil break and learn to program a Particle board for a work project but will resume next week.


On Oct 23, 2017, at 11:13 AM, Ben Coman <[hidden email]> wrote:



On Mon, Oct 23, 2017 at 11:46 PM, Jan Cada <[hidden email]> wrote:
Hi,

I would like to connect fingerprint reader to pharo - so far I am able to use C library to connect to it using UFFI,
however the problem is that I can wait for fingerprint indefinitely ( blocking call to library) or register call-back for moment when fingerprint is available.
The registration function returns immediately, so it is clear that the callback will be called from another thread.

Is such situation supported by UFFI ?

Thanks for any tip,

Jan

Callbacks are supported. Here is an example...

@Todd, How did find working through this part?  
cheers -ben



Reply | Threaded
Open this post in threaded view
|

Re: UFFI with asynchronous callbacks

Denis Kudriashov
Hi.

Esteban has version ported to UFFI https://github.com/estebanlm/TalkFFI. But I don't know is it working or not. 

2017-11-08 10:15 GMT+01:00 Todd Blanchard <[hidden email]>:
I know, but its closer to "done" than starting from scratch.



On Nov 8, 2017, at 1:13 AM, Ben Coman <[hidden email]> wrote:

AFAIK, TalkFFI hasn't been updated to UFFI for Pharo 5.

cheers -ben

On Wed, Nov 8, 2017 at 4:07 PM, Todd Blanchard <[hidden email]> wrote:
Just catching up....

I'm trying to work with 64 bit Pharo 6.(1? 2?).

I've run into some issues that I have not been able to resolve.  I've loaded up TalkFFI with the LibClang library and testLocation fails.  Anything that tries to deal with getting a code location fails and I cannot figure out what the issue is yet.

Also, callbacks do not work at all.  

One might say that this is only tested on 32 bit Pharo and that's fine, but I have a 64 bit computer loaded with 64 bit standard libraries and recompiling everything to get 32 bit versions is just not practical.  Its past time to do the 64 bit thing.

FWIW, my test library at this point is SQLite Amalgam header to see if I can automatically build a SQLite interface (should be easy as it is one file) but it is kind of frustrating that these libclang features are not working on 64 bit libs.  

I have been running in lldb to try to catch the crashes, and I have written a number of toy programs to make certain things are the sizes I expect.

Still stuck at this juncture.

Had to take a lil break and learn to program a Particle board for a work project but will resume next week.


On Oct 23, 2017, at 11:13 AM, Ben Coman <[hidden email]> wrote:



On Mon, Oct 23, 2017 at 11:46 PM, Jan Cada <[hidden email]> wrote:
Hi,

I would like to connect fingerprint reader to pharo - so far I am able to use C library to connect to it using UFFI,
however the problem is that I can wait for fingerprint indefinitely ( blocking call to library) or register call-back for moment when fingerprint is available.
The registration function returns immediately, so it is clear that the callback will be called from another thread.

Is such situation supported by UFFI ?

Thanks for any tip,

Jan

Callbacks are supported. Here is an example...

@Todd, How did find working through this part?  
cheers -ben




Reply | Threaded
Open this post in threaded view
|

Re: UFFI with asynchronous callbacks

tblanchard
Pretty sure that's the one I loaded.

Still having issues with libclang on 64 bit with code locations.

On Nov 8, 2017, at 1:26 AM, Denis Kudriashov <[hidden email]> wrote:

Hi.

Esteban has version ported to UFFI https://github.com/estebanlm/TalkFFI. But I don't know is it working or not. 

2017-11-08 10:15 GMT+01:00 Todd Blanchard <[hidden email]>:
I know, but its closer to "done" than starting from scratch.



On Nov 8, 2017, at 1:13 AM, Ben Coman <[hidden email]> wrote:

AFAIK, TalkFFI hasn't been updated to UFFI for Pharo 5.

cheers -ben

On Wed, Nov 8, 2017 at 4:07 PM, Todd Blanchard <[hidden email]> wrote:
Just catching up....

I'm trying to work with 64 bit Pharo 6.(1? 2?).

I've run into some issues that I have not been able to resolve.  I've loaded up TalkFFI with the LibClang library and testLocation fails.  Anything that tries to deal with getting a code location fails and I cannot figure out what the issue is yet.

Also, callbacks do not work at all.  

One might say that this is only tested on 32 bit Pharo and that's fine, but I have a 64 bit computer loaded with 64 bit standard libraries and recompiling everything to get 32 bit versions is just not practical.  Its past time to do the 64 bit thing.

FWIW, my test library at this point is SQLite Amalgam header to see if I can automatically build a SQLite interface (should be easy as it is one file) but it is kind of frustrating that these libclang features are not working on 64 bit libs.  

I have been running in lldb to try to catch the crashes, and I have written a number of toy programs to make certain things are the sizes I expect.

Still stuck at this juncture.

Had to take a lil break and learn to program a Particle board for a work project but will resume next week.


On Oct 23, 2017, at 11:13 AM, Ben Coman <[hidden email]> wrote:



On Mon, Oct 23, 2017 at 11:46 PM, Jan Cada <[hidden email]> wrote:
Hi,

I would like to connect fingerprint reader to pharo - so far I am able to use C library to connect to it using UFFI,
however the problem is that I can wait for fingerprint indefinitely ( blocking call to library) or register call-back for moment when fingerprint is available.
The registration function returns immediately, so it is clear that the callback will be called from another thread.

Is such situation supported by UFFI ?

Thanks for any tip,

Jan

Callbacks are supported. Here is an example...

@Todd, How did find working through this part?  
cheers -ben





Reply | Threaded
Open this post in threaded view
|

Re: UFFI with asynchronous callbacks

EstebanLM


On 8 Nov 2017, at 06:55, Todd Blanchard <[hidden email]> wrote:

Pretty sure that's the one I loaded.

Still having issues with libclang on 64 bit with code locations.

that was made for 32bit. 
I never tried it witht 64bit libclang so I would not expect it works just like that ;)

Esteban


On Nov 8, 2017, at 1:26 AM, Denis Kudriashov <[hidden email]> wrote:

Hi.

Esteban has version ported to UFFI https://github.com/estebanlm/TalkFFI. But I don't know is it working or not. 

2017-11-08 10:15 GMT+01:00 Todd Blanchard <[hidden email]>:
I know, but its closer to "done" than starting from scratch.



On Nov 8, 2017, at 1:13 AM, Ben Coman <[hidden email]> wrote:

AFAIK, TalkFFI hasn't been updated to UFFI for Pharo 5.

cheers -ben

On Wed, Nov 8, 2017 at 4:07 PM, Todd Blanchard <[hidden email]> wrote:
Just catching up....

I'm trying to work with 64 bit Pharo 6.(1? 2?).

I've run into some issues that I have not been able to resolve.  I've loaded up TalkFFI with the LibClang library and testLocation fails.  Anything that tries to deal with getting a code location fails and I cannot figure out what the issue is yet.

Also, callbacks do not work at all.  

One might say that this is only tested on 32 bit Pharo and that's fine, but I have a 64 bit computer loaded with 64 bit standard libraries and recompiling everything to get 32 bit versions is just not practical.  Its past time to do the 64 bit thing.

FWIW, my test library at this point is SQLite Amalgam header to see if I can automatically build a SQLite interface (should be easy as it is one file) but it is kind of frustrating that these libclang features are not working on 64 bit libs.  

I have been running in lldb to try to catch the crashes, and I have written a number of toy programs to make certain things are the sizes I expect.

Still stuck at this juncture.

Had to take a lil break and learn to program a Particle board for a work project but will resume next week.


On Oct 23, 2017, at 11:13 AM, Ben Coman <[hidden email]> wrote:



On Mon, Oct 23, 2017 at 11:46 PM, Jan Cada <[hidden email]> wrote:
Hi,

I would like to connect fingerprint reader to pharo - so far I am able to use C library to connect to it using UFFI,
however the problem is that I can wait for fingerprint indefinitely ( blocking call to library) or register call-back for moment when fingerprint is available.
The registration function returns immediately, so it is clear that the callback will be called from another thread.

Is such situation supported by UFFI ?

Thanks for any tip,

Jan

Callbacks are supported. Here is an example...

@Todd, How did find working through this part?  
cheers -ben






Reply | Threaded
Open this post in threaded view
|

Re: UFFI with asynchronous callbacks

EstebanLM
In reply to this post by tblanchard


On 8 Nov 2017, at 05:07, Todd Blanchard <[hidden email]> wrote:

Just catching up....

I'm trying to work with 64 bit Pharo 6.(1? 2?).

I've run into some issues that I have not been able to resolve.  I've loaded up TalkFFI with the LibClang library and testLocation fails.  Anything that tries to deal with getting a code location fails and I cannot figure out what the issue is yet.

Also, callbacks do not work at all.  

that’s unlikely to be true. 
what you will not have, definitively, is async callbacks (that’s WIP and not for the immediate).

Esteban


One might say that this is only tested on 32 bit Pharo and that's fine, but I have a 64 bit computer loaded with 64 bit standard libraries and recompiling everything to get 32 bit versions is just not practical.  Its past time to do the 64 bit thing.

FWIW, my test library at this point is SQLite Amalgam header to see if I can automatically build a SQLite interface (should be easy as it is one file) but it is kind of frustrating that these libclang features are not working on 64 bit libs.  

I have been running in lldb to try to catch the crashes, and I have written a number of toy programs to make certain things are the sizes I expect.

Still stuck at this juncture.

Had to take a lil break and learn to program a Particle board for a work project but will resume next week.


On Oct 23, 2017, at 11:13 AM, Ben Coman <[hidden email]> wrote:



On Mon, Oct 23, 2017 at 11:46 PM, Jan Cada <[hidden email]> wrote:
Hi,

I would like to connect fingerprint reader to pharo - so far I am able to use C library to connect to it using UFFI,
however the problem is that I can wait for fingerprint indefinitely ( blocking call to library) or register call-back for moment when fingerprint is available.
The registration function returns immediately, so it is clear that the callback will be called from another thread.

Is such situation supported by UFFI ?

Thanks for any tip,

Jan

Callbacks are supported. Here is an example...

@Todd, How did find working through this part?  
cheers -ben