User Manual

Disconnect

24/4/25
Disconnect

Disconnect action is used to disconnect your application from the Bluetooth device it is connected to. Disconnecting the connection stops data transmission and terminates notifications from the device. After this process, the user can connect to a new device or reconnect to the same device.

Technical Features

  • Bluetooth Disconnection: Terminates the connection between the application and the active Bluetooth device.
  • Real-Time Application: Data traffic is interrupted by terminating the connection when active communication with the device is not required.
  • Energy Efficiency: Bluetooth consumption is reduced when the connection is terminated.
  • Mobile Compatibility: The action only works in mobile applications (iOS/Android).
  • Reconnection Preparation: Ideal for situations where the device connection must be terminated before connecting to a new device.

Disconnect Action Application Steps

1. Creating a Bluetooth Datasource

  • Log in to the Kuika platform.
  • Open your mobile project from the Apps screen.
  • Go to the Datasources module from the left menu.
  • Open the screen for adding a new data source using the + icon on the left. Then select Bluetooth as the Datasource Type.
  • Enter the following information:
    • Device Name (required)
    • Device ID (optional)
    • Device Address (optional - e.g., 00:1A:2B:3C:4D:5E)
  • Click the CREATE button to create the data source.

2. Creating a Bluetooth Method

  1. Click the ADD NEW METHOD button under the data source you created.
  2. Fill in the fields as follows:
    • Name
    • Characteristic ID
    • Service ID
    • Characteristic Type (Read, Write, Notify, Indicate)
  3. Click the SAVE button to create the method.

3. Adding the Disconnect Action

  1. Click on the method you created.
  2. From the Properties panel on the right:
    • +ADD ACTION → Custom → userguide123 → Select the Disconnect_bluetooth action.
  3. Configure the action and click the SAVE button.

Parameter Definitions

This action works directly through the previously defined Bluetooth data source. No additional parameters are required. However, the connection must be established beforehand.

Usage Scenario: Disconnecting the Device

In a sports app, when the user completes a sports activity, data transfer from the device should be stopped and the Bluetooth connection should be terminated. This preserves the device's battery and makes the app ready to connect to other devices.

1. Go to the UI Design module.

  • Add a Button element.
  • In the Properties panel, set the button name to “Disconnect.”

2. When this button is clicked, add the following action from the + ADD ACTION menu to disconnect the connection:

  • OnClick → Custom → Kuika → Disconnect_bluetooth.

3. To send a notification to the user as the next action:

  • ADD ACTION → Add the Notify action.
  • Parameters:
    • title: “Notification”
    • message: “Bluetooth connection has been terminated”
    • type: “info”

With this flow, when the user clicks the “Disconnect” button, the Bluetooth connection with the device is terminated and an informative message is displayed on the screen.

Disconnect Action Advanced Customizations

  • Conditional Control: If the device is connected, the Disconnect action can be triggered, otherwise a warning can be displayed.
  • Automatic Rescan: After Disconnect, the Scan For Devices action can be triggered to list devices that can be connected to.
  • User Notification: After the action, the user can be notified that the connection has been disconnected via Notify or Modal.
  • Feedback Logging: When the disconnect operation is performed, a system log record can be kept or information can be sent to the admin panel.

Technical Risks and Precautions

  • Disconnect When No Connection: The connection cannot be disconnected if the device is not connected. The connection status must be checked beforehand.
  • Incomplete Process: If data transfer is in progress before the connection is disconnected, the process should not be interrupted before completion.
  • Device Errors: Some devices require the connection to be terminated properly before reconnecting. Ensure that the disconnect action is working correctly.

The Disconnect action enables you to perform controlled connection terminations in features that use Bluetooth in your application. It provides safe and effective use in critical processes such as switching between devices, energy management, and preventing connection errors.

Other Related Content

No items found.

Glossary

No items found.

Alt Başlıklar