6 #ifndef __MBIM_TRANSPORT_H__ 7 #define __MBIM_TRANSPORT_H__ 20 #define MBIM_UUID_SIZE 16 22 #define MBIM_MAX_CIDS 64 24 // TODO: determine at runtime by quering USB descriptor or ioctl to driver. 25 #define MBIM_MAX_CTRL_TRANSFER 4096 28 #define MBIM_COMMAND_TYPE_QUERY 0 29 #define MBIM_COMMAND_TYPE_SET 1 31 #define MBIM_STATUS_SUCCESS 0 32 #define MBIM_STATUS_FAILURE 2 33 #define MBIM_STATUS_INVALID_PARAMETERS 21 34 #define MBIM_STATUS_READ_FAILURE 22 35 #define MBIM_STATUS_WRITE_FAILURE 23 36 #define MBIM_STATUS_CUSTOM_BUILD_FAILURE 0xfffffff0 37 #define MBIM_STATUS_CUSTOM_PARSE_FAILURE 0xfffffff1 46 MBIM_TRANSPORT_ERR_UNKNOWN,
47 MBIM_TRANSPORT_ERR_READ,
48 MBIM_TRANSPORT_ERR_WRITE,
64 MBIM_TRANSPORT_ERR_TYPE err_type;
140 #ifndef EVENT_FD_UNSUPPORTED 145 pthread_mutex_t writeLock;
146 pthread_t readThread;
147 uint32_t transactionId;
148 pthread_mutex_t transactionIdLock;
150 pthread_mutex_t transactionListLock;
151 struct MultiFragmentMessage* pIncomingMessage;
153 pthread_mutex_t indicatorListLock;
155 void * pErrCallbackContext;
205 const uint8_t* deviceServiceId,
207 uint32_t commandType,
208 uint8_t* informationBuffer,
209 uint16_t informationBufferLength,
266 uint8_t* informationBuffer,
267 uint32_t informationBufferLength,
268 void* pParseCallbackContext
293 const uint8_t* deviceService,
295 uint32_t commandType,
296 uint8_t* informationBuffer,
297 uint16_t informationBufferLength,
299 void* pParseCallbackContext,
320 void * pErrCallbackContext
327 #endif //__MBIM_TRANSPORT_H__ MBIM_TRANSPORT_ERR_TYPE
Definition: MbimTransport.h:44
void MbimTransport_ShutDown(MbimTransport *pThis)
void(* MBIM_TRANSPORT_ERR_CALLBACK)(void *pErrCallbackContext, MBIM_TRANSPORT_ERR_INFO err_info)
Definition: MbimTransport.h:79
struct MbimTransport MbimTransport
Definition: MbimTransport.h:136
void MbimTransport_AttachIndicator(MbimTransport *pThis, MbimIndicator *pIndicator)
void MbimTransport_DetachIndicator(MbimTransport *pThis, MbimIndicator *pIndicator)
Definition: MbimTransport.h:62
Definition: MbimTransaction.h:72
uint32_t(* MBIM_PARSE_CALLBACK)(uint8_t *informationBuffer, uint32_t informationBufferLength, void *pParseCallbackContext)
Definition: MbimTransport.h:265
Definition: MbimIndicator.h:62
uint32_t MbimTransport_ExecuteCommandSynchronously(MbimTransport *pTransport, const uint8_t *deviceService, uint32_t cid, uint32_t commandType, uint8_t *informationBuffer, uint16_t informationBufferLength, MBIM_PARSE_CALLBACK pParseCallback, void *pParseCallbackContext, time_t timeout)
int MbimTransport_SendCommand(MbimTransport *pThis, const uint8_t *deviceServiceId, uint32_t cid, uint32_t commandType, uint8_t *informationBuffer, uint16_t informationBufferLength, MbimTransaction *pTransaction)
int MbimTransport_Initialize(MbimTransport *pThis, char *devicePath, uint32_t maxExpectedInformationLength)
void MbimTransport_RegisterErrCallback(MbimTransport *pThis, MBIM_TRANSPORT_ERR_CALLBACK pErrCallback, void *pErrCallbackContext)
void MbimTransport_CancelTransaction(MbimTransport *pThis, uint32_t transactionId)
uint32_t MbimTransport_GetNextTransactionId(MbimTransport *pThis)