Add dds_get_guid to get the GUID of a local entity
This is merely a more convenient way of obtaining it: otherwise one has subscribe to the correct built-in topic, read the sample corresponding to the entity's instance handle and get the "key" field. That's a bit of a detour to get the network-wide unique identifier. Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
		
							parent
							
								
									b2cf6921da
								
							
						
					
					
						commit
						45c0f432a9
					
				
					 3 changed files with 73 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -418,6 +418,26 @@ dds_get_mask(dds_entity_t condition, uint32_t *mask);
 | 
			
		|||
DDS_EXPORT dds_return_t
 | 
			
		||||
dds_get_instance_handle(dds_entity_t entity, dds_instance_handle_t *ihdl);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @brief Returns the GUID that represents the entity in the network,
 | 
			
		||||
 * and therefore only supports participants, readers and writers.
 | 
			
		||||
 *
 | 
			
		||||
 * @param[in]   entity  Entity of which to get the instance handle.
 | 
			
		||||
 * @param[out]  guid    Where to store the GUID.
 | 
			
		||||
 *
 | 
			
		||||
 * @returns A dds_return_t indicating success or failure.
 | 
			
		||||
 *
 | 
			
		||||
 * @retval DDS_RETCODE_OK
 | 
			
		||||
 *             Success.
 | 
			
		||||
 * @retval DDS_RETCODE_ILLEGAL_OPERATION
 | 
			
		||||
 *             The operation is invoked on an inappropriate object.
 | 
			
		||||
 * @retval DDS_RETCODE_ERROR
 | 
			
		||||
 *             An internal error has occurred.
 | 
			
		||||
 */
 | 
			
		||||
/* TODO: Check list of return codes is complete. */
 | 
			
		||||
DDS_EXPORT dds_return_t
 | 
			
		||||
dds_get_guid (dds_entity_t entity, dds_guid_t *guid);
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
  All entities have a set of "status conditions" (following the DCPS
 | 
			
		||||
  spec), read peeks, take reads & resets (analogously to read & take
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue