This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

GAP central and GATT server

Hi:

I'm implementing an controller for an open source drone Crazyflie (www.bitcraze.se/.../). My device is similar to pca10001 board. Since Crazyflie is acting as peripheral, I make my device act as GAP central (S120 1.0.0 and SDK6.1). What's more, I need to make my device act as GATT server so I can send control command to the Crazyflie. I try to find example from SDK for a central and GATT server combination but could not get one. So I change the code upon ble_app_multilink_central example. After some adaption, the GAP connection and service discovery is OK. However, when I want to send command via sd_ble_gatts_hvx(), it will return BLE_ERROR_GATTS_SYS_ATTR_MISSING. I already add the gatts characteristic, but I notice that this Crazyflie peripheral will not send notification to my device. I'm not sure if that''s the problem. I want to know if there is any example for "GAP central and GATT server" so I can refer to?

I also attached my code and running log. Appreciate it if someone can look at it and help me! Thanks! ble_app_multilink_central.rar

Parents
  • Thanks for reply and question. It seems my previous understanding is wrong. The Crazyflies is running GATT server. Please find Crazyflie's firmware of 51822 in github.com/.../crazyflie2-nrf-firmware By. In the file ble_crazyflies.c, they claim the GATT services as below:

    sd_ble_gatts_service_add(BLE_GATTS_SRVC_TYPE_PRIMARY, &service_uuid, &service_handle); err = sd_ble_gatts_characteristic_add(service_handle, &crtp_md, &crtp_attr, &crtp_handle);

    Actually for my need, I just want to send control command to the Crazyflies via it's CRTP service. In this case, I should use GATT client in my side. And I can take ble_ias_c.c as example, am I right? Thanks! Spike

Reply
  • Thanks for reply and question. It seems my previous understanding is wrong. The Crazyflies is running GATT server. Please find Crazyflie's firmware of 51822 in github.com/.../crazyflie2-nrf-firmware By. In the file ble_crazyflies.c, they claim the GATT services as below:

    sd_ble_gatts_service_add(BLE_GATTS_SRVC_TYPE_PRIMARY, &service_uuid, &service_handle); err = sd_ble_gatts_characteristic_add(service_handle, &crtp_md, &crtp_attr, &crtp_handle);

    Actually for my need, I just want to send control command to the Crazyflies via it's CRTP service. In this case, I should use GATT client in my side. And I can take ble_ias_c.c as example, am I right? Thanks! Spike

Children
No Data
Related