3 * Copyright (C) 2005-2013 Team XBMC
6 * This Program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
11 * This Program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with XBMC; see the file COPYING. If not, see
18 * <http://www.gnu.org/licenses/>.
22 #include "utils/StdString.h"
30 /// Unknown message type.
37 IRSSMT_RegisterClient = 1,
39 /// Unregister Client.
41 IRSSMT_UnregisterClient = 2,
44 /// Register Repeater.
46 IRSSMT_RegisterRepeater = 3,
48 /// Unregister Repeater.
50 IRSSMT_UnregisterRepeater = 4,
69 IRSSMT_ServerShutdown = 8,
73 IRSSMT_ServerSuspend = 9,
77 IRSSMT_ServerResume = 10,
82 IRSSMT_RemoteEvent = 11,
86 IRSSMT_KeyboardEvent = 12,
90 IRSSMT_MouseEvent = 13,
93 /// Forward a Remote Event.
95 IRSSMT_ForwardRemoteEvent = 14,
97 /// Forward a Keyboard Event.
99 IRSSMT_ForwardKeyboardEvent = 15,
101 /// Forward a Mouse Event.
103 IRSSMT_ForwardMouseEvent = 16,
106 /// Available Receivers.
108 IRSSMT_AvailableReceivers = 17,
110 /// Available Blasters.
112 IRSSMT_AvailableBlasters = 18,
114 /// Active Receivers.
116 IRSSMT_ActiveReceivers = 19,
120 IRSSMT_ActiveBlasters = 20,
122 /// Detected Receivers.
124 IRSSMT_DetectedReceivers = 21,
126 /// Detected Blasters.
128 IRSSMT_DetectedBlasters = 22,
132 /// Flags to determine more information about the message.
134 enum IRSS_MessageFlags
139 IRSSMF_None = 0x0000,
142 /// Message is a Request.
144 IRSSMF_Request = 0x0001,
146 /// Message is a Response to a received Message.
148 IRSSMF_Response = 0x0002,
150 /// Message is a Notification.
152 IRSSMF_Notify = 0x0004,
155 /// Operation Success.
157 IRSSMF_Success = 0x0008,
159 /// Operation Failure.
161 IRSSMF_Failure = 0x0010,
163 /// Operation Time-Out.
165 IRSSMF_Timeout = 0x0020,
167 //IRSSMF_Error = 0x0040,
169 //IRSSMF_DataString = 0x0080,
170 //IRSSMF_DataBytes = 0x0100,
172 //IRSSMF_ForceRespond = 0x0200,
175 /// Force the recipient not to respond.
177 IRSSMF_ForceNotRespond = 0x0400,
184 CIrssMessage(IRSS_MessageType type, uint32_t flags);
185 CIrssMessage(IRSS_MessageType type, uint32_t flags, char* data, int size);
186 CIrssMessage(IRSS_MessageType type, uint32_t flags, const CStdString& data);
189 void SetDataAsBytes(char* data, int size);
190 void SetDataAsString(const CStdString& data);
191 char* ToBytes(int& size);
192 void SetType(IRSS_MessageType type);
193 void SetFlags(uint32_t flags);
194 IRSS_MessageType GetType() {return m_type;}
195 uint32_t GetFlags() {return m_flags;}
196 char* GetData() {return m_data;}
197 uint32_t GetDataSize() {return m_dataSize;}
198 static bool FromBytes(char* from, int size, CIrssMessage& message);
201 IRSS_MessageType m_type;