Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Reading information from a USB into a program?  RSS feed

 
Jay Orsaw
Ranch Hand
Posts: 356
Android Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay so I have a client who wants me to be able to read some data from a device of his connected by a USB port. He wants me to get the data and create a program from it. I tried googling but had no luck, so I wanted to know if anyone has any idea how I would do this? DO I need a 3rd party app to be able to read in the information from the USB, or would it be some file on the USB that I just read in? He mentioned a driver for it?
 
Paul Witten
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jay Orsaw wrote:Okay so I have a client who wants me to be able to read some data from a device of his connected by a USB port. He wants me to get the data and create a program from it. I tried googling but had no luck, so I wanted to know if anyone has any idea how I would do this? DO I need a 3rd party app to be able to read in the information from the USB, or would it be some file on the USB that I just read in? He mentioned a driver for it?

What does "get the data and create a program from it" mean Jay?

What did you google?

Are you required to read from a stream or from a file on a device connected by USB?

I think you'd be better off trying to describe the requirements more clearly. If you don't understand the requirements then that fella with the driver should know. Nobody here would know what the driver is supposed to do better than that pesky lil' fella.
 
Jay Orsaw
Ranch Hand
Posts: 356
Android Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Witten wrote:
Jay Orsaw wrote:Okay so I have a client who wants me to be able to read some data from a device of his connected by a USB port. He wants me to get the data and create a program from it. I tried googling but had no luck, so I wanted to know if anyone has any idea how I would do this? DO I need a 3rd party app to be able to read in the information from the USB, or would it be some file on the USB that I just read in? He mentioned a driver for it?

What does "get the data and create a program from it" mean Jay?

What did you google?

Are you required to read from a stream or from a file on a device connected by USB?

I think you'd be better off trying to describe the requirements more clearly. If you don't understand the requirements then that fella with the driver should know. Nobody here would know what the driver is supposed to do better than that pesky lil' fella.



That's the part I was confused about. Should there be a driver that I need to read, or like he said it would be like an oscilliscope... Would that mean I just read in the stream of data from the unit? it's not a device like a phone, or anything, and the only information should be the votage, and resistance of the unit, so I'm not sure exactly what he's wanting to do, which is why I'm confused. I assume if there was a driver I would just need to be told hope to read it; however I am interested in how they would make that driver? What would needed? I'm curious as a programmer.
 
Paul Witten
Ranch Hand
Posts: 86
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jay Orsaw wrote:That's the part I was confused about. Should there be a driver that I need to read, or like he said it would be like an oscilliscope... Would that mean I just read in the stream of data from the unit? it's not a device like a phone, or anything, and the only information should be the votage, and resistance of the unit, so I'm not sure exactly what he's wanting to do, which is why I'm confused. I assume if there was a driver I would just need to be told hope to read it; however I am interested in how they would make that driver? What would needed? I'm curious as a programmer.

Ah, a medical device. Well, the bad news is that there is only one option, but the good news is that the option is the key to your world: Get the doc to the driver. The driver apparently offers and API, and if the API is documented correctly then it will spell out how to connect (which port) what the data types are, how the stream is delimited, etc. Somebody should have offered this to you as required reading already though. It's not like a programmer can figure out an API without reading the doc. Maybe they did give it to you already. If there is a jar or zip that they gave you then perhaps they zipped the doc in there and just expected that you'd find it. Anything can be going on, but it's not normal for somebody to inform you of a driver with no API doc and expect you to figure it out.

Everything I just said to you is offered from a deep dark cave where I have no idea what human transactions have been involved or what expectations have been set or what API exists or doesn't exist. It's just a guess.

My question for the guy with the driver would be, "Where the hell is the API doc? I've been waiting a week to hear from you." Har ...
 
Jay Orsaw
Ranch Hand
Posts: 356
Android Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Witten wrote:
Jay Orsaw wrote:That's the part I was confused about. Should there be a driver that I need to read, or like he said it would be like an oscilliscope... Would that mean I just read in the stream of data from the unit? it's not a device like a phone, or anything, and the only information should be the votage, and resistance of the unit, so I'm not sure exactly what he's wanting to do, which is why I'm confused. I assume if there was a driver I would just need to be told hope to read it; however I am interested in how they would make that driver? What would needed? I'm curious as a programmer.

Ah, a medical device. Well, the bad news is that there is only one option, but the good news is that the option is the key to your world: Get the doc to the driver. The driver apparently offers and API, and if the API is documented correctly then it will spell out how to connect (which port) what the data types are, how the stream is delimited, etc. Somebody should have offered this to you as required reading already though. It's not like a programmer can figure out an API without reading the doc. Maybe they did give it to you already. If there is a jar or zip that they gave you then perhaps they zipped the doc in there and just expected that you'd find it. Anything can be going on, but it's not normal for somebody to inform you of a driver with no API doc and expect you to figure it out.

Everything I just said to you is offered from a deep dark cave where I have no idea what human transactions have been involved or what expectations have been set or what API exists or doesn't exist. It's just a guess.

My question for the guy with the driver would be, "Where the hell is the API doc? I've been waiting a week to hear from you." Har ...


HAHA yes exactly that's why I;m so confused. Apparently he told me he's getting some dude who does C++ to make the driver.... So that comes to the conclusion how do you make the driver if you have to make it from nothing? Or what are you making it from? Can I make the drivers, or is that something you would do at the chip level, etc, etc?
 
Paul Witten
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jay Orsaw wrote:HAHA yes exactly that's why I;m so confused. Apparently he told me he's getting some dude who does C++ to make the driver.... So that comes to the conclusion how do you make the driver if you have to make it from nothing? Or what are you making it from? Can I make the drivers, or is that something you would do at the chip level, etc, etc?

Drivers tend to sit between the hardware and applications, so his objective is to write a piece of code that exposes a clean API for your app to get to the device firmware. He will have to expose methods that let you query the device. Your code will not talk directly to the device firmware. It will talk to his driver's API. The data may come as a character stream from port xxxx or it may be a bytestream, or other stream. It may be event driven, we don't know, only he would know once he has studied the API of the device, etc.

Let's hope he documents the API well. After all, he is beholden to the document of the device firmware API and should know the value of a good doc. Get to know that guy if you can. Take him to lunch. Ask him about the design of his API and he'd probably be tickled to explain it to another human.
 
Jay Orsaw
Ranch Hand
Posts: 356
Android Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Witten wrote:
Jay Orsaw wrote:HAHA yes exactly that's why I;m so confused. Apparently he told me he's getting some dude who does C++ to make the driver.... So that comes to the conclusion how do you make the driver if you have to make it from nothing? Or what are you making it from? Can I make the drivers, or is that something you would do at the chip level, etc, etc?

Drivers tend to sit between the hardware and applications, so his objective is to write a piece of code that exposes a clean API for your app to get to the device firmware. He will have to expose methods that let you query the device. Your code will not talk directly to the device firmware. It will talk to his driver's API. The data may come as a character stream from port xxxx or it may be a bytestream, or other stream. It may be event driven, we don't know, only he would know once he has studied the API of the device, etc.

Let's hope he documents the API well. After all, he is beholden to the document of the device firmware API and should know the value of a good doc. Get to know that guy if you can. Take him to lunch. Ask him about the design of his API and he'd probably be tickled to explain it to another human.



Haha ic... So the Firmware is where the goodies are.... So the only way I could make drivers myself is if I understood how the firmware works? He's getting some dude to make the driver apparently, so it's not him, it's some other dude.... Or if I could do it that would be better, but i'm not sure if there is a certain language for drivers. Sadly he lives on the other side of the US so no lunch for him :P.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!