| | |
| | | package com.sandu.ximon.admin.newnova.utils; |
| | | |
| | | import com.sun.jna.Native; |
| | | /* |
| | | * 使ç¨åé
读: |
| | | * 1 å
³äºå¯è½åççæç´¢ä¸å°Tå¡çåå ï¼ |
| | | * 1.1. æå¼äºexpressï¼å¯¼è´udp端å£è¢«å ç¨ï¼è¯·å
³éexpress软件åéè¯ |
| | | * 1.2. SDKåTå¡ä¸å¨åä¸ä¸ªå±åç½ï¼å¯ä»¥å°è¯æå®ipæç´¢ï¼ä½¿ç¨æ¹æ³è§ï¼https://docapi.vnnox.com/web/#/7?page_id=609 |
| | | |
| | | * 2 å
³äºä½¿ç¨sdk卿åºå¯è½åºç°çé®é¢åè§£å³æ¹æ³ï¼ |
| | | * |
| | | * 2.1. å¨linuxä¸å¦æåºç°lib***.so file too short ,è¿ç§éè¯¯ï¼æå¯è½æ¯è½¯è¿æ¥å¤±æï¼å¯ä»¥å°è¯å é¤åææä»¶ï¼å°è¯ ln -s éæ°çæè½¯è¿æ¥ãæ¯å¦ï¼ ./libcurl.so: file too shortï¼é¦å
rm libcurl.soï¼ç¶åln -s libcurl.so.4.3.0 libcurl.soå³å¯ã |
| | | * 2.2. é对java项ç®ï¼ä½¿ç¨JNAå è½½soåºæ¶ï¼è¯·ä½¿ç¨ç»å¯¹è·¯å¾ãæ¯å¦ï¼ |
| | | * //winodws |
| | | * ViplexCore instance = (ViplexCore) Native.loadLibrary("D:\\ViplexCore3.3.0.01_x64\\bin\\viplexcore.dll",ViplexCore.class); |
| | | * //æè
linux |
| | | * ViplexCore instance = (ViplexCore) Native.loadLibrary("home/user/desktop/ViplexCore_3.3.0.01_CentOS/bin/libviplexcore.so",ViplexCore.class); |
| | | * |
| | | * 2.3. é对java项ç®ï¼å¦æè¦ä½¿ç¨ç¸å¯¹è·¯å¾ï¼è¯·å°sdk卿åºè·¯å¾æ·»å å°classpathç¯å¢åéï¼æä¸é¢å ç§æ¹æ³ï¼ä¹å¯ä»¥æç´¢ç¸å
³æç¨æ·»å ï¼ï¼ä¾å¦ï¼ |
| | | * 2.3.1. å½ä»¤è¡ä½¿ç¨ï¼ javac -cp "C:\Users\HiWin10\Downloads\ViplexCore3.3.0.01_x64\bin" (详è§SDK demo/java/ä¸runDemo.shæè
runDemo.batæä»¶) |
| | | * 2.3.2. 导å
¥ç¯å¢åéï¼å¦ï¼ export CLASSPATH=$CLASSPATH:home/user/ViplexCore3.3.0.01_x64/ |
| | | * 2.3.3. é对springboot项ç®ï¼ java -Xbootclasspath/a:/home/nova/novasdk/ |
| | | * */ |
| | | /* |
| | | * 使ç¨åé
读: |
| | | * 1 å
³äºå¯è½åççæç´¢ä¸å°Tå¡çåå ï¼ |
| | | * 1.1. æå¼äºexpressï¼å¯¼è´udp端å£è¢«å ç¨ï¼è¯·å
³éexpress软件åéè¯ |
| | | * 1.2. SDKåTå¡ä¸å¨åä¸ä¸ªå±åç½ï¼å¯ä»¥å°è¯æå®ipæç´¢ï¼ä½¿ç¨æ¹æ³è§ï¼https://docapi.vnnox.com/web/#/7?page_id=609 |
| | | |
| | | * 2 å
³äºä½¿ç¨sdk卿åºå¯è½åºç°çé®é¢åè§£å³æ¹æ³ï¼ |
| | | * |
| | | * 2.1. å¨linuxä¸å¦æåºç°lib***.so file too short ,è¿ç§éè¯¯ï¼æå¯è½æ¯è½¯è¿æ¥å¤±æï¼å¯ä»¥å°è¯å é¤åææä»¶ï¼å°è¯ ln -s éæ°çæè½¯è¿æ¥ãæ¯å¦ï¼ ./libcurl.so: file too shortï¼é¦å
rm libcurl.soï¼ç¶åln -s libcurl.so.4.3.0 libcurl.soå³å¯ã |
| | | * 2.2. é对java项ç®ï¼ä½¿ç¨JNAå è½½soåºæ¶ï¼è¯·ä½¿ç¨ç»å¯¹è·¯å¾ãæ¯å¦ï¼ |
| | | * //winodws |
| | | * ViplexCore instance = (ViplexCore) Native.loadLibrary("D:\\ViplexCore3.3.0.01_x64\\bin\\viplexcore.dll",ViplexCore.class); |
| | | * //æè
linux |
| | | * ViplexCore instance = (ViplexCore) Native.loadLibrary("home/user/desktop/ViplexCore_3.3.0.01_CentOS/bin/libviplexcore.so",ViplexCore.class); |
| | | * |
| | | * 2.3. é对java项ç®ï¼å¦æè¦ä½¿ç¨ç¸å¯¹è·¯å¾ï¼è¯·å°sdk卿åºè·¯å¾æ·»å å°classpathç¯å¢åéï¼æä¸é¢å ç§æ¹æ³ï¼ä¹å¯ä»¥æç´¢ç¸å
³æç¨æ·»å ï¼ï¼ä¾å¦ï¼ |
| | | * 2.3.1. å½ä»¤è¡ä½¿ç¨ï¼ javac -cp "C:\Users\HiWin10\Downloads\ViplexCore3.3.0.01_x64\bin" (详è§SDK demo/java/ä¸runDemo.shæè
runDemo.batæä»¶) |
| | | * 2.3.2. 导å
¥ç¯å¢åéï¼å¦ï¼ export CLASSPATH=$CLASSPATH:home/user/ViplexCore3.3.0.01_x64/ |
| | | * 2.3.3. é对springboot项ç®ï¼ java -Xbootclasspath/a:/home/nova/novasdk/ |
| | | * */ |
| | | public class APITest { |
| | | static Boolean g_bAPIReturn = false; |
| | | static int g_code = 0; |
| | | static String g_sn = "BZSA79353N1310006847"; //BZSA07313J0350000997 |
| | | static String g_sn = "MZVA51930N2113017308"; //BZSA07313J0350000997 |
| | | |
| | | static void waitAPIReturn() throws InterruptedException |
| | | { |
| | | while (!g_bAPIReturn) |
| | | { |
| | | static void waitAPIReturn() throws InterruptedException { |
| | | while (!g_bAPIReturn) { |
| | | Thread.sleep(1000); |
| | | } |
| | | g_bAPIReturn = false; |
| | | } |
| | | |
| | | static void testApi() throws InterruptedException |
| | | { |
| | | System.setProperty("jna.encoding", "UTF-8"); |
| | | ViplexCore instance = (ViplexCore) Native.loadLibrary("viplexcore",ViplexCore.class); |
| | | //å½éè¦éæå°é¡¹ç®ä¸æ¶ï¼è¯·ä¿®æ¹ä¸é¢å è½½åºçä½ç½®ä¸ºä½ ä¸è½½çsdkåºçç»å¯¹è·¯å¾ï¼windowsä¸å¦ï¼ |
| | | //ViplexCore instance = (ViplexCore) Native.loadLibrary("D:\\ViplexCore3.3.0.01_x64\\bin\\viplexcore.dll",ViplexCore.class); |
| | | |
| | | //å½éè¦éæå°é¡¹ç®ä¸æ¶ï¼è¯·ä¿®æ¹æ¤å¤å è½½åºçä½ç½®ä¸ºä½ ä¸è½½çsdkåºçç»å¯¹è·¯å¾ï¼linuxä¸å¦ï¼ |
| | | //ViplexCore instance = (ViplexCore) Native.loadLibrary("home/user/desktop/ViplexCore_3.3.0.01_CentOS/bin/libviplexcore.so",ViplexCore.class); |
| | | ViplexCore.CallBack callBack = new ViplexCore.CallBack() { |
| | | static void testApi() throws InterruptedException { |
| | | System.setProperty("jna.encoding", "UTF-8"); |
| | | // ViplexCore instance = (ViplexCore) Native.loadLibrary("viplexcore",ViplexCore.class); |
| | | //å½éè¦éæå°é¡¹ç®ä¸æ¶ï¼è¯·ä¿®æ¹ä¸é¢å è½½åºçä½ç½®ä¸ºä½ ä¸è½½çsdkåºçç»å¯¹è·¯å¾ï¼windowsä¸å¦ï¼ |
| | | ViplexCore instance = (ViplexCore) Native.loadLibrary("C:\\Users\\Administrator\\Desktop\\novaWin\\bin\\viplexcore.dll", ViplexCore.class); |
| | | |
| | | @Override |
| | | public void dataCallBack(int code, String data) { |
| | | // TODO Auto-generated method stub |
| | | g_code = code; |
| | | String strCode = "\nViplexCore Demo code:" + code; |
| | | String strData = "\nViplexCore Demo data:" + data; |
| | | System.out.println(strCode); |
| | | System.out.println(strData); |
| | | g_bAPIReturn=true; |
| | | } |
| | | |
| | | }; |
| | | //å½éè¦éæå°é¡¹ç®ä¸æ¶ï¼è¯·ä¿®æ¹æ¤å¤å è½½åºçä½ç½®ä¸ºä½ ä¸è½½çsdkåºçç»å¯¹è·¯å¾ï¼linuxä¸å¦ï¼ |
| | | // ViplexCore instance = (ViplexCore) Native.loadLibrary("C:\\Users\\Administrator\\Desktop\\novaLinux\\bin\\libviplexcore.so",ViplexCore.class); |
| | | ViplexCore.CallBack callBack = new ViplexCore.CallBack() { |
| | | |
| | | String rootDir = System.getProperty("user.dir") + "/temp"; |
| | | rootDir = rootDir.replaceAll( "\\\\","/"); |
| | | String createProgram = "{\"name\":\"Demo\",\"width\":500,\"height\":500,\"tplID\":1,\"winInfo\":{\"height\":100,\"width\":100,\"left\":0,\"top\":0,\"zindex\":0,\"index\":0}}"; |
| | | String editProgram = "{\"programID\":1,\"pageID\":1,\"pageInfo\":{\"name\":\"èç®\",\"widgetContainers\":[{\"audioGroup\":\"\",\"backgroundColor\":\"#00000000\",\"backgroundDrawable\":\"\",\"contents\":{\"widgetGroups\":[],\"widgets\":[{\"id\":1,\"enable\":true,\"repeatCount\":1,\"layout\":{\"y\":\"0\",\"height\":\"100%\",\"x\":\"0\",\"width\":\"100%\"},\"backgroundColor\":\"#00000000\",\"backgroundDrawable\":\"\",\"backgroundMusic\":\"\",\"zOrder\":0,\"displayRatio\":\"FULL\",\"outAnimation\":{\"type\":0,\"duration\":0},\"dataSource\":\"62ea7e60c493c1f860ae256eef8ec89c.png\",\"type\":\"PICTURE\",\"constraints\":[{\"cron\":[],\"endTime\":\"4017-12-30T23:59:59Z+8:00\",\"startTime\":\"1970-01-01T00:00:00Z+8:00\"}],\"border\":{\"borderThickness\":\"2px,3px,5%,6\",\"style\":0,\"backgroundColor\":\"#ff000000\",\"name\":\"border\",\"cornerRadius\":\"2%\",\"effects\":{\"headTailSpacing\":\"\",\"isHeadTail\":false,\"speedByPixelEnable\":true,\"speed\":0,\"animation\":\"CLOCK_WISE\"}},\"inAnimation\":{\"type\":0,\"duration\":1000},\"duration\":3605000,\"name\":\"test.png\",\"originalDataSource\":\"./test.png\",\"functionStorage\":\"\",\"isSupportSpecialEffects\":false}]},\"enable\":true,\"id\":1,\"itemsSource\":\"\",\"layout\":{\"height\":\"1.0\",\"width\":\"1.0\",\"x\":\"0.0\",\"y\":\"0.0\"},\"name\":\"widgetContainers1\",\"pickCount\":0,\"pickPolicy\":\"ORDER\",\"zOrder\":0}]}}"; |
| | | String genrateProgram = String.format( |
| | | "{\"programID\":1,\"outPutPath\":\"%s/\",\"mediasPath\":[{\"oldPath\":\"test\",\"newPath\":\"test\"}]}", |
| | | rootDir); |
| | | String trasfromProgram = String.format( |
| | | "{\"sn\": \"%s\",\"iconPath\": \"\",\"iconName\": \"\",\"sendProgramFilePaths\": {\"programPath\": \"%s/program1\",\"mediasPath\": {\"./test.png\": \"test.png\"}},\"programName\": \"program1\",\"deviceIdentifier\": \"Demo\",\"startPlayAfterTransferred\": true,\"insertPlay\": true}", |
| | | g_sn, |
| | | rootDir); |
| | | |
| | | |
| | | Boolean bTestVideo = false; |
| | | if (bTestVideo) |
| | | { |
| | | editProgram = "{\"programID\":1,\"pageID\":1,\"pageInfo\":{\"name\":\"Demo\",\"widgetContainers\":[{\"contents\":{\"widgets\":[{\"constraints\":[{\"cron\":[\"0 0 0 ? * 1,2,3,4,5,6,7\"],\"endTime\":\"4017-12-30T23:59:59Z 8:00\",\"startTime\":\"1970-01-01T00:00:00Z 8:00\"}],\"duration\":5000,\"dataSource\":\"219c7dd3260d6bf98ebf61b6da440ffd.avi\",\"type\":\"VIDEO\",\"name\":\"test.vai\",\"originalDataSource\":\"./test.avi\"}]},\"id\":1,\"name\":\"widgetContainers1\"}]}}"; |
| | | |
| | | trasfromProgram = String.format( |
| | | "{\"sn\":\"%s\",\"iconPath\": \"\",\"iconName\": \"\",\"sendProgramFilePaths\": {\"programPath\": \"%s/program1\",\"mediasPath\": {\"./test.avi\": \"test.avi\"}},\"programName\": \"program1\",\"deviceIdentifier\": \"Demo\",\"startPlayAfterTransferred\": true,\"insertPlay\": true}", |
| | | g_sn, |
| | | rootDir); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | Boolean testText = false; |
| | | if (testText) { |
| | | editProgram = "{\"programID\":1,\"pageID\":1,\"pageInfo\":{\"name\":\"jiemu\",\"widgetContainers\":[{\"contents\":{\"widgets\":[{\"constraints\":[{\"cron\":[\"0 0 0 ? * 1,2,3,4,5,6,7\"],\"endTime\":\"4017-12-30T23:59:59Z+8:00\",\"startTime\":\"1970-01-01T00:00:00Z+8:00\"}],\"duration\":5000,\"metadata\":{\"content\":{\"autoPaging\":true,\"backgroundMusic\":{\"duration\":0,\"isTextSync\":false},\"displayStyle\":{\"scrollAttributes\":{\"effects\":{\"animation\":\"MARQUEE_LEFT\",\"speed\":3}},\"type\":\"SCROLL\"},\"paragraphs\":[{\"backgroundColor\":\"#00000000\",\"horizontalAlignment\":\"CENTER\",\"letterSpacing\":0,\"lineSpacing\":0,\"lines\":[{\"segs\":[{\"content\":\"ç®ä½ç¹é«æ¥æ¬èªíêµì´.English123\"}]}],\"verticalAlignment\":\"CENTER\"}],\"textAttributes\":[{\"backgroundColor\":\"#ff000000\",\"attributes\":{\"font\":{\"family\":[\"Arial\"],\"isUnderline\":false,\"size\":20,\"style\":\"NORMAL\"},\"letterSpacing\":0,\"textColor\":\"#ffff0000\"}}]}},\"name\":\"text\",\"type\":\"ARCH_TEXT\"}]},\"id\":1,\"name\":\"widgetContainers1\"}]}}"; |
| | | trasfromProgram = String.format( |
| | | "{\"sn\": \"%s\",\"iconPath\": \"\",\"iconName\": \"\",\"sendProgramFilePaths\": {\"programPath\": \"%s/program1\",\"mediasPath\": {}},\"programName\": \"program1\",\"deviceIdentifier\": \"Demo\",\"startPlayAfterTransferred\": true,\"insertPlay\": true}", |
| | | g_sn, |
| | | rootDir); |
| | | } |
| | | |
| | | String companyInfo = "{\"company\":\"NovaStar\",\"phone\":\"029-68216000\",\"email\":\"hr@novastar.tech\"}"; |
| | | instance.nvSetDevLang("Java"); |
| | | System.out.println("nvInit(sdk åå§å):"); |
| | | System.out.println(instance.nvInit(rootDir,companyInfo)); |
| | | System.out.println("ViplexCore Demo nvSearchTerminalAsync(æç´¢) begin... "); |
| | | instance.nvSearchTerminalAsync(callBack); |
| | | Thread.sleep(3000); |
| | | g_bAPIReturn = false; |
| | | |
| | | // System.out.println("ViplexCore Demo nvSearchAppointIpAsync(æå®IPæç´¢) begin... "); |
| | | // String requestData = "{\"ip\":\"172.18.179.106\"}"; |
| | | // instance.nvSearchAppointIpAsync(requestData, callBack); |
| | | // Thread.sleep(2000); |
| | | |
| | | System.out.println("ViplexCore Demo nvLoginAsync(ç»å½) begin... "); |
| | | String loginParam = String.format("{\"sn\":\"%s\",\"username\":\"admin\",\"rememberPwd\":1,\"password\":\"1234567890\",\"loginType\":0}" |
| | | , g_sn); |
| | | instance.nvLoginAsync(loginParam, callBack); |
| | | waitAPIReturn(); |
| | | if (g_code != 0) { |
| | | System.out.println("ViplexCore Demo nvLoginAsync(ç»å½) 失败ï¼"); |
| | | return; |
| | | @Override |
| | | public void dataCallBack(int code, String data) { |
| | | // TODO Auto-generated method stub |
| | | g_code = code; |
| | | String strCode = "\nViplexCore Demo code:" + code; |
| | | String strData = "\nViplexCore Demo data:" + data; |
| | | System.out.println(strCode); |
| | | System.out.println(strData); |
| | | g_bAPIReturn = true; |
| | | } |
| | | System.out.println("ViplexCore Demo nvCreateProgramAsync(å建èç®) begin... "); |
| | | instance.nvCreateProgramAsync(createProgram, callBack); |
| | | waitAPIReturn(); |
| | | |
| | | }; |
| | | |
| | | String rootDir = System.getProperty("user.dir") + "/temp"; |
| | | System.out.println("ä¿åè·¯å¾:" + rootDir); |
| | | rootDir = rootDir.replaceAll("\\\\", "/"); |
| | | String createProgram = "{\"name\":\"jiemu1\",\"width\":240,\"height\":144}"; |
| | | String editProgram = "{\"programID\":13,\"pageID\":1,\"pageInfo\":{\"name\":\"èç®01\",\"widgetContainers\":[{\"contents\":{\"widgets\":[{\"constraints\":[{\"cron\":[\"0 0 0 ? * 1,2,3,4,5,6,7\"],\"endTime\":\"4017-12-30T23:59:59Z+8:00\",\"startTime\":\"1970-01-01T00:00:00Z+8:00\"}],\"duration\":5000,\"dataSource\":\"62ea7e60c493c1f860ae256eef8ec89c.png\",\"type\":\"PICTURE\",\"name\":\"test.png\",\"originalDataSource\":\"C:/Users/Administrator/Desktop/novaWin/demo/java/test.png\"}]},\"id\":1,\"name\":\"widgetContainers1\"}]}}"; |
| | | String genrateProgram = String.format( |
| | | "{\"programID\":13,\"outPutPath\":\"%s/\"}", |
| | | rootDir); |
| | | String trasfromProgram = String.format( |
| | | "{\"sn\": \"%s\",\"iconPath\": \"\",\"iconName\": \"\",\"sendProgramFilePaths\": {\"programPath\": \"%s/program13\",\"mediasPath\": {\"C:/Users/Administrator/Desktop/novaWin/demo/java/test.png\": \"test.png\"}},\"programName\": \"jiemu1\",\"deviceIdentifier\": \"Demo\",\"startPlayAfterTransferred\": true,\"insertPlay\": true}", |
| | | g_sn, |
| | | rootDir); |
| | | |
| | | |
| | | String requestDatapath = "{\"filePath\":\"./test.png\"}"; |
| | | System.out.println("ViplexCore Demo nvGetFileMD5Async(è·åMD5) begin... "); |
| | | instance.nvGetFileMD5Async(requestDatapath, callBack); |
| | | waitAPIReturn(); |
| | | // Boolean bTestVideo = false; |
| | | // if (bTestVideo) { |
| | | // editProgram = "{\"programID\":1,\"pageID\":1,\"pageInfo\":{\"name\":\"Demo\",\"widgetContainers\":[{\"contents\":{\"widgets\":[{\"constraints\":[{\"cron\":[\"0 0 0 ? * 1,2,3,4,5,6,7\"],\"endTime\":\"4017-12-30T23:59:59Z 8:00\",\"startTime\":\"1970-01-01T00:00:00Z 8:00\"}],\"duration\":5000,\"dataSource\":\"219c7dd3260d6bf98ebf61b6da440ffd.avi\",\"type\":\"VIDEO\",\"name\":\"test.vai\",\"originalDataSource\":\"./test.avi\"}]},\"id\":1,\"name\":\"widgetContainers1\"}]}}"; |
| | | // |
| | | // trasfromProgram = String.format( |
| | | // "{\"sn\":\"%s\",\"iconPath\": \"\",\"iconName\": \"\",\"sendProgramFilePaths\": {\"programPath\": \"%s/program1\",\"mediasPath\": {\"./test.avi\": \"test.avi\"}},\"programName\": \"program1\",\"deviceIdentifier\": \"Demo\",\"startPlayAfterTransferred\": true,\"insertPlay\": true}", |
| | | // g_sn, |
| | | // rootDir); |
| | | // } |
| | | // |
| | | // |
| | | // Boolean testText = false; |
| | | // if (testText) { |
| | | // editProgram = "{\"programID\":1,\"pageID\":1,\"pageInfo\":{\"name\":\"jiemu\",\"widgetContainers\":[{\"contents\":{\"widgets\":[{\"constraints\":[{\"cron\":[\"0 0 0 ? * 1,2,3,4,5,6,7\"],\"endTime\":\"4017-12-30T23:59:59Z+8:00\",\"startTime\":\"1970-01-01T00:00:00Z+8:00\"}],\"duration\":5000,\"metadata\":{\"content\":{\"autoPaging\":true,\"backgroundMusic\":{\"duration\":0,\"isTextSync\":false},\"displayStyle\":{\"scrollAttributes\":{\"effects\":{\"animation\":\"MARQUEE_LEFT\",\"speed\":3}},\"type\":\"SCROLL\"},\"paragraphs\":[{\"backgroundColor\":\"#00000000\",\"horizontalAlignment\":\"CENTER\",\"letterSpacing\":0,\"lineSpacing\":0,\"lines\":[{\"segs\":[{\"content\":\"ç®ä½ç¹é«æ¥æ¬èªíêµì´.English123\"}]}],\"verticalAlignment\":\"CENTER\"}],\"textAttributes\":[{\"backgroundColor\":\"#ff000000\",\"attributes\":{\"font\":{\"family\":[\"Arial\"],\"isUnderline\":false,\"size\":20,\"style\":\"NORMAL\"},\"letterSpacing\":0,\"textColor\":\"#ffff0000\"}}]}},\"name\":\"text\",\"type\":\"ARCH_TEXT\"}]},\"id\":1,\"name\":\"widgetContainers1\"}]}}"; |
| | | // trasfromProgram = String.format( |
| | | // "{\"sn\": \"%s\",\"iconPath\": \"\",\"iconName\": \"\",\"sendProgramFilePaths\": {\"programPath\": \"%s/program1\",\"mediasPath\": {}},\"programName\": \"program1\",\"deviceIdentifier\": \"Demo\",\"startPlayAfterTransferred\": true,\"insertPlay\": true}", |
| | | // g_sn, |
| | | // rootDir); |
| | | // } |
| | | |
| | | System.out.println("ViplexCore Demo nvSetPageProgramAsync(ç¼è¾èç®) begin... "); |
| | | instance.nvSetPageProgramAsync(editProgram, callBack); |
| | | waitAPIReturn(); |
| | | String companyInfo = "{\"company\":\"NovaStar\",\"phone\":\"029-68216000\",\"email\":\"hr@novastar.tech\"}"; |
| | | instance.nvSetDevLang("Java"); |
| | | System.out.println("nvInit(sdk åå§å):"); |
| | | System.out.println(instance.nvInit(rootDir, companyInfo)); |
| | | System.out.println("ViplexCore Demo nvSearchTerminalAsync(æç´¢) begin... "); |
| | | instance.nvSearchTerminalAsync(callBack); |
| | | Thread.sleep(3000); |
| | | g_bAPIReturn = false; |
| | | |
| | | System.out.println("ViplexCore Demo nvMakeProgramAsync(çæèç®) begin... "); |
| | | instance.nvMakeProgramAsync(genrateProgram, callBack); |
| | | waitAPIReturn(); |
| | | // System.out.println("ViplexCore Demo nvSearchAppointIpAsync(æå®IPæç´¢) begin... "); |
| | | // String requestData = "{\"ip\":\"172.18.179.106\"}"; |
| | | // instance.nvSearchAppointIpAsync(requestData, callBack); |
| | | // Thread.sleep(2000); |
| | | |
| | | System.out.println("ViplexCore Demo nvStartTransferProgramAsync(åéèç®) begin... "); |
| | | instance.nvStartTransferProgramAsync(trasfromProgram, callBack); |
| | | Thread.sleep(10000); |
| | | g_bAPIReturn = false; |
| | | |
| | | System.out.println("ViplexCore Demo nvGetProgramInfoAsync(è·åèç®ä¿¡æ¯) begin... "); |
| | | String requestDatasn = String.format("{\"sn\":\"%s\"}", g_sn); |
| | | instance.nvGetProgramInfoAsync(requestDatasn, callBack); |
| | | waitAPIReturn(); |
| | | |
| | | System.out.println("ViplexCore Demo nvSetVolumeAsync(设置é³é) begin... "); |
| | | String setVolumeParam = String.format("{\"sn\":\"%s\",\"volumeInfo\":{\"ratio\":60.0}}", g_sn); |
| | | instance.nvSetVolumeAsync(setVolumeParam, callBack); |
| | | waitAPIReturn(); |
| | | |
| | | System.out.println("ViplexCore Demo nvGetVolumeAsync(è·åé³é) begin... "); |
| | | String getVolumeParam = String.format("{\"sn\":\"%s\"}", g_sn); |
| | | instance.nvGetVolumeAsync(getVolumeParam, callBack); |
| | | waitAPIReturn(); |
| | | System.out.println("ViplexCore Demo nvLoginAsync(ç»å½) begin... "); |
| | | String loginParam = String.format("{\"sn\":\"MZVA51930N2113017308\",\"ip\":\"\",\"username\":\"admin\",\"rememberPwd\":0,\"password\":\"123456\",\"loginType\":0}" |
| | | , g_sn); |
| | | instance.nvLoginAsync(loginParam, callBack); |
| | | waitAPIReturn(); |
| | | if (g_code != 0) { |
| | | System.out.println("ViplexCore Demo nvLoginAsync(ç»å½) 失败ï¼"); |
| | | System.out.println("é误ç :" + g_code); |
| | | return; |
| | | } |
| | | System.out.println("ViplexCore Demo nvCreateProgramAsync(å建èç®) begin... "); |
| | | instance.nvCreateProgramAsync(createProgram, callBack); |
| | | waitAPIReturn(); |
| | | |
| | | public static void main(String[] args) throws InterruptedException{ |
| | | |
| | | String requestDatapath = "{\"filePath\":\"C:/Users/Administrator/Desktop/novaWin/demo/java/test.png\"}"; |
| | | System.out.println("ViplexCore Demo nvGetFileMD5Async(è·åMD5) begin... "); |
| | | instance.nvGetFileMD5Async(requestDatapath, callBack); |
| | | waitAPIReturn(); |
| | | |
| | | System.out.println("ViplexCore Demo nvSetPageProgramAsync(ç¼è¾èç®) begin... "); |
| | | instance.nvSetPageProgramAsync(editProgram, callBack); |
| | | waitAPIReturn(); |
| | | |
| | | System.out.println("ViplexCore Demo nvMakeProgramAsync(çæèç®) begin... "); |
| | | instance.nvMakeProgramAsync(genrateProgram, callBack); |
| | | waitAPIReturn(); |
| | | |
| | | System.out.println("ViplexCore Demo nvStartTransferProgramAsync(åéèç®) begin... "); |
| | | System.out.println(trasfromProgram); |
| | | instance.nvStartTransferProgramAsync(trasfromProgram, callBack); |
| | | Thread.sleep(10000); |
| | | g_bAPIReturn = false; |
| | | |
| | | System.out.println("ViplexCore Demo nvGetProgramInfoAsync(è·åèç®ä¿¡æ¯) begin... "); |
| | | String requestDatasn = String.format("{\"sn\":\"%s\"}", g_sn); |
| | | instance.nvGetProgramInfoAsync(requestDatasn, callBack); |
| | | waitAPIReturn(); |
| | | // |
| | | // System.out.println("ViplexCore Demo nvSetVolumeAsync(设置é³é) begin... "); |
| | | // String setVolumeParam = String.format("{\"sn\":\"%s\",\"volumeInfo\":{\"ratio\":60.0}}", g_sn); |
| | | // instance.nvSetVolumeAsync(setVolumeParam, callBack); |
| | | // waitAPIReturn(); |
| | | // |
| | | // System.out.println("ViplexCore Demo nvGetVolumeAsync(è·åé³é) begin... "); |
| | | // String getVolumeParam = String.format("{\"sn\":\"%s\"}", g_sn); |
| | | // instance.nvGetVolumeAsync(getVolumeParam, callBack); |
| | | // waitAPIReturn(); |
| | | } |
| | | |
| | | public static void main(String[] args) throws InterruptedException { |
| | | testApi(); |
| | | } |
| | | } |