Revision 52

View differences:

hci/trunk/eneraptor-web-app/grails-app/controllers/com/eneraptor/hci/LogicRequestController.groovy
14 14
		
15 15
		output += reportService.println("Test started")
16 16
		
17
		String reqStr = "<hci-request type='checkConnection'><data>012345</data></hci-request>"
17
		String reqStr = "<?xml version=\"1.0\"?><hci-request type=\"checkConnection\"><data>12345</data></hci-request>"
18 18
		Map testReply = hciLogicCommService.getReplyToRequest(reqStr)
19 19
		
20 20
		if(testReply['status'] == "error") {
21 21
			output += reportService.println("<span style='color:red;'>Error: " + testReply['content'] + "</span>")
22 22
		} else {
23 23
			output += reportService.println("Connection established succesfully")
24
			if(testReply['content'] == "012345") {
24
			if(testReply['content'] == "<logic-response type=\"checkConnection\"><data>12345</data></logic-response>") {
25 25
				output += "<span style='color:green;'>Logic unit replied! The eneraptor system is set up properly.</span>"
26 26
			} else {
27 27
				output += reportService.println("<span style='color:red;'>The connection was established, but there was no reply from the logic unit.</span>")
28 28
				output += reportService.println("<span style='color:red;'>You should check the logic's port number and IP address.</span>");
29
				output += reportService.println("<span style='color:red;'>Returned: " + testReply['content'].encodeAsHTML() + "</span>");
29 30
			}
30 31
		}
31 32
		

Also available in: Unified diff