Camera progress

This commit is contained in:
aprochazka
2023-04-04 21:13:32 +02:00
parent f05df1ef8e
commit 505b448eeb
12 changed files with 80 additions and 43 deletions

BIN
Receiver/Displayer.o Normal file

Binary file not shown.

BIN
Receiver/ImageView.o Normal file

Binary file not shown.

View File

@ -11,7 +11,7 @@ void Receiver::printHex(unsigned char value) {
void Receiver::openStream(){
while(1){
// Open the CDC device file for reading
cdcFile = open("/dev/ttyACM2", O_RDWR | O_NOCTTY);
cdcFile = open("/dev/ttyACM1", O_RDWR | O_NOCTTY);
if (cdcFile == -1) {
std::cerr << "Failed to open CDC device file" << std::endl;
std::this_thread::sleep_for(std::chrono::milliseconds(500));

BIN
Receiver/Receiver.o Normal file

Binary file not shown.

BIN
Receiver/Transfer.o Normal file

Binary file not shown.

BIN
Receiver/main Executable file

Binary file not shown.

View File

@ -9,13 +9,22 @@
int cdcFile;
struct termios tty;
void readLoop(){
openStream(&cdcFile);
initSerial(&tty, &cdcFile);
void readLoop(Receiver ** receiverPtr){
(*receiverPtr)->openStream();
(*receiverPtr)->initSerial();
while (true) {
readCdcData(&cdcFile);
std::this_thread::sleep_for(std::chrono::milliseconds(5));
unsigned char character[10];
(*receiverPtr)->readCdcData(&character);
if((*receiverPtr)->findStart(&character) != -1)
{std::cout << "start" << std::endl;}
else if((*receiverPtr)->findEnd(&character) != -1)
{std::cout << "stop" << std::endl;}
else{
std::cout << "-";
}
std::this_thread::sleep_for(std::chrono::milliseconds(20));
}
close(cdcFile);
@ -36,12 +45,13 @@ void receiverLoop(Receiver ** receiverPtr){
int main()
{
Displayer dis;
Receiver *rec = new Receiver(&dis);
/*
dis.createWindow();
dis.renderWindow();
Receiver *rec = new Receiver(&dis);
rec->openStream();
rec->initSerial();
rec->fillBuffer();
@ -52,8 +62,8 @@ int main()
dis.windowLoop();
t1.join();
*/
//readLoop();
readLoop(&rec);
return 0;
}

BIN
Receiver/main.o Normal file

Binary file not shown.