2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file FIoISerialPortEventListener.h
19 * @brief This is the header file for the %ISerialPortEventListener interface.
21 * This header file contains the declarations of the %ISerialPortEventListener interface.
24 #ifndef _FIO_SERIAL_PORT_EVENT_LISTENER_H_
25 #define _FIO_SERIAL_PORT_EVENT_LISTENER_H_
27 #include <FBaseResult.h>
28 #include <FBaseRtIEventListener.h>
29 #include <FIoSerialPort.h>
31 namespace Tizen { namespace Io
35 * @interface ISerialPortEventListener
36 * @brief This interface provides event handlers to receive serial port events synchronously.
40 * The %ISerialPortEventListener interface provides event handlers to receive serial port events synchronously. @n
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>.
46 class _OSP_EXPORT_ ISerialPortEventListener
47 : virtual public Tizen::Base::Runtime::IEventListener
52 * Called when the data is received on the serial port.
56 * @param[in] byteBuffer A byte buffer that contains the received data
57 * @remarks The ByteBuffer instance needs to be deleted by the application.
59 virtual void OnSerialPortDataReceivedN(Tizen::Base::ByteBuffer& byteBuffer) = 0;
62 * Called when an error occurs on the serial port.
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.
70 virtual void OnSerialPortErrorOccured(result r) = 0;
74 // This method is for internal use only.
75 // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
77 // This method is reserved and may change its name at any time without prior notice.
81 virtual void ISerialPortEventListener_Reserved1(void) {}
84 // This method is for internal use only.
85 // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
87 // This method is reserved and may change its name at any time without prior notice.
91 virtual void ISerialPortEventListener_Reserved2(void) {}
94 // This method is for internal use only.
95 // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
97 // This method is reserved and may change its name at any time without prior notice.
101 virtual void ISerialPortEventListener_Reserved3(void) {}
103 }; // ISerialPortEventListener
107 #endif // _FIO_SERIAL_PORT_EVENT_LISTENER_H_