Truxton message get truxton

From truxwiki.com
Jump to navigation Jump to search

This retrieves the handle to the Truxton instance handling this message object.

Syntax

uint64_t truxton_message_get_truxton( uint64_t message_handle );

Parameters

message_handle

The handle to a message created by the truxton_message_create call.

Return value

A non-zero value on success, zero on failure.

Remarks

This allows you to call any API that requires a handle to the Truxton object. Many times, in code, you are given one type of thing but need another. Should you find yourself in a situation where you were given file handle and you need to do something at the Truxton level, you can get the handle you need.

Sample

void can_send( uint64_t message_handle )
{
   if ( truxton_message_get_truxton( message_handle ) == 0 )
   {
      printf( "Cannot send this message.\n" );
   }
   else
   {
      printf( "Sending this message is possible.\n" );
   }   
}