Commit a9ae6dc8 authored by AfirSraftGarrier's avatar AfirSraftGarrier

格式并加些打印

parent d65b2baa
...@@ -33,19 +33,33 @@ public class DeviceControllerTest { ...@@ -33,19 +33,33 @@ public class DeviceControllerTest {
System.out.println(bytes2Hex(allBytes)); System.out.println(bytes2Hex(allBytes));
} }
@SneakyThrows
@Test @Test
void socket() { void testSocket() {
String serverIp = "112.74.57.111"; String serverIp = "112.74.57.111";
int serverPort = 18889; int serverPort = 18889;
String appId = "ebsh71dp5t1ck948l5";
String sn = "ERE54S619LNYMPKVN9";
String appKey = "110801";
socket(serverIp, serverPort, appId, sn, appKey);
}
@Test
void yxSocket() {
String serverIp = "14.116.221.61";
int serverPort = 18889;
String appId = "mny3i9pgg0xxs520qf";
String sn = "IU23404BR1CQJOC63Q";
String appKey = "20221114";
socket(serverIp, serverPort, appId, sn, appKey);
}
@SneakyThrows
void socket(String serverIp, int serverPort, String appId, String sn, String appKey) {
Socket socket = new Socket(serverIp, serverPort); Socket socket = new Socket(serverIp, serverPort);
socket.setKeepAlive(true); socket.setKeepAlive(true);
System.out.println("connect success..."); System.out.println("connect success...");
// 事先组装好要发送的鉴权信息 // 事先组装好要发送的鉴权信息
String appId = "ebsh71dp5t1ck948l5";
String sn = "ERE54S619LNYMPKVN9";
String appKey = "110801";
byte[] authSendBytes = getAuthSendBytes(appId, sn, appKey); byte[] authSendBytes = getAuthSendBytes(appId, sn, appKey);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment