forked from nryhbhue/Electra-AC-Remote
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathelectraAcRemoteEncoder.h
More file actions
41 lines (32 loc) · 1.09 KB
/
Copy pathelectraAcRemoteEncoder.h
File metadata and controls
41 lines (32 loc) · 1.09 KB
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
#ifndef ELECTRA_AC_REMOTE_ENCODER_H
#define ELECTRA_AC_REMOTE_ENCODER_H
// Constants for masking different properties of the air conditioner state
#define FULL_STATE_MASK 0x200000002
#define ON_STATE_MASK 0x1
#define FAN_MASK 0x3
#define SWING_MASK 0x3
#define MODE_MASK 0x7
#define TEMP_MASK 0xF
#define COOL 0x1
#define HEAT 0x2
#define SWING_OFF 0x0
#define SWING_ON 0x1
#define SWING_SINGLE 0x2
#define OFF 0x0
#define ON 0x1
#define TIMINGS_LENGTH 200
#define DATA_BITS_LENGTH 34
typedef enum acParameters {fan,mode,temp,swing} acParameter;
// Structure to hold air conditioner state and encoding information
typedef struct airCon {
uint64_t fullState;
uint64_t fan;
uint64_t mode;
uint64_t temp;
uint64_t swing;
char bitStrings[DATA_BITS_LENGTH][2];
char manchesterString[DATA_BITS_LENGTH*2];
int manchesterTimings[TIMINGS_LENGTH]; //64 time frames per packet x 3 + 1 for ending trail
} ac;
int *getCodes (struct airCon* newAc,int fanV,int modeV,int tempV,int state,int swingV);
#endif