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

Diff for: libraries/MySensors/examples/BatteryPoweredSensor/BatteryPoweredSensor.ino

+5-2
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()

Diff for: libraries/MySensors/examples/DallasTemperatureSensor/DallasTemperatureSensor.ino

+3
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)

Diff for: libraries/MySensors/examples/DistanceSensor/DistanceSensor.ino

+3
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();

Diff for: libraries/MySensors/examples/EnergyMeterPulseSensor/EnergyMeterPulseSensor.ino

+3
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

Diff for: libraries/MySensors/examples/IrSensor/IrSensor.ino

+3
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
}

Diff for: libraries/MySensors/examples/LightLuxSensor/LightLuxSensor.ino

+3
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

Diff for: libraries/MySensors/examples/LightSensor/LightSensor.ino

+3
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
}

Diff for: libraries/MySensors/examples/MotionSensor/MotionSensor.ino

+4
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);

Diff for: libraries/MySensors/examples/PressureSensor/PressureSensor.ino

+4
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) { }

Diff for: libraries/MySensors/examples/RelayActuator/RelayActuator.ino

+3
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);

Diff for: libraries/MySensors/examples/RelayWithButtonActuator/RelayWithButtonActuator.ino

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ void setup()
2626
{
2727
gw.begin();
2828

29+
// Send the sketch version information to the gateway and Controller
30+
gw.sendSketchInfo("Relay & Button", "1.0");
31+
2932
// Set buttonPin as Input
3033
pinMode(BUTTON_PIN, INPUT);
3134
buttVal = digitalRead(BUTTON_PIN); //read initial state

Diff for: libraries/MySensors/examples/RelayingNode/RelayingNode.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ void setup()
1616
gw.begin();
1717

1818
//Send the sensor node sketch version information to the gateway
19-
gw.sendSketchInfo("RelayingNode", "1.2");
19+
gw.sendSketchInfo("Relaying Node", "1.0");
2020
}
2121

2222
void loop()

Diff for: libraries/MySensors/examples/ServoActuator/ServoActuator.ino

+3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ void setup()
2929
{
3030
gw.begin();
3131

32+
// Send the sketch version information to the gateway and Controller
33+
gw.sendSketchInfo("Servo", "1.0");
34+
3235
// Register all sensors to gw (they will be created as child devices)
3336
gw.sendSensorPresentation(CHILD_ID, S_COVER);
3437

Diff for: libraries/MySensors/examples/SoilMoistSensor/SoilMoistSensor.ino

+3
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("Soil Moisture Sensor", "1.0");
21+
1922
pinMode(DIGITAL_INPUT_SOIL_SENSOR, INPUT); // sets the soil sensor digital pin as input
2023
// Register all sensors to gw (they will be created as child devices)
2124
gw.sendSensorPresentation(CHILD_ID, S_MOTION);

Diff for: libraries/MySensors/examples/TimeAndVariableSensor/TimeAndVariableSensor.ino

+3
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("Clock", "1.0");
22+
2023
// Register any sensortype. This example we just create a motion sensor.
2124
gw.sendSensorPresentation(CHILD_ID, S_MOTION);
2225

Diff for: libraries/MySensors/examples/WaterMeterPulseSensor/WaterMeterPulseSensor.ino

+3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ void setup()
4848
{
4949
gw.begin();
5050

51+
// Send the sketch version information to the gateway and Controller
52+
gw.sendSketchInfo("Water Meter", "1.0");
53+
5154
// Register this device as Waterflow sensor
5255
gw.sendSensorPresentation(CHILD_ID, S_WATER);
5356

0 commit comments

Comments
 (0)