34 #include "pprzlink/messages.h"
42 #define OTF_UNINIT 0x00
43 #define OTF_WAIT_START OTF_UNINIT
44 #define OTF_WAIT_COUNTER 0x01
45 #define OTF_WAIT_ANGLES 0x02
46 #define OTF_WAIT_ALTITUDE 0x03
47 #define OTF_WAIT_CHECKSUM 0x04
49 #define OTF_START 0x0A
50 #define OTF_LIMITER ','
55 void *
_sbrk(
int a __attribute__((unused))) {
return 0;}
61 static char otf_inp[64];
79 if (isdigit((
int)
c)) {
83 otf_inp[otf_idx++] =
c;
98 if (isdigit((
int)
c) || (
c ==
'-') || (
c ==
'.')) {
99 otf_inp[otf_idx++] =
c;
101 if ((otf_idx > 1) && (otf_idx < 9) && (
c ==
OTF_LIMITER)) {
102 otf_inp[otf_idx] = 0;
105 if (otf_crs_idx++ == 2) {
115 if (isdigit((
int)
c) || (
c ==
'-') || (
c ==
'.')) {
116 otf_inp[otf_idx++] =
c;
118 if ((otf_idx > 1) && (otf_idx < 9) && (
c ==
OTF_LIMITER)) {
119 otf_inp[otf_idx] = 0;
130 if (isxdigit((
int)
c)) {
131 otf_inp[otf_idx++] =
c;
133 if ((otf_idx == 2) && (
c ==
OTF_END)) {
134 otf_inp[otf_idx] = 0;
135 checksum = strtol(otf_inp, NULL, 16);