Top |
MbimMessage | |
enum | MbimMessageType |
struct | MbimIPv4 |
struct | MbimIPv6 |
enum | MbimMessageCommandType |
MbimMessage is a generic type representing a MBIM message of any kind (request, response, indication).
MbimMessage * mbim_message_new (const guint8 *data
,guint32 data_length
);
Create a MbimMessage with the given contents.
a newly created MbimMessage, which should be freed with mbim_message_unref()
.
[transfer full]
Since: 1.0
MbimMessage *
mbim_message_dup (const MbimMessage *self
);
Create a MbimMessage with the same contents as self
.
a newly created MbimMessage, which should be freed with mbim_message_unref()
.
[transfer full]
Since: 1.0
MbimMessage *
mbim_message_ref (MbimMessage *self
);
Atomically increments the reference count of self
by one.
Since: 1.0
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.
Since: 1.0
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.
self |
a MbimMessage. |
|
line_prefix |
prefix string to use in each new generated line. |
|
headers_only |
|
Since: 1.0
const guint8 * mbim_message_get_raw (const MbimMessage *self
,guint32 *length
,GError **error
);
Gets the whole raw data buffer of the MbimMessage.
self |
a MbimMessage. |
|
length |
return location for the size of the output buffer. |
[out] |
error |
return location for error or |
Since: 1.0
MbimMessageType
mbim_message_get_message_type (const MbimMessage *self
);
Gets the message type.
Since: 1.0
guint32
mbim_message_get_message_length (const MbimMessage *self
);
Gets the whole message length.
Since: 1.0
guint32
mbim_message_get_transaction_id (const MbimMessage *self
);
Gets the transaction ID of the message.
Since: 1.0
void mbim_message_set_transaction_id (MbimMessage *self
,guint32 transaction_id
);
Sets the transaction ID of the message.
Since: 1.0
const gchar *
mbim_message_type_get_string (MbimMessageType val
);
Gets the nickname string for the MbimMessageType specified at val
.
a string with the nickname, or NULL
if not found. Do not free the returned value.
[transfer none]
Since: 1.0
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.
a newly created MbimMessage. The returned value
should be freed with mbim_message_unref()
.
[transfer full]
Since: 1.0
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
.
Since: 1.0
MbimStatusError
mbim_message_open_done_get_status_code
(const MbimMessage *self
);
Get status code from the MBIM_MESSAGE_TYPE_OPEN_DONE
message.
Since: 1.0
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.
Since: 1.0
MbimMessage *
mbim_message_close_new (guint32 transaction_id
);
Create a new MbimMessage of type MBIM_MESSAGE_TYPE_CLOSE
with the specified
parameters.
a newly created MbimMessage. The returned value
should be freed with mbim_message_unref()
.
[transfer full]
Since: 1.0
MbimStatusError
mbim_message_close_done_get_status_code
(const MbimMessage *self
);
Get status code from the MBIM_MESSAGE_TYPE_CLOSE_DONE
message.
Since: 1.0
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.
Since: 1.0
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.
a newly created MbimMessage. The returned value
should be freed with mbim_message_unref()
.
[transfer full]
Since: 1.0
MbimMessage * mbim_message_function_error_new (guint32 transaction_id
,MbimProtocolError error_status_code
);
Create a new MbimMessage of type MBIM_MESSAGE_TYPE_FUNCTION_ERROR
with the specified
parameters.
a newly created MbimMessage. The returned value
should be freed with mbim_message_unref()
.
[transfer full]
Since: 1.12
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.
Since: 1.0
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.
Since: 1.0
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 |
transaction ID. |
|
service |
a MbimService. |
|
cid |
the command ID. |
|
command_type |
the command type. |
a newly created MbimMessage. The returned value
should be freed with mbim_message_unref()
.
[transfer full]
Since: 1.0
void mbim_message_command_append (MbimMessage *self
,const guint8 *buffer
,guint32 buffer_size
);
Appends the contents of buffer
to self
.
self |
a MbimMessage. |
|
buffer |
raw buffer to append to the message. |
|
buffer_size |
length of the data in |
Since: 1.0
MbimService
mbim_message_command_get_service (const MbimMessage *self
);
Get the service of a MBIM_MESSAGE_TYPE_COMMAND
message.
Since: 1.0
const MbimUuid *
mbim_message_command_get_service_id (const MbimMessage *self
);
Get the service UUID of a MBIM_MESSAGE_TYPE_COMMAND
message.
Since: 1.0
guint32
mbim_message_command_get_cid (const MbimMessage *self
);
Get the command id of a MBIM_MESSAGE_TYPE_COMMAND
message.
Since: 1.0
MbimMessageCommandType
mbim_message_command_get_command_type (const MbimMessage *self
);
Get the command type of a MBIM_MESSAGE_TYPE_COMMAND
message.
Since: 1.0
const guint8 * mbim_message_command_get_raw_information_buffer (const MbimMessage *self
,guint32 *out_length
);
Gets the information buffer of the MBIM_MESSAGE_TYPE_COMMAND
message.
Since: 1.0
const gchar *
mbim_message_command_type_get_string (MbimMessageCommandType val
);
Gets the nickname string for the MbimMessageCommandType specified at val
.
a string with the nickname, or NULL
if not found. Do not free the returned value.
[transfer none]
Since: 1.0
MbimService
mbim_message_command_done_get_service (const MbimMessage *self
);
Get the service of a MBIM_MESSAGE_TYPE_COMMAND_DONE
message.
Since: 1.0
const MbimUuid *
mbim_message_command_done_get_service_id
(const MbimMessage *self
);
Get the service UUID of a MBIM_MESSAGE_TYPE_COMMAND_DONE
message.
Since: 1.0
guint32
mbim_message_command_done_get_cid (const MbimMessage *self
);
Get the command id of a MBIM_MESSAGE_TYPE_COMMAND_DONE
message.
Since: 1.0
MbimStatusError
mbim_message_command_done_get_status_code
(const MbimMessage *self
);
Get status code from the MBIM_MESSAGE_TYPE_COMMAND_DONE
message.
Since: 1.0
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.
Since: 1.0
const guint8 * mbim_message_command_done_get_raw_information_buffer (const MbimMessage *self
,guint32 *out_length
);
Gets the information buffer of the MBIM_MESSAGE_TYPE_COMMAND_DONE
message.
Since: 1.0
MbimService
mbim_message_indicate_status_get_service
(const MbimMessage *self
);
Get the service of a MBIM_MESSAGE_TYPE_INDICATE_STATUS
message.
Since: 1.0
const MbimUuid *
mbim_message_indicate_status_get_service_id
(const MbimMessage *self
);
Get the service UUID of a MBIM_MESSAGE_TYPE_INDICATE_STATUS
message.
Since: 1.0
guint32
mbim_message_indicate_status_get_cid (const MbimMessage *self
);
Get the command id of a MBIM_MESSAGE_TYPE_INDICATE_STATUS
message.
Since: 1.0
const guint8 * mbim_message_indicate_status_get_raw_information_buffer (const MbimMessage *self
,guint32 *out_length
);
Gets the information buffer of the MBIM_MESSAGE_TYPE_INDICATE_STATUS
message.
Since: 1.0
gboolean mbim_message_response_get_result (const MbimMessage *self
,MbimMessageType expected
,GError **error
);
Gets the result of the operation from the response message, which
can be either a MBIM_MESSAGE_TYPE_FUNCTION_ERROR
message or a message of the
specified expected
type.
self |
a MbimMessage response message. |
|
expected |
expected MbimMessageType if there isn't any error in the operation. |
|
error |
return location for error or |
Since: 1.12
typedef struct _MbimMessage MbimMessage;
An opaque type representing a MBIM message.
Since: 1.0
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. |
Since: 1.0