-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
44 lines (36 loc) · 842 Bytes
/
main.cpp
File metadata and controls
44 lines (36 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "Framing.h"
#include <string.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <assert.h>
#include <fstream>
using std::ofstream;
#include <iostream>
#include <vector>
using std::cout;
using std::endl;
int main(){
ofstream stream;
stream.open("/home/ronaldo/Documentos/PTC/workspace/protocol/myurl.txt");
const char * path = "/dev/ttyUSB0";
char * data = (char*)malloc(19);
data[0] = 'O';
data[1] = 'l';
data[2] = 'a';
data[3] = 'a';
data[4] = 'M';
data[5] = 0x7e;
data[6] = 'N';
data[7] = 'D';
data[8] = 'O';
//Serial serial(path,9600);
Framing testa(8,1024);
int idx = strlen(data);
testa.mountFrame(data,idx,0,0,);
stream.write((char*)data,15);
stream.close();
// testa.send(data1,11);
//: testa.receive(data1);
return 0;
}