]> git.basschouten.com Git - openhab-addons.git/blob
2169ef88866cd0e5057ce3395a9a119906c2c162
[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.souliss.internal;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16
17 /**
18  * Network constants. The class {@link SoulissUDPConstants} contains Souliss constants. Original version is
19  * taken from SoulissApp. For scope of this binding not all constants are used.
20  *
21  * @author Tonino Fazio - Initial contribution
22  * @author Luca Calcaterra - Refactor for OH3
23  * @author Alessandro Del Pex - @since 1.7.0
24  */
25 @NonNullByDefault
26 public class SoulissUDPConstants {
27
28     public static final String TAG = "SoulissApp";
29
30     public static final int SOULISS_BINDING_LOCAL_PORT = 0;
31     public static final int SOULISS_GATEWAY_DEFAULT_PORT = 230;
32
33     public static final Integer SOULISS_DEFAULT_NODE_INDEX = 70;
34     public static final Integer SOULISS_DEFAULT_USER_INDEX = 120;
35
36     public static final String BROADCASTADDR = "255.255.255.255";
37
38     public static final byte SOULISS_UDP_FUNCTION_FORCE = 0x33;
39     public static final byte SOULISS_UDP_FUNCTION_FORCE_MASSIVE = 0x34;
40
41     public static final byte SOULISS_UDP_FUNCTION_SUBSCRIBE_REQ = 0x21;
42     public static final byte SOULISS_UDP_FUNCTION_SUBSCRIBE_RESP = 0x31;
43     public static final byte SOULISS_UDP_FUNCTION_POLL_REQ = 0x27;
44     public static final byte SOULISS_UDP_FUNCTION_POLL_RESP = 0x37;
45     public static final byte SOULISS_UDP_FUNCTION_TYP_REQ = 0x22;
46     public static final byte SOULISS_UDP_FUNCTION_TYP_RESP = 0x32;
47     public static final byte SOULISS_UDP_FUNCTION_HEALTHY_REQ = 0x25;
48     public static final byte SOULISS_UDP_FUNCTION_HEALTHY_RESP = 0x35;
49
50     public static final byte SOULISS_UDP_FUNCTION_PING_REQ = 0x8;
51     public static final byte SOULISS_UDP_FUNCTION_PING_RESP = 0x18;
52
53     public static final byte SOULISS_UDP_FUNCTION_DISCOVER_GW_NODE_BCAST_REQ = 0x28;
54     public static final byte SOULISS_UDP_FUNCTION_DISCOVER_GW_NODE_BCAST_RESP = 0x38;
55
56     public static final int SOULISS_UDP_FUNCTION_DBSTRUCT_REQ = 0x26;
57     public static final int SOULISS_UDP_FUNCTION_DBSTRUCT_RESP = 0x36;
58
59     public static final int SOULISS_UDP_FUNCTION_ACTION_MESSAGE = 0x72;
60
61     protected static final Byte[] PING_PAYLOAD = { SOULISS_UDP_FUNCTION_PING_REQ, 0, 0, 0, 0 };
62     protected static final Byte[] PING_DISCOVER_BCAST_PAYLOAD = { SOULISS_UDP_FUNCTION_DISCOVER_GW_NODE_BCAST_REQ, 0, 0,
63             0, 0 };
64     protected static final Byte[] DBSTRUCT_PAYLOAD = { SOULISS_UDP_FUNCTION_DBSTRUCT_REQ, 0, 0, 0, 0 };
65
66     // private constructor
67     private SoulissUDPConstants() {
68     }
69 }