RealSense Cross Platform API
RealSense Cross-platform API
Loading...
Searching...
No Matches
rs_eth_config.h File Reference

Exposes RealSense ethernet configuration functionality for C compilers. More...

#include "rs_types.h"

Go to the source code of this file.

Typedefs

typedef enum rs2_eth_link_priority rs2_eth_link_priority
 Ethernet link priority options.
typedef uint8_t rs2_ip_address[4]
 IP address structure for IPv4 addresses.

Enumerations

enum  rs2_eth_link_priority {
  RS2_LINK_PRIORITY_USB_ONLY = 0 , RS2_LINK_PRIORITY_ETH_ONLY = 1 , RS2_LINK_PRIORITY_ETH_FIRST = 2 , RS2_LINK_PRIORITY_USB_FIRST = 3 ,
  RS2_LINK_PRIORITY_DYNAMIC_BIT = 0x10 , RS2_LINK_PRIORITY_DYNAMIC_ETH_FIRST = RS2_LINK_PRIORITY_ETH_FIRST | RS2_LINK_PRIORITY_DYNAMIC_BIT , RS2_LINK_PRIORITY_DYNAMIC_USB_FIRST = RS2_LINK_PRIORITY_USB_FIRST | RS2_LINK_PRIORITY_DYNAMIC_BIT , RS2_LINK_PRIORITY_COUNT
}
 Ethernet link priority options. More...

Functions

const char * rs2_eth_link_priority_to_string (rs2_eth_link_priority priority)
int rs2_supports_eth_config (const rs2_device *device, rs2_error **error)
unsigned int rs2_get_link_speed (const rs2_device *device, rs2_error **error)
rs2_eth_link_priority rs2_get_link_priority (const rs2_device *device, rs2_error **error)
void rs2_set_link_priority (const rs2_device *device, rs2_eth_link_priority priority, rs2_error **error)
unsigned int rs2_get_link_timeout (const rs2_device *device, rs2_error **error)
void rs2_set_link_timeout (const rs2_device *device, unsigned int timeout, rs2_error **error)
unsigned int rs2_get_dds_domain (const rs2_device *device, rs2_error **error)
void rs2_set_dds_domain (const rs2_device *device, unsigned int domain, rs2_error **error)
void rs2_get_ip_address (const rs2_device *device, rs2_ip_address configured_ip, rs2_ip_address actual_ip, rs2_error **error)
void rs2_set_ip_address (const rs2_device *device, const rs2_ip_address ip, rs2_error **error)
void rs2_get_netmask (const rs2_device *device, rs2_ip_address configured_netmask, rs2_ip_address actual_netmask, rs2_error **error)
void rs2_set_netmask (const rs2_device *device, const rs2_ip_address netmask, rs2_error **error)
void rs2_get_gateway (const rs2_device *device, rs2_ip_address configured_gateway, rs2_ip_address actual_gateway, rs2_error **error)
void rs2_set_gateway (const rs2_device *device, const rs2_ip_address gateway, rs2_error **error)
void rs2_get_dhcp_config (const rs2_device *device, int *enabled, unsigned int *timeout, rs2_error **error)
void rs2_set_dhcp_config (const rs2_device *device, int enabled, unsigned int timeout, rs2_error **error)
unsigned int rs2_get_mtu (const rs2_device *device, rs2_error **error)
void rs2_set_mtu (const rs2_device *device, unsigned int mtu, rs2_error **error)
unsigned int rs2_get_transmission_delay (const rs2_device *device, rs2_error **error)
void rs2_set_transmission_delay (const rs2_device *device, unsigned int delay, rs2_error **error)
unsigned int rs2_get_udp_ttl (const rs2_device *device, rs2_error **error)
void rs2_set_udp_ttl (const rs2_device *device, unsigned int ttl, rs2_error **error)
void rs2_restore_default_eth_config (const rs2_device *device, rs2_error **error)

Detailed Description

Exposes RealSense ethernet configuration functionality for C compilers.

Typedef Documentation

◆ rs2_eth_link_priority

Ethernet link priority options.

◆ rs2_ip_address

typedef uint8_t rs2_ip_address[4]

IP address structure for IPv4 addresses.

Enumeration Type Documentation

◆ rs2_eth_link_priority

Ethernet link priority options.

Enumerator
RS2_LINK_PRIORITY_USB_ONLY 

Use USB connection only

RS2_LINK_PRIORITY_ETH_ONLY 

Use Ethernet connection only

RS2_LINK_PRIORITY_ETH_FIRST 

Prefer Ethernet, fallback to USB

RS2_LINK_PRIORITY_USB_FIRST 

Prefer USB, fallback to Ethernet

RS2_LINK_PRIORITY_DYNAMIC_BIT 

Dynamic switching bit flag

RS2_LINK_PRIORITY_DYNAMIC_ETH_FIRST 

Dynamic Ethernet-first priority

RS2_LINK_PRIORITY_DYNAMIC_USB_FIRST 

Dynamic USB-first priority

RS2_LINK_PRIORITY_COUNT 

Number of enumeration values. Not a valid input: intended to be used in for-loops.

Function Documentation

◆ rs2_eth_link_priority_to_string()

const char * rs2_eth_link_priority_to_string ( rs2_eth_link_priority priority)

◆ rs2_get_dds_domain()

unsigned int rs2_get_dds_domain ( const rs2_device * device,
rs2_error ** error )

Get current DDS domain id (0-232) used when connected through Ethernet

Parameters
[in]deviceRealSense device
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
Current DDS domain id used when connected through Ethernet

◆ rs2_get_dhcp_config()

void rs2_get_dhcp_config ( const rs2_device * device,
int * enabled,
unsigned int * timeout,
rs2_error ** error )

Get DHCP configuration

Parameters
[in]deviceRealSense device
[out]enabledDHCP enabled flag (0=off, non-zero=on)
[out]timeoutDHCP timeout threshold in seconds (0-255)
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_get_gateway()

void rs2_get_gateway ( const rs2_device * device,
rs2_ip_address configured_gateway,
rs2_ip_address actual_gateway,
rs2_error ** error )

Get gateway address

Parameters
[in]deviceRealSense device
[out]configured_gatewayConfigured gateway address to populate
[out]actual_gatewayActual gateway address to populate. Might be different from configured_gateway if DHCP is enabled
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_get_ip_address()

void rs2_get_ip_address ( const rs2_device * device,
rs2_ip_address configured_ip,
rs2_ip_address actual_ip,
rs2_error ** error )

Get IP address

Parameters
[in]deviceRealSense device
[out]configured_ipConfigured IP address to populate
[out]actual_ipActual IP address to populate. Might be different from configured_ip if DHCP is enabled
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_get_link_priority()

rs2_eth_link_priority rs2_get_link_priority ( const rs2_device * device,
rs2_error ** error )

Get link priority

Parameters
[in]deviceRealSense device
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
Current link priority setting

◆ rs2_get_link_speed()

unsigned int rs2_get_link_speed ( const rs2_device * device,
rs2_error ** error )

Get Ethernet link speed

Parameters
[in]deviceRealSense device
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
Current Ethernet link speed Mbps. 0 if link is not available.

◆ rs2_get_link_timeout()

unsigned int rs2_get_link_timeout ( const rs2_device * device,
rs2_error ** error )

Get timeout in milliseconds before falling back to other connection type

Parameters
[in]deviceRealSense device
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
Current link timeout in milliseconds

◆ rs2_get_mtu()

unsigned int rs2_get_mtu ( const rs2_device * device,
rs2_error ** error )

Get MTU (Maximum Transmission Unit)

Parameters
[in]deviceRealSense device
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
Current MTU in bytes

◆ rs2_get_netmask()

void rs2_get_netmask ( const rs2_device * device,
rs2_ip_address configured_netmask,
rs2_ip_address actual_netmask,
rs2_error ** error )

Get network mask

Parameters
[in]deviceRealSense device
[out]configured_netmaskConfigured network mask to populate
[out]actual_netmaskActual network mask to populate. Might be different from configured_netmask if DHCP is enabled
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_get_transmission_delay()

unsigned int rs2_get_transmission_delay ( const rs2_device * device,
rs2_error ** error )

Get transmission delay

Parameters
[in]deviceRealSense device
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
Current transmission delay in microseconds

◆ rs2_get_udp_ttl()

unsigned int rs2_get_udp_ttl ( const rs2_device * device,
rs2_error ** error )

Get UDP packet "time to live" (TTL)

Parameters
[in]deviceRealSense device
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
Current UDP TTL value

◆ rs2_restore_default_eth_config()

void rs2_restore_default_eth_config ( const rs2_device * device,
rs2_error ** error )

Restores configuration to factory settings

Parameters
[in]deviceRealSense device
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
Non-zero if device supports ethernet configuration, zero otherwise

◆ rs2_set_dds_domain()

void rs2_set_dds_domain ( const rs2_device * device,
unsigned int domain,
rs2_error ** error )

Set DDS domain id to use when connected through Ethernet

Parameters
[in]deviceRealSense device
[in]domainDDS domain id to use (0-232)
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_set_dhcp_config()

void rs2_set_dhcp_config ( const rs2_device * device,
int enabled,
unsigned int timeout,
rs2_error ** error )

Set DHCP configuration

Parameters
[in]deviceRealSense device
[in]enabledDHCP enabled flag (0=off, non-zero=on)
[in]timeoutDHCP timeout threshold in seconds (0-255)
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_set_gateway()

void rs2_set_gateway ( const rs2_device * device,
const rs2_ip_address gateway,
rs2_error ** error )

Set gateway address

Parameters
[in]deviceRealSense device
[in]gatewayGateway address to set
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_set_ip_address()

void rs2_set_ip_address ( const rs2_device * device,
const rs2_ip_address ip,
rs2_error ** error )

Set IP address

Parameters
[in]deviceRealSense device
[in]ipIP address to set
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_set_link_priority()

void rs2_set_link_priority ( const rs2_device * device,
rs2_eth_link_priority priority,
rs2_error ** error )

Set link priority

Parameters
[in]deviceRealSense device
[in]priorityLink priority to set
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_set_link_timeout()

void rs2_set_link_timeout ( const rs2_device * device,
unsigned int timeout,
rs2_error ** error )

Set timeout in milliseconds before falling back to other connection type

Parameters
[in]deviceRealSense device
[in]timeoutLink timeout to set in milliseconds
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_set_mtu()

void rs2_set_mtu ( const rs2_device * device,
unsigned int mtu,
rs2_error ** error )

Set MTU (Maximum Transmission Unit)

Parameters
[in]deviceRealSense device
[in]mtuMTU in bytes (500-9000, in 500 byte steps)
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_set_netmask()

void rs2_set_netmask ( const rs2_device * device,
const rs2_ip_address netmask,
rs2_error ** error )

Set network mask

Parameters
[in]deviceRealSense device
[in]netmaskNetwork mask to set
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_set_transmission_delay()

void rs2_set_transmission_delay ( const rs2_device * device,
unsigned int delay,
rs2_error ** error )

Set transmission delay

Parameters
[in]deviceRealSense device
[in]delayTransmission delay in microseconds (0-144, in 3us steps)
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_set_udp_ttl()

void rs2_set_udp_ttl ( const rs2_device * device,
unsigned int ttl,
rs2_error ** error )

Set UDP packet "time to live" (TTL)

Parameters
[in]deviceRealSense device
[in]ttlUDP TTL value (1-255)
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_supports_eth_config()

int rs2_supports_eth_config ( const rs2_device * device,
rs2_error ** error )

Check if device supports ethernet configuration

Parameters
[in]deviceRealSense device
[out]errorIf non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
Non-zero if device supports ethernet configuration, zero otherwise