How to implement this case(in the picture)?
|
|
---|---|
Hello, To implenment this case,this is my client code
Is my idea right? Besides,I have another question about the picture.Dose the gray circle mean the hardware? How dose the device exchange data with the hardware? Thanks! wT |
|
|
---|---|
Hi, yes your code is close to being right. You have understood the basic principle. You probably need to extract the returned data from your device into a data type your do_some_data_process() function understands. You can either do this in the routine itself or before you send the DeviceData to your routine. Yes the grey bubble represents the hardware. How you communicate with the hardware is completely dependant on the hardware interface. It could be ethernet in which case you would communicate via a socket or a protocol like http, it could be a card in the pci bus in which case you need a software library to communicate with the hardware (SDK), it could be a serial line in which case you need to send commands (usually in ascii) to the device over the serial port. Nowadays ethernet is very common. Hope this helps. Andy |