javacall_result bt_push_unregister_url(const char *url) { bt_port_t port; bt_push_t *push, *prev; REPORT_INFO(LC_PUSH, "Bluetooth PushRegistry URL un-registration:"); REPORT_INFO1(LC_PUSH, "%s", url); bt_push_parse_url(url, &port, NULL); push = find_push(&port, &prev); if (push == NULL) { return JAVACALL_FAIL; } /* remove the service record */ javacall_bt_sddb_remove_record(push->record.id); /* close server and client connections */ close_all(push); /* remove the entry */ if (prev != NULL) { prev->next = push->next; } else { g_registry = push->next; } g_count--; pcsl_mem_free(push); push_save(); javacall_bt_stack_set_service_classes(javacall_bt_sddb_get_service_classes(0)); REPORT_INFO(LC_PUSH, "Un-registration successful."); return JAVACALL_OK; }
/** * Removes service record from the SDDB. * * @param handle hanlde of the service record to be deleted */ KNIEXPORT KNI_RETURNTYPE_VOID Java_com_sun_kvem_jsr082_bluetooth_SDDB_removeRecord(void) { javacall_bt_sddb_remove_record((bt_sddbid_t)KNI_GetParameterAsInt(1)); javacall_bt_stack_set_service_classes(javacall_bt_sddb_get_service_classes(0)); KNI_ReturnVoid(); }
void bt_push_shutdown() { bt_push_t *push = g_registry; REPORT_INFO(LC_PUSH, "Shutting down Bluetooth PushRegistry."); while (push != NULL) { bt_push_t *next = push->next; javacall_bt_sddb_remove_record(push->record.id); pcsl_mem_free(push->record.data); close_all(push); pcsl_mem_free(push); push = next; } g_registry = NULL; javacall_bt_sddb_finalize(); }