storage.h revision c7eadb0e913a7979510a66c74f2113b8b12523ab
1/* 2 * 3 * BlueZ - Bluetooth protocol stack for Linux 4 * 5 * Copyright (C) 2002-2010 Marcel Holtmann <marcel@holtmann.org> 6 * 7 * 8 * This program is free software; you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation; either version 2 of the License, or 11 * (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 * 22 */ 23 24int read_device_alias(const char *src, const char *dst, char *alias, size_t size); 25int write_device_alias(const char *src, const char *dst, const char *alias); 26int write_discoverable_timeout(bdaddr_t *bdaddr, int timeout); 27int read_discoverable_timeout(const char *src, int *timeout); 28int write_pairable_timeout(bdaddr_t *bdaddr, int timeout); 29int read_pairable_timeout(const char *src, int *timeout); 30int write_device_mode(bdaddr_t *bdaddr, const char *mode); 31int read_device_mode(const char *src, char *mode, int length); 32int read_on_mode(const char *src, char *mode, int length); 33int write_local_name(bdaddr_t *bdaddr, const char *name); 34int read_local_name(bdaddr_t *bdaddr, char *name); 35int write_local_class(bdaddr_t *bdaddr, uint8_t *class); 36int read_local_class(bdaddr_t *bdaddr, uint8_t *class); 37int write_remote_class(bdaddr_t *local, bdaddr_t *peer, uint32_t class); 38int read_remote_class(bdaddr_t *local, bdaddr_t *peer, uint32_t *class); 39int write_device_name(bdaddr_t *local, bdaddr_t *peer, char *name); 40int read_device_name(const char *src, const char *dst, char *name); 41int write_remote_eir(bdaddr_t *local, bdaddr_t *peer, uint8_t *data); 42int read_remote_eir(bdaddr_t *local, bdaddr_t *peer, uint8_t *data); 43int write_l2cap_info(bdaddr_t *local, bdaddr_t *peer, 44 uint16_t mtu_result, uint16_t mtu, 45 uint16_t mask_result, uint32_t mask); 46int read_l2cap_info(bdaddr_t *local, bdaddr_t *peer, 47 uint16_t *mtu_result, uint16_t *mtu, 48 uint16_t *mask_result, uint32_t *mask); 49int write_version_info(bdaddr_t *local, bdaddr_t *peer, uint16_t manufacturer, uint8_t lmp_ver, uint16_t lmp_subver); 50int write_features_info(bdaddr_t *local, bdaddr_t *peer, unsigned char *page1, unsigned char *page2); 51int write_lastseen_info(bdaddr_t *local, bdaddr_t *peer, struct tm *tm); 52int write_lastused_info(bdaddr_t *local, bdaddr_t *peer, struct tm *tm); 53int write_link_key(bdaddr_t *local, bdaddr_t *peer, unsigned char *key, uint8_t type, int length); 54int read_link_key(bdaddr_t *local, bdaddr_t *peer, unsigned char *key, uint8_t *type); 55int read_pin_length(bdaddr_t *local, bdaddr_t *peer); 56int read_pin_code(bdaddr_t *local, bdaddr_t *peer, char *pin); 57gboolean read_trust(const bdaddr_t *local, const char *addr, const char *service); 58int write_trust(const char *src, const char *addr, const char *service, gboolean trust); 59GSList *list_trusts(bdaddr_t *local, const char *service); 60int write_device_profiles(bdaddr_t *src, bdaddr_t *dst, const char *profiles); 61int delete_entry(bdaddr_t *src, const char *storage, const char *key); 62int store_record(const gchar *src, const gchar *dst, sdp_record_t *rec); 63sdp_record_t *record_from_string(const gchar *str); 64sdp_record_t *fetch_record(const gchar *src, const gchar *dst, const uint32_t handle); 65int delete_record(const gchar *src, const gchar *dst, const uint32_t handle); 66void delete_all_records(const bdaddr_t *src, const bdaddr_t *dst); 67sdp_list_t *read_records(const bdaddr_t *src, const bdaddr_t *dst); 68sdp_record_t *find_record_in_list(sdp_list_t *recs, const char *uuid); 69int store_device_id(const gchar *src, const gchar *dst, 70 const uint16_t source, const uint16_t vendor, 71 const uint16_t product, const uint16_t version); 72int read_device_id(const gchar *src, const gchar *dst, 73 uint16_t *source, uint16_t *vendor, 74 uint16_t *product, uint16_t *version); 75int write_device_pairable(bdaddr_t *local, gboolean mode); 76int read_device_pairable(bdaddr_t *local, gboolean *mode); 77 78#define PNP_UUID "00001200-0000-1000-8000-00805f9b34fb" 79 80