Importing a C project on Node-Red [closed] - c

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have a C project (hex file) and I would like to use in my node-red project. by creating my own node in node-red that's call this project and exchange data with it.
knowing that I don't have the code source .
My questions are:
Is it possible?
If so, How I can do it ? I have read some docs about N-API, but I don't know if it's usefull.

Without knowing a lot more about what your C program does this is hard to answer.
But you have 2 possible choices here
If your application can receive data from stdin or as command line arguments and output to stdout then you can use the exec or daemon nodes to just run the exe file
You can build a NodeJS node that wraps your C program using the NAPI and then build a Node-RED Node that uses that node and makes method calls against your C library. If you take this path you will need to get the NodeJS module working first.

Related

How can I turn my code into an actual aplication for windows? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I developed a program written in C language using Gtk+ 3 for visual interface, and to run it I always use the comand line (Im using cygwin), but I would like to know how can i make my program an aplication, witch can be installed in windows and function like any other aplication (launch it throught files explorer or even throught the desktop enviroment)?
Thank you for your answers!
Provided that you have written the code portable, you basically have two options.
Install GTK on Windows. You can find instructions here: https://www.gtk.org/docs/installations/windows/
Rewrite the whole application for Windows API. This is NOT trivial.
On top of that, use windows installer

sequences for writing embedded drivers [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I'm really confused when I'm writing a driver? just need to know which file should I write first header file, or the configuration file otherwise the code file. just for example keypad driver using C. if there any resources to understand more these steps for writing driver I will be very thankful
Be it a driver development or application development,
Very first step is be clear with requirement,
Then have a proper design and then go for coding.
Note that coding without design is a disaster.
Which file to start with is your question?
If you are so much confused just start with code file.
Keep entire code in that file.
Later on you can re arrange your code to different files like header file , Config file , code file etc...

Build a File Monitoring System [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have just started programming and would like to implement a file monitoring system from scratch in C.
I have used the Watch Service API in java but I would like to learn how to build one from scratch. I would really appreciate some assistance and guidance.
Thanks.
You can:
either rely on existing system calls that will push you notifications on file system modifications (eg: inotify)
implement your own kernel module that will intercept file system modification and notify you (if you really want to reimplement the wheel)
use a polling-approach, rebuild the filesystem tree in-memory and compare it every second or so. This will be very cpu/io/memory consuming, but it can be instructive.

Can I write server, client code in a same program and run them [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
just trying to test socket programming. I am thinking to create a project and write both server.c and client.c in that same project. Is it possible or do I have to create two projects and run them parallely? I am writing in C.
Yes you can. but if you're using an IDE (eclipse, or something else you prefer) it would be easier for you to do it in separate projects, as you can just build & run each one and both projects will run in parallel, and then the server & client will be able to communicate with each other.
When they are in the same project, you can tell the IDE to build the project, but you'll have to run it from command-line in order to run server & client at the same time.

Porting old C project into C++/CX [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I'm rather new to C++/CX, and right now have an old C project which I need to port into C++/CX.
The output are flushed into text-file or standard output, but it's not that important right now since I can just take them into the Message Dialog there.
My question is that, do you have any tips for porting this project?
I just tried to copy a C file into CPP but failed to compile.
I mean, do I need to wrap the old functions into some kind of Class structure now?
Thanks in advance!
For the differences between C and C++, a starting point is David Tribble's "C99 vs C++98". Without any more details (original C environment, current C++ environment, some details on exact error messages) it is next to impossible to answer the question.

Resources