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

    It seems like the subscribe parameters are invalid somehow. Could you try setting a persistence flag? This way, the subscription will be removed upon disconnection, and the server will have to issue a new subscription to the client when reconnecting. Please \...\ncs\zephyr\include\bluetooth\gatt.h for more information on the subscribe parameters.

    Best regards,

    Simon

Reply
  • Hi

    It seems like the subscribe parameters are invalid somehow. Could you try setting a persistence flag? This way, the subscription will be removed upon disconnection, and the server will have to issue a new subscription to the client when reconnecting. Please \...\ncs\zephyr\include\bluetooth\gatt.h for more information on the subscribe parameters.

    Best regards,

    Simon

Children
Related