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

nRF9160: LTE Sensor Gateway

I am using nRF9160: LTE Sensor Gateway to connect wiht nRF52832. My problem is I cannot re establish connection between the nRF9160 and the nRF52832. I have tried to create a function which is called whenever disconnection occours below

static void disconnected(struct bt_conn *conn, u8_t conn_err)
{
int err;

err = bt_scan_start(BT_SCAN_TYPE_SCAN_ACTIVE);
if (err) {
printk("Scanning failed to start, err %d\n", err);
}

printk("Scanning...\n");
}

However when the devices reconnect I encounter this error when calling bt_gatt_dm_start(conn, BT_UUID_TMS, &discovery_cb, NULL);

does anyone know how to solve this issue? or work around on getting bluetooth devices reconnected when their is a disconnection?

please assist

Parents
  • Hi Marshed

    It seems the BT_GATT_SUBSCRIBE_FLAG_VOLATILE is called in the remove_subscriptions function in gatt.c. I assume implementing this function into your project, upon disconnection, should be enough. 

    Best regards,

    Simon

    PS: Our Zephyr experts are out of office for summer vacation for this and the coming week, so you might want to try contacting Zephyr for more detailed assistance. The Zephyr Project, in general, have mailing lists, slack, and other means to discuss/contact.

Reply
  • Hi Marshed

    It seems the BT_GATT_SUBSCRIBE_FLAG_VOLATILE is called in the remove_subscriptions function in gatt.c. I assume implementing this function into your project, upon disconnection, should be enough. 

    Best regards,

    Simon

    PS: Our Zephyr experts are out of office for summer vacation for this and the coming week, so you might want to try contacting Zephyr for more detailed assistance. The Zephyr Project, in general, have mailing lists, slack, and other means to discuss/contact.

Children
Related