libmbim-glib Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy |
MbimMessage; enum MbimMessageType; struct MbimIPv4; struct MbimIPv6; enum MbimMessageCommandType; MbimMessage * mbim_message_new (const guint8 *data
,guint32 data_length
); MbimMessage * mbim_message_dup (const MbimMessage *self
); MbimMessage * mbim_message_ref (MbimMessage *self
); void mbim_message_unref (MbimMessage *self
); gchar * mbim_message_get_printable (const MbimMessage *self
,const gchar *line_prefix
,gboolean headers_only
); const guint8 * mbim_message_get_raw (const MbimMessage *self
,guint32 *length
,GError **error
); MbimMessageType mbim_message_get_message_type (const MbimMessage *self
); guint32 mbim_message_get_message_length (const MbimMessage *self
); guint32 mbim_message_get_transaction_id (const MbimMessage *self
); void mbim_message_set_transaction_id (MbimMessage *self
,guint32 transaction_id
); const gchar * mbim_message_type_get_string (MbimMessageType val
); MbimMessage * mbim_message_open_new (guint32 transaction_id
,guint32 max_control_transfer
); guint32 mbim_message_open_get_max_control_transfer (const MbimMessage *self
); MbimStatusError mbim_message_open_done_get_status_code (const MbimMessage *self
); gboolean mbim_message_open_done_get_result (const MbimMessage *self
,GError **error
); MbimMessage * mbim_message_close_new (guint32 transaction_id
); MbimStatusError mbim_message_close_done_get_status_code (const MbimMessage *self
); gboolean mbim_message_close_done_get_result (const MbimMessage *self
,GError **error
); MbimMessage * mbim_message_error_new (guint32 transaction_id
,MbimProtocolError error_status_code
); MbimProtocolError mbim_message_error_get_error_status_code (const MbimMessage *self
); GError * mbim_message_error_get_error (const MbimMessage *self
); MbimMessage * mbim_message_command_new (guint32 transaction_id
,MbimService service
,guint32 cid
,MbimMessageCommandType command_type
); void mbim_message_command_append (MbimMessage *self
,const guint8 *buffer
,guint32 buffer_size
); MbimService mbim_message_command_get_service (const MbimMessage *self
); const MbimUuid * mbim_message_command_get_service_id (const MbimMessage *self
); guint32 mbim_message_command_get_cid (const MbimMessage *self
); MbimMessageCommandType mbim_message_command_get_command_type (const MbimMessage *self
); const guint8 * mbim_message_command_get_raw_information_buffer (const MbimMessage *self
,guint32 *length
); const gchar * mbim_message_command_type_get_string (MbimMessageCommandType val
); MbimService mbim_message_command_done_get_service (const MbimMessage *self
); const MbimUuid * mbim_message_command_done_get_service_id (const MbimMessage *self
); guint32 mbim_message_command_done_get_cid (const MbimMessage *self
); MbimStatusError mbim_message_command_done_get_status_code (const MbimMessage *self
); gboolean mbim_message_command_done_get_result (const MbimMessage *self
,GError **error
); const guint8 * mbim_message_command_done_get_raw_information_buffer (const MbimMessage *self
,guint32 *length
); MbimService mbim_message_indicate_status_get_service (const MbimMessage *self
); const MbimUuid * mbim_message_indicate_status_get_service_id (const MbimMessage *self
); guint32 mbim_message_indicate_status_get_cid (const MbimMessage *self
); const guint8 * mbim_message_indicate_status_get_raw_information_buffer (const MbimMessage *self
,guint32 *length
);
GBoxed +----MbimMessage
GEnum +----MbimMessageType
GEnum +----MbimMessageCommandType
MbimMessage is a generic type representing a MBIM message of any kind (request, response, indication).
typedef enum { MBIM_MESSAGE_TYPE_INVALID = 0x00000000, /* From Host to Function */ MBIM_MESSAGE_TYPE_OPEN = 0x00000001, MBIM_MESSAGE_TYPE_CLOSE = 0x00000002, MBIM_MESSAGE_TYPE_COMMAND = 0x00000003, MBIM_MESSAGE_TYPE_HOST_ERROR = 0x00000004, /* From Function to Host */ MBIM_MESSAGE_TYPE_OPEN_DONE = 0x80000001, MBIM_MESSAGE_TYPE_CLOSE_DONE = 0x80000002, MBIM_MESSAGE_TYPE_COMMAND_DONE = 0x80000003, MBIM_MESSAGE_TYPE_FUNCTION_ERROR = 0x80000004, MBIM_MESSAGE_TYPE_INDICATE_STATUS = 0x80000007 } MbimMessageType;
Type of MBIM messages.
Invalid MBIM message. | |
Initialization request. | |
Close request. | |
Command request. | |
Host-reported error in the communication. | |
Response to initialization request. | |
Response to close request. | |
Response to command request. | |
Function-reported error in the communication. | |
Unsolicited message from the function. |
struct MbimIPv4 { guint8 addr[4]; };
An IPv4 address.
guint8 |
4 bytes specifying the IPv4 address. |
struct MbimIPv6 { guint8 addr[16]; };
An IPv6 address.
guint8 |
16 bytes specifying the IPv6 address. |
typedef enum { MBIM_MESSAGE_COMMAND_TYPE_UNKNOWN = -1, MBIM_MESSAGE_COMMAND_TYPE_QUERY = 0, MBIM_MESSAGE_COMMAND_TYPE_SET = 1 } MbimMessageCommandType;
Type of command message.
MbimMessage * mbim_message_new (const guint8 *data
,guint32 data_length
);
Create a MbimMessage with the given contents.
|
contents of the message. |
|
length of the message. |
Returns : |
a newly created MbimMessage, which should be freed with mbim_message_unref() . [transfer full]
|
MbimMessage * mbim_message_dup (const MbimMessage *self
);
Create a MbimMessage with the same contents as self
.
|
a MbimMessage to duplicate. |
Returns : |
a newly created MbimMessage, which should be freed with mbim_message_unref() . [transfer full]
|
MbimMessage * mbim_message_ref (MbimMessage *self
);
Atomically increments the reference count of self
by one.
|
a MbimMessage. |
Returns : |
(transfer full) the new reference to self . |
void mbim_message_unref (MbimMessage *self
);
Atomically decrements the reference count of self
by one.
If the reference count drops to 0, self
is completely disposed.
|
a MbimMessage. |
gchar * mbim_message_get_printable (const MbimMessage *self
,const gchar *line_prefix
,gboolean headers_only
);
Gets a printable string with the contents of the whole MBIM message.
|
a MbimMessage. |
|
prefix string to use in each new generated line. |
|
TRUE if only basic headers should be printed. |
Returns : |
a newly allocated string, which should be freed with g_free() . [transfer full]
|
const guint8 * mbim_message_get_raw (const MbimMessage *self
,guint32 *length
,GError **error
);
Gets the whole raw data buffer of the MbimMessage.
|
a MbimMessage. |
|
return location for the size of the output buffer. [out] |
|
return location for error or NULL . |
Returns : |
The raw data buffer, or NULL if error is set. [transfer none]
|
MbimMessageType mbim_message_get_message_type (const MbimMessage *self
);
Gets the message type.
|
a MbimMessage. |
Returns : |
a MbimMessageType. |
guint32 mbim_message_get_message_length (const MbimMessage *self
);
Gets the whole message length.
|
a MbimMessage. |
Returns : |
the length of the message. |
guint32 mbim_message_get_transaction_id (const MbimMessage *self
);
Gets the transaction ID of the message.
|
a MbimMessage. |
Returns : |
the transaction ID. |
void mbim_message_set_transaction_id (MbimMessage *self
,guint32 transaction_id
);
Sets the transaction ID of the message.
|
a MbimMessage. |
|
the transaction id. |
const gchar * mbim_message_type_get_string (MbimMessageType val
);
Gets the nickname string for the MbimMessageType specified at val
.
|
a MbimMessageType. |
Returns : |
a string with the nickname, or NULL if not found. Do not free the returned value. [transfer none]
|
MbimMessage * mbim_message_open_new (guint32 transaction_id
,guint32 max_control_transfer
);
Create a new MbimMessage of type MBIM_MESSAGE_TYPE_OPEN
with the specified
parameters.
|
transaction ID. |
|
maximum control transfer. |
Returns : |
a newly created MbimMessage. The returned value
should be freed with mbim_message_unref() . [transfer full]
|
guint32 mbim_message_open_get_max_control_transfer
(const MbimMessage *self
);
Get the maximum control transfer set to be used in the MbimMessage of type
MBIM_MESSAGE_TYPE_OPEN
.
|
a MbimMessage. |
Returns : |
the maximum control transfer. |
MbimStatusError mbim_message_open_done_get_status_code
(const MbimMessage *self
);
Get status code from the MBIM_MESSAGE_TYPE_OPEN_DONE
message.
|
a MbimMessage. |
Returns : |
a MbimStatusError. |
gboolean mbim_message_open_done_get_result (const MbimMessage *self
,GError **error
);
Gets the result of the 'Open' operation in the MBIM_MESSAGE_TYPE_OPEN_DONE
message.
|
a MbimMessage. |
|
return location for error or NULL . |
Returns : |
TRUE if the operation succeeded, FALSE if error is set. |
MbimMessage * mbim_message_close_new (guint32 transaction_id
);
Create a new MbimMessage of type MBIM_MESSAGE_TYPE_CLOSE
with the specified
parameters.
|
transaction ID. |
Returns : |
a newly created MbimMessage. The returned value
should be freed with mbim_message_unref() . [transfer full]
|
MbimStatusError mbim_message_close_done_get_status_code
(const MbimMessage *self
);
Get status code from the MBIM_MESSAGE_TYPE_CLOSE_DONE
message.
|
a MbimMessage. |
Returns : |
a MbimStatusError. |
gboolean mbim_message_close_done_get_result (const MbimMessage *self
,GError **error
);
Gets the result of the 'Close' operation in the MBIM_MESSAGE_TYPE_CLOSE_DONE
message.
|
a MbimMessage. |
|
return location for error or NULL . |
Returns : |
TRUE if the operation succeeded, FALSE if error is set. |
MbimMessage * mbim_message_error_new (guint32 transaction_id
,MbimProtocolError error_status_code
);
Create a new MbimMessage of type MBIM_MESSAGE_TYPE_HOST_ERROR
with the specified
parameters.
|
transaction ID. |
|
a MbimProtocolError. |
Returns : |
a newly created MbimMessage. The returned value
should be freed with mbim_message_unref() . [transfer full]
|
MbimProtocolError mbim_message_error_get_error_status_code
(const MbimMessage *self
);
Get the error code in a MBIM_MESSAGE_TYPE_HOST_ERROR
or
MBIM_MESSAGE_TYPE_FUNCTION_ERROR
message.
|
a MbimMessage. |
Returns : |
a MbimProtocolError. |
GError * mbim_message_error_get_error (const MbimMessage *self
);
Get the error in a MBIM_MESSAGE_TYPE_HOST_ERROR
or
MBIM_MESSAGE_TYPE_FUNCTION_ERROR
message.
|
a MbimMessage. |
Returns : |
a newly allocated GError, which should be freed with g_error_free() . |
MbimMessage * mbim_message_command_new (guint32 transaction_id
,MbimService service
,guint32 cid
,MbimMessageCommandType command_type
);
Create a new MbimMessage of type MBIM_MESSAGE_TYPE_COMMAND
with the
specified parameters and an empty information buffer.
|
transaction ID. |
|
a MbimService. |
|
the command ID. |
|
the command type. |
Returns : |
a newly created MbimMessage. The returned value
should be freed with mbim_message_unref() . [transfer full]
|
void mbim_message_command_append (MbimMessage *self
,const guint8 *buffer
,guint32 buffer_size
);
Appends the contents of buffer
to self
.
|
a MbimMessage. |
|
raw buffer to append to the message. |
|
length of the data in buffer . |
MbimService mbim_message_command_get_service (const MbimMessage *self
);
Get the service of a MBIM_MESSAGE_TYPE_COMMAND
message.
|
a MbimMessage. |
Returns : |
a MbimService. |
const MbimUuid * mbim_message_command_get_service_id (const MbimMessage *self
);
Get the service UUID of a MBIM_MESSAGE_TYPE_COMMAND
message.
|
a MbimMessage. |
Returns : |
a MbimUuid. |
guint32 mbim_message_command_get_cid (const MbimMessage *self
);
Get the command id of a MBIM_MESSAGE_TYPE_COMMAND
message.
|
a MbimMessage. |
Returns : |
a CID. |
MbimMessageCommandType mbim_message_command_get_command_type
(const MbimMessage *self
);
Get the command type of a MBIM_MESSAGE_TYPE_COMMAND
message.
|
a MbimMessage. |
Returns : |
a MbimMessageCommandType. |
const guint8 * mbim_message_command_get_raw_information_buffer (const MbimMessage *self
,guint32 *length
);
Gets the information buffer of the MBIM_MESSAGE_TYPE_COMMAND
message.
|
a MbimMessage. |
|
return location for the size of the output buffer. [out] |
Returns : |
The raw data buffer, or NULL if empty. [transfer none] |
const gchar * mbim_message_command_type_get_string
(MbimMessageCommandType val
);
Gets the nickname string for the MbimMessageCommandType specified at val
.
|
a MbimMessageCommandType. |
Returns : |
a string with the nickname, or NULL if not found. Do not free the returned value. [transfer none]
|
MbimService mbim_message_command_done_get_service
(const MbimMessage *self
);
Get the service of a MBIM_MESSAGE_TYPE_COMMAND_DONE
message.
|
a MbimMessage. |
Returns : |
a MbimService. |
const MbimUuid * mbim_message_command_done_get_service_id
(const MbimMessage *self
);
Get the service UUID of a MBIM_MESSAGE_TYPE_COMMAND_DONE
message.
|
a MbimMessage. |
Returns : |
a MbimUuid. |
guint32 mbim_message_command_done_get_cid (const MbimMessage *self
);
Get the command id of a MBIM_MESSAGE_TYPE_COMMAND_DONE
message.
|
a MbimMessage. |
Returns : |
a CID. |
MbimStatusError mbim_message_command_done_get_status_code
(const MbimMessage *self
);
Get status code from the MBIM_MESSAGE_TYPE_COMMAND_DONE
message.
|
a MbimMessage. |
Returns : |
a MbimStatusError. |
gboolean mbim_message_command_done_get_result (const MbimMessage *self
,GError **error
);
Gets the result of the 'Command' operation in the MBIM_MESSAGE_TYPE_COMMAND_DONE
message.
|
a MbimMessage. |
|
return location for error or NULL . |
Returns : |
TRUE if the operation succeeded, FALSE if error is set. |
const guint8 * mbim_message_command_done_get_raw_information_buffer (const MbimMessage *self
,guint32 *length
);
Gets the information buffer of the MBIM_MESSAGE_TYPE_COMMAND_DONE
message.
|
a MbimMessage. |
|
return location for the size of the output buffer. [out] |
Returns : |
The raw data buffer, or NULL if empty. [transfer none] |
MbimService mbim_message_indicate_status_get_service
(const MbimMessage *self
);
Get the service of a MBIM_MESSAGE_TYPE_INDICATE_STATUS
message.
|
a MbimMessage. |
Returns : |
a MbimService. |
const MbimUuid * mbim_message_indicate_status_get_service_id
(const MbimMessage *self
);
Get the service UUID of a MBIM_MESSAGE_TYPE_INDICATE_STATUS
message.
|
a MbimMessage. |
Returns : |
a MbimUuid. |
guint32 mbim_message_indicate_status_get_cid
(const MbimMessage *self
);
Get the command id of a MBIM_MESSAGE_TYPE_INDICATE_STATUS
message.
|
a MbimMessage. |
Returns : |
a CID. |
const guint8 * mbim_message_indicate_status_get_raw_information_buffer (const MbimMessage *self
,guint32 *length
);
Gets the information buffer of the MBIM_MESSAGE_TYPE_INDICATE_STATUS
message.
|
a MbimMessage. |
|
return location for the size of the output buffer. [out] |
Returns : |
The raw data buffer, or NULL if empty. [transfer none] |