Linux LITE MBIM
MBPL_SDK_R25_ENG3
|
Data Structures | |
struct | MBIM_TRANSPORT_ERR_INFO |
struct | MbimTransport |
struct | MbimTransaction |
struct | MbimIndicator |
struct | MbimSyncObject |
Files | |
file | MbimTransport.h |
file | MbimTransaction.h |
file | MbimIndicator.h |
file | MbimSyncObject.h |
file | BasicConnectDeviceService.h |
Typedefs | |
typedef void(* | MBIM_TRANSPORT_ERR_CALLBACK) (void *pErrCallbackContext, MBIM_TRANSPORT_ERR_INFO err_info) |
typedef struct MbimTransport | MbimTransport |
typedef void(* | MBIM_DONE_CALLBACK) (uint32_t status, uint32_t transactionId, uint8_t *informationBuffer, uint32_t informationBufferLength, void *pDoneCallbackContext) |
typedef struct MbimTransaction | MbimTransaction |
typedef void(* | MBIM_INDICATION_CALLBACK) (uint8_t *deviceServiceId, uint32_t cid, uint8_t *informationBuffer, uint32_t informationBufferLength, void *pIndicationCallbackContext) |
typedef struct MbimIndicator | MbimIndicator |
typedef struct MbimSyncObject | MbimSyncObject |
Enumerations | |
enum | MBIM_TRANSPORT_ERR_TYPE { MBIM_TRANSPORT_ERR_UNKNOWN, MBIM_TRANSPORT_ERR_READ, MBIM_TRANSPORT_ERR_WRITE } |
Functions | |
int | MbimTransport_Initialize (MbimTransport *pThis, char *devicePath, uint32_t maxExpectedInformationLength) |
void | MbimTransport_ShutDown (MbimTransport *pThis) |
int | MbimTransport_SendCommand (MbimTransport *pThis, const uint8_t *deviceServiceId, uint32_t cid, uint32_t commandType, uint8_t *informationBuffer, uint16_t informationBufferLength, MbimTransaction *pTransaction) |
uint32_t | MbimTransport_GetNextTransactionId (MbimTransport *pThis) |
void | MbimTransport_CancelTransaction (MbimTransport *pThis, uint32_t transactionId) |
void | MbimTransport_AttachIndicator (MbimTransport *pThis, MbimIndicator *pIndicator) |
void | MbimTransport_DetachIndicator (MbimTransport *pThis, MbimIndicator *pIndicator) |
void | MbimTransport_RegisterErrCallback (MbimTransport *pThis, MBIM_TRANSPORT_ERR_CALLBACK pErrCallback, void *pErrCallbackContext) |
void | MbimTransaction_Initialize (MbimTransaction *pThis, uint32_t transactionId, MBIM_DONE_CALLBACK pDoneCallback, void *pDoneCallbackContext) |
void | MbimIndicator_Initialize (MbimIndicator *pThis, MBIM_INDICATION_CALLBACK pIndicationCallback, void *pIndicationCallbackContext) |
int | MbimSyncObject_Initialize (MbimSyncObject *pThis, uint8_t *informationBuffer, uint32_t informationBufferLength) |
int | MbimSyncObject_Destroy (MbimSyncObject *pThis) |
int | MbimSyncObject_Lock (MbimSyncObject *pThis) |
int | MbimSyncObject_Unlock (MbimSyncObject *pThis) |
int | MbimSyncObject_Wait (MbimSyncObject *pThis) |
int | MbimSyncObject_TimedWait (MbimSyncObject *pThis, time_t timeoutSeconds) |
int | MbimSyncObject_Signal (MbimSyncObject *pThis) |
void | MbimSyncObject_DoneCallback (uint32_t status, uint32_t transactionId, uint8_t *informationBuffer, uint32_t informationBufferLength, void *pDoneCallbackContext) |
typedef void(* MBIM_TRANSPORT_ERR_CALLBACK) (void *pErrCallbackContext, MBIM_TRANSPORT_ERR_INFO err_info) |
MBIM transport error callback function.
[in] | pErrCallbackContext | User context of the callback function |
[in] | err_info | A MBIM_TRANSPORT_ERR_INFO structure which contains the detailed error info. |
typedef struct MbimTransport MbimTransport |
This structure abstracts a MBIM transport layer. It is responsible for applying MBIM headers to packets destined for MBIM device services and forwarding them to the device. It is responsible for receiving MBIM packets from the device. On the basis of MBIM headers, it assembles multi-fragment responses and indications and delivers them back to user.
deviceFd |
|
devRemoved |
|
shutdownFd |
|
writeLock |
|
readThread |
|
transactionId |
|
transactionIdLock |
|
transactionList |
|
transactionListLock |
|
pIncomingMessage |
|
indicatorList |
|
indicatorListLock |
|
pErrCallback |
|
pErrCallbackContext |
|
typedef void(* MBIM_DONE_CALLBACK) (uint32_t status, uint32_t transactionId, uint8_t *informationBuffer, uint32_t informationBufferLength, void *pDoneCallbackContext) |
This function prototype represents the callback which is called by the MBIM transport when a MBIM transaction completes.
[in] | status | MBIM status of the MBIM transaction. |
[in] | transactionId | Transaction ID of associated MBIM transaction. |
[in] | informationBuffer | Transaction response's informationBuffer. |
[in] | informationBufferLength | Number of bytes in transaction response's informationBuffer. |
[in] | pDoneCallbackContext | User context supplied when transaction was initialized. |
typedef struct MbimTransaction MbimTransaction |
This structure abstracts a MBIM transaction. It is responsible for tracking a MBIM request to its response.
pPrev |
|
pNext |
|
transactionId |
|
pDoneCallback |
|
pDoneCallbackContext |
|
status |
|
typedef void(* MBIM_INDICATION_CALLBACK) (uint8_t *deviceServiceId, uint32_t cid, uint8_t *informationBuffer, uint32_t informationBufferLength, void *pIndicationCallbackContext) |
This funcion prototype represents the callback which is called by the MBIM transport when a MBIM indication is received.
[in] | informationBuffer | Indication's informationBuffer. |
[in] | informationBufferLength | Number of bytes in indication's informationBuffer. |
[in] | pIndicationCallbackContext | User context supplied when indicator was initialized. |
typedef struct MbimIndicator MbimIndicator |
This structure abstracts a MBIM indication callback. Users who wish to be notified of MBIM indications can register one of these objects with the MbimTransport object using MbimTransport_AttachIndicator/MbimTransport_DetachIndicator calls.
pPrev |
|
pNext |
|
pIndicationCallback |
|
pIndicationCallbackContext |
|
typedef struct MbimSyncObject MbimSyncObject |
This structure is a wrapper around a mutex and condition object and an external buffer. It is a convenience object which may be used to create synchronous MBIM APIs.
mutex |
|
condition |
|
status |
|
informationBuffer |
|
informationBufferLength |
|
MBIM transport error type definitions
int MbimTransport_Initialize | ( | MbimTransport * | pThis, |
char * | devicePath, | ||
uint32_t | maxExpectedInformationLength | ||
) |
Initialize this MBIM transport object.
[in] | pThis | The primary object of this call. |
[in] | devicePath | Absolute path to device. |
[in] | maxExpectedInformationLength | Maximum expected length of information content. |
void MbimTransport_ShutDown | ( | MbimTransport * | pThis | ) |
Shut down this MBIM transport object.
[in] | pThis | The primary object of this call. |
int MbimTransport_SendCommand | ( | MbimTransport * | pThis, |
const uint8_t * | deviceServiceId, | ||
uint32_t | cid, | ||
uint32_t | commandType, | ||
uint8_t * | informationBuffer, | ||
uint16_t | informationBufferLength, | ||
MbimTransaction * | pTransaction | ||
) |
Send a MBIM command to the device and return immediately.
[in] | pThis | The primary object of this call. |
[in] | deviceServiceId | Device service UUID which is recipient of command. |
[in] | cid | Command ID (CID) which is specific to that device service. |
[in] | commandType | 1 = set, 0 = get. |
[in] | informationBuffer | Buffer of information content. |
[in] | informationBufferLength | Size in bytes of information content. |
[in] | pTransaction | Transaction object which will track the command/response. |
uint32_t MbimTransport_GetNextTransactionId | ( | MbimTransport * | pThis | ) |
Returns next transaction ID for MBIM transport.
[in] | pThis | The primary object of this call. |
void MbimTransport_CancelTransaction | ( | MbimTransport * | pThis, |
uint32_t | transactionId | ||
) |
Cancel an outstanding MBIM transaction.
[in] | pThis | The primary object of this call. |
[in] | transactionId | ID of transaction to be cancelled. |
void MbimTransport_AttachIndicator | ( | MbimTransport * | pThis, |
MbimIndicator * | pIndicator | ||
) |
Attaches a MBIM indicator to this MBIM transport object.
[in] | pThis | The primary object of this call. |
[in] | pIndicator | Indicator to be attached. |
void MbimTransport_DetachIndicator | ( | MbimTransport * | pThis, |
MbimIndicator * | pIndicator | ||
) |
Detaches a MBIM indicator to this MBIM transport object.
[in] | pThis | The primary object of this call. |
[in] | pIndicator | Indicator to be detached. |
void MbimTransport_RegisterErrCallback | ( | MbimTransport * | pThis, |
MBIM_TRANSPORT_ERR_CALLBACK | pErrCallback, | ||
void * | pErrCallbackContext | ||
) |
This function is for client applications to register for lite-mbim transport error notifications. The most recent callback registration is the only function that is invoked when device is removed.
[in] | pThis | The primary object of this call. |
[in] | pErrCallback | A valid function pointer to be notified when transport error occurred. NULL to disable callback notifications. |
[in] | pErrCallbackContext | User context when transport error callback is called. |
void MbimTransaction_Initialize | ( | MbimTransaction * | pThis, |
uint32_t | transactionId, | ||
MBIM_DONE_CALLBACK | pDoneCallback, | ||
void * | pDoneCallbackContext | ||
) |
Initialize MBIM transaction.
[in] | pThis | The primary object of this call. |
[in] | transactionId | Transaction ID obtained from a call to MbimTransport_GetNextTransactionId. |
[in] | pDoneCallback | User function to be be called when MBIM response is received. |
[in] | pDoneCallbackContext | A user context for callback. |
void MbimIndicator_Initialize | ( | MbimIndicator * | pThis, |
MBIM_INDICATION_CALLBACK | pIndicationCallback, | ||
void * | pIndicationCallbackContext | ||
) |
Initialize the indicator object.
[in] | pThis | The primary object of this call. |
[in] | pIndicationCallback | User function to be be called when MBIM indication is received. |
[in] | pIndicationCallbackContext | A user context for callback. |
int MbimSyncObject_Initialize | ( | MbimSyncObject * | pThis, |
uint8_t * | informationBuffer, | ||
uint32_t | informationBufferLength | ||
) |
Initialize sync object.
[in] | pThis |
|
[in] | informationBuffer |
|
[in] | informationBufferLength |
|
int MbimSyncObject_Destroy | ( | MbimSyncObject * | pThis | ) |
Destroy sync object.
[in] | pThis | The primary object of this call. |
int MbimSyncObject_Lock | ( | MbimSyncObject * | pThis | ) |
Lock sync object.
[in] | pThis | The primary object of this call. |
int MbimSyncObject_Unlock | ( | MbimSyncObject * | pThis | ) |
Unlock sync object.
[in] | pThis | The primary object of this call. |
int MbimSyncObject_Wait | ( | MbimSyncObject * | pThis | ) |
Block, waiting on sync object.
[in] | pThis | The primary object of this call. |
int MbimSyncObject_TimedWait | ( | MbimSyncObject * | pThis, |
time_t | timeoutSeconds | ||
) |
Block, waiting on sync object for a number of seconds.
[in] | pThis | The primary object of this call. |
[in] | timeoutSeconds | Timeout in seconds before abondoning wait. |
int MbimSyncObject_Signal | ( | MbimSyncObject * | pThis | ) |
Signal sync object. Waiting thread should wake up.
[in] | pThis | The primary object of this call. |
void MbimSyncObject_DoneCallback | ( | uint32_t | status, |
uint32_t | transactionId, | ||
uint8_t * | informationBuffer, | ||
uint32_t | informationBufferLength, | ||
void * | pDoneCallbackContext | ||
) |
This funcion copies MBIM command response's informationBuffer to this object's informationBuffer and signals the waiting thread.
[in] | status | MBIM status of the MBIM transaction. |
[in] | transactionId | Transaction ID of associated MBIM transaction. |
[in] | informationBuffer | Transaction response's informationBuffer. |
[in] | informationBufferLength | Number of bytes in transaction response's informationBuffer. |
[in] | pDoneCallbackContext | Pointer to this sync object. |