Einzelnen Beitrag anzeigen

hathor
(Gast)

n/a Beiträge
 
#5

AW: USB mit Message

  Alt 3. Jan 2014, 11:58
So wie bei COM-Ports gibt es auch bei USB Handshakes:

Transaction types which support flow control return handshakes to indicate:

Successful reception of data
Command acceptance or rejection
Flow control
Halt conditions

http://wiki.osdev.org/Universal_Serial_Bus

Aber man müsste die Hardware-Umsetzung RS485-USB kennen, um das Handshaking zu kennen.
Am Besten wäre eine Weiterleitung eines Interrupts, um CPU-Waste time zu vermeiden.

Nachtrag:
In den Software-Beispielen gibt es C#-Code - da wird aber leider auch nur gepollt:

Code:
#define PROFI_RCV_CON_IND()    do                                                                                \
                                {                                                                                  \
                                  con_ind_buffer_len = 256;                                                       \
                                  result = profi_rcv_con_ind (&con_ind_sdb, con_ind_buffer, &con_ind_buffer_len); \
                                  if (_kbhit ()) if (_getch () == 'q') exit (0);                                    \
                                } while (result == NO_CON_IND_RECEIVED);                                          \
                                                                                                                   \
                                if (result == E_IF_FATAL_ERROR) handle_fatal_error ((T_EXCEPTION*) con_ind_buffer)

Geändert von hathor ( 3. Jan 2014 um 12:32 Uhr)
  Mit Zitat antworten Zitat