storage.h revision adad645d0ad11c5b332058ce8e5d1797cf1c0727
1506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasi/* 2506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasi * 3506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasi * BlueZ - Bluetooth protocol stack for Linux 4506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasi * 5fb333f1c88df9c50529a390297565a6627bcf7adMarcel Holtmann * Copyright (C) 2002-2009 Marcel Holtmann <marcel@holtmann.org> 6506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasi * 7506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasi * 8506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasi * This program is free software; you can redistribute it and/or modify 9506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasi * it under the terms of the GNU General Public License as published by 10506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasi * the Free Software Foundation; either version 2 of the License, or 11506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasi * (at your option) any later version. 12506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasi * 13506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasi * This program is distributed in the hope that it will be useful, 14506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasi * but WITHOUT ANY WARRANTY; without even the implied warranty of 15506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasi * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasi * GNU General Public License for more details. 17506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasi * 18506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasi * You should have received a copy of the GNU General Public License 19506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasi * along with this program; if not, write to the Free Software 20506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasi * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasi * 22506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasi */ 23506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasi 24506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasiint read_device_alias(const char *src, const char *dst, char *alias, size_t size); 25506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasiint write_device_alias(const char *src, const char *dst, const char *alias); 26506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasiint write_discoverable_timeout(bdaddr_t *bdaddr, int timeout); 27676f5e7dea3c6c160ffdf08d42bf83e72a5a6c3fClaudio Takahasiint read_discoverable_timeout(const char *src, int *timeout); 283ee81cab2ed66b7f3d4fbd6ba6676d5d9448d6dcLuiz Augusto von Dentzint write_pairable_timeout(bdaddr_t *bdaddr, int timeout); 293ee81cab2ed66b7f3d4fbd6ba6676d5d9448d6dcLuiz Augusto von Dentzint read_pairable_timeout(const char *src, int *timeout); 30506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasiint write_device_mode(bdaddr_t *bdaddr, const char *mode); 31676f5e7dea3c6c160ffdf08d42bf83e72a5a6c3fClaudio Takahasiint read_device_mode(const char *src, char *mode, int length); 32506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasiint read_on_mode(const char *src, char *mode, int length); 3331e380bc0c6baea07d204e781f63ec388fdc3e20Johan Hedbergint write_local_name(bdaddr_t *bdaddr, const char *name); 34506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasiint read_local_name(bdaddr_t *bdaddr, char *name); 35506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasiint write_local_class(bdaddr_t *bdaddr, uint8_t *class); 36506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasiint read_local_class(bdaddr_t *bdaddr, uint8_t *class); 37506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasiint write_remote_class(bdaddr_t *local, bdaddr_t *peer, uint32_t class); 38506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasiint read_remote_class(bdaddr_t *local, bdaddr_t *peer, uint32_t *class); 39506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasiint write_device_name(bdaddr_t *local, bdaddr_t *peer, char *name); 40506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasiint read_device_name(const char *src, const char *dst, char *name); 41506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasiint write_remote_eir(bdaddr_t *local, bdaddr_t *peer, uint8_t *data); 420f26327986cf2a0aae3b3e30faf3728dfb36f6d5Johan Hedbergint read_remote_eir(bdaddr_t *local, bdaddr_t *peer, uint8_t *data); 43506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasiint write_l2cap_info(bdaddr_t *local, bdaddr_t *peer, 44506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasi uint16_t mtu_result, uint16_t mtu, 45506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasi uint16_t mask_result, uint32_t mask); 46506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasiint read_l2cap_info(bdaddr_t *local, bdaddr_t *peer, 47506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasi uint16_t *mtu_result, uint16_t *mtu, 48506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasi uint16_t *mask_result, uint32_t *mask); 49506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasiint write_version_info(bdaddr_t *local, bdaddr_t *peer, uint16_t manufacturer, uint8_t lmp_ver, uint16_t lmp_subver); 50506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasiint write_features_info(bdaddr_t *local, bdaddr_t *peer, unsigned char *features); 51506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasiint write_lastseen_info(bdaddr_t *local, bdaddr_t *peer, struct tm *tm); 52506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasiint write_lastused_info(bdaddr_t *local, bdaddr_t *peer, struct tm *tm); 53506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasiint write_link_key(bdaddr_t *local, bdaddr_t *peer, unsigned char *key, uint8_t type, int length); 54506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasiint read_link_key(bdaddr_t *local, bdaddr_t *peer, unsigned char *key, uint8_t *type); 55506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasiint read_pin_length(bdaddr_t *local, bdaddr_t *peer); 56506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasiint read_pin_code(bdaddr_t *local, bdaddr_t *peer, char *pin); 57506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasigboolean read_trust(const bdaddr_t *local, const char *addr, const char *service); 58d4982955787817ad17aec6de9308c8f1d7ed0b92Claudio Takahasiint write_trust(const char *src, const char *addr, const char *service, gboolean trust); 59506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio TakahasiGSList *list_trusts(bdaddr_t *local, const char *service); 60506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasiint write_device_profiles(bdaddr_t *src, bdaddr_t *dst, const char *profiles); 61506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasiint delete_entry(bdaddr_t *src, const char *storage, const char *key); 62506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasiint store_record(const gchar *src, const gchar *dst, sdp_record_t *rec); 63fe785852485ecaa8c162682cc4dfcb6dd22f2210Bastien Nocerasdp_record_t *record_from_string(const gchar *str); 64506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasisdp_record_t *fetch_record(const gchar *src, const gchar *dst, const uint32_t handle); 65506c95298346d318304aa7e2211dfba5dbe6e3e0Claudio Takahasiint delete_record(const gchar *src, const gchar *dst, const uint32_t handle); 66adad645d0ad11c5b332058ce8e5d1797cf1c0727Johan Hedbergvoid delete_all_records(const bdaddr_t *src, const bdaddr_t *dst); 67adad645d0ad11c5b332058ce8e5d1797cf1c0727Johan Hedbergsdp_list_t *read_records(const bdaddr_t *src, const bdaddr_t *dst); 6860af857dbc8a258eb91ef3fb6de06c17c8fb4ec2David Woodhousesdp_record_t *find_record_in_list(sdp_list_t *recs, const char *uuid); 69fce6db565f747ca9ad560f7d8bff6a45522d905cMarcel Holtmannint store_device_id(const gchar *src, const gchar *dst, 70fce6db565f747ca9ad560f7d8bff6a45522d905cMarcel Holtmann const uint16_t source, const uint16_t vendor, 71fce6db565f747ca9ad560f7d8bff6a45522d905cMarcel Holtmann const uint16_t product, const uint16_t version); 72fce6db565f747ca9ad560f7d8bff6a45522d905cMarcel Holtmannint read_device_id(const gchar *src, const gchar *dst, 73fce6db565f747ca9ad560f7d8bff6a45522d905cMarcel Holtmann uint16_t *source, uint16_t *vendor, 74fce6db565f747ca9ad560f7d8bff6a45522d905cMarcel Holtmann uint16_t *product, uint16_t *version); 750c561f77956654c654f14daea35e90ad0ba20164Luiz Augusto von Dentzint write_device_pairable(bdaddr_t *local, gboolean mode); 760c561f77956654c654f14daea35e90ad0ba20164Luiz Augusto von Dentzint read_device_pairable(bdaddr_t *local, gboolean *mode); 77af8bb26f9bbc3ffb63a8dcc50768c59466540357David Woodhouse 78af8bb26f9bbc3ffb63a8dcc50768c59466540357David Woodhouse#define PNP_UUID "00001200-0000-1000-8000-00805f9b34fb" 79af8bb26f9bbc3ffb63a8dcc50768c59466540357David Woodhouse 80