I set the arm as the client and received the data using socket_read_ascii_float();
My server code is:
char sendBuf[80] = “(0.46, 0.1, 0.4, 3.14, 0, 0 )”;
send(sClient, sendBuf, strlen(sendBuf), 0);
What should I change the code of my server side to make my robot arm receive data ?
socket_read_ascii_float(number, socket_name=’socket_0’)
Example Command
socket_read_ascii_float(4,”socket10”)
Number 4 Number of floats to read
socket_name socket_10
socket_send_byte(value,socket_name=’socket_0’)
Example Command
socket_send_byte(2,”socket10”)
value 2
socket_name socket_10
Returns True or False (sent or not sent)
socket_send_int(value,socket_name=’socket_0’)
Example Command
socket_send_int(2,”socket10”)
value 2
socket_name socket_10
Returns True or False (sent or not sent)
socket_send_line(str,socket_name=’socket_0’)
Example Command
socket_send_int(“hello”,”socket10”)
str hello
socket_name socket_10
Returns True or False (sent or not sent)
socket_send_string(str,socket_name=’socket_0’)
Example Command
socket_send_int(“hello”,”socket10”)
str hello
socket_name socket_10
Returns True or False (sent or not sent)
You should use printf to add ‘\n’ in the end.