Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add C function support #13

Open
jadonk opened this issue Apr 25, 2018 · 4 comments
Open

Add C function support #13

jadonk opened this issue Apr 25, 2018 · 4 comments
Assignees

Comments

@jadonk
Copy link
Member

jadonk commented Apr 25, 2018

From @jadonk on July 26, 2012 18:8

It shouldn't be required to create node modules to add C functions that are compiled on the target. Need to merge in support for C routines that leverage Arduino-for-Userspace-Linux.

Copied from original issue: jadonk#27

@jadonk
Copy link
Member Author

jadonk commented Apr 26, 2018

The Arduino-for-Userspace-Linux library seems to be largely superseded by MRAA and the now "native" support by create.arduino.cc.

@anujdeshpande
Copy link

So does first class support with MRAA help us work with create.arduino.cc?

I see that we are already supported - makes sense to add first class support? (looks like there are still things to do to get there)

@jadonk
Copy link
Member Author

jadonk commented May 1, 2018

It is still riddled with bugs to the best of my knowledge, but this could increase the user base significantly.

@vaishnavachath
Copy link

@jadonk @anujdeshpande I have tried to implement external C function support through this example here : [https://github.com/vaishnav98/bonescript/tree/master/test/test-ffi_spi].can you please review it , i had the code tested on BeagleBone Black with
Linux beaglebone 4.9.88-ti-r111 and BeagleBoard.org Debian Image 2018-03-05

I tried to implement the exported SPI functions to bonescript so that it can be called like this :
var b=require('bonescript')
b.openSPI();
...

but in this case the example works only when the example.js is in the same directory as the spi.js, and throws an error "File not Found spidev.so" , it seems like a path issue how can i solve it?can it be solved by adding the path to the .so file in LD_LIBRARY_PATH environment variable, if yes , how do i modify the makefile to accomodate this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants