Skip to content

Commit

Permalink
Use gid struct for request id
Browse files Browse the repository at this point in the history
Everywhere else in rmw, we use the type rmw_gid_t for global identifiers.
For example, rmw_get_gid_for_publisher and rmw_get_gid_for_client.
Furthermore, other global identifiers have a maximum size of 24 bytes, not 16 bytes.
Changing the type and name of the client id in the rmw_request_id_t struct makes it consistent
with other parts of the rmw API.

Signed-off-by: Jacob Perron <[email protected]>
  • Loading branch information
jacobperron committed Oct 13, 2022
1 parent b635eec commit ca82819
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions rmw/include/rmw/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ extern "C"
// implementation. It may need to be increased in the future.
#define RMW_GID_STORAGE_SIZE 24u

/// ROS graph ID of the topic
typedef struct RMW_PUBLIC_TYPE rmw_gid_s
{
/// Name of the rmw implementation
const char * implementation_identifier;

/// Bype data Gid value
uint8_t data[RMW_GID_STORAGE_SIZE];
} rmw_gid_t;

/// Structure which encapsulates an rmw node
typedef struct RMW_PUBLIC_TYPE rmw_node_s
{
Expand Down Expand Up @@ -355,8 +365,8 @@ typedef struct RMW_PUBLIC_TYPE rmw_wait_set_s
/// An rmw service request identifier
typedef struct RMW_PUBLIC_TYPE rmw_request_id_s
{
/// The guid of the writer associated with this request
int8_t writer_guid[16];
/// The globally unique identifier of the client writer associated with this request
rmw_gid_t client_gid;

/// Sequence number of this service
int64_t sequence_number;
Expand Down Expand Up @@ -616,16 +626,6 @@ typedef struct RMW_PUBLIC_TYPE rmw_qos_profile_s
bool avoid_ros_namespace_conventions;
} rmw_qos_profile_t;

/// ROS graph ID of the topic
typedef struct RMW_PUBLIC_TYPE rmw_gid_s
{
/// Name of the rmw implementation
const char * implementation_identifier;

/// Bype data Gid value
uint8_t data[RMW_GID_STORAGE_SIZE];
} rmw_gid_t;

#define RMW_MESSAGE_INFO_SEQUENCE_NUMBER_UNSUPPORTED UINT64_MAX

/// Information describing an rmw message
Expand Down

0 comments on commit ca82819

Please sign in to comment.