Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/**
* Test and debug module.
* SHALL NOT BE INCLUDED IN RELEASE
*
* @author ETSI / STF424
* @version $URL$
* $Id$
*
*/
package org.etsi.its.adapter;
import org.etsi.its.adapter.ports.ProtocolPort;
import org.etsi.its.adapter.ports.ProtocolPortFactory;
/**
* Test and debug module.
*/
public class Main {
/**
* @param args
*/
public static void main(String[] args) {
}
/**
* Creates CAM port using stack LoopBack/Debug and sends a message
*/
@SuppressWarnings("unused")
private static void camTest() {
ProtocolPort port = ProtocolPortFactory.getInstance().createPort("camPort", "toto", "GN/Debug", "ACACACACACAC");
port.send("CAM MESSAGE !".getBytes());
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
port.dispose();
}
/**
* Creates BTP port using stack GN/LoopBack/Debug and sends a message
*/
@SuppressWarnings("unused")
private static void btpTest() {
ProtocolPort port = ProtocolPortFactory.getInstance().createPort("btpPort", "toto", "GN/Loopback/Debug", "ACACACACACAC");
port.send("BTP MESSAGE !".getBytes());
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
port.dispose();
}
/**
* Creates GN port using stack GnSource and sends a message
*/
@SuppressWarnings("unused")
private static void gnTest() {
byte[] gnMsg = {(byte)0x00, (byte)0x50, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x1f, (byte)0x00, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0xff, (byte)0x54, (byte)0x45, (byte)0x53, (byte)0x54, (byte)0x20, (byte)0x31, (byte)0x20, (byte)0x54, (byte)0x45, (byte)0x53, (byte)0x54, (byte)0x20,
(byte)0x54, (byte)0x45, (byte)0x53, (byte)0x54, (byte)0x20, (byte)0x54, (byte)0x45, (byte)0x53, (byte)0x54, (byte)0x20, (byte)0x54, (byte)0x45, (byte)0x53, (byte)0x54, (byte)0x20, (byte)0x54,
(byte)0x45, (byte)0x53, (byte)0x54};
ProtocolPort port = ProtocolPortFactory.getInstance().createPort("geoNetworkingPort", "toto", "Loopback/Debug", "ACACACACACAC");
port.send(gnMsg);
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
port.dispose();
}
}