include
ypprotocol.h
Go to the documentation of this file.
1
// Copyright (c) 2010-2016 The YP-Spur Authors, except where otherwise indicated.
2
//
3
// Permission is hereby granted, free of charge, to any person obtaining a copy
4
// of this software and associated documentation files (the "Software"), to
5
// deal in the Software without restriction, including without limitation the
6
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7
// sell copies of the Software, and to permit persons to whom the Software is
8
// furnished to do so, subject to the following conditions:
9
//
10
// The above copyright notice and this permission notice shall be included in
11
// all copies or substantial portions of the Software.
12
//
13
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
16
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
// SOFTWARE.
20
21
#ifndef YPPROTOCOL_H
22
#define YPPROTOCOL_H
23
24
#include <stdio.h>
25
#include <string.h>
26
27
#ifdef __cplusplus
28
extern
"C"
{
29
#endif // __cplusplus
30
32
typedef
struct
VERSION_INFO
33
{
34
char
vender
[128];
35
char
product
[128];
36
char
firmware
[128];
37
char
protocol
[128];
38
char
serialno
[128];
39
}
Ver_t
;
40
42
typedef
struct
PARAMETER_INFO
43
{
44
char
pwm_resolution
[128];
45
char
motor_num
[128];
46
char
robot_name
[128];
47
}
Param_t
;
48
49
int
get_version
(
Ver_t
*apVer);
50
int
get_parameter
(
Param_t
*apParam);
51
int
set_baudrate
(
int
baud);
52
int
get_embedded_param
(
char
*param);
53
54
#ifdef __cplusplus
55
}
56
#endif // __cplusplus
57
#endif // YPPROTOCOL_H
get_parameter
int get_parameter(Param_t *apParam)
Get version info.
Definition:
ypprotocol.c:186
Param_t
struct PARAMETER_INFO Param_t
VERSION_INFO::firmware
char firmware[128]
Definition:
ypprotocol.h:36
VERSION_INFO::product
char product[128]
Definition:
ypprotocol.h:35
VERSION_INFO::protocol
char protocol[128]
Definition:
ypprotocol.h:37
set_baudrate
int set_baudrate(int baud)
Definition:
ypprotocol.c:57
get_version
int get_version(Ver_t *apVer)
Get version info.
Definition:
ypprotocol.c:111
PARAMETER_INFO
Definition:
ypprotocol.h:42
Ver_t
struct VERSION_INFO Ver_t
VERSION_INFO::vender
char vender[128]
Definition:
ypprotocol.h:34
get_embedded_param
int get_embedded_param(char *param)
Definition:
ypprotocol.c:248
PARAMETER_INFO::motor_num
char motor_num[128]
Definition:
ypprotocol.h:45
VERSION_INFO::serialno
char serialno[128]
Definition:
ypprotocol.h:38
PARAMETER_INFO::robot_name
char robot_name[128]
Definition:
ypprotocol.h:46
PARAMETER_INFO::pwm_resolution
char pwm_resolution[128]
Definition:
ypprotocol.h:44
VERSION_INFO
Definition:
ypprotocol.h:32
yp-spur
Author(s):
autogenerated on Fri Oct 20 2023 03:02:42