2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FIoISerialPortEventListener.h
20 * @brief This is the header file for the %ISerialPortEventListener interface.
22 * This header file contains the declarations of the %ISerialPortEventListener interface.
25 #ifndef _FIO_SERIAL_PORT_EVENT_LISTENER_H_
26 #define _FIO_SERIAL_PORT_EVENT_LISTENER_H_
28 #include <FBaseResult.h>
29 #include <FBaseRtIEventListener.h>
30 #include <FIoSerialPort.h>
32 namespace Tizen { namespace Io
36 * @interface ISerialPortEventListener
37 * @brief This interface provides event handlers to receive serial port events synchronously.
41 * The %ISerialPortEventListener interface provides event handlers to receive serial port events synchronously. @n
43 * 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>.
47 class _OSP_EXPORT_ ISerialPortEventListener
48 : virtual public Tizen::Base::Runtime::IEventListener
53 * Called when the data is received on the serial port.
57 * @param[in] byteBuffer A byte buffer that contains the received data
58 * @remarks The ByteBuffer instance needs to be deleted by the application.
60 virtual void OnSerialPortDataReceivedN(Tizen::Base::ByteBuffer& byteBuffer) = 0;
63 * Called when an error occurs on the serial port.
67 * @param[in] r The error code
68 * @exception E_INVALID_DATA The data is invalid.
69 * @exception E_SYSTEM A system error has occurred.
71 virtual void OnSerialPortErrorOccured(result r) = 0;
75 // This method is for internal use only.
76 // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
78 // This method is reserved and may change its name at any time without prior notice.
82 virtual void ISerialPortEventListener_Reserved1(void) {}
85 // This method is for internal use only.
86 // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
88 // This method is reserved and may change its name at any time without prior notice.
92 virtual void ISerialPortEventListener_Reserved2(void) {}
95 // This method is for internal use only.
96 // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
98 // This method is reserved and may change its name at any time without prior notice.
102 virtual void ISerialPortEventListener_Reserved3(void) {}
104 }; // ISerialPortEventListener
108 #endif // _FIO_SERIAL_PORT_EVENT_LISTENER_H_