private ParcelHeader _header;
/// <summary>
- /// Constructor for this class.
+ /// Constructs a new instance of the Parcel class.
/// </summary>
- /// <param name="withHeader">If it's false, the parcel object does not have the header.</param>
- /// <exception cref="InvalidIOException">Thrown when an internal IO error occurs.</exception>
+ /// <param name="withHeader">Determines whether the created parcel object includes a header or not.</param>
+ /// <exception cref="InvalidIOException">Thrown when an internal I/O error occurs during the construction process.</exception>
/// <since_tizen> 11 </since_tizen>
public Parcel(bool withHeader)
{
}
/// <summary>
- /// Constructor with port object.
+ /// Creates a new parcel object from a specified port object.
/// </summary>
- /// <param name="port">Port object.</param>
- /// <exception cref="InvalidIOException">Thrown when an internal IO error occurs.</exception>
+ /// <param name="port">The port object to create a parcel from.</param>
+ /// <exception cref="InvalidIOException">An internal IO error occurred while creating the parcel.</exception>
/// <since_tizen> 5 </since_tizen>
public Parcel(Port port)
{
}
/// <summary>
- /// Constructor with the raw bytes.
+ /// Constructs a new Parcel object from the specified raw bytes.
/// </summary>
- /// <param name="bytes">The raw bytes.</param>
- /// <exception cref="InvalidIOException">Thrown when an internal IO error occurs.</exception>
+ /// <param name="bytes">An array of bytes that represents the content of the parcel.</param>
+ /// <exception cref="InvalidOperationException">Thrown if an invalid argument is passed in or an internal I/O error occurs.</exception>
/// <since_tizen> 9 </since_tizen>
public Parcel(byte[] bytes)
{
}
/// <summary>
- /// Gets the raw bytes of the parcel.
+ /// Converts the current parcel into its raw bytes representation.
/// </summary>
- /// <returns>The raw bytes of the parcel.</returns>
- /// <exception cref="InvalidIOException">Thrown when an internal IO error occurs.</exception>
+ /// <returns>An array of bytes containing the contents of the parcel.</returns>
+ /// <exception cref="InvalidIOException">Thrown if an internal I/O error occurs during conversion.</exception>
/// <since_tizen> 9 </since_tizen>
public byte[] ToBytes()
{
}
/// <summary>
- /// Sends parcel data through the port.
+ /// Sends parcel data through the specified port.
/// </summary>
- /// <param name="p">The RPC port object for writing data.</param>
+ /// <param name="port">The RPC port object for writing data.</param>
/// <exception cref="InvalidIOException">Thrown when an internal IO error occurs.</exception>
/// <since_tizen> 5 </since_tizen>
public void Send(Port p)
}
/// <summary>
- /// Writes a byte value into parcel object.
+ /// Writes a single byte value into the parcel object.
/// </summary>
- /// <param name="b">byte data.</param>
+ /// <param name="b">The byte value to be written into the parcel object.</param>
/// <since_tizen> 5 </since_tizen>
public void WriteByte(byte b)
{
/// <summary>
/// Writes a short value into parcel object.
/// </summary>
- /// <param name="b">short data.</param>
+ /// <param name="b">The short data to write.</param>
/// <since_tizen> 5 </since_tizen>
public void WriteShort(short b)
{
}
/// <summary>
- /// Writes an int value into parcel object.
- /// </summary>
- /// <param name="b">int data.</param>
+ /// Writes an integer value into the parcel object.
+ /// </summary>
+ /// <param name="b">The integer value to write.</param>
+ /// <example>
+ /// Here's an example showing how to write an integer value into a parcel object:
+ ///
+ /// <code>
+ /// // Create a new parcel object
+ /// Parcel parcel = new Parcel();
+ ///
+ /// // Write an integer value into the parcel object
+ /// parcel.WriteInt(42);
+ ///
+ /// // Do something else with the parcel object...
+ /// ...
+ /// </code>
+ /// </example>
/// <since_tizen> 5 </since_tizen>
public void WriteInt(int b)
{
}
/// <summary>
- /// Writes a long value into parcel object.
+ /// Writes a long value into the parcel object.
/// </summary>
- /// <param name="b">long data.</param>
+ /// <param name="b">The long data to write.</param>
/// <since_tizen> 5 </since_tizen>
public void WriteLong(long b)
{
}
/// <summary>
- /// Writes a float value into parcel object.
+ /// Writes a float value into the parcel object.
/// </summary>
- /// <param name="b">float data.</param>
+ /// <param name="b">The float data to write into the parcel object.</param>
/// <since_tizen> 5 </since_tizen>
public void WriteFloat(float b)
{
}
/// <summary>
- /// Writes a double value into parcel object.
+ /// Writes a double value into the parcel object.
/// </summary>
- /// <param name="b">double data.</param>
+ /// <param name="b">The double data to write.</param>
/// <since_tizen> 5 </since_tizen>
public void WriteDouble(double b)
{
}
/// <summary>
- /// Writes a string value into parcel object.
+ /// Writes a string value into the parcel object.
/// </summary>
- /// <param name="b">string data.</param>
+ /// <param name="b">The string data to be written into the parcel object.</param>
/// <since_tizen> 5 </since_tizen>
public void WriteString(string b)
{
}
/// <summary>
- /// Writes a bool value into parcel object.
+ /// Writes a boolean value into the parcel object.
/// </summary>
- /// <param name="b">bool data.</param>
+ /// <param name="b">The boolean value to write.</param>
/// <since_tizen> 5 </since_tizen>
public void WriteBool(bool b)
{
}
/// <summary>
- /// Writes a Bundle data into parcel object.
+ /// Writes a Bundle data into the parcel object.
/// </summary>
- /// <param name="b">Bundle data.</param>
+ /// <param name="b">The Bundle object to write.</param>
/// <since_tizen> 5 </since_tizen>
public void WriteBundle(Bundle b)
{
}
/// <summary>
- /// Writes a count of an array into parcel object.
+ /// Writes a count of an array into the parcel object.
/// </summary>
- /// <param name="cnt">Array count.</param>
+ /// <param name="cnt">The number of elements in the array.</param>
/// <since_tizen> 5 </since_tizen>
public void WriteArrayCount(int cnt)
{
}
/// <summary>
- /// Reads a byte value from parcel object.
+ /// Reads a byte value from the parcel object.
/// </summary>
- /// <returns>byte data.</returns>
+ /// <returns>The byte value.</returns>
/// <since_tizen> 5 </since_tizen>
public byte ReadByte()
{
}
/// <summary>
- /// Reads a short value from parcel object.
+ /// Reads a short value from the parcel object.
/// </summary>
- /// <returns>short data.</returns>
+ /// <returns>The short data.</returns>
/// <since_tizen> 5 </since_tizen>
public short ReadShort()
{
}
/// <summary>
- /// Reads an int value from parcel object.
+ /// Reads an integer value from the parcel object.
/// </summary>
- /// <returns>int data.</returns>
+ /// <returns>The integer data.</returns>
/// <since_tizen> 5 </since_tizen>
public int ReadInt()
{
}
/// <summary>
- /// Reads a long value from parcel object.
+ /// Reads a long value from the parcel object.
/// </summary>
- /// <returns>long data.</returns>
+ /// <returns>The long data.</returns>
/// <since_tizen> 5 </since_tizen>
public long ReadLong()
{
}
/// <summary>
- /// Reads a float value from parcel object.
+ /// Reads a float value from the parcel object.
/// </summary>
- /// <returns>float data.</returns>
+ /// <returns>The float data.</returns>
/// <since_tizen> 5 </since_tizen>
public float ReadFloat()
{
}
/// <summary>
- /// Reads a double value from parcel object.
+ /// Reads a double value from the parcel object.
/// </summary>
- /// <returns>double data.</returns>
+ /// <returns>The double data.</returns>
/// <since_tizen> 5 </since_tizen>
public double ReadDouble()
{
}
/// <summary>
- /// Reads a string value from parcel object.
+ /// Reads a string value from the parcel object.
/// </summary>
- /// <returns>string data.</returns>
+ /// <returns>The string data.</returns>
/// <since_tizen> 5 </since_tizen>
public string ReadString()
{
}
/// <summary>
- /// Reads a bool value from parcel object.
+ /// Reads a boolean value from the parcel object.
/// </summary>
- /// <returns>bool data.</returns>
+ /// <returns>The boolean data.</returns>
/// <since_tizen> 5 </since_tizen>
public bool ReadBool()
{
}
/// <summary>
- /// Reads a Bundle value from parcel object.
+ /// Reads a Bundle value from the parcel object.
/// </summary>
- /// <returns>Bundle data.</returns>
+ /// <returns>The Bundle data.</returns>
/// <since_tizen> 5 </since_tizen>
public Bundle ReadBundle()
{
}
/// <summary>
- /// Reads a count of an array from parcel object.
+ /// Reads a count of an array from a parcel object.
/// </summary>
- /// <returns>Array count.</returns>
+ /// <returns>The number of elements in the array.</returns>
/// <since_tizen> 5 </since_tizen>
public int ReadArrayCount()
{
}
/// <summary>
- /// Writes bytes into parcel object.
+ /// Writes bytes into the parcel object.
/// </summary>
- /// <param name="bytes">Array of bytes.</param>
+ /// <param name="bytes">An array of bytes containing the data to be written.</param>
/// <since_tizen> 5 </since_tizen>
public void Write(byte[] bytes)
{
}
/// <summary>
- /// Reads bytes from parcel object.
+ /// Reads bytes from the parcel object.
/// </summary>
- /// <param name="size">Bytes to read.</param>
- /// <returns>Array of bytes.</returns>
+ /// <param name="size">The number of bytes to read.</param>
+ /// <returns>An array of bytes that were read from the parcel.</returns>
/// <since_tizen> 5 </since_tizen>
public byte[] Read(int size)
{
namespace Tizen.Applications.RPCPort
{
/// <summary>
- /// Abstract class for creating a proxy class for RPC.
+ /// Base class for creating a proxy class for remote procedure calls.
/// </summary>
/// <since_tizen> 5 </since_tizen>
public abstract class ProxyBase : IDisposable
protected Port CallbackPort { get; private set; }
/// <summary>
- /// Constructor for this class.
+ /// Creates a new instance of the ProxyBase class.
/// </summary>
- /// <exception cref="InvalidIOException">Thrown when internal IO error occurs.</exception>
+ /// <exception cref="InvalidIOException">Thrown when an internal I/O error occurs during initialization.</exception>
/// <since_tizen> 5 </since_tizen>
public ProxyBase()
{
}
/// <summary>
- /// Connects to port.
+ /// Establishes a connection to the specified application through the named remote procedure call (RPC) port.
/// </summary>
- /// <param name="appid">The target stub app ID.</param>
- /// <param name="port">The name of the RPC port.</param>
- /// <exception cref="InvalidIDException">Thrown when not available app ID is used.</exception>
- /// <exception cref="InvalidIOException">Thrown when an internal IO error occurs.</exception>
- /// <exception cref="PermissionDeniedException">Thrown when the permission is denied.</exception>
+ /// <remarks>
+ /// By calling this method, you can establish a connection between two applications using the specified RPC port. It requires the target application ID and the name of the desired RPC port.
+ /// If the connection cannot be established due to invalid arguments or insufficient privileges, appropriate exceptions are thrown accordingly.
+ /// </remarks>
+ /// <param name="appid">The ID of the target application to connect to.</param>
+ /// <param name="port">The name of the RPC port to use for the connection.</param>
+ /// <exception cref="InvalidIDException">Thrown if the specified application ID does not exist.</exception>
+ /// <exception cref="InvalidIOException">Thrown in case of an internal input/output error during the connection process.</exception>
+ /// <exception cref="PermissionDeniedException">Thrown when the required privileges are missing or access is otherwise restricted.</exception>
/// <privilege>http://tizen.org/privilege/datasharing</privilege>
/// <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
/// <since_tizen> 5 </since_tizen>
}
/// <summary>
- /// Connects to port synchronously.
+ /// Establishes a connection to the specified application synchronously through the named remote procedure call (RPC) port.
/// </summary>
- /// <param name="appid">The target stub app ID.</param>
- /// <param name="port">The name of the RPC port.</param>
- /// <exception cref="InvalidIDException">Thrown when not available app ID is used.</exception>
- /// <exception cref="InvalidIOException">Thrown when an internal IO error occurs.</exception>
- /// <exception cref="PermissionDeniedException">Thrown when the permission is denied.</exception>
+ /// <param name="appid">The ID of the target application to connect to.</param>
+ /// <param name="port">The name of the RPC port to use for the connection.</param>
+ /// <exception cref="InvalidIDException">Thrown if the specified application ID does not exist.</exception>
+ /// <exception cref="InvalidIOException">Thrown in case of an internal input/output error during the connection process.</exception>
+ /// <exception cref="PermissionDeniedException">Thrown when the required privileges are missing or access is otherwise restricted.</exception>
/// <privilege>http://tizen.org/privilege/datasharing</privilege>
/// <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
/// <since_tizen> 8 </since_tizen>
}
/// <summary>
- /// Gets a port.
+ /// Retrieves a port based on its type.
/// </summary>
- /// <param name="t">The type of port.</param>
- /// <returns>Port object.</returns>
- /// <exception cref="InvalidIOException">Thrown when an internal IO error occurs.</exception>
+ /// <param name="t">The specific type of port to retrieve.</param>
+ /// <returns>An object representing the requested port.</returns>
+ /// <exception cref="InvalidIOException">Thrown if an internal I/O error occurs while retrieving the port.</exception>
+ /// <example>
+ /// To get a main port:
+ /// <code>
+ /// Port mainPort = GetPort(Port.Type.Main);
+ /// </code>
+ /// </example>
/// <since_tizen> 5 </since_tizen>
protected Port GetPort(Port.Type t)
{
/// <summary>
/// Abstract method for receiving connected event.
/// </summary>
- /// <param name="endPoint">The target stub app ID.</param>
- /// <param name="portName">The name of the RPC port.</param>
+ /// <param name="endPoint">The target stub application ID.</param>
+ /// <param name="portName">The name of the Remote Procedure Call (RPC) port.</param>
/// <param name="port">Port object for reading and writing.</param>
/// <since_tizen> 5 </since_tizen>
protected abstract void OnConnectedEvent(string endPoint, string portName, Port port);
/// <summary>
/// Abstract method for receiving disconnected event.
/// </summary>
- /// <param name="endPoint">The target stub app ID.</param>
- /// <param name="portName">The name of the port.</param>
+ /// <param name="endPoint">The target stub application ID..</param>
+ /// <param name="portName">The name of the Remote Procedure Call (RPC) port.</param>
/// <since_tizen> 5 </since_tizen>
protected abstract void OnDisconnectedEvent(string endPoint, string portName);
/// <summary>
/// Abstract method called when the proxy receives data from stub.
/// </summary>
- /// <param name="endPoint">The target stub app ID.</param>
- /// <param name="portName">The name of the RPC port.</param>
+ /// <param name="endPoint">The target stub application ID..</param>
+ /// <param name="portName">The name of the Remote Procedure Call (RPC) port.</param>
/// <since_tizen> 5 </since_tizen>
protected abstract void OnReceivedEvent(string endPoint, string portName);
/// <summary>
/// Abstract method for receiving rejected event.
/// </summary>
- /// <param name="endPoint">The target stub app ID.</param>
- /// <param name="portName">The name of the RPC port.</param>
+ /// <param name="endPoint">The target stub application ID..</param>
+ /// <param name="portName">The name of the Remote Procedure Call (RPC) port.</param>
/// <since_tizen> 5 </since_tizen>
protected abstract void OnRejectedEvent(string endPoint, string portName);
namespace Tizen.Applications.RPCPort
{
/// <summary>
- /// Abstract class for creating a stub class for RPC.
+ /// Base class for creating stubs in RPC.
/// </summary>
+ /// <remarks>
+ /// This class provides a base implementation for creating stubs that are used in Remote Procedure Call (RPC). By extending this class, you can easily implement your own stubs for specific interfaces.
+ /// The StubBase class handles common functionality such as managing the connection state and handling incoming requests from clients. It also provides methods for sending responses back to the client after processing the request.
+ /// To create a stub for a specific interface, you need to extend the StubBase class and override its virtual methods according to the requirements of the interface.
+ /// </remarks>
/// <since_tizen> 5 </since_tizen>
public abstract class StubBase : IDisposable
{
public string PortName { get; }
/// <summary>
- /// Constructor for this class.
+ /// Constructs a new instance of the StubBase class.
/// </summary>
/// <param name="portName">The name of the port that wants to listen.</param>
/// <exception cref="InvalidIOException">Thrown when an internal IO error occurs.</exception>
+ /// <example>
+ /// Here's an example showing how to construct a new instance of the StubBase class:
+ ///
+ /// <code>
+ /// // Create a new instance of the StubBase class
+ /// var stubBase = new StubBase("MyPort");
+ /// </code>
+ /// </example>
/// <since_tizen> 5 </since_tizen>
public StubBase(string portName)
{
}
/// <summary>
- /// Listens to the requests for connections.
+ /// Starts listening to incoming connection requests on the specified port.
/// </summary>
- /// <exception cref="InvalidIOException">Thrown when an internal IO error occurs.</exception>
+ /// <remarks>
+ /// This method enables your application to listen for incoming connection requests from other applications.
+ /// It is typically called after setting up the necessary network infrastructure such as creating a server socket and specifying a listening port.
+ /// </remarks>
+ /// <exception cref="InvalidIOException">Thrown when an internal IO error occurs during the listening process.</exception>
/// <since_tizen> 5 </since_tizen>
protected void Listen()
{
}
/// <summary>
- /// Sets a trusted proxy to the stub.
+ /// Sets whether the stub allows only trusted proxies or not.
/// </summary>
- /// <param name="trusted">Whether stub allows only trusted proxy or not.</param>
+ /// <param name="trusted">Indicates if the stub allows only trusted proxies or not.</param>
/// <since_tizen> 5 </since_tizen>
protected void SetTrusted(bool trusted)
{
}
/// <summary>
- /// Gets s port.
+ /// Retrieves a port based on its type and the connected instance.
/// </summary>
- /// <param name="t">The type of port.</param>
- /// <param name="instance">The ID of the instance, which is connected.</param>
- /// <returns>Port object.</returns>
- /// <exception cref="InvalidIDException">Thrown when invalid instance is used.</exception>
- /// <exception cref="InvalidIOException">Thrown when an internal IO error occurs.</exception>
+ /// <param name="t">The type of port to retrieve.</param>
+ /// <param name="instance">The ID of the instance that the port is connected to.</param>
+ /// <returns>The requested port.</returns>
+ /// <exception cref="InvalidIDException">Thrown if an invalid instance ID is passed.</exception>
+ /// <exception cref="InvalidIOException">Thrown in case of an internal I/O error.</exception>
/// <since_tizen> 5 </since_tizen>
protected Port GetPort(Port.Type t, string instance)
{
/// <summary>
/// Abstract method for receiving connected event.
/// </summary>
- /// <param name="sender">The target proxy app ID.</param>
+ /// <param name="sender">The target proxy applicstion ID.</param>
/// <param name="instance">The information about the request.</param>
/// <since_tizen> 5 </since_tizen>
protected abstract void OnConnectedEvent(string sender, string instance);
/// <summary>
/// Abstract method for receiving disconnected event.
/// </summary>
- /// <param name="sender">The target proxy app ID.</param>
+ /// <param name="sender">The target proxy applicstion ID.</param>
/// <param name="instance">The information about the request.</param>
/// <since_tizen> 5 </since_tizen>
protected abstract void OnDisconnectedEvent(string sender, string instance);
/// <summary>
/// Abstract method called when the stub receives data from proxy.
/// </summary>
- /// <param name="sender">The target proxy app ID.</param>
+ /// <param name="sender">The target proxy applicstion ID.</param>
/// <param name="instance">The information about the request.</param>
/// <param name="port">Port object for reading and writing.</param>
/// <returns><c>true</c> to continue receiving data, otherwise <c>false</c> to disconnect from the port.</returns>