890d0f1d1aac3f2f1c5ba8a016f15b0cfdac4ccd
[platform/framework/native/appfw.git] / inc / FIoISerialPortEventListener.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 /**
18  * @file        FIoISerialPortEventListener.h
19  * @brief       This is the header file for the %ISerialPortEventListener interface.
20  *
21  * This header file contains the declarations of the %ISerialPortEventListener interface.
22  */
23
24 #ifndef _FIO_SERIAL_PORT_EVENT_LISTENER_H_
25 #define _FIO_SERIAL_PORT_EVENT_LISTENER_H_
26
27 #include <FBaseResult.h>
28 #include <FBaseRtIEventListener.h>
29 #include <FIoSerialPort.h>
30
31 namespace Tizen { namespace Io
32 {
33
34 /**
35  * @interface ISerialPortEventListener
36  * @brief This interface provides event handlers to receive serial port events synchronously.
37  *
38  * @since       2.0
39  *
40  * The %ISerialPortEventListener interface provides event handlers to receive serial port events synchronously. @n
41  *
42  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/io/serial_port_comm.htm">Serial Port Communication</a>.
43  *
44  */
45
46 class _OSP_EXPORT_ ISerialPortEventListener
47         : virtual public Tizen::Base::Runtime::IEventListener
48 {
49
50 public:
51         /**
52         * Called when the data is received on the serial port.
53         *
54         * @since                2.0
55         *
56         * @param[in]    byteBuffer              A byte buffer that contains the received data
57         * @remarks                      The ByteBuffer instance needs to be deleted by the application.
58         */
59         virtual void OnSerialPortDataReceivedN(Tizen::Base::ByteBuffer& byteBuffer) = 0;
60
61         /**
62         * Called when an error occurs on the serial port.
63         *
64         * @since                2.0
65         *
66         * @param[in]    r       The error code
67         * @exception    E_INVALID_DATA  The data is invalid.
68         * @exception    E_SYSTEM                                A system error has occurred.
69         */
70         virtual void OnSerialPortErrorOccured(result r) = 0;
71
72 protected:
73         //
74         // This method is for internal use only.
75         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
76         //
77         // This method is reserved and may change its name at any time without prior notice.
78         //
79         // @since       2.0
80         //
81         virtual void ISerialPortEventListener_Reserved1(void) {}
82
83         //
84         // This method is for internal use only.
85         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
86         //
87         // This method is reserved and may change its name at any time without prior notice.
88         //
89         // @since       2.0
90         //
91         virtual void ISerialPortEventListener_Reserved2(void) {}
92
93         //
94         // This method is for internal use only.
95         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
96         //
97         // This method is reserved and may change its name at any time without prior notice.
98         //
99         // @since       2.0
100         //
101         virtual void ISerialPortEventListener_Reserved3(void) {}
102
103 }; // ISerialPortEventListener
104
105 }} // Tizen::Io
106
107 #endif // _FIO_SERIAL_PORT_EVENT_LISTENER_H_
108