System.Tether.AppProfile.TTetheringAppProfile.SendString

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function SendString(const AProfile: TTetheringProfileInfo; const Description, AString: string): Boolean;

C++

bool __fastcall SendString(const System::Tether::Manager::TTetheringProfileInfo &AProfile, const System::UnicodeString Description, const System::UnicodeString AString);

Properties

Type Visibility Source Unit Parent
function public
System.Tether.AppProfile.pas
System.Tether.AppProfile.hpp
System.Tether.AppProfile TTetheringAppProfile

Description

Sends the specified string to the specified remote profile.

This function receives the following parameters:

  • AProfile is the remote profile to receive the string.
  • Description is a description of the contents of the string.
  • AString is the string to be sent.

The remote profile receives the string as a parameter of the "send string" command, therefore it is not necessary for the remote profile to accept and receive the string separately (as it is the case with SendStream). This means that the remote profile cannot choose whether to receive the string or not. The function returns True if the remote profile received the command.

SendString is a synchronous function. This function performs a request to the remote profile, and the function execution only finishes after there is a response from the remote profile. You might want to use a separate thread to run this function.

Note: Because this function simplifies the process by sending the string inside the command (thus eliminating the extra step of sending the string), its execution is faster than the execution of SendStream.

Exceptions

A call to SendString may raise any of the following exceptions:

Exception Exception.Message Scenarios

ETetheringException

Profile <profile identifier> is not connected.

  • AProfile is not connected.

No available connections to <profile identifier>

Cannot get a connection to profile <profile identifier>.

  • SendString could not get a connection to AProfile.

Cannot connect to profile <profile identifier>

See Also