-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathremote_start_task.h
61 lines (52 loc) · 2.04 KB
/
remote_start_task.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
57
58
59
60
61
/*
* remote_start_task.h
* Handle to and public initialization function for Remote Start task, as well
* as public struct typedef for status of the ignition system.
*
* Copyright 2018, 2019 Matt Rounds
*
* This file is part of ExplorerLink.
*
* ExplorerLink is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* ExplorerLink is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* ExplorerLink. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef __REMOTE_START_TASK_H__
#define __REMOTE_START_TASK_H__
#include "FreeRTOS.h"
#include "task.h"
#define RS_NOTIFY_NONE 0x00000000
#define RS_NOTIFY_IGNITION_ON 0x00000001
#define RS_NOTIFY_IGNITION_OFF 0x00000002
#define RS_NOTIFY_START 0x00000004
#define RS_NOTIFY_NO_CLIENT 0x00000008
#define RS_NOTIFY_CLIENT 0x00000010
#define RS_NOTIFY_CHECK_PASS 0x00000020
#define RS_NOTIFY_ERROR 0x80000000
#define RS_NOTIFY_ALL 0xffffffff
/*
* Ignition status flags.
*/
typedef struct IgnitionStatus_t {
/* Whether the last attempt to turn on the ignition failed. */
bool lastOnFailed : 1;
/* Whether the last attempt to turn off the ignition failed. */
bool lastOffFailed : 1;
/* Whether the last attempt to start the engine failed. */
bool lastStartFailed : 1;
/* Whether the ignition is running (RUN signal asserted). */
bool running : 1;
} IgnitionStatus_t;
extern TaskHandle_t xRemoteStartTaskHandle;
extern IgnitionStatus_t xIgnitionStatus;
uint32_t RemoteStartTaskInit(void);
#endif /* __REMOTE_START_TASK_H__ */