Once you have finished communicating with your device, Digi recommends you disconnect it.
This releases the BLE interface so other applications can use it.
To disconnect a device, use the Disconnect() method of the Digi device object.
This method immediately frees the allocated resources.
| Method | Description |
|---|---|
Disconnect() |
Disconnects the Digi device. |
The Disconnect() method may fail for the following reasons:
-
Any error caught as DigiIoTException.
// Instantiate a Digi device object.
DigiBLEDevice myDigiBLEDevice = new DigiBLEDevice("00:00:00:00:00:00", "password");
// Connect the device.
myDigiBLEDevice.Connect();
// Work with the device.
[...]
// Disconnect the device.
myDigiBLEDevice.Disconnect();