37 lines
787 B
C
37 lines
787 B
C
#include <stdio.h>
|
|
|
|
#include <stdint.h>
|
|
#include <unistd.h>
|
|
#include "by_cmd.h"
|
|
#include "logc/log.h"
|
|
|
|
char test_data[] = "hello world\r\n";
|
|
char buff[20] = {0};
|
|
|
|
uint8_t cmd_temp;
|
|
uint32_t buff_temp[20];
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
// by_serial_t serial;
|
|
// by_serial_init(&serial, "/dev/ttyTHS0");
|
|
|
|
// while (1) {
|
|
// // by_serial_write(&serial, test_data, sizeof(test_data) - 1);
|
|
// // if (0 < by_serial_read(&serial, buff, 1)) {
|
|
// // printf("%c", buff[0]);
|
|
// // }
|
|
// if (by_serial_get_used_buffer_len(&serial) > 1) {
|
|
// by_serial_read(&serial, buff, 6);
|
|
// }
|
|
// printf("used buff len %d\r\n", by_serial_get_used_buffer_len(&serial));
|
|
// sleep(1);
|
|
// }
|
|
|
|
by_cmd_init();
|
|
|
|
by_cmd_send_distance_x(20.0, 1000);
|
|
|
|
return 0;
|
|
}
|