From: hjhun <36876573+hjhun@users.noreply.github.com> Date: Fri, 27 Sep 2024 04:45:29 +0000 (+0900) Subject: [Applications.RPCPort] Enhance API descriptions (#6370) X-Git-Tag: submit/tizen/20240927.150859~1^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f7443369a03b12013eb49138121b24582d0039e2;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [Applications.RPCPort] Enhance API descriptions (#6370) * [Applications.RPCPort] Enhance API descriptions Signed-off-by: Hwankyu Jhun * [Applications.RPCPort] Modify privileges section Signed-off-by: Hwankyu Jhun --------- Signed-off-by: Hwankyu Jhun --- diff --git a/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/Parcel.cs b/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/Parcel.cs index 9923019a7..ce0aada91 100755 --- a/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/Parcel.cs +++ b/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/Parcel.cs @@ -156,10 +156,10 @@ namespace Tizen.Applications.RPCPort private ParcelHeader _header; /// - /// Constructor for this class. + /// Constructs a new instance of the Parcel class. /// - /// If it's false, the parcel object does not have the header. - /// Thrown when an internal IO error occurs. + /// Determines whether the created parcel object includes a header or not. + /// Thrown when an internal I/O error occurs during the construction process. /// 11 public Parcel(bool withHeader) { @@ -188,10 +188,10 @@ namespace Tizen.Applications.RPCPort } /// - /// Constructor with port object. + /// Creates a new parcel object from a specified port object. /// - /// Port object. - /// Thrown when an internal IO error occurs. + /// The port object to create a parcel from. + /// An internal IO error occurred while creating the parcel. /// 5 public Parcel(Port port) { @@ -203,10 +203,10 @@ namespace Tizen.Applications.RPCPort } /// - /// Constructor with the raw bytes. + /// Constructs a new Parcel object from the specified raw bytes. /// - /// The raw bytes. - /// Thrown when an internal IO error occurs. + /// An array of bytes that represents the content of the parcel. + /// Thrown if an invalid argument is passed in or an internal I/O error occurs. /// 9 public Parcel(byte[] bytes) { @@ -218,10 +218,10 @@ namespace Tizen.Applications.RPCPort } /// - /// Gets the raw bytes of the parcel. + /// Converts the current parcel into its raw bytes representation. /// - /// The raw bytes of the parcel. - /// Thrown when an internal IO error occurs. + /// An array of bytes containing the contents of the parcel. + /// Thrown if an internal I/O error occurs during conversion. /// 9 public byte[] ToBytes() { @@ -234,9 +234,9 @@ namespace Tizen.Applications.RPCPort } /// - /// Sends parcel data through the port. + /// Sends parcel data through the specified port. /// - /// The RPC port object for writing data. + /// The RPC port object for writing data. /// Thrown when an internal IO error occurs. /// 5 public void Send(Port p) @@ -249,9 +249,9 @@ namespace Tizen.Applications.RPCPort } /// - /// Writes a byte value into parcel object. + /// Writes a single byte value into the parcel object. /// - /// byte data. + /// The byte value to be written into the parcel object. /// 5 public void WriteByte(byte b) { @@ -261,7 +261,7 @@ namespace Tizen.Applications.RPCPort /// /// Writes a short value into parcel object. /// - /// short data. + /// The short data to write. /// 5 public void WriteShort(short b) { @@ -269,9 +269,23 @@ namespace Tizen.Applications.RPCPort } /// - /// Writes an int value into parcel object. - /// - /// int data. + /// Writes an integer value into the parcel object. + /// + /// The integer value to write. + /// + /// Here's an example showing how to write an integer value into a parcel object: + /// + /// + /// // 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... + /// ... + /// + /// /// 5 public void WriteInt(int b) { @@ -279,9 +293,9 @@ namespace Tizen.Applications.RPCPort } /// - /// Writes a long value into parcel object. + /// Writes a long value into the parcel object. /// - /// long data. + /// The long data to write. /// 5 public void WriteLong(long b) { @@ -289,9 +303,9 @@ namespace Tizen.Applications.RPCPort } /// - /// Writes a float value into parcel object. + /// Writes a float value into the parcel object. /// - /// float data. + /// The float data to write into the parcel object. /// 5 public void WriteFloat(float b) { @@ -299,9 +313,9 @@ namespace Tizen.Applications.RPCPort } /// - /// Writes a double value into parcel object. + /// Writes a double value into the parcel object. /// - /// double data. + /// The double data to write. /// 5 public void WriteDouble(double b) { @@ -309,9 +323,9 @@ namespace Tizen.Applications.RPCPort } /// - /// Writes a string value into parcel object. + /// Writes a string value into the parcel object. /// - /// string data. + /// The string data to be written into the parcel object. /// 5 public void WriteString(string b) { @@ -319,9 +333,9 @@ namespace Tizen.Applications.RPCPort } /// - /// Writes a bool value into parcel object. + /// Writes a boolean value into the parcel object. /// - /// bool data. + /// The boolean value to write. /// 5 public void WriteBool(bool b) { @@ -329,9 +343,9 @@ namespace Tizen.Applications.RPCPort } /// - /// Writes a Bundle data into parcel object. + /// Writes a Bundle data into the parcel object. /// - /// Bundle data. + /// The Bundle object to write. /// 5 public void WriteBundle(Bundle b) { @@ -344,9 +358,9 @@ namespace Tizen.Applications.RPCPort } /// - /// Writes a count of an array into parcel object. + /// Writes a count of an array into the parcel object. /// - /// Array count. + /// The number of elements in the array. /// 5 public void WriteArrayCount(int cnt) { @@ -354,9 +368,9 @@ namespace Tizen.Applications.RPCPort } /// - /// Reads a byte value from parcel object. + /// Reads a byte value from the parcel object. /// - /// byte data. + /// The byte value. /// 5 public byte ReadByte() { @@ -365,9 +379,9 @@ namespace Tizen.Applications.RPCPort } /// - /// Reads a short value from parcel object. + /// Reads a short value from the parcel object. /// - /// short data. + /// The short data. /// 5 public short ReadShort() { @@ -376,9 +390,9 @@ namespace Tizen.Applications.RPCPort } /// - /// Reads an int value from parcel object. + /// Reads an integer value from the parcel object. /// - /// int data. + /// The integer data. /// 5 public int ReadInt() { @@ -387,9 +401,9 @@ namespace Tizen.Applications.RPCPort } /// - /// Reads a long value from parcel object. + /// Reads a long value from the parcel object. /// - /// long data. + /// The long data. /// 5 public long ReadLong() { @@ -398,9 +412,9 @@ namespace Tizen.Applications.RPCPort } /// - /// Reads a float value from parcel object. + /// Reads a float value from the parcel object. /// - /// float data. + /// The float data. /// 5 public float ReadFloat() { @@ -409,9 +423,9 @@ namespace Tizen.Applications.RPCPort } /// - /// Reads a double value from parcel object. + /// Reads a double value from the parcel object. /// - /// double data. + /// The double data. /// 5 public double ReadDouble() { @@ -420,9 +434,9 @@ namespace Tizen.Applications.RPCPort } /// - /// Reads a string value from parcel object. + /// Reads a string value from the parcel object. /// - /// string data. + /// The string data. /// 5 public string ReadString() { @@ -431,9 +445,9 @@ namespace Tizen.Applications.RPCPort } /// - /// Reads a bool value from parcel object. + /// Reads a boolean value from the parcel object. /// - /// bool data. + /// The boolean data. /// 5 public bool ReadBool() { @@ -442,9 +456,9 @@ namespace Tizen.Applications.RPCPort } /// - /// Reads a Bundle value from parcel object. + /// Reads a Bundle value from the parcel object. /// - /// Bundle data. + /// The Bundle data. /// 5 public Bundle ReadBundle() { @@ -460,9 +474,9 @@ namespace Tizen.Applications.RPCPort } /// - /// Reads a count of an array from parcel object. + /// Reads a count of an array from a parcel object. /// - /// Array count. + /// The number of elements in the array. /// 5 public int ReadArrayCount() { @@ -471,9 +485,9 @@ namespace Tizen.Applications.RPCPort } /// - /// Writes bytes into parcel object. + /// Writes bytes into the parcel object. /// - /// Array of bytes. + /// An array of bytes containing the data to be written. /// 5 public void Write(byte[] bytes) { @@ -486,10 +500,10 @@ namespace Tizen.Applications.RPCPort } /// - /// Reads bytes from parcel object. + /// Reads bytes from the parcel object. /// - /// Bytes to read. - /// Array of bytes. + /// The number of bytes to read. + /// An array of bytes that were read from the parcel. /// 5 public byte[] Read(int size) { diff --git a/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/Port.cs b/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/Port.cs index f8261902a..5518b86fa 100755 --- a/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/Port.cs +++ b/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/Port.cs @@ -21,7 +21,7 @@ using System.Linq; namespace Tizen.Applications.RPCPort { /// - /// The class that proxy and stub can use to communicate with each other. + /// A class used by proxies and stubs to communicate with each other. /// /// 5 public class Port diff --git a/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/ProxyBase.cs b/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/ProxyBase.cs index 3206c52f2..038dbdd1c 100755 --- a/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/ProxyBase.cs +++ b/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/ProxyBase.cs @@ -19,7 +19,7 @@ using System; namespace Tizen.Applications.RPCPort { /// - /// Abstract class for creating a proxy class for RPC. + /// Base class for creating a proxy class for remote procedure calls. /// /// 5 public abstract class ProxyBase : IDisposable @@ -45,9 +45,9 @@ namespace Tizen.Applications.RPCPort protected Port CallbackPort { get; private set; } /// - /// Constructor for this class. + /// Creates a new instance of the ProxyBase class. /// - /// Thrown when internal IO error occurs. + /// Thrown when an internal I/O error occurs during initialization. /// 5 public ProxyBase() { @@ -64,13 +64,17 @@ namespace Tizen.Applications.RPCPort } /// - /// Connects to port. + /// Establishes a connection to the specified application through the named remote procedure call (RPC) port. /// - /// The target stub app ID. - /// The name of the RPC port. - /// Thrown when not available app ID is used. - /// Thrown when an internal IO error occurs. - /// Thrown when the permission is denied. + /// + /// 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. + /// + /// The ID of the target application to connect to. + /// The name of the RPC port to use for the connection. + /// Thrown if the specified application ID does not exist. + /// Thrown in case of an internal input/output error during the connection process. + /// Thrown when the required privileges are missing or access is otherwise restricted. /// http://tizen.org/privilege/datasharing /// http://tizen.org/privilege/appmanager.launch /// 5 @@ -89,13 +93,13 @@ namespace Tizen.Applications.RPCPort } /// - /// Connects to port synchronously. + /// Establishes a connection to the specified application synchronously through the named remote procedure call (RPC) port. /// - /// The target stub app ID. - /// The name of the RPC port. - /// Thrown when not available app ID is used. - /// Thrown when an internal IO error occurs. - /// Thrown when the permission is denied. + /// The ID of the target application to connect to. + /// The name of the RPC port to use for the connection. + /// Thrown if the specified application ID does not exist. + /// Thrown in case of an internal input/output error during the connection process. + /// Thrown when the required privileges are missing or access is otherwise restricted. /// http://tizen.org/privilege/datasharing /// http://tizen.org/privilege/appmanager.launch /// 8 @@ -114,11 +118,17 @@ namespace Tizen.Applications.RPCPort } /// - /// Gets a port. + /// Retrieves a port based on its type. /// - /// The type of port. - /// Port object. - /// Thrown when an internal IO error occurs. + /// The specific type of port to retrieve. + /// An object representing the requested port. + /// Thrown if an internal I/O error occurs while retrieving the port. + /// + /// To get a main port: + /// + /// Port mainPort = GetPort(Port.Type.Main); + /// + /// /// 5 protected Port GetPort(Port.Type t) { @@ -137,8 +147,8 @@ namespace Tizen.Applications.RPCPort /// /// Abstract method for receiving connected event. /// - /// The target stub app ID. - /// The name of the RPC port. + /// The target stub application ID. + /// The name of the Remote Procedure Call (RPC) port. /// Port object for reading and writing. /// 5 protected abstract void OnConnectedEvent(string endPoint, string portName, Port port); @@ -146,24 +156,24 @@ namespace Tizen.Applications.RPCPort /// /// Abstract method for receiving disconnected event. /// - /// The target stub app ID. - /// The name of the port. + /// The target stub application ID.. + /// The name of the Remote Procedure Call (RPC) port. /// 5 protected abstract void OnDisconnectedEvent(string endPoint, string portName); /// /// Abstract method called when the proxy receives data from stub. /// - /// The target stub app ID. - /// The name of the RPC port. + /// The target stub application ID.. + /// The name of the Remote Procedure Call (RPC) port. /// 5 protected abstract void OnReceivedEvent(string endPoint, string portName); /// /// Abstract method for receiving rejected event. /// - /// The target stub app ID. - /// The name of the RPC port. + /// The target stub application ID.. + /// The name of the Remote Procedure Call (RPC) port. /// 5 protected abstract void OnRejectedEvent(string endPoint, string portName); diff --git a/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/StubBase.cs b/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/StubBase.cs index 8e9c13a80..43272dee3 100755 --- a/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/StubBase.cs +++ b/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/StubBase.cs @@ -19,8 +19,13 @@ using System; namespace Tizen.Applications.RPCPort { /// - /// Abstract class for creating a stub class for RPC. + /// Base class for creating stubs in RPC. /// + /// + /// 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. + /// /// 5 public abstract class StubBase : IDisposable { @@ -36,10 +41,18 @@ namespace Tizen.Applications.RPCPort public string PortName { get; } /// - /// Constructor for this class. + /// Constructs a new instance of the StubBase class. /// /// The name of the port that wants to listen. /// Thrown when an internal IO error occurs. + /// + /// Here's an example showing how to construct a new instance of the StubBase class: + /// + /// + /// // Create a new instance of the StubBase class + /// var stubBase = new StubBase("MyPort"); + /// + /// /// 5 public StubBase(string portName) { @@ -55,9 +68,13 @@ namespace Tizen.Applications.RPCPort } /// - /// Listens to the requests for connections. + /// Starts listening to incoming connection requests on the specified port. /// - /// Thrown when an internal IO error occurs. + /// + /// 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. + /// + /// Thrown when an internal IO error occurs during the listening process. /// 5 protected void Listen() { @@ -87,9 +104,9 @@ namespace Tizen.Applications.RPCPort } /// - /// Sets a trusted proxy to the stub. + /// Sets whether the stub allows only trusted proxies or not. /// - /// Whether stub allows only trusted proxy or not. + /// Indicates if the stub allows only trusted proxies or not. /// 5 protected void SetTrusted(bool trusted) { @@ -97,13 +114,13 @@ namespace Tizen.Applications.RPCPort } /// - /// Gets s port. + /// Retrieves a port based on its type and the connected instance. /// - /// The type of port. - /// The ID of the instance, which is connected. - /// Port object. - /// Thrown when invalid instance is used. - /// Thrown when an internal IO error occurs. + /// The type of port to retrieve. + /// The ID of the instance that the port is connected to. + /// The requested port. + /// Thrown if an invalid instance ID is passed. + /// Thrown in case of an internal I/O error. /// 5 protected Port GetPort(Port.Type t, string instance) { @@ -123,7 +140,7 @@ namespace Tizen.Applications.RPCPort /// /// Abstract method for receiving connected event. /// - /// The target proxy app ID. + /// The target proxy applicstion ID. /// The information about the request. /// 5 protected abstract void OnConnectedEvent(string sender, string instance); @@ -131,7 +148,7 @@ namespace Tizen.Applications.RPCPort /// /// Abstract method for receiving disconnected event. /// - /// The target proxy app ID. + /// The target proxy applicstion ID. /// The information about the request. /// 5 protected abstract void OnDisconnectedEvent(string sender, string instance); @@ -139,7 +156,7 @@ namespace Tizen.Applications.RPCPort /// /// Abstract method called when the stub receives data from proxy. /// - /// The target proxy app ID. + /// The target proxy applicstion ID. /// The information about the request. /// Port object for reading and writing. /// true to continue receiving data, otherwise false to disconnect from the port.