/// recompute molecule's bonds via distance bond search from current timestep int DrawMolecule::recalc_bonds() { Timestep *ts = current(); if (ts) { clear_bonds(); // clear the existing bond list vmd_bond_search(this, ts, -1, 0); // just add bonds, no dup checking msgInfo << "Bond count: " << count_bonds() << sendmsg; return 0; } msgInfo << "No coordinates" << sendmsg; return -1; }
void on_nble_get_version_rsp(const struct nble_get_version_rsp *rsp) { BT_DBG("VERSION: %d.%d.%d %.20s", rsp->ver.major, rsp->ver.minor, rsp->ver.patch, rsp->ver.version_string); if (memcmp(&rsp->ver.version_string[sizeof(rsp->ver.version_string) - sizeof(compatible_firmware)], compatible_firmware, sizeof(compatible_firmware))) { BT_ERR("\n\n" "Incompatible firmware: %.20s, please use version %.4s" "\n\n", rsp->ver.version_string, compatible_firmware); /* TODO: shall we allow to continue */ } /* Make sure the nRF51 persistent memory is cleared */ clear_bonds(BT_ADDR_LE_ANY); if (bt_ready_cb) { bt_ready_cb(0); bt_ready_cb = NULL; } }
int bt_storage_clear(bt_addr_le_t *addr) { clear_bonds(addr); /* FIXME: make the necessary storage callbacks too. */ return 0; }