Skip to content

Commit d2b26dd

Browse files
committed
E Updated readme
1 parent b4abac6 commit d2b26dd

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Call `GetServicesAsync` to retrieve a list of all services supported by the devi
105105
var services = await client.GetServicesAsync();
106106
```
107107

108-
Some operations require the device to support a service. For instance, to retrieve the stream URI the device must support the media service. To check whether the ONVIF service is supported by the device, call:
108+
Some operations require the device to support a service. For instance, to retrieve the stream URI the device must support the media service. To check whether the Onvif service is supported by the device, call:
109109
```cs
110110
if (services.Service.FirstOrDefault(x => x.Namespace == OnvifServices.MEDIA) != null)
111111
{
@@ -149,16 +149,14 @@ eventListener.Start((int cameraID, string ev) =>
149149
var subscriptionResponse = await client.BasicSubscribeAsync(eventListener.GetOnvifEventListenerUri(CAMERA1));
150150
```
151151
### Using the generated WCF clients
152-
First add a reference to the DLL that implements the clients (e.g. `SharpOnvifClient.DeviceMgmt`). Create the authentication behavior:
152+
First add a reference to the DLL that implements the clients (e.g. `SharpOnvifClient.DeviceMgmt`). Add the usings:
153153
```cs
154-
var auth = new DigestBehavior("admin", "password");
154+
using SharpOnvifClient;
155155
```
156156
Create the Onvif client and set the authentication behavior using `SetOnvifAuthentication` extension method from `SharpOnvifClient.OnvifAuthenticationExtensions` before you use it:
157157
```cs
158-
using SharpOnvifClient;
159-
160158
System.Net.NetworkCredential credentials = new System.Net.NetworkCredential(userName, password);
161-
IEndpointBehavior legacyAuth = new WsUsernameTokenBehavior(_credentials);
159+
IEndpointBehavior legacyAuth = new WsUsernameTokenBehavior(credentials);
162160

163161
using (var deviceClient = new DeviceClient(
164162
OnvifBindingFactory.CreateBinding(),

0 commit comments

Comments
 (0)