consolidate all repos to one for archive
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
#include "serial.h"
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <string.h>
|
||||
#include <chrono>
|
||||
|
||||
int main()
|
||||
{
|
||||
serial s;
|
||||
if (!s.init("/dev/ttyACM0"))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint8_t buf[150] = {0};
|
||||
s.sread((uint8_t *)buf, sizeof(buf));
|
||||
while (true)
|
||||
{
|
||||
int read = s.sread((uint8_t *)buf, sizeof(buf));
|
||||
buf[read] = '\0';
|
||||
|
||||
if ('{' == *(char *)&buf[0])
|
||||
{
|
||||
printf("%s\n", (char *)&buf[0]);
|
||||
}
|
||||
}
|
||||
|
||||
return 0; // success
|
||||
};
|
||||
Reference in New Issue
Block a user