34. Makeeachdaycount
decode()函式會將接收資料解碼存入decode_results結構變數
class decode_results{
public:
decode_type_t decode_type; //UNKNOWN, NEC, SONY, RC5, ...
unsigned int address; //Used by Panasonic & Sharp [16-bits]
unsigned long value; //Decoded value [max 32-bits]
int bits; //Number of bits in decoded value
volatile unsigned int *rawbuf; //Raw intervals in 50uS ticks
int rawlen; //Number of records in rawbuf
int overflow; //true iff IR raw code too long
};
其中decode_type_t是在IRremote.h檔案中宣告的列舉資料
typedef enum {
UNKNOWN = -1, UNUSED = 0, RC5, RC6, NEC, SONY, PANASONIC, JVC, SAMSUNG, WHYNTER,
AIWA_RC_T501, LG, SANYO, MITSUBISHI, DISH, SHARP, DENON, PRONTO, LEGO_PF,
} decode_type_t;
IRRemote程式庫 3/4
34