-
Notifications
You must be signed in to change notification settings - Fork 1
/
sllin_app.h
56 lines (49 loc) · 922 Bytes
/
sllin_app.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
51
52
53
54
55
56
#ifndef __SLLIN_APP_H__
#define __SLLIN_APP_H__
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#include <string.h>
#include <signal.h>
#include <poll.h>
#include <ctype.h>
#include <libgen.h>
#include <time.h>
#include <errno.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/uio.h>
#include <net/if.h>
#include <linux/can.h>
#include <linux/can/raw.h>
#include <pthread.h>
#define LIN_TIMEOUT 5000 //5s
#define OilTempOffset 40
enum {
STATUS_OK = 0,
STATUS_KO = -1,
STATUS_UNDEF = -5
};
enum {
LinFuelLvl = 0,
LinOilPres,
LinOilTemp,
LinSpeedo,
LinBackLight,
LinSlavesNum
};
struct LinMsg{
unsigned long ulLinId;
unsigned char ucDataLen;
unsigned char pucData[8];
};
struct LinMsgStruct{
unsigned long uwLinId;
unsigned char ucLinDataLen;
signed long slMinVal;
unsigned long ulMaxVal;
};
#endif