2 * Copyright (C) 2008-2013 Team XBMC
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 package org.xbmc.eventclient;
20 import java.nio.charset.Charset;
23 * XBMC Event Client Class
25 * A HELO packet establishes a valid connection to XBMC. It is the
26 * first packet that should be sent.
27 * @author Stefan Agner
30 public class PacketHELO extends Packet {
34 * A HELO packet establishes a valid connection to XBMC.
35 * @param devicename Name of the device which connects to XBMC
37 public PacketHELO(String devicename)
40 this.appendPayload(devicename);
41 this.appendPayload(ICON_NONE);
42 this.appendPayload((short)0); // port no
43 this.appendPayload(0); // reserved1
44 this.appendPayload(0); // reserved2
48 * A HELO packet establishes a valid connection to XBMC.
49 * @param devicename Name of the device which connects to XBMC
50 * @param iconType Type of the icon (Packet.ICON_PNG, Packet.ICON_JPEG or Packet.ICON_GIF)
51 * @param iconData The icon as a Byte-Array
53 public PacketHELO(String devicename, byte iconType, byte[] iconData)
56 this.appendPayload(devicename);
57 this.appendPayload(iconType);
58 this.appendPayload((short)0); // port no
59 this.appendPayload(0); // reserved1
60 this.appendPayload(0); // reserved2
61 this.appendPayload(iconData); // reserved2