By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,617 Members | 1,166 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,617 IT Pros & Developers. It's quick & easy.

Advice on Project

P: n/a
Hello,
This isn't exactly a C programming question, but i figured experienced
C programmers would offer the best response.
My boss wants a program developed that reads from ANY
device(peripheral) over a serial/usb/tin can/etc. connection. I've
tried convincing him it needs to be more specific (develop a driver
for ONE device and go from there) but to no avail, I would like
somebody else's professional opinion of why this is not attainable, or
just comments/convincing arguments.
Thank You
Nov 14 '05 #1
Share this Question
Share on Google+
11 Replies


P: n/a

"Milton" <fo*******@hotmail.com> wrote

This isn't exactly a C programming question, but i figured experienced
C programmers would offer the best response.
My boss wants a program developed that reads from ANY
device(peripheral) over a serial/usb/tin can/etc. connection. I've
tried convincing him it needs to be more specific (develop a driver
for ONE device and go from there) but to no avail, I would like
somebody else's professional opinion of why this is not attainable, or
just comments/convincing arguments.

This question is very platform-specific. If your platform abstracts devices,
let's say handles them as files, then you can write a program that can read
from any device. However this may not be too useful, for instance a video
camera will give a huge amount of data that is inherently two dimensional, a
morse key will just give a trickle of data that is essentially analogue,
though digitised for the computer. You can dump the data in hex format to
the screen, but actually writing one routine that will do something useful
with these two sources is very tricky.

If the platform doesn't abstract devices, the you will need a separate
interface to each one. Since the program must handle any device, you will
need facilities for loading a video device driver for the video camera, a
morse driver for the morse code key, and so on. This is not inherently
impossible (operating systems do just that) but it is a very tricky bit of
programming requiring deep knowledge of the platform internals.
Nov 14 '05 #2

P: n/a
kal
fo*******@hotmail.com (Milton) wrote in message news:<9d**************************@posting.google. com>...
Hello,
This isn't exactly a C programming question, but i figured experienced
C programmers would offer the best response.
My boss wants a program developed that reads from ANY
device(peripheral) over a serial/usb/tin can/etc. connection. I've
tried convincing him it needs to be more specific (develop a driver
for ONE device and go from there) but to no avail, I would like
somebody else's professional opinion of why this is not attainable, or
just comments/convincing arguments.
Thank You


You are paraphrasing what your boss told you. you have omitted
substantial but relevant details of the problem at hand.

The program given below reads from ANY peripheral device.
In fact it reads from ALL the devices. It also reads from
devices attached to other computers within a hundred yards.

#include <assert.h>
#include <complex.h>
#include <ctype.h>
#include <errno.h>
#include <fenv.h>
#include <float.h>
#include <inttypes.h>
#include <iso646.h>
#include <limits.h>
#include <locale.h>
#include <math.h>
#include <setjmp.h>
#include <signal.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <tgmath.h>
#include <time.h>
#include <wchar.h>
#include <wctype.h>

int main(){for(;;)fgetc(stdin);return 0;}
Nov 14 '05 #3

P: n/a
kal wrote:
.... snip ...
The program given below reads from ANY peripheral device.
In fact it reads from ALL the devices. It also reads from
devices attached to other computers within a hundred yards.


.... snip foolish code ...

Don't give such silly advice without clearly indicating it is
meant in jest. Some dewey eyed newbie might take you seriously.

--
Chuck F (cb********@yahoo.com) (cb********@worldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!
Nov 14 '05 #4

P: n/a

"kal" <k_*****@yahoo.com> wrote in message
news:a5**************************@posting.google.c om...
fo*******@hotmail.com (Milton) wrote in message

news:<9d**************************@posting.google. com>...
Hello,
This isn't exactly a C programming question, but i figured experienced
C programmers would offer the best response.
My boss wants a program developed that reads from ANY
device(peripheral) over a serial/usb/tin can/etc. connection. I've
tried convincing him it needs to be more specific (develop a driver
for ONE device and go from there) but to no avail, I would like
somebody else's professional opinion of why this is not attainable, or
just comments/convincing arguments.
Thank You


You are paraphrasing what your boss told you. you have omitted
substantial but relevant details of the problem at hand.

The program given below reads from ANY peripheral device.
In fact it reads from ALL the devices. It also reads from
devices attached to other computers within a hundred yards.

#include <assert.h>
#include <complex.h>
#include <ctype.h>
#include <errno.h>
#include <fenv.h>
#include <float.h>
#include <inttypes.h>
#include <iso646.h>
#include <limits.h>
#include <locale.h>
#include <math.h>
#include <setjmp.h>
#include <signal.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <tgmath.h>
#include <time.h>
#include <wchar.h>
#include <wctype.h>

int main(){for(;;)fgetc(stdin);return 0;}


Any??????????????????????????????????.
Arse-hole.
--
Imanpreet Singh Arora
If I would have only known, I would have been a locksmith.
-- Albert Einstein


Nov 14 '05 #5

P: n/a

"Milton" <fo*******@hotmail.com> wrote in message
news:9d**************************@posting.google.c om...
Hello,
This isn't exactly a C programming question, but i figured experienced
C programmers would offer the best response.
My boss wants a program developed that reads from ANY
device(peripheral) over a serial/usb/tin can/etc. connection. I've
tried convincing him it needs to be more specific (develop a driver
for ONE device and go from there) but to no avail, I would like
somebody else's professional opinion of why this is not attainable, or
just comments/convincing arguments.
Thank You


Like someone else has also stated this this quite a OS dependent question. I
ain't sure how you can do it in Windows. But on Linux/Unix(1) you may just
take the device as an argument and read from it just like any other file.
(1) Does Unix also has the same concept of /dev/XXXX?

--
Imanpreet Singh Arora
If I would have only known, I would have been a locksmith.
-- Albert Einstein


Nov 14 '05 #6

P: n/a
Imanpreet Singh Arora wrote:
"Milton" <fo*******@hotmail.com> wrote in message
news:9d**************************@posting.google.c om...
[redacted] Like someone else has also stated this this quite a OS dependent question. I
ain't sure how you can do it in Windows. But on Linux/Unix(1) you may just
take the device as an argument and read from it just like any other file.
(1) Does Unix also has the same concept of /dev/XXXX?


Where do you think Linux got the concept of /dev/XXXX from?

Nov 14 '05 #7

P: n/a
On 18 Aug 2004 09:41:03 -0700, fo*******@hotmail.com (Milton) wrote:
Hello,
This isn't exactly a C programming question, but i figured experienced
C programmers would offer the best response.
My boss wants a program developed that reads from ANY
device(peripheral) over a serial/usb/tin can/etc. connection. I've
tried convincing him it needs to be more specific (develop a driver
for ONE device and go from there) but to no avail, I would like
somebody else's professional opinion of why this is not attainable, or
just comments/convincing arguments.
Thank You

This is what the OS is doing, so the "program" your boss wants
developed already exists on most platforms - it is the device handling
part of the OS. And the OS typically won't let you run a program that
reads from devices - you will need to use some kind of interface to
the device, provided by the OS.

Of course the OS will let you write and run your own device driver
instead of the one the manufacturer of the device provides - but why
would you want to do that? It has nothing to do with the original
task.

Another thought: ... reads from ANY device ... and what DOES it with
all that data? Pass it over to client programs that KNOW something
about that data? Well... looks like you're going to write a new OS for
your boss :)
Nov 14 '05 #8

P: n/a
Mac
On Wed, 18 Aug 2004 09:41:03 -0700, Milton wrote:
Hello,
This isn't exactly a C programming question, but i figured experienced
C programmers would offer the best response.
My boss wants a program developed that reads from ANY
device(peripheral) over a serial/usb/tin can/etc. connection. I've
tried convincing him it needs to be more specific (develop a driver
for ONE device and go from there) but to no avail, I would like
somebody else's professional opinion of why this is not attainable, or
just comments/convincing arguments.
Thank You


Are you sure you're not just trolling? This sounds like some kind of joke.

What you have outlined is far too vague to be called a project. It isn't
even a concept. It is a sketch of a concept. Not only that, but you will
most likely be re-inventing the wheel since device drivers probably
already exist which do this for any device where the idea makes sense.

Anyway, I suggest that you tell your boss that you like his idea and are
going to write up a detailed engineering specification for it. If he
agrees, then write it up as you see fit, and give it to him. Make sure you
spell out exactly what your code will and will not be able to do so that
you don't create expectations that can't be filled. You might want to
estimate the time for various parts of the project and identify the major
risks that you see. Explain how you will make it easy to add new devices
and you will start by reading from a file. After the file reading code is
debugged, you will add support for other devices one at a time. But this
will be easy because of the modular way you wrote the code in the first
place.

If he won't let you write up the specification or if he can't be bothered
to read it but still wants you to do the project, I suggest you find a way
for someone else to be your boss. (New manager at same company, or new
company.)

Good luck.

--Mac

Nov 14 '05 #9

P: n/a
Mac <fo*@bar.net> wrote in message news:<pa***************************@bar.net>...
Are you sure you're not just trolling? This sounds like some kind of joke.

Sadly, no. This is a true story.
What you have outlined is far too vague to be called a project. It isn't
even a concept. It is a sketch of a concept. Not only that, but you will
most likely be re-inventing the wheel since device drivers probably
already exist which do this for any device where the idea makes sense.
Yeah, the drivers were one of the annoying parts. There was also
"Installing needed programs without user interaction" and "Installing
drivers through a website" /issues/.

Anyway, I suggest that you tell your boss that you like his idea and are
going to write up a detailed engineering specification for it. If he
agrees, then write it up as you see fit, and give it to him. Make sure you
spell out exactly what your code will and will not be able to do so that
you don't create expectations that can't be filled. You might want to
estimate the time for various parts of the project and identify the major
risks that you see. Explain how you will make it easy to add new devices
and you will start by reading from a file. After the file reading code is
debugged, you will add support for other devices one at a time. But this
will be easy because of the modular way you wrote the code in the first
place.


We had a meeting yesterday. It was about 2 hours long, and his
various toys that he wanted to make became some Rube Goldberg machine
involving a torn apart mouse and spinning wheels and levers assembled
in the lunch room. I think the project is dead now.
Nov 14 '05 #10

P: n/a
red floyd wrote:
Imanpreet Singh Arora wrote:
"Milton" <fo*******@hotmail.com> wrote in message
news:9d**************************@posting.google.c om...
[redacted]


Like someone else has also stated this this quite a OS dependent
question. I
ain't sure how you can do it in Windows. But on Linux/Unix(1) you may
just
take the device as an argument and read from it just like any other file.
(1) Does Unix also has the same concept of /dev/XXXX?


Where do you think Linux got the concept of /dev/XXXX from?


(S)he doesn't know, and that's why (s)he asked.

Thanks,
--GS

Nov 14 '05 #11

P: n/a

"Imanpreet Singh Arora" <ma*********@msn.com> wrote
The program given below reads from ANY peripheral device.
In fact it reads from ALL the devices. It also reads from
devices attached to other computers within a hundred yards.

#include <assert.h>
#include <complex.h>
#include <ctype.h>
#include <errno.h>
#include <fenv.h>
#include <float.h>
#include <inttypes.h>
#include <iso646.h>
#include <limits.h>
#include <locale.h>
#include <math.h>
#include <setjmp.h>
#include <signal.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <tgmath.h>
#include <time.h>
#include <wchar.h>
#include <wctype.h>

int main(){for(;;)fgetc(stdin);return 0;}


Any??????????????????????????????????.
Arse-hole.

The prgram will read from any device that the platform allows to be attached
to stdin. For the average user this is just the keyboard, but most platforms
will allow advanced users to set up other devices as virtual keyboards.
Nov 14 '05 #12

This discussion thread is closed

Replies have been disabled for this discussion.