Languages

Menu
Sites
Language
bluetooth error

Hi, i am developing a Watch app that commnuicates with external devices using Bluttooth Low Energy(BLE).

Watch is a client, external devices is a server.

 

bt_gatt_client_create(remote_address, client);

bt_gatt_client_get_service(client, UUID, &svc);

bt_gatt_service_get_characteristic(svc, control_point_UUID, &write);

bt_gatt_set_value(control_point_UUID,  ...); // i send 5byte char character

bt_gatt_client_write_value(control_point_UUID, __bt_gatt_client_write_complete_cb, NULL);

// upper callback function
__bt_gatt_client_write_complete_cb(int result, bt_gatt_h gatt_handle, void *data)
{
    // the result is -9, 0xFD
}

In callback function(__bt_gatt_client_write_cmomplete_cb), i got a result which  assigned as -9.

 

It is hard to upload image...

log below..

bt-hal-gatt-client.c: __hal_bluetooth_internal_write_cb(1616) > write Characteristic dbus failed Error:[GDBus.Error:org.bluez.Error.Failed: Operation failed with ATT error: 0xfd]

bt-request-sender.c: __send_request_cb(449) > event_type[23], result= INTERNAL [0xfffffff7]

 

To solve the problem, i was looking for a solution and i found that trying to apply notification as true.

However, Tizen native api doesn't support that the client cannot set a status of server notification.

 

Today, I attempted to convert "bt_gatt_service_get_characteristic" to "bt_gatt_characteristic_create", but it was not working..

And i try to convert "bt_gatt_client_get_service" to "bt_gatt_service_create" and "bt_gatt_server_create"... 

 

How can i solve this problem?

 

Edited by: Junhak Lee on 05 Apr, 2021

Responses

12 Replies
Junhak Lee

I added  "bt_gatt_client_set_characteristic_value_changed_cb" function behind "bt_gatt_client_write_value" call and the error was gone.

Peter Groft

Check Bluetooth basics

    Turn Bluetooth off and then on again. Learn how to turn Bluetooth on and off.
    Confirm that your devices are paired and connected. Learn how to pair and connect via Bluetooth.
    Restart your devices. Learn how to restart your Pixel phone or Nexus device.

Regards,
Peter

Cucumber Nox

acquire new knowledge that is useful. We appreciate the website's excellent documentation and information.

James

Based on the error message you provided, it seems that the Bluetooth Low Energy (BLE) operation you are attempting to perform has failed with an ATT error code of 0xFD. This error code indicates that the attribute handle value given was not valid on this server.

There could be various reasons for this error, including incorrect attribute handle values, a disconnected server, or a problem with the Bluetooth connection itself. To solve this issue, you can try the following steps:

  1. Double-check that the UUIDs and handles you are using in your code are correct and match those of the BLE server.

  2. Make sure that the BLE server is still connected and available. You can use the bt_gatt_client_set_connection_state_changed_cb() function to register a callback that will notify you of changes to the Bluetooth connection state.

  3. Verify that the BLE server is configured correctly and supports the specific BLE operation you are trying to perform.

  4. If the above steps do not work, you may need to consult the documentation for the BLE server you are communicating with or seek assistance from the developer community.

Regarding your attempt to use notification as a possible solution, it is important to note that the Tizen native API does not support the client setting the notification status of the server. The server must advertise its supported characteristics and notify the client when power wash house changes occur. Therefore, changing bt_gatt_service_get_characteristic() to bt_gatt_characteristic_create() may not solve the problem.

Overall, debugging BLE communication issues can be challenging, so it is recommended to thoroughly review the BLE protocol and API documentation and seek assistance from the developer community or support channels if needed.

michealjasson

The same issue that I am encountering now..

Rachel Gomez

Turn Bluetooth off and then on again. Learn how to turn Bluetooth on and off.
Confirm that your devices are paired and connected. Learn how to pair and connect via Bluetooth.
Restart your devices. Learn how to restart your Pixel phone or Nexus device.

Regards,

Rachel Gomez

Mary Solero

It seems like you are encountering an error when trying to write to a Bluetooth Low Energy (BLE) characteristic on an external device from your Tizen watch app. The error message suggests that the operation failed with an ATT error code of 0xfd, which indicates an "Attribute Not Long" error. This error is typically caused when the data being written to the characteristic is larger than the maximum allowed length.

One thing you could try is to check the size of the data you are trying to write to the characteristic. Make sure it is not larger than the maximum allowed length for the characteristic. You can get the maximum length of the characteristic by calling the bt_gatt_characteristic_get_length function.

If the data size is not the issue, you could also try increasing the MTU (Maximum Transmission Unit) size of the BLE connection between your watch app and the external device. This can be done by calling the bt_gatt_set_mtu function.

Another thing to consider is whether the external device is properly configured to receive write requests from your watch app. Make sure that the characteristic you are trying to write to has the proper write permissions enabled on the external device. You could also try writing to a different characteristic to see if the issue is specific to that characteristic.

If none of these solutions work, you may need to consult the documentation or support resources for the external device you are trying to communicate with, or seek assistance from the Tizen developer community or support resources.

Cindy Lashley

Useful content.

treeger

Go on to share content

Steve Pallet

Have you managed to get this bluetooth to work viably to share? I'm looking to design blue tooth app linked to a robot that does and folds your laundry and you can monitor it from work or in the car. Ever since I got my RV fridge repaired in Calgary by appliancerepaircalgarypros.com I imagined if a drone couldn't have flown out to my campsite and repair it. Then I thought of the old Jetsons cartoons and did some researching online, which led me here. Feel free to go forward with the idea but thought it was worth sharing.

salma wisoky

I appreciate the website's excellent documentation and information.

Bekean Pinky

In your write completion callback (__bt_gatt_client_write_complete_cb), you should examine the result parameter to understand the nature of the error. Different negative values can indicate various issues. In your case, -9 (0xFD) may be a specific error code that requires nterpretation based on the BLE specification or the documentation of the Bluetooth stack you are using.