You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The assembly supports pairing with encryption and authenication.
89
+
The assembly supports pairing with encryption and authentication.
90
90
91
91
If you don't do anything in your code it will use the **Just works** method of pairing which will enable encryption on the connection.
92
92
@@ -102,6 +102,20 @@ Calling dispose will remove the object from memory.
102
102
103
103
This object is new and doesn't exist in the normal Windows implementation and was added to allow better handling of pairing and connections from the managed code.
104
104
105
+
### Setting the Device Name and it Appearance
106
+
107
+
The device name and appearance is part of the Generic Access service which is automatically
108
+
included in each Gatt Server definition. The name should be the name of current device and the appearance which
109
+
is optional is a 16 bit code that represents the use of the device. Defaults to 0 which is "Unknown Device".
110
+
For details on codes see the Bluetooth Sig Assigned numbers document; section **2.6.3 Appearance Subcategory values**. Use the values column for the code.
111
+
For example code 0x0481 is for a cycling computer.
### Defining the service and associated Characteristics
106
120
107
121
The GattServiceProvider is used to create and advertise the primary service definitions. An extra device information service will be automatically created when first service is created.
@@ -116,7 +130,7 @@ if (result.Error != BluetoothError.Success)
116
130
serviceProvider=result.ServiceProvider;
117
131
```
118
132
119
-
To create further services for the Gatt server call **GattServiceProvider.Create(uuid)** for each new service.
133
+
To create further services for the Gatt server call **GattServiceProvider.Create(UUID)** for each new service.
120
134
121
135
Access all created services via the BluetoothLEServer instance.
122
136
@@ -173,7 +187,7 @@ GattLocalCharacteristicParameters ReadParameters = new GattLocalCharacteristicPa
173
187
};
174
188
175
189
```
176
-
If the **StaticValue** is set the the read event will not be called and doesn't need to be defined.
190
+
If the **StaticValue** is set the read event will not be called and doesn't need to be defined.
177
191
178
192
### Adding a Write or WriteWithoutResponse Characteristic
AfterconnectingtotehdeviceyoucangobacktoWatchingfor advertisements with the restriction that you can't connect to newly found devcies until the Watching is stopped.
395
+
AfterconnectingtothedevicegobacktoWatchingfor advertisements with the restriction that you can't connect to newly found devices until the Watching is stopped.
382
396
You can still communication with connected devices while the Watcher is running. Best way is to collect all found devices in a table until Watcher is
383
397
stopped then connect to all found devices. See [Central 2 sample](https://github.com/nanoframework/Samples/tree/main/samples/Bluetooth/Central2)
384
398
385
399
The Close() methodisnotexposedinthedesktopversionbutithasbeenimplementedinthisversion
@@ -412,7 +430,7 @@ The services are cached so the first time they are queried it will retrieve them
412
430
Further calls for services will return the cached results. To clear the cache the device must be disposed.
413
431
414
432
415
-
## Querying service characterisics
433
+
## Querying service characteristics
416
434
417
435
With the GattDeviceService object a query can be made for the required Characteristics.
418
436
In the same way as the service there is a method to query for a all Characteristics or just specific Characteristics.
@@ -438,7 +456,7 @@ Note:
438
456
The Characteristics are cached so the first time requested it will retrieve them from the device.
439
457
Further calls to same service will return the cached results.
440
458
441
-
## Querying characterisics descriptors
459
+
## Querying characteristics descriptors
442
460
443
461
Descriptors can be retrieved in the same way as Services and Characteristics using the methods
444
462
GetDescriptors and GetDescriptorsForUuid.
@@ -497,7 +515,7 @@ This can be used to Write with or without a response.
497
515
}
498
516
```
499
517
500
-
## Enabling the value changed notifcations
518
+
## Enabling the value changed notifications
501
519
502
520
This enables the receiving of events when a Characteristic value changes on the server. The notifications are enabled
503
521
by setting up an event then setting the value of the CCCD descriptor as below.
@@ -546,7 +564,7 @@ For good information on Bluetooth Pairing and how the IO Capabilities effect the
546
564
547
565
By default the *ProtectionLevel* is **None** and the *IOCapabilities* is **NoInputNoOutput** so the pairing will use **Just Works** method if both ends are nanoFramework.
548
566
549
-
The ProtectionLevel will be automaticlly updated depending on the requirements of any added Characteristics.
567
+
The ProtectionLevel will be automatically updated depending on the requirements of any added Characteristics.
550
568
This can be manually set to force a different level of protection.
551
569
552
570
|*ProtectionLevel*||
@@ -557,8 +575,8 @@ This can be manually set to force a different level of protection.
557
575
558
576
## IOCapabilities
559
577
560
-
The IO Capabilities are input and output peripherals availble on the device for pairing.
561
-
Depending on what IOCapabilities each device has will covern how the pairing will be done.
578
+
The IO Capabilities are input and output peripherals available on the device for pairing.
579
+
Depending on what IOCapabilities each device has will govern how the pairing will be done.
562
580
563
581
|*IOCapabilities*||
564
582
| ------- | ----- |
@@ -569,11 +587,11 @@ Depending on what IOCapabilities each device has will covern how the pairing wil
569
587
570
588
## Pairing Matrix
571
589
572
-
The Initiator is the devcie thats starts the pairing operation. This would normally be the Client.
573
-
The Responder is the devcie responding to the pairing request.
590
+
The Initiator is the device thats starts the pairing operation. This would normally be the Client.
591
+
The Responder is the device responding to the pairing request.
574
592
575
-
*Just Works* : Means there is no inpt required and connection is just set up. If any Characteristics
576
-
have a protection level of Authentiction then a access error will be given.
593
+
*Just Works* : Means there is no input required and connection is just set up. If any Characteristics
594
+
have a protection level of Authentication then a access error will be given.
0 commit comments