-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathudpcom.h
More file actions
66 lines (48 loc) · 1.27 KB
/
Copy pathudpcom.h
File metadata and controls
66 lines (48 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#pragma once
#ifndef UDPCOM_H
#define UDPCOM_H
#include <winsock2.h>
#include <ws2tcpip.h>
#include <Windows.h>
#include "datatrans.h"
#include "stdio.h"
#include <iostream>
#include "crc.h"
#include "..\Data\EmbededData.h"
#define PRO_START1_POS 0
#define PRO_START2_POS 1
#define PRO_LEN_H_POS 2
#define PRO_LEN_L_POS 3
#define PRO_CMD_POS 4
#define PRO_DATA_POS 5
#define PRO_PRO_LEN 7
#define CMD_READ_BASE (0x01)
#define CMD_READ_POS (CMD_READ_BASE+2)
#define CMD_READ_VOL (CMD_READ_BASE+4)
#define CMD_READ_VEL (CMD_READ_BASE +5)
#define CMD_READ_TEMP (CMD_READ_BASE +10)
#define CMD_READ_EFFORT (CMD_READ_BASE +8)
#define WRITE_BASE (0X10)
#define CMD_WRITE_PVE (WRITE_BASE +0)
#define CMD_WRITE_VOL (CMD_WRITE_BASE+10)
#define ARM_BASE 1
#define ARM_SHOULDER 2
#define ARM_EBLOW 3
#define ARM_WRIST_1 4
#define ARM_WRIST_2 5
#define ARM_WRIST_3 6
typedef struct _udp UDP;
typedef struct _pve PVE;
struct _pve {
float pos;
float vel;
float eft;
};
struct _udp {
SOCKET* Socket_Joint;
PVE pve;
void (*UdpUserCmd)(PVE pve ,unsigned char cmd,char joint_num);
void (*UdpUserRecv)(EMBEDED_DATA* p);
};
unsigned char UdpModuleRegister(UDP **p);
#endif // !UDPCOM_H