Advice on Project

M

Milton

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
 
M

Malcolm

Milton said:
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.
 
K

kal

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;}
 
C

CBFalconer

kal said:
.... 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.
 
I

Imanpreet Singh Arora

kal said:
(e-mail address removed) (Milton) wrote in message

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.
 
I

Imanpreet Singh Arora

Milton said:
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?
 
R

red floyd

Imanpreet said:
[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

Smoker

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 :)
 
M

Mac

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
 
M

Milton

Mac said:
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.
 
G

gokrix

red said:
Imanpreet said:
[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
 
M

Malcolm

Imanpreet Singh Arora said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,146
Messages
2,570,831
Members
47,374
Latest member
anuragag27

Latest Threads

Top