m2mb API docs  25.20.008
m2mb API sets documentation
m2mb_usb.h
Go to the documentation of this file.
1 /*===============================================================================================*/
2 /* >>> Copyright (C) Telit Communications S.p.A. Italy All Rights Reserved. <<< */
28 #ifndef M2M_M2MB_USB_API_H
29 #define M2M_M2MB_USB_API_H
30 
31 /* Global declarations ==========================================================================*/
32 #ifndef NULL
33 #define NULL 0
34 #endif
35 
36 /* Global enums ==============================================================================*/
37 
38 enum M2MB_USB_IOCTL_REQUEST
39 {
40  M2MB_USB_IOCTL_SET_CFG = 0, /* set whole usb device configuration */
41  M2MB_USB_IOCTL_GET_CFG, /* get whole usb device configuration */
42  M2MB_USB_IOCTL_SET_CB, /* set usb rx callback function */
43  M2MB_USB_IOCTL_GET_CB, /* get usb rx callback function */
44  M2MB_USB_IOCTL_SET_USERDATA, /* set usb userdata */
45  M2MB_USB_IOCTL_GET_USERDATA, /* get usb userdata */
46  M2MB_USB_IOCTL_NOF_REQ /* number of m2mb usb ioctl requests */
47 };
48 
49 /* Global typedefs ==============================================================================*/
50 
51 typedef enum
52 {
53  M2MB_USB_RX_EVENT,
54  M2MB_USB_TX_EVENT
55 } M2MB_USB_IND_E;
56 
57 /* Client callback function type to be called when data is received from the client. */
58 typedef void ( *m2mb_usb_ind_callback )( INT32 fd, M2MB_USB_IND_E usb_event, UINT16 resp_size, void *resp_struct, void *userdata );
59 
60 /* USB device configuration struct */
61 typedef struct
62 {
63  m2mb_usb_ind_callback m2mb_usb_app_cb_func; /* this is a callback that user can register;
64  it will be called when new rx data is availavle
65  on dsm and when tx data has been transmitted */
66  void *userData; /* user data to be returned by callback function */
68 
69 typedef struct M2MB_USB_HANDLE_TAG *M2MB_USB_HANDLE;
70 
71 
72 /* Global functions =============================================================================*/
73 
74 /*-----------------------------------------------------------------------------------------------*/
109 /*-----------------------------------------------------------------------------------------------*/
110 
111 INT32 m2mb_usb_open( const CHAR *path, INT32 flags, ... );
112 
113 /*-----------------------------------------------------------------------------------------------*/
150  /*-----------------------------------------------------------------------------------------------*/
151 
152 INT32 m2mb_usb_close( INT32 fd );
153 
154 /*-----------------------------------------------------------------------------------------------*/
207  /*---------------------------------------------------------------------------------------------*/
208 
209 INT32 m2mb_usb_ioctl( INT32 fd, INT32 request, ... );
210 
211 /*-----------------------------------------------------------------------------------------------*/
252  /*---------------------------------------------------------------------------------------------*/
253 
254 SSIZE_T m2mb_usb_read( INT32 fd, void *buf, SIZE_T nbyte );
255 
256 /*-----------------------------------------------------------------------------------------------*/
299  /*-----------------------------------------------------------------------------------------------*/
300 
301 SSIZE_T m2mb_usb_write( INT32 fd, const void *buf, SIZE_T nbyte );
302 
303 #endif /* M2M_M2MB_USB_API_H */
304 
305 
m2mb_usb_write
SSIZE_T m2mb_usb_write(INT32 fd, const void *buf, SIZE_T nbyte)
m2mb_usb_write
M2MB_USB_CFG_T
Definition: m2mb_usb.h:61
m2mb_usb_read
SSIZE_T m2mb_usb_read(INT32 fd, void *buf, SIZE_T nbyte)
m2mb_usb_read
m2mb_usb_close
INT32 m2mb_usb_close(INT32 fd)
m2mb_usb_close
m2mb_usb_ioctl
INT32 m2mb_usb_ioctl(INT32 fd, INT32 request,...)
m2mb_usb_ioctl
m2mb_usb_open
INT32 m2mb_usb_open(const CHAR *path, INT32 flags,...)
m2mb_usb_open