Skip to content

Commit

Permalink
tags
Browse files Browse the repository at this point in the history
  • Loading branch information
milyin committed Feb 25, 2024
1 parent 2ac04a2 commit 7b26648
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 11 deletions.
115 changes: 104 additions & 11 deletions include/zenoh-pico/api/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@ extern "C" {
* Z_WHAT_PEER: Peer.
* Z_WHAT_CLIENT: Client.
*/
// tags{c.z_what_t}
typedef enum {
// tags{c.z_what_t.router}
Z_WHAT_ROUTER = 0x01, // Router
Z_WHAT_PEER = 0x02, // Peer
Z_WHAT_CLIENT = 0x03 // Client
// tags{c.z_what_t.peer}
Z_WHAT_PEER = 0x02, // Peer
// tags{c.z_what_t.client}
Z_WHAT_CLIENT = 0x03 // Client
} z_what_t;

/**
Expand All @@ -43,7 +47,15 @@ typedef enum {
* Z_WHATAMI_PEER: Bitmask to filter for Zenoh peers.
* Z_WHATAMI_CLIENT: Bitmask to filter for Zenoh clients.
*/
typedef enum { Z_WHATAMI_ROUTER = 0x00, Z_WHATAMI_PEER = 0x01, Z_WHATAMI_CLIENT = 0x02 } z_whatami_t;
// tags{c.z_whatami_t}
typedef enum {
// tags{c.z_whatami_t.router}
Z_WHATAMI_ROUTER = 0x00,
// tags{c.z_whatami_t.peer}
Z_WHATAMI_PEER = 0x01,
// tags{c.z_whatami_t.client}
Z_WHATAMI_CLIENT = 0x02
} z_whatami_t;
#define Z_WHATAMI_DEFAULT Z_WHATAMI_ROUTER

/**
Expand All @@ -63,15 +75,25 @@ typedef enum { Z_WHATAMI_ROUTER = 0x00, Z_WHATAMI_PEER = 0x01, Z_WHATAMI_CLIENT
* Z_KEYEXPR_CANON_CONTAINS_SHARP_OR_QMARK: The key contains ``#`` or ``?``, which is forbidden.
* Z_KEYEXPR_CANON_CONTAINS_UNBOUND_DOLLAR: The key contains a ``$`` which is not bound to a DSL.
*/
// tags{c.zp_keyexpr_canon_status_t}
typedef enum {
// tags{c.zp_keyexpr_canon_status_t.success}
Z_KEYEXPR_CANON_SUCCESS = 0,
// tags{c.zp_keyexpr_canon_status_t.lone_dollar_star}
Z_KEYEXPR_CANON_LONE_DOLLAR_STAR = -1,
// tags{c.zp_keyexpr_canon_status_t.single_star_after_double_star}
Z_KEYEXPR_CANON_SINGLE_STAR_AFTER_DOUBLE_STAR = -2,
// tags{c.zp_keyexpr_canon_status_t.double_star_after_double_star}
Z_KEYEXPR_CANON_DOUBLE_STAR_AFTER_DOUBLE_STAR = -3,
// tags{c.zp_keyexpr_canon_status_t.empty_chunk}
Z_KEYEXPR_CANON_EMPTY_CHUNK = -4,
// tags{c.zp_keyexpr_canon_status_t.stars_in_chunk}
Z_KEYEXPR_CANON_STARS_IN_CHUNK = -5,
// tags{c.zp_keyexpr_canon_status_t.dollar_after_dollar_or_star}
Z_KEYEXPR_CANON_DOLLAR_AFTER_DOLLAR_OR_STAR = -6,
// tags{c.zp_keyexpr_canon_status_t.contains_sharp_or_QMARK}
Z_KEYEXPR_CANON_CONTAINS_SHARP_OR_QMARK = -7,
// tags{c.zp_keyexpr_canon_status_t.contains_unbound_dollar}
Z_KEYEXPR_CANON_CONTAINS_UNBOUND_DOLLAR = -8
} zp_keyexpr_canon_status_t;

Expand All @@ -82,7 +104,13 @@ typedef enum {
* Z_SAMPLE_KIND_PUT: The Sample was issued by a ``put`` operation.
* Z_SAMPLE_KIND_DELETE: The Sample was issued by a ``delete`` operation.
*/
typedef enum { Z_SAMPLE_KIND_PUT = 0, Z_SAMPLE_KIND_DELETE = 1 } z_sample_kind_t;
// tags{c.z_sample_kind_t}
typedef enum {
// tags{c.z_sample_kind_t.put}
Z_SAMPLE_KIND_PUT = 0,
// tags{c.z_sample_kind_t.delete}
Z_SAMPLE_KIND_DELETE = 1
} z_sample_kind_t;
#define Z_SAMPLE_KIND_DEFAULT Z_SAMPLE_KIND_PUT

/**
Expand Down Expand Up @@ -111,28 +139,51 @@ typedef enum { Z_SAMPLE_KIND_PUT = 0, Z_SAMPLE_KIND_DELETE = 1 } z_sample_kind_t
* Z_ENCODING_PREFIX_IMAGE_PNG: ``image/png``. Portable Network Graphics.
* Z_ENCODING_PREFIX_IMAGE_GIF: ``image/gif``. Graphics Interchange Format (GIF).
*/
// tags{c.z_encoding_prefix_t}
typedef enum {
// tags{c.z_encoding_prefix_t.empty}
Z_ENCODING_PREFIX_EMPTY = 0,
// tags{c.z_encoding_prefix_t.app_octet_stream}
Z_ENCODING_PREFIX_APP_OCTET_STREAM = 1,
// tags{c.z_encoding_prefix_t.app_custom}
Z_ENCODING_PREFIX_APP_CUSTOM = 2, // non iana standard
// tags{c.z_encoding_prefix_t.text_plain}
Z_ENCODING_PREFIX_TEXT_PLAIN = 3,
// tags{c.z_encoding_prefix_t.app_properties}
Z_ENCODING_PREFIX_APP_PROPERTIES = 4, // non iana standard
Z_ENCODING_PREFIX_APP_JSON = 5, // if not readable from casual users
// tags{c.z_encoding_prefix_t.app_json}
Z_ENCODING_PREFIX_APP_JSON = 5, // if not readable from casual users
// tags{c.z_encoding_prefix_t.app_sql}
Z_ENCODING_PREFIX_APP_SQL = 6,
// tags{c.z_encoding_prefix_t.app_integer}
Z_ENCODING_PREFIX_APP_INTEGER = 7, // non iana standard
Z_ENCODING_PREFIX_APP_FLOAT = 8, // non iana standard
Z_ENCODING_PREFIX_APP_XML = 9, // if not readable from casual users (RFC 3023, section 3)
// tags{c.z_encoding_prefix_t.app_float}
Z_ENCODING_PREFIX_APP_FLOAT = 8, // non iana standard
// tags{c.z_encoding_prefix_t.app_xml}
Z_ENCODING_PREFIX_APP_XML = 9, // if not readable from casual users (RFC 3023, section 3)
// tags{c.z_encoding_prefix_t.app_xhtml_xml}
Z_ENCODING_PREFIX_APP_XHTML_XML = 10,
// tags{c.z_encoding_prefix_t.app_x_www_form_urlencoded}
Z_ENCODING_PREFIX_APP_X_WWW_FORM_URLENCODED = 11,
// tags{c.z_encoding_prefix_t.text_json}
Z_ENCODING_PREFIX_TEXT_JSON = 12, // non iana standard - if readable from casual users
// tags{c.z_encoding_prefix_t.text_html}
Z_ENCODING_PREFIX_TEXT_HTML = 13,
// tags{c.z_encoding_prefix_t.text_xml}
Z_ENCODING_PREFIX_TEXT_XML = 14, // if readable from casual users (RFC 3023, section 3)
// tags{c.z_encoding_prefix_t.text_css}
Z_ENCODING_PREFIX_TEXT_CSS = 15,
// tags{c.z_encoding_prefix_t.text_csv}
Z_ENCODING_PREFIX_TEXT_CSV = 16,
// tags{c.z_encoding_prefix_t.text_javascript}
Z_ENCODING_PREFIX_TEXT_JAVASCRIPT = 17,
// tags{c.z_encoding_prefix_t.image_jpeg}
Z_ENCODING_PREFIX_IMAGE_JPEG = 18,
// tags{c.z_encoding_prefix_t.image_png}
Z_ENCODING_PREFIX_IMAGE_PNG = 19,
// tags{c.z_encoding_prefix_t.image_gif}
Z_ENCODING_PREFIX_IMAGE_GIF = 20
// tags{c.z_encoding_prefix_t.image_svg_xml}
} z_encoding_prefix_t;
#define Z_ENCODING_PREFIX_DEFAULT Z_ENCODING_PREFIX_EMPTY

Expand All @@ -149,10 +200,15 @@ typedef enum {
* Z_CONSOLIDATION_MODE_LATEST: It guarantees unicity of replies for the same key expression.
* It optimizes bandwidth.
*/
// tags{c.z_consolidation_mode_t}
typedef enum {
// tags{c.z_consolidation_mode_t.auto}
Z_CONSOLIDATION_MODE_AUTO = -1,
// tags{c.z_consolidation_mode_t.none}
Z_CONSOLIDATION_MODE_NONE = 0,
// tags{c.z_consolidation_mode_t.monotonic}
Z_CONSOLIDATION_MODE_MONOTONIC = 1,
// tags{c.z_consolidation_mode_t.latest}
Z_CONSOLIDATION_MODE_LATEST = 2,
} z_consolidation_mode_t;
#define Z_CONSOLIDATION_MODE_DEFAULT Z_CONSOLIDATION_MODE_AUTO
Expand All @@ -164,7 +220,13 @@ typedef enum {
* Z_RELIABILITY_BEST_EFFORT: Defines reliability as ``BEST_EFFORT``
* Z_RELIABILITY_RELIABLE: Defines reliability as ``RELIABLE``
*/
typedef enum { Z_RELIABILITY_BEST_EFFORT = 1, Z_RELIABILITY_RELIABLE = 0 } z_reliability_t;
// tags{c.z_reliability_t}
typedef enum {
// tags{c.z_reliability_t.best_effort}
Z_RELIABILITY_BEST_EFFORT = 1,
// tags{c.z_reliability_t.reliable}
Z_RELIABILITY_RELIABLE = 0
} z_reliability_t;
#define Z_RELIABILITY_DEFAULT Z_RELIABILITY_RELIABLE

/**
Expand All @@ -175,7 +237,13 @@ typedef enum { Z_RELIABILITY_BEST_EFFORT = 1, Z_RELIABILITY_RELIABLE = 0 } z_rel
* Z_REPLY_TAG_FINAL: Tag identifying that the reply does not contain any data and that there will be no more
* replies for this query.
*/
typedef enum { Z_REPLY_TAG_DATA = 0, Z_REPLY_TAG_FINAL = 1 } z_reply_tag_t;
// tags{c.z_reply_tag_t}
typedef enum {
// tags{c.z_reply_tag_t.data}
Z_REPLY_TAG_DATA = 0,
// tags{c.z_reply_tag_t.final}
Z_REPLY_TAG_FINAL = 1
} z_reply_tag_t;

/**
* Congestion control values.
Expand All @@ -186,7 +254,13 @@ typedef enum { Z_REPLY_TAG_DATA = 0, Z_REPLY_TAG_FINAL = 1 } z_reply_tag_t;
* Z_CONGESTION_CONTROL_DROP: Defines congestion control as ``DROP``. Messages are dropped in case
* of congestion control.
*/
typedef enum { Z_CONGESTION_CONTROL_BLOCK = 0, Z_CONGESTION_CONTROL_DROP = 1 } z_congestion_control_t;
// tags{c.z_congestion_control_t}
typedef enum {
// tags{c.z_congestion_control_t.block}
Z_CONGESTION_CONTROL_BLOCK = 0,
// tags{c.z_congestion_control_t.drop}
Z_CONGESTION_CONTROL_DROP = 1
} z_congestion_control_t;
#define Z_CONGESTION_CONTROL_DEFAULT Z_CONGESTION_CONTROL_BLOCK

/**
Expand All @@ -202,14 +276,23 @@ typedef enum { Z_CONGESTION_CONTROL_BLOCK = 0, Z_CONGESTION_CONTROL_DROP = 1 } z
* Z_PRIORITY_DATA_LOW: Lowest priority for ``Data`` messages.
* Z_PRIORITY_BACKGROUND: Priority for ``Background traffic`` messages.
*/
// tags{c.z_priority_t}
typedef enum {
// tags{c.z_priority_t.control}
_Z_PRIORITY_CONTROL = 0,
// tags{c.z_priority_t.real_time}
Z_PRIORITY_REAL_TIME = 1,
// tags{c.z_priority_t.interactive_high}
Z_PRIORITY_INTERACTIVE_HIGH = 2,
// tags{c.z_priority_t.interactive_low}
Z_PRIORITY_INTERACTIVE_LOW = 3,
// tags{c.z_priority_t.data_high}
Z_PRIORITY_DATA_HIGH = 4,
// tags{c.z_priority_t.data}
Z_PRIORITY_DATA = 5,
// tags{c.z_priority_t.data_low}
Z_PRIORITY_DATA_LOW = 6,
// tags{c.z_priority_t.background}
Z_PRIORITY_BACKGROUND = 7
} z_priority_t;
#define Z_PRIORITY_DEFAULT Z_PRIORITY_DATA
Expand All @@ -221,7 +304,13 @@ typedef enum {
* Z_SUBMODE_PUSH: Defines the subscription with a push paradigm.
* Z_SUBMODE_PULL: Defines the subscription with a pull paradigm.
*/
typedef enum { Z_SUBMODE_PUSH = 0, Z_SUBMODE_PULL = 1 } z_submode_t;
// tags{c.z_submode_t}
typedef enum {
// tags{c.z_submode_t.push}
Z_SUBMODE_PUSH = 0,
// tags{c.z_submode_t.pull}
Z_SUBMODE_PULL = 1
} z_submode_t;
#define Z_SUBMODE_DEFAULT Z_SUBMODE_PUSH

/**
Expand All @@ -232,9 +321,13 @@ typedef enum { Z_SUBMODE_PUSH = 0, Z_SUBMODE_PULL = 1 } z_submode_t;
* Z_QUERY_TARGET_ALL: All matching queryables.
* Z_QUERY_TARGET_ALL_COMPLETE: A set of complete queryables.
*/
// tags{c.z_query_target_t}
typedef enum {
// tags{c.z_query_target_t.best_matching}
Z_QUERY_TARGET_BEST_MATCHING = 0,
// tags{c.z_query_target_t.all}
Z_QUERY_TARGET_ALL = 1,
// tags{c.z_query_target_t.all_complete}
Z_QUERY_TARGET_ALL_COMPLETE = 2
} z_query_target_t;
#define Z_QUERY_TARGET_DEFAULT Z_QUERY_TARGET_BEST_MATCHING
Expand Down
11 changes: 11 additions & 0 deletions include/zenoh-pico/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* Accepted values : `"client"`, `"peer"`.
* Default value : `"client"`.
*/
// tags{c.z_config_mode_key}
#define Z_CONFIG_MODE_KEY 0x40
#define Z_CONFIG_MODE_CLIENT "client"
#define Z_CONFIG_MODE_PEER "peer"
Expand All @@ -32,6 +33,7 @@
* Default value : None.
* Multiple values are not accepted in zenoh-pico.
*/
// tags{c.z_config_connect_key}
#define Z_CONFIG_CONNECT_KEY 0x41

/**
Expand All @@ -40,27 +42,31 @@
* Default value : None.
* Multiple values accepted.
*/
// tags{c.z_config_listen_key}
#define Z_CONFIG_LISTEN_KEY 0x42

/**
* The user name to use for authentication.
* Accepted values : `<string>`.
* Default value : None.
*/
// tags{c.z_config_user_key}
#define Z_CONFIG_USER_KEY 0x43

/**
* The password to use for authentication.
* Accepted values : `<string>`.
* Default value : None.
*/
// tags{c.z_config_password_key}
#define Z_CONFIG_PASSWORD_KEY 0x44

/**
* Activates/Deactivates multicast scouting.
* Accepted values : `false`, `true`.
* Default value : `true`.
*/
// tags{c.z_config_multicast_scouting_key}
#define Z_CONFIG_MULTICAST_SCOUTING_KEY 0x45
#define Z_CONFIG_MULTICAST_SCOUTING_DEFAULT "true"

Expand All @@ -69,6 +75,7 @@
* Accepted values : `<ip address>:<port>`.
* Default value : `"224.0.0.224:7446"`.
*/
// tags{c.z_config_multicast_locator_key}
#define Z_CONFIG_MULTICAST_LOCATOR_KEY 0x46
#define Z_CONFIG_MULTICAST_LOCATOR_DEFAULT "udp/224.0.0.224:7446"

Expand All @@ -77,6 +84,7 @@
* Accepted values : `<int in milliseconds>`.
* Default value : `"3000"`.
*/
// tags{c.z_config_scouting_timeout_key}
#define Z_CONFIG_SCOUTING_TIMEOUT_KEY 0x47
#define Z_CONFIG_SCOUTING_TIMEOUT_DEFAULT "3000"

Expand All @@ -85,20 +93,23 @@
* Accepted values : [0-7]. Bitwise value are defined in :c:enum:`z_whatami_t`.
* Default value : `3`.
*/
// tags{c.z_config_scouting_what_key}
#define Z_CONFIG_SCOUTING_WHAT_KEY 0x48
#define Z_CONFIG_SCOUTING_WHAT_DEFAULT "3"

/**
* A configurable and static Zenoh ID to be used on Zenoh Sessions.
* Accepted values : `<UUDI 128-bit>`.
*/
// tags{c.z_config_session_zid_key}
#define Z_CONFIG_SESSION_ZID_KEY 0x49

/**
* Indicates if data messages should be timestamped.
* Accepted values : `false`, `true`.
* Default value : `false`.
*/
// tags{c.z_config_add_timestamp_key}
#define Z_CONFIG_ADD_TIMESTAMP_KEY 0x4A
#define Z_CONFIG_ADD_TIMESTAMP_DEFAULT "false"

Expand Down

0 comments on commit 7b26648

Please sign in to comment.