Saturday, June 18, 2016

Robo4j brick-client socket server update

  Robo4j framework has released update of its light-weight socket server. Update contains possibility to use cURL to command the robot directly. 
$curl  -X GET  http://:8022?move=30\&left=10\&right=10\&back=20
The internal socket server is planned to run fully asynchronously. The result is printed out after being processed with the result state. In case of mentioned command the following output is printed directly into the command line:
<HTML>
<HEAD>    
<TITLE>        
Robo4j Client success page    
</TITLE>
</HEAD>
<BODY>
<H1>Robo4j Client default success page</H1>
<p>    Robo4j Command has been successfully processed!<BR>    Congratulation</p><p>    command= [ClientRequestDTO{type=RequestCommandEnum{code=1, name='move'}, value='30'}, ClientRequestDTO{type=RequestCommandEnum{code=3, name='left'}, value='10'}, ClientRequestDTO{type=RequestCommandEnum{code=2, name='right'}, value='10'}, ClientRequestDTO{type=RequestCommandEnum{code=4, name='back'}, value='20'}]</p>
</BODY>
</HTML>
When robot status is required following command is used:
$curl  -X GET  http://192.168.178.26:8022/status
Robot answers through the command line in the following form:
<HTML>
<HEAD>
<TITLE>        
Robo4j Client status page    
</TITLE>
</HEAD>
<BODY>
<H1>Robo4j Client default status page</H1>
<p>    Robo4j Core agent status successfully generated!<BR>
<p>    CACHE= [AgentStatus{status=AgentStatusEnum{code=1, def='active'}, messages=[]}, AgentStatus{status=AgentStatusEnum{code=4, def='request_get'}, messages=[[ClientRequestDTO{type=RequestCommandEnum{code=1, name='move'}, value='30'}, ClientRequestDTO{type=RequestCommandEnum{code=3, name='left'}, value='10'}, ClientRequestDTO{type=RequestCommandEnum{code=2, name='right'}, value='10'}, ClientRequestDTO{type=RequestCommandEnum{code=4, name='back'}, value='20'}]]}]</p>
</BODY>
</HTML>

   The small update contains also code changes according to the way how the incoming events/tasks are being processed.
Enjoy and more is coming soon!

No comments:

Post a Comment