EasyManua.ls Logo

SIYI A8 mini - Page 49

SIYI A8 mini
107 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
A8 mini User Manual v1.5
42
2023 SIYI Technology Co., Ltd, All Rights Reserved
Mark
Before using the SDK to communicate with the gimbal camera in UDP protocol, please do make sure that
the device and the gimbal camera are in the same gateway, which means that ubuntu can ping the gimbal
camera’s IP addresses successfully.
If they still didn’t communicate, the possible reason is that the Windows firewall is interrupting the sending
and receiving of data, then try to disable Windows firewall temporarily.
Relevant Code Examples
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#define RECV_BUUF_SIZE 64
#define SERVER_PORT 37260 // Gimbal Camera (Server) Port
#define SERVER_IP "192.168.144.25" // Gimbal Camera (Server) IP Addresses
int main(int argc, char *argv[])
{
int sockfd;
int ret, i, recv_len;
struct sockaddr_in send_addr, recv_addr;
unsigned char send_buf[] = {0x55,0x66,0x01,0x01,0x00,0x00,0x00,0x08,0x01,0xd1,0x12}; // Frame
protocol of the relevant functions in hexadecimal
unsigned char recv_buf[RECV_BUUF_SIZE] = {0};
/* Create UDP Socket
AF_INET: ipv4 addresses
SOCK_DGRAM: UDP protocol
0: automatically choose the default protocol of the relevant type
*/
if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
perror("socket");
exit(1);

Table of Contents

Related product manuals