Skip to content

Commit cbc2312

Browse files
committed
Added example of setting the Protocol_reversion
1 parent e9c5eb9 commit cbc2312

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

BACnetServerExample/BACnetServerExampleDatabase.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public class ExampleDatabaseDevice : ExampleDatabaseBase
4242
public UInt32 instance;
4343
public String modelName;
4444
public UInt32 vendorIdentifiier;
45+
public UInt32 protocolRevision;
4546
public String vendorName;
4647
}
4748
public class ExampleDatabaseAnalog : ExampleDatabaseBase
@@ -177,6 +178,7 @@ public void Setup()
177178
this.Device.instance = 389001;
178179
this.Device.description = "This is the example description";
179180
this.Device.vendorIdentifiier = 389; // 389 is Chipkin's vendorIdentifiier
181+
this.Device.protocolRevision = 16; // Overide the protocolRevision
180182
this.Device.vendorName = "Chipkin Automation Systems";
181183
this.Device.modelName = "BACnetServerExampleCSharp";
182184

BACnetServerExample/Program.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ unsafe class BACnetServer
4949
private ExampleDatabase database = new ExampleDatabase();
5050

5151
// Version
52-
const string APPLICATION_VERSION = "0.0.2";
52+
const string APPLICATION_VERSION = "0.0.3";
5353

5454
// Server setup and main loop
5555
public void Run()
@@ -592,7 +592,7 @@ public bool CallbackGetEnumerated(UInt32 deviceInstance, UInt16 objectType, UInt
592592
*value = (UInt32)(database.BinaryInput[objectInstance].presentValue ? 1 : 0);
593593
Console.WriteLine("FYI: BinaryInput[{0}].value got [{1}]", objectInstance, database.BinaryInput[objectInstance].presentValue);
594594
return true;
595-
}
595+
}
596596
}
597597
break;
598598
case CASBACnetStackAdapter.OBJECT_TYPE_BINARY_VALUE:
@@ -649,6 +649,11 @@ public bool CallbackGetUnsignedInteger(UInt32 deviceInstance, UInt16 objectType,
649649
*value = database.Device.vendorIdentifiier;
650650
return true;
651651
}
652+
else if (propertyIdentifier == CASBACnetStackAdapter.PROPERTY_IDENTIFIER_PROTOCOLREVISION)
653+
{
654+
*value = database.Device.protocolRevision;
655+
return true;
656+
}
652657
}
653658
break;
654659

@@ -724,7 +729,7 @@ public bool CallbackGetPropertyBool(UInt32 deviceInstance, UInt16 objectType, UI
724729
*value = database.AnalogInput[objectInstance].outOfService;
725730
Console.WriteLine("FYI: AnalogInput[{0}].outOfService got [{1}]", objectInstance, database.AnalogInput[objectInstance].outOfService);
726731
return true;
727-
}
732+
}
728733
}
729734
break;
730735
case CASBACnetStackAdapter.OBJECT_TYPE_ANALOG_OUTPUT:

CHANGELOG.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22

33
## Version 0.0.x
44

5-
### 0.0.2.x (2020-Jun-19)
5+
### 0.0.3 (2020-Aug-19)
6+
7+
- Added example of setting the protocol revision.
8+
9+
### 0.0.2 (2020-Jun-19)
10+
611
- Implemented help and quit functionality.
712

8-
### 0.0.1.x (2020-Feb-12)
13+
### 0.0.1 (2020-Feb-12)
914

10-
- Inital release.
15+
- Inital release

0 commit comments

Comments
 (0)