m2m_hw_usb_write

M2M_API_RESULT m2m_hw_usb_write (M2M_T_HW_USB_HANDLE handle,

CHAR *buffer, INT32 len, INT32 *len_sent)

 

Description: the function sends data through USB channel. The sending modes are set by the function m2m_hw_usb_ioctl.

If USB cable is not plugged in, the function returns a fail. If the cable is disconnected during running operation, the function returns the number of bytes written up to the cable disconnection events. If no bytes have been written, the function returns zero. This behaviors is independent from the write blocking mode set. 

 

Parameters:
handle:                  USB channel handle
buffer:                   pointer to the allocated buffer containing the data to be sent
len:              number of characters to be sent.

len_sent:       pointer to the allocated variable that will be filled with the number of data sent (bytes).

 

Return value:
         refer to M2M_API_RESULT enum

 

Output data:
        
on success:   number of bytes that was sent, see "len_sent" parameter
        
on failure:     len_sent = 0, buffer content unchanged