Commit a7564220 authored by Bjarki Arge Andreasen's avatar Bjarki Arge Andreasen Committed by Johan Hedberg
Browse files

modem: modem_cmux: Update documentation



This commit updates the documentation for
the modem_cmux modem module.

Signed-off-by: default avatarBjarki Arge Andreasen <bjarkix123@gmail.com>
parent cc03017b
Loading
Loading
Loading
Loading
+41 −15
Original line number Diff line number Diff line
@@ -33,14 +33,14 @@
extern "C" {
#endif

struct modem_cmux;
/**
 * @brief Modem CMUX
 * @defgroup modem_cmux Modem CMUX
 * @ingroup modem
 * @{
 */

enum modem_cmux_state {
	MODEM_CMUX_STATE_DISCONNECTED = 0,
	MODEM_CMUX_STATE_CONNECTING,
	MODEM_CMUX_STATE_CONNECTED,
	MODEM_CMUX_STATE_DISCONNECTING,
};
struct modem_cmux;

enum modem_cmux_event {
	MODEM_CMUX_EVENT_CONNECTED = 0,
@@ -50,6 +50,17 @@ enum modem_cmux_event {
typedef void (*modem_cmux_callback)(struct modem_cmux *cmux, enum modem_cmux_event event,
				    void *user_data);

/**
 * @cond INTERNAL_HIDDEN
 */

enum modem_cmux_state {
	MODEM_CMUX_STATE_DISCONNECTED = 0,
	MODEM_CMUX_STATE_CONNECTING,
	MODEM_CMUX_STATE_CONNECTED,
	MODEM_CMUX_STATE_DISCONNECTING,
};

enum modem_cmux_receive_state {
	MODEM_CMUX_RECEIVE_STATE_SOF = 0,
	MODEM_CMUX_RECEIVE_STATE_RESYNC_0,
@@ -74,11 +85,6 @@ enum modem_cmux_dlci_state {
	MODEM_CMUX_DLCI_STATE_CLOSING,
};

enum modem_cmux_dlci_event {
	MODEM_CMUX_DLCI_EVENT_OPENED,
	MODEM_CMUX_DLCI_EVENT_CLOSED,
};

struct modem_cmux_dlci {
	sys_snode_t node;

@@ -157,6 +163,10 @@ struct modem_cmux {
	struct k_event event;
};

/**
 * @endcond
 */

/**
 * @brief Contains CMUX instance configuration data
 */
@@ -205,7 +215,7 @@ struct modem_pipe *modem_cmux_dlci_init(struct modem_cmux *cmux, struct modem_cm
					const struct modem_cmux_dlci_config *config);

/**
 * @brief Initialize CMUX instance
 * @brief Attach CMUX instance to pipe
 *
 * @param cmux CMUX instance
 * @param pipe Pipe instance to attach CMUX instance to
@@ -243,7 +253,8 @@ int modem_cmux_connect_async(struct modem_cmux *cmux);
 *
 * @param cmux CMUX instance
 *
 * @note When disconnected, the bus pipe can be used directly again
 * @note The bus pipe must be released using modem_cmux_release() after disconnecting
 * before being reused.
 */
int modem_cmux_disconnect(struct modem_cmux *cmux);

@@ -254,12 +265,27 @@ int modem_cmux_disconnect(struct modem_cmux *cmux);
 *
 * @param cmux CMUX instance
 *
 * @note When disconnected, the bus pipe can be used directly again
 * @note The bus pipe must be released using modem_cmux_release() after disconnecting
 * before being reused.
 */
int modem_cmux_disconnect_async(struct modem_cmux *cmux);

/**
 * @brief Release CMUX instance from pipe
 *
 * @details Releases the pipe and hard resets the CMUX instance internally. CMUX should
 * be disconnected using modem_cmux_disconnect().
 *
 * @param cmux CMUX instance
 *
 * @note The bus pipe can be used directly again after CMUX instance is released.
 */
void modem_cmux_release(struct modem_cmux *cmux);

/**
 * @}
 */

#ifdef __cplusplus
}
#endif