]> git.basschouten.com Git - openhab-addons.git/blob
182295d6e10db7f68effca283fa828470eb4b50f
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.playstation.internal;
14
15 import java.util.Collections;
16 import java.util.Set;
17 import java.util.stream.Collectors;
18 import java.util.stream.Stream;
19
20 import org.eclipse.jdt.annotation.NonNullByDefault;
21 import org.openhab.core.thing.ThingTypeUID;
22
23 /**
24  * The {@link PlayStationBindingConstants} class defines common constants, which are
25  * used across the whole binding.
26  *
27  * @author Fredrik Ahlström - Initial contribution
28  */
29 @NonNullByDefault
30 public class PlayStationBindingConstants {
31
32     private static final String BINDING_ID = "playstation";
33
34     // List of all Thing Type UIDs
35     public static final ThingTypeUID THING_TYPE_PS3 = new ThingTypeUID(BINDING_ID, "PS3");
36     public static final ThingTypeUID THING_TYPE_PS4 = new ThingTypeUID(BINDING_ID, "PS4");
37     public static final ThingTypeUID THING_TYPE_PS5 = new ThingTypeUID(BINDING_ID, "PS5");
38
39     public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections
40             .unmodifiableSet(Stream.of(THING_TYPE_PS3, THING_TYPE_PS4, THING_TYPE_PS5).collect(Collectors.toSet()));
41
42     // List of all Channel ids
43     static final String CHANNEL_POWER = "power";
44     static final String CHANNEL_APPLICATION_NAME = "applicationName";
45     static final String CHANNEL_APPLICATION_ID = "applicationId";
46     static final String CHANNEL_APPLICATION_IMAGE = "applicationImage";
47     static final String CHANNEL_OSK_TEXT = "oskText";
48     static final String CHANNEL_SEND_KEY = "sendKey";
49     static final String CHANNEL_2ND_SCREEN = "secondScreen";
50     static final String CHANNEL_CONNECT = "connect";
51
52     // List of sendKey commands
53     static final String SEND_KEY_UP = "keyUp";
54     static final String SEND_KEY_DOWN = "keyDown";
55     static final String SEND_KEY_RIGHT = "keyRight";
56     static final String SEND_KEY_LEFT = "keyLeft";
57     static final String SEND_KEY_ENTER = "keyEnter";
58     static final String SEND_KEY_BACK = "keyBack";
59     static final String SEND_KEY_OPTION = "keyOption";
60     static final String SEND_KEY_PS = "keyPS";
61
62     // List of all known properties in the response from the PS3/PS4
63     public static final String RESPONSE_HOST_ID = "host-id";
64     public static final String RESPONSE_HOST_TYPE = "host-type";
65     public static final String RESPONSE_HOST_NAME = "host-name";
66     public static final String RESPONSE_HOST_MTP_PROTOCOL_VERSION = "host-mtp-protocol-version";
67     public static final String RESPONSE_HOST_REQUEST_PORT = "host-request-port";
68     public static final String RESPONSE_HOST_WIRELESS_PROTOCOL_VERSION = "host-wireless-protocol-version";
69     public static final String RESPONSE_HOST_MAC_ADDRESS = "host-mac-address";
70     public static final String RESPONSE_HOST_SUPPORTED_DEVICE = "host-supported-device";
71     public static final String RESPONSE_DEVICE_DISCOVERY_PROTOCOL_VERSION = "device_discovery_protocol-version";
72     public static final String RESPONSE_SYSTEM_VERSION = "system-version";
73     public static final String RESPONSE_RUNNING_APP_NAME = "running-app-name";
74     public static final String RESPONSE_RUNNING_APP_TITLEID = "running-app-titleid";
75
76     // Constant field used in PlayStationDiscovery to set the configuration properties during discovery.
77     public static final String USER_CREDENTIAL = "userCredential";
78     public static final String PAIRING_CODE = "pairingCode";
79     public static final String IP_ADDRESS = "ipAddress";
80     public static final String IP_PORT = "ipPort";
81
82     // PlayStation Vita HW versions
83     public static final String PSVHW_PCHXXXX = "PCHXXXX";
84     public static final String PSVHW_PCH1000 = "PCH1000";
85     public static final String PSVHW_PCH1100 = "PCH1100";
86     public static final String PSVHW_PCH2000 = "PCH2000";
87
88     // PlayStation Vita TV HW versions
89     public static final String PSVTVHW_VTE1000 = "VTE1000";
90
91     // PlayStation 3 HW versions
92     public static final String PS3HW_CECHXXXX = "CECHXXXX";
93     public static final String PS3HW_CECHA00 = "CECHA00";
94     public static final String PS3HW_CECHB00 = "CECHB00";
95     public static final String PS3HW_CECHC00 = "CECHC00";
96     public static final String PS3HW_CECHE00 = "CECHE00";
97     public static final String PS3HW_CECHG00 = "CECHG00";
98     public static final String PS3HW_CECHH00 = "CECHH00";
99     public static final String PS3HW_CECHJ00 = "CECHJ00";
100     public static final String PS3HW_CECHK00 = "CECHK00";
101     public static final String PS3HW_CECHL00 = "CECHL00";
102     public static final String PS3HW_CECHM00 = "CECHM00";
103     public static final String PS3HW_CECHP00 = "CECHP00";
104     public static final String PS3HW_CECHQ00 = "CECHQ00";
105     public static final String PS3HW_CECH2000 = "CECH-2000";
106     public static final String PS3HW_CECH2100 = "CECH-2100";
107     public static final String PS3HW_CECH2500 = "CECH-2500";
108     public static final String PS3HW_CECH3000 = "CECH-3000";
109     public static final String PS3HW_CECH4000 = "CECH-4000";
110     public static final String PS3HW_CECH4200 = "CECH-4200";
111     public static final String PS3HW_CECH4300 = "CECH-4300";
112
113     // PlayStation 4 HW versions
114     public static final String PS4HW_CUHXXXX = "CUH-XXXX";
115     public static final String PS4HW_CUH1000 = "CUH-1000";
116     public static final String PS4HW_CUH1100 = "CUH-1100";
117     public static final String PS4HW_CUH1200 = "CUH-1200";
118     public static final String PS4HW_CUH2000 = "CUH-2000";
119     public static final String PS4HW_CUH2100 = "CUH-2100";
120     public static final String PS4HW_CUH2200 = "CUH-2200";
121     public static final String PS4HW_CUH7000 = "CUH-7000";
122     public static final String PS4HW_CUH7100 = "CUH-7100";
123
124     // PlayStation 5 HW versions
125     public static final String PS5HW_CFIXXXX = "CFI-XXXX";
126     public static final String PS5HW_CFI1000A = "CFI-1000A";
127     public static final String PS5HW_CFI1000B = "CFI-1000B";
128
129     static final int PS4_KEY_UP = 1 << 0;
130     static final int PS4_KEY_DOWN = 1 << 1;
131     static final int PS4_KEY_RIGHT = 1 << 2;
132     static final int PS4_KEY_LEFT = 1 << 3;
133     static final int PS4_KEY_ENTER = 1 << 4;
134     static final int PS4_KEY_BACK = 1 << 5;
135     static final int PS4_KEY_OPTION = 1 << 6;
136     static final int PS4_KEY_PS = 1 << 7;
137     static final int PS4_KEY_OFF = 1 << 8;
138     static final int PS4_KEY_CANCEL = 1 << 9;
139     static final int PS4_KEY_OPEN_RC = 1 << 10;
140     static final int PS4_KEY_CLOSE_RC = 1 << 11;
141
142     /** Default port for PS3. */
143     public static final int DEFAULT_PS3_WAKE_ON_LAN_PORT = 5223;
144     public static final int DEFAULT_PS3_REMOTE_PLAY_PORT = 9293;
145     public static final int DEFAULT_PS3_MEDIA_MANAGER_PORT = 9309;
146     public static final int DEFAULT_PS3_DLNA_PORT1 = 56235;
147     public static final int DEFAULT_PS3_DLNA_PORT2 = 56259;
148
149     // Default port numbers PS4 uses.
150     public static final int DEFAULT_BROADCAST_PORT = 987;
151     public static final int DEFAULT_COMMUNICATION_PORT = 997;
152     public static final int DEFAULT_REMOTE_PLAY_PORT = 9295;
153
154     // Open ports on the PS5.
155     public static final int DEFAULT_PS5_HTTP_PORT = 41800;
156
157     private PlayStationBindingConstants() {
158         // Don't instantiate this class.
159     }
160 }