Merge remote-tracking branch 'origin/master' into development
Conflicts: libraries/MySensors/Sensor.cpp
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
The Sensor Net Arduino library adds a new layer on top of the RF24 library.
|
||||
The MySensors Arduino library adds a new layer on top of the RF24 library.
|
||||
It handles radio network routing, relaying and ids.
|
||||
|
||||
Created by Henrik Ekblad <henrik.ekblad@gmail.com>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
The Sensor Net Arduino library adds a new layer on top of the RF24 library.
|
||||
The MySensors Arduino library adds a new layer on top of the RF24 library.
|
||||
It handles radio network routing, relaying and ids.
|
||||
|
||||
Created by Henrik Ekblad <henrik.ekblad@gmail.com>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
The Sensor Net Arduino library adds a new layer on top of the RF24 library.
|
||||
The MySensors Arduino library adds a new layer on top of the RF24 library.
|
||||
It handles radio network routing, relaying and ids.
|
||||
|
||||
Created by Henrik Ekblad <henrik.ekblad@gmail.com>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
The Sensor Net Arduino library adds a new layer on top of the RF24 library.
|
||||
The MySensors Arduino library adds a new layer on top of the RF24 library.
|
||||
It handles radio network routing, relaying and ids.
|
||||
|
||||
Created by Henrik Ekblad <henrik.ekblad@gmail.com>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
The Sensor Net Arduino library adds a new layer on top of the RF24 library.
|
||||
The MySensors library adds a new layer on top of the RF24 library.
|
||||
It handles radio network routing, relaying and ids.
|
||||
|
||||
Created by Henrik Ekblad <henrik.ekblad@gmail.com>
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#define Sensor_h
|
||||
|
||||
#include "Config.h"
|
||||
#include "Version.h"
|
||||
#include <nRF24L01.h>
|
||||
#include <RF24.h>
|
||||
#include <RF24_config.h>
|
||||
@@ -29,7 +30,6 @@
|
||||
#define debug(x,...)
|
||||
#endif
|
||||
|
||||
#define LIBRARY_VERSION "1.2+"
|
||||
#define PROTOCOL_VERSION 1
|
||||
#define BAUD_RATE 115200
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
/***
|
||||
* This file defines the Sensor library version number
|
||||
* Normally, contributors should not modify this directly
|
||||
* as it is manaaged by the MySensors Bot.
|
||||
*/
|
||||
#ifndef Version_h
|
||||
#define Version_h
|
||||
|
||||
#define LIBRARY_VERSION "1.3b3 (18848a2)"
|
||||
|
||||
#endif
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <SPI.h>
|
||||
#include <EEPROM.h>
|
||||
#include <RF24.h>
|
||||
#include <IRremote.h>
|
||||
#include <IRLib.h>
|
||||
|
||||
int RECV_PIN = 8;
|
||||
|
||||
@@ -17,13 +17,16 @@ int RECV_PIN = 8;
|
||||
|
||||
IRsend irsend;
|
||||
IRrecv irrecv(RECV_PIN);
|
||||
decode_results results;
|
||||
IRdecode decoder;
|
||||
//decode_results results;
|
||||
unsigned int Buffer[RAWBUF];
|
||||
|
||||
Sensor gw;
|
||||
|
||||
void setup()
|
||||
{
|
||||
irrecv.enableIRIn(); // Start the ir receiver
|
||||
decoder.UseExtnBuf(Buffer);
|
||||
gw.begin();
|
||||
|
||||
// Send the sketch version information to the gateway and Controller
|
||||
@@ -41,22 +44,24 @@ void loop()
|
||||
|
||||
int incomingRelayStatus = atoi(message.data);
|
||||
if (incomingRelayStatus == 1) {
|
||||
irsend.sendNEC(0x1EE17887, 32); // Vol up yamaha ysp-900
|
||||
irsend.send(NEC, 0x1EE17887, 32); // Vol up yamaha ysp-900
|
||||
} else {
|
||||
irsend.sendNEC(0x1EE1F807, 32); // Vol down yamaha ysp-900
|
||||
irsend.send(NEC, 0x1EE1F807, 32); // Vol down yamaha ysp-900
|
||||
}
|
||||
// Start receiving ir again...
|
||||
irrecv.enableIRIn();
|
||||
}
|
||||
|
||||
|
||||
if (irrecv.decode(&results)) {
|
||||
if (irrecv.GetResults(&decoder)) {
|
||||
irrecv.resume();
|
||||
decoder.decode();
|
||||
decoder.DumpResults();
|
||||
|
||||
char buffer[10];
|
||||
sprintf(buffer, "%08lx", results.value);
|
||||
dump(&results);
|
||||
sprintf(buffer, "%08lx", decoder.value);
|
||||
// Send ir result to gw
|
||||
gw.sendVariable(CHILD_1, V_VAR1, buffer);
|
||||
irrecv.resume(); // Receive the next value
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +71,7 @@ void loop()
|
||||
// void * to work around compiler issue
|
||||
//void dump(void *v) {
|
||||
// decode_results *results = (decode_results *)v
|
||||
void dump(decode_results *results) {
|
||||
/*void dump(decode_results *results) {
|
||||
int count = results->rawlen;
|
||||
if (results->decode_type == UNKNOWN) {
|
||||
Serial.print("Unknown encoding: ");
|
||||
@@ -110,4 +115,4 @@ void dump(decode_results *results) {
|
||||
}
|
||||
Serial.println("");
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
@@ -50,7 +50,7 @@ void loop()
|
||||
}
|
||||
|
||||
void setRelayStatus(message_s message) {
|
||||
if (message.header.messageType=M_SET_VARIABLE &&
|
||||
if (message.header.messageType==M_SET_VARIABLE &&
|
||||
message.header.type==V_LIGHT) {
|
||||
int incomingRelayStatus = atoi(message.data);
|
||||
// Change relay state
|
||||
|
||||
Reference in New Issue
Block a user