Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

MCUmgr Transport management API. More...

Files

file  transport_mgmt.h
 Header file for the MCUmgr transport management group API.

Macros

#define TRANSPORT_MGMT_DIRECTION_INCOMING   false
 Incoming transport whereby the device will forward read/write request packets on the specified transport and send them out on the transport it is bridged with.
#define TRANSPORT_MGMT_DIRECTION_OUTGOING   true
 Outgoing transport whereby the device will forward read/write response packets on the specified transport and send them out on the transport it is bridged with.

Enumerations

enum  transport_mgmt_ids {
  TRANSPORT_MGMT_ID_CONNECT , TRANSPORT_MGMT_ID_DISCONNECT , TRANSPORT_MGMT_ID_STATUS , TRANSPORT_MGMT_ID_RESERVED_1 ,
  TRANSPORT_MGMT_ID_RESERVED_2 , TRANSPORT_MGMT_ID_RESERVED_3 , TRANSPORT_MGMT_ID_LIST , TRANSPORT_MGMT_ID_GET_MODES ,
  TRANSPORT_MGMT_ID_GET_CONFIG_DETAILS
}
 Command IDs for transport management group. More...
enum  transport_mgmt_ret_code_t {
  TRANSPORT_MGMT_ERR_OK = 0 , TRANSPORT_MGMT_ERR_UNKNOWN , TRANSPORT_MGMT_ERR_TRANSPORT_MISSING_REQUIRED_FUNCTIONS , TRANSPORT_MGMT_ERR_TRANSPORT_MISSING_INFO_FUNCTIONS ,
  TRANSPORT_MGMT_ERR_INVALID_TRANSPORT , TRANSPORT_MGMT_ERR_INVALID_MODE , TRANSPORT_MGMT_ERR_ALL_CONTEXTS_USED , TRANSPORT_MGMT_ERR_BOTH_TRANSPORT_AND_ALL_PARAMETERS ,
  TRANSPORT_MGMT_ERR_NOT_BRIDGED , TRANSPORT_MGMT_ERR_SAME_BRIDGE_DEVICE_DISALLOWED , TRANSPORT_MGMT_ERR_TRANSPORT_INGOING_NOT_SUPPORTED , TRANSPORT_MGMT_ERR_TRANSPORT_OUTGOING_NOT_SUPPORTED ,
  TRANSPORT_MGMT_ERR_TRANSPORT_INCOMING_TRANSPORT_ALREADY_BRIDGED , TRANSPORT_MGMT_ERR_TRANSPORT_OUTGOING_TRANSPORT_ALREADY_BRIDGED
}
 Command result codes for transport management group. More...
enum  transport_mgmt_config_type_t {
  TRANSPORT_MGMT_CONFIG_TYPE_UINT = 0 , TRANSPORT_MGMT_CONFIG_TYPE_INT , TRANSPORT_MGMT_CONFIG_TYPE_BOOL , TRANSPORT_MGMT_CONFIG_TYPE_STRING ,
  TRANSPORT_MGMT_CONFIG_TYPE_BYTE_STRING
}
 Config types. More...

Functions

bool transport_mgmt_is_bridged (struct smp_transport *transport, bool direction)
 Checks if a given transport is bridged or not.
struct smp_transporttransport_mgmt_get_other_transport (struct smp_transport *transport, bool direction)
 Gets the other transport which is part of a bridge.
const struct smp_transport_bridgetransport_mgmt_get_bridge (struct smp_transport *transport, bool direction)
 Gets a transport bridge context.
int transport_mgmt_disconnect_bridge (struct smp_transport_bridge *bridge)
 Disconnects an active bridge.
int transport_mgmt_disconnect_transport (struct smp_transport *transport, bool incoming, bool outgoing)
 Disconnects an active bridge.
int transport_mgmt_disconnect_all (void)
 Disconnects all active bridges.
const uint16_t transport_mgmt_group_id (void)
 Gets the group ID for transport management group.

Detailed Description

MCUmgr Transport management API.

Since
4.5
Version
0.1.0

Macro Definition Documentation

◆ TRANSPORT_MGMT_DIRECTION_INCOMING

#define TRANSPORT_MGMT_DIRECTION_INCOMING   false

#include <zephyr/mgmt/mcumgr/grp/transport_mgmt/transport_mgmt.h>

Incoming transport whereby the device will forward read/write request packets on the specified transport and send them out on the transport it is bridged with.

◆ TRANSPORT_MGMT_DIRECTION_OUTGOING

#define TRANSPORT_MGMT_DIRECTION_OUTGOING   true

#include <zephyr/mgmt/mcumgr/grp/transport_mgmt/transport_mgmt.h>

Outgoing transport whereby the device will forward read/write response packets on the specified transport and send them out on the transport it is bridged with.

Enumeration Type Documentation

◆ transport_mgmt_config_type_t

#include <zephyr/mgmt/mcumgr/grp/transport_mgmt/transport_mgmt.h>

Config types.

Enumerator
TRANSPORT_MGMT_CONFIG_TYPE_UINT 

Unsigned integer.

TRANSPORT_MGMT_CONFIG_TYPE_INT 

Signed integer.

TRANSPORT_MGMT_CONFIG_TYPE_BOOL 

Boolean.

TRANSPORT_MGMT_CONFIG_TYPE_STRING 

Text string.

TRANSPORT_MGMT_CONFIG_TYPE_BYTE_STRING 

Byte string.

◆ transport_mgmt_ids

#include <zephyr/mgmt/mcumgr/grp/transport_mgmt/transport_mgmt.h>

Command IDs for transport management group.

Enumerator
TRANSPORT_MGMT_ID_CONNECT 

Used to connect (bridge) to another transport.

TRANSPORT_MGMT_ID_DISCONNECT 

Used to disconnect current bridge or all bridges.

TRANSPORT_MGMT_ID_STATUS 

Returns current bridge status.

TRANSPORT_MGMT_ID_RESERVED_1 

Reserved for future use.

TRANSPORT_MGMT_ID_RESERVED_2 

Reserved for future use.

TRANSPORT_MGMT_ID_RESERVED_3 

Reserved for future use.

TRANSPORT_MGMT_ID_LIST 

List supported transports.

TRANSPORT_MGMT_ID_GET_MODES 

Get the supported modes of a transport.

TRANSPORT_MGMT_ID_GET_CONFIG_DETAILS 

Get the configuration details of a transport.

◆ transport_mgmt_ret_code_t

#include <zephyr/mgmt/mcumgr/grp/transport_mgmt/transport_mgmt.h>

Command result codes for transport management group.

Enumerator
TRANSPORT_MGMT_ERR_OK 

No error, this is implied if there is no ret value in the response.

TRANSPORT_MGMT_ERR_UNKNOWN 

Unknown error occurred.

TRANSPORT_MGMT_ERR_TRANSPORT_MISSING_REQUIRED_FUNCTIONS 

The transport is missing the required mandatory bridging functions.

TRANSPORT_MGMT_ERR_TRANSPORT_MISSING_INFO_FUNCTIONS 

The transport is missing the information bridging functions.

TRANSPORT_MGMT_ERR_INVALID_TRANSPORT 

Invalid, unsupported or no transport ID provided.

TRANSPORT_MGMT_ERR_INVALID_MODE 

Invalid, unsupported or no mode provided.

TRANSPORT_MGMT_ERR_ALL_CONTEXTS_USED 

All transport bridging context are in use.

TRANSPORT_MGMT_ERR_BOTH_TRANSPORT_AND_ALL_PARAMETERS 

The transport or all parameters were both provided and only one should be supplied.

TRANSPORT_MGMT_ERR_NOT_BRIDGED 

The transport is not bridged.

TRANSPORT_MGMT_ERR_SAME_BRIDGE_DEVICE_DISALLOWED 

The transport does not support being used as both the input and output bridge device.

TRANSPORT_MGMT_ERR_TRANSPORT_INGOING_NOT_SUPPORTED 

The transport does not support being used as the ingoing part of a bridge.

TRANSPORT_MGMT_ERR_TRANSPORT_OUTGOING_NOT_SUPPORTED 

The transport does not support being used as the outgoing part of a bridge.

TRANSPORT_MGMT_ERR_TRANSPORT_INCOMING_TRANSPORT_ALREADY_BRIDGED 

The incoming transport is already bridged to another transport.

TRANSPORT_MGMT_ERR_TRANSPORT_OUTGOING_TRANSPORT_ALREADY_BRIDGED 

The outgoing transport is already bridged to another transport.

Function Documentation

◆ transport_mgmt_disconnect_all()

int transport_mgmt_disconnect_all ( void )

#include <zephyr/mgmt/mcumgr/grp/transport_mgmt/transport_mgmt.h>

Disconnects all active bridges.

Returns
return code

◆ transport_mgmt_disconnect_bridge()

int transport_mgmt_disconnect_bridge ( struct smp_transport_bridge * bridge)

#include <zephyr/mgmt/mcumgr/grp/transport_mgmt/transport_mgmt.h>

Disconnects an active bridge.

Parameters
bridgebridge context
Returns
return code

◆ transport_mgmt_disconnect_transport()

int transport_mgmt_disconnect_transport ( struct smp_transport * transport,
bool incoming,
bool outgoing )

#include <zephyr/mgmt/mcumgr/grp/transport_mgmt/transport_mgmt.h>

Disconnects an active bridge.

Parameters
transporttransport which is bridged
incomingif true, will disconnect the bridge context that this is bridged to in incoming mode
outgoingif true, will disconnect the bridge context that this is bridged to in outgoing mode
Returns
return code

◆ transport_mgmt_get_bridge()

const struct smp_transport_bridge * transport_mgmt_get_bridge ( struct smp_transport * transport,
bool direction )

#include <zephyr/mgmt/mcumgr/grp/transport_mgmt/transport_mgmt.h>

Gets a transport bridge context.

Parameters
transporttransport which is bridged
directionspecifies the direction of the transport for the bridge to get either TRANSPORT_MGMT_DIRECTION_INCOMING or TRANSPORT_MGMT_DIRECTION_OUTGOING
Returns
the transport bridge context if a valid bridged transport was provided, otherwise NULL.

◆ transport_mgmt_get_other_transport()

struct smp_transport * transport_mgmt_get_other_transport ( struct smp_transport * transport,
bool direction )

#include <zephyr/mgmt/mcumgr/grp/transport_mgmt/transport_mgmt.h>

Gets the other transport which is part of a bridge.

Parameters
transporttransport which is bridged
directionspecifies the direction of the bridge to check to get the opposing transport for, either TRANSPORT_MGMT_DIRECTION_INCOMING or TRANSPORT_MGMT_DIRECTION_OUTGOING
Returns
the other transport context if a valid bridge was provided, otherwise NULL.

◆ transport_mgmt_group_id()

const uint16_t transport_mgmt_group_id ( void )

#include <zephyr/mgmt/mcumgr/grp/transport_mgmt/transport_mgmt.h>

Gets the group ID for transport management group.

Users must implement this function in their own code if they wish to use a dynamic group ID set at run-time when CONFIG_MCUMGR_GRP_TRANSPORT_GROUP_ID_CUSTOM_FUNCTION is enabled.

Returns
The transport mgmt group ID which must be within the range 64 - 65535.

◆ transport_mgmt_is_bridged()

bool transport_mgmt_is_bridged ( struct smp_transport * transport,
bool direction )

#include <zephyr/mgmt/mcumgr/grp/transport_mgmt/transport_mgmt.h>

Checks if a given transport is bridged or not.

Parameters
transporttransport to check status of
directionspecifies the direction of the bridge to check for, either TRANSPORT_MGMT_DIRECTION_INCOMING or TRANSPORT_MGMT_DIRECTION_OUTGOING
Returns
true if given transport in given mode is bridged, false otherwise.