Skip to content

Commit ef5f00e

Browse files
committed
Merge pull request arduino#6 from bblacey/example-versioning
Sketch reporting of name and versioning added
2 parents 6404899 + 67b52ec commit ef5f00e

File tree

16 files changed

+50
-3
lines changed

16 files changed

+50
-3
lines changed

libraries/MySensors/examples/BatteryPoweredSensor/BatteryPoweredSensor.ino

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// This is an example on how to send in battery measurement for a sensor
2-
// For instruction how to measure battery power on A0 see the follwoing forum
1+
// This is an example that demonstrates how to report the battery level for a sensor
2+
// Instructions for measuring battery capacity on A0 are available in the follwoing forum
33
// thread: http://forum.micasaverde.com/index.php/topic,20078.0.html
44

55

@@ -21,6 +21,9 @@ void setup()
2121
// use the 1.1 V internal reference
2222
analogReference(INTERNAL);
2323
gw.begin();
24+
25+
// Send the sketch version information to the gateway and Controller
26+
gw.sendSketchInfo("Battery Meter", "1.0");
2427
}
2528

2629
void loop()

libraries/MySensors/examples/DallasTemperatureSensor/DallasTemperatureSensor.ino

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ void setup()
2323
sensors.begin();
2424
gw.begin();
2525

26+
// Send the sketch version information to the gateway and Controller
27+
gw.sendSketchInfo("Temperature Sensor", "1.0");
28+
2629
// Fetch the number of attached sensors
2730
numSensors = sensors.getDeviceCount();
2831
// Register all sensors to gw (they will be created as child devices)

libraries/MySensors/examples/DistanceSensor/DistanceSensor.ino

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ void setup()
2121
{
2222
gw.begin();
2323

24+
// Send the sketch version information to the gateway and Controller
25+
gw.sendSketchInfo("Distance Sensor", "1.0");
26+
2427
// Register all sensors to gw (they will be created as child devices)
2528
gw.sendSensorPresentation(0, S_DISTANCE);
2629
metric = gw.isMetricSystem();

libraries/MySensors/examples/EnergyMeterPulseSensor/EnergyMeterPulseSensor.ino

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ void setup()
3939
{
4040
gw.begin();
4141

42+
// Send the sketch version information to the gateway and Controller
43+
gw.sendSketchInfo("Energy Meter", "1.0");
44+
4245
// Register this device as power sensor
4346
gw.sendSensorPresentation(CHILD_ID, S_POWER);
4447

libraries/MySensors/examples/IrSensor/IrSensor.ino

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ void setup()
2626
irrecv.enableIRIn(); // Start the ir receiver
2727
gw.begin();
2828

29+
// Send the sketch version information to the gateway and Controller
30+
gw.sendSketchInfo("IR Sensor", "1.0");
31+
2932
// Register a sensors to gw. Use binary light for test purposes.
3033
gw.sendSensorPresentation(CHILD_1, S_LIGHT);
3134
}

libraries/MySensors/examples/LightLuxSensor/LightLuxSensor.ino

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ void setup()
3838
{
3939
gw.begin();
4040

41+
// Send the sketch version information to the gateway and Controller
42+
gw.sendSketchInfo("Light Lux Sensor", "1.0");
43+
4144
// Register all sensors to gateway (they will be created as child devices)
4245
gw.sendSensorPresentation(CHILD_ID_LIGHT, S_LIGHT_LEVEL);
4346

libraries/MySensors/examples/LightSensor/LightSensor.ino

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ void setup()
1717
{
1818
gw.begin();
1919

20+
// Send the sketch version information to the gateway and Controller
21+
gw.sendSketchInfo("Light Sensor", "1.0");
22+
2023
// Register all sensors to gateway (they will be created as child devices)
2124
gw.sendSensorPresentation(CHILD_ID_LIGHT, S_LIGHT_LEVEL);
2225
}

libraries/MySensors/examples/MotionSensor/MotionSensor.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ Sleep sleep;
1414
void setup()
1515
{
1616
gw.begin();
17+
18+
// Send the sketch version information to the gateway and Controller
19+
gw.sendSketchInfo("Motion Sensor", "1.0");
20+
1721
pinMode(DIGITAL_INPUT_SENSOR, INPUT); // sets the motion sensor digital pin as input
1822
// Register all sensors to gw (they will be created as child devices)
1923
gw.sendSensorPresentation(CHILD_ID, S_MOTION);

libraries/MySensors/examples/PressureSensor/PressureSensor.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ boolean metric;
2727

2828
void setup() {
2929
gw.begin();
30+
31+
// Send the sketch version information to the gateway and Controller
32+
gw.sendSketchInfo("Pressure Sensor", "1.0");
33+
3034
if (!bmp.begin()) {
3135
Serial.println("Could not find a valid BMP085 sensor, check wiring!");
3236
while (1) { }

libraries/MySensors/examples/RelayActuator/RelayActuator.ino

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ void setup()
1616
{
1717
gw.begin();
1818

19+
// Send the sketch version information to the gateway and Controller
20+
gw.sendSketchInfo("Relay", "1.0");
21+
1922
// Register all sensors to gw (they will be created as child devices)
2023
for (int i=0; i<NUMBER_OF_RELAYS;i++) {
2124
gw.sendSensorPresentation(RELAY_1+i, S_LIGHT);

0 commit comments

Comments
 (0)