Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
You need to know exactly where the driver software looks, so it can access data which it uses. Is it somewhere in ram, in a device, in a disk file, in a sensor? Etc.
Or, does the driver already have a built-in routine which looks for a flag, to notify it that it should access your data?
You also need to make sure:
* that your data is available at the time it is needed.
* that nothing overwrites your data beforehand.
* that your data doesn't cause anything to go wrong somewhere.
This device driver is only pseudo, for learning purpose only. I am just learning to pass an integer to char driver which will manipulate the data and give the result. I find that strings work very well with write () system call, whereas we have problem with integers. Could you explain how to pass integers using write system call to the driver
Number formats need to match at both sender and receiver.
* Number of bytes
* Signed vs. unsigned
* Suppression of leading zero's
* Little or big endian
* Position of decimal point
Etc.
The least little non-matching thing can generate an error. And there may be a sequence of coded values which the driver expects to get, in addition to your data.
Anyway, since you have succeeded with strings, look for ways to convert a number back and forth from a string.
Can you convert 153 to a string by calling a function such as: a$=STR$(x)
Send as a word consisting of three characters (namely "153").
Then at the receiving end call a function such as: x=VAL(a$)
in order to recover the number.
Or another way, send characters whose ascii values can be assembled, or added, or subtracted to recreate your data.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.