-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcan.h
50 lines (31 loc) · 798 Bytes
/
can.h
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
45
46
47
48
49
50
// Author: lbk
// Contact: [email protected]
// Last update: 2020.11.13
#pragma once
#include <iostream>
#include <canlib.h>
#include <string>
#include"my_typedef.h"
#ifndef _CAN_H_
#define _CAN_H_
namespace lbk
{
class pciecan
{
public:
canHandle hn; //canhandle
canStatus stat; //error stat
bool can_on; //canbus stat
char channel = 0;
int number_channel = 0;
char device_name[100] = { 0 };
public:
bool caninit();
void CheckForError(char cmd[50], canStatus stat);
bool CanRcv(int64* _rcv_id, uint8* _rcv_buf, uint32* _rcv_len);
bool CanSend(int64 _send_id, uint8* _send_buf, uint32 _send_len);
bool Canoff();
bool CanClose();
};
}
#endif