Skip to content

Commit 866ba8b

Browse files
committed
E Updated readme
1 parent a72129b commit 866ba8b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,19 @@ foreach (var notification in notifications)
133133
### Basic event subscription
134134
Basic event subscription utilizes a callback from the camera when an event occurs. This requires the camera to be able to reach your machine through a firewall/NAT. To listen for incoming notifications, you must run `SimpleOnvifEventListener`:
135135
```cs
136+
// ID 1 will identify this camera in the callback
137+
const int CAMERA1 = 1;
138+
136139
var eventListener = new SimpleOnvifEventListener();
137140
eventListener.Start((int cameraID, string ev) =>
138141
{
139-
// handle the notification message
140142
bool? isTamper = SharpOnvifClient.OnvifEvents.IsTamperDetected(notification);
143+
if(cameraID == CAMERA1)
144+
{
145+
// handle the notification message for CAMERA1
146+
}
141147
});
142148

143-
// ID 1 will identify this camera in the callback
144-
const int cameraID = 1;
145149
var subscriptionResponse = await client.BasicSubscribeAsync(eventListener.GetOnvifEventListenerUri(cameraID));
146150
```
147151
### Using the generated WCF clients
@@ -162,7 +166,7 @@ Create the ONVIF client and set the authentication behavior before you use it:
162166
```
163167
Call any method on the client like:
164168
```cs
165-
var deviceInfo = await deviceClient.GetDeviceInformationAsync(new GetDeviceInformationRequest()).ConfigureAwait(false);
169+
var deviceInfo = await deviceClient.GetDeviceInformationAsync(new GetDeviceInformationRequest());
166170
```
167171
## Testing
168172
Only the DeviceMgmt, Media and Events were tested with Hikvision cameras.

0 commit comments

Comments
 (0)