A2 mini User Manual V1.1
33
2023 SIYI Technology Co., Ltd, All Rights Reserved
}
/* Receive the responding data from gimbal camera
sockfd: descriptor of “sockfd” socket
recv_buf: head address in RAM of the responding data
RECV_BUUF_SIZE: size of the buffer, which is the length of the max data to
receive
0: receiving mark, usually it is 0
(struct sockaddr *)&recv_addr: the target structure will be filled with addresses (including
IP addresses and port) from the data sender
&addr_len: the target storage position, the structure size of
“src_addr” and “addrlen” should be filled before calling, the actual size of the sender will be filled after calling
*/
recv_len = recvfrom(sockfd, recv_buf, RECV_BUUF_SIZE, 0, (struct sockaddr *)&recv_addr,
&addr_len);
if (recv_len < 0) {
perror("recvfrom");
exit(1);
}
// print the received data in hexadecimal
printf("Received HEX data: ");
for (int i = 0; i < recv_len; i++)
{
printf("%02x ", recv_buf[i]);
}
printf("\n");
// close socket
close(sockfd);
return 0;
}
3.4 Control in SIYI QGC Windows Software through HM30 Image
Transmission System
Gimbal connects to air unit directly to control gimbal rotation, gimbal functions, and
video display in SIYI QGC Windows software when the air unit is communicating