25 #include <sys/types.h> 32 #endif // HAVE_CONFIG_H 40 #define RECEIVE_BUFFER_SIZE 2048 42 int ss_receive(
char *buf,
int len,
double receive_time,
void *data)
49 strcat((
char *)data, buf);
50 if (strstr((
char *)data,
"\n\n"))
63 strcpy(buf,
"\n\n\n\n");
68 sprintf(buf,
"SS%06d\n", baud);
75 if (strstr(buf,
"\n00P\n") != NULL)
81 else if (strstr(buf,
"\n04T\n") != NULL)
91 int vv_receive(
char *buf,
int len,
double receive_time,
void *data)
98 strcat((
char *)data, buf);
99 if (strstr((
char *)data,
"\n\n"))
116 char *tmp, *lf, *val;
120 memset(apVer, 0,
sizeof(
Ver_t));
122 strcpy(buf,
"\n\n\n\n");
133 if (strstr(buf,
"\n00P\n") == 0)
138 if ((lf = strchr(readpos,
'\n')) == NULL)
141 if ((tag = strstr(readpos,
"VEND:")) != 0)
145 else if ((tag = strstr(readpos,
"PROD:")) != 0)
149 else if ((tag = strstr(readpos,
"FIRM:")) != 0)
153 else if ((tag = strstr(readpos,
"PROT:")) != 0)
157 else if ((tag = strstr(readpos,
"SERI:")) != 0)
166 tmp = strchr(tag,
';');
167 val = strchr(tag,
':');
173 strcpy(wbuf, val + 1);
191 char *tmp, *lf, *val;
195 memset(apParam, 0,
sizeof(
Param_t));
197 strcpy(buf,
"\n\n\n\n");
208 if (strstr(buf,
"\n00P\n") == 0)
213 if ((lf = strchr(readpos,
'\n')) == NULL)
216 if ((tag = strstr(readpos,
"PWMRES:")) != 0)
220 else if ((tag = strstr(readpos,
"MOTORNUM:")) != 0)
224 else if ((tag = strstr(readpos,
"NAME:")) != 0)
233 tmp = strchr(tag,
';');
234 val = strchr(tag,
':');
240 strcpy(wbuf, val + 1);
256 memset(buf, 0,
sizeof(buf));
258 strcpy(buf,
"\n\n\n\n");
263 strcpy(buf,
"GETEMBEDDEDPARAM\n");
269 if (strstr(buf,
"\n00P\n") == 0)
274 if ((lf = strchr(readpos,
'\n')) == NULL)
277 if (strstr(readpos,
"00P") != 0)
#define RECEIVE_BUFFER_SIZE
int serial_write(char *buf, int len)
int serial_change_baudrate(int baud)
ボーレートを変更する
int get_embedded_param(char *param)
int vv_receive(char *buf, int len, double receive_time, void *data)
int ss_receive(char *buf, int len, double receive_time, void *data)
int serial_recieve(int(*serial_event)(char *, int, double, void *), void *data)
int get_version(Ver_t *apVer)
Get version info.
void serial_flush_in(void)
int get_parameter(Param_t *apParam)
Get version info.
int set_baudrate(int baud)