1f1b34e8dSMatthias Ringwald /* 2f1b34e8dSMatthias Ringwald * Copyright (C) 2014 BlueKitchen GmbH 3f1b34e8dSMatthias Ringwald * 4f1b34e8dSMatthias Ringwald * Redistribution and use in source and binary forms, with or without 5f1b34e8dSMatthias Ringwald * modification, are permitted provided that the following conditions 6f1b34e8dSMatthias Ringwald * are met: 7f1b34e8dSMatthias Ringwald * 8f1b34e8dSMatthias Ringwald * 1. Redistributions of source code must retain the above copyright 9f1b34e8dSMatthias Ringwald * notice, this list of conditions and the following disclaimer. 10f1b34e8dSMatthias Ringwald * 2. Redistributions in binary form must reproduce the above copyright 11f1b34e8dSMatthias Ringwald * notice, this list of conditions and the following disclaimer in the 12f1b34e8dSMatthias Ringwald * documentation and/or other materials provided with the distribution. 13f1b34e8dSMatthias Ringwald * 3. Neither the name of the copyright holders nor the names of 14f1b34e8dSMatthias Ringwald * contributors may be used to endorse or promote products derived 15f1b34e8dSMatthias Ringwald * from this software without specific prior written permission. 16f1b34e8dSMatthias Ringwald * 4. Any redistribution, use, or modification is done solely for 17f1b34e8dSMatthias Ringwald * personal benefit and not for any commercial purpose or for 18f1b34e8dSMatthias Ringwald * monetary gain. 19f1b34e8dSMatthias Ringwald * 20f1b34e8dSMatthias Ringwald * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS 21f1b34e8dSMatthias Ringwald * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22f1b34e8dSMatthias Ringwald * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23f1b34e8dSMatthias Ringwald * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MATTHIAS 24f1b34e8dSMatthias Ringwald * RINGWALD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25f1b34e8dSMatthias Ringwald * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 26f1b34e8dSMatthias Ringwald * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 27f1b34e8dSMatthias Ringwald * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 28f1b34e8dSMatthias Ringwald * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 29f1b34e8dSMatthias Ringwald * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 30f1b34e8dSMatthias Ringwald * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31f1b34e8dSMatthias Ringwald * SUCH DAMAGE. 32f1b34e8dSMatthias Ringwald * 33f1b34e8dSMatthias Ringwald * Please inquire about commercial licensing options at 34f1b34e8dSMatthias Ringwald * [email protected] 35f1b34e8dSMatthias Ringwald * 36f1b34e8dSMatthias Ringwald */ 37f1b34e8dSMatthias Ringwald 38f1b34e8dSMatthias Ringwald #ifndef __GOEP_CLIENT_H 39f1b34e8dSMatthias Ringwald 40f1b34e8dSMatthias Ringwald #if defined __cplusplus 41f1b34e8dSMatthias Ringwald extern "C" { 42f1b34e8dSMatthias Ringwald #endif 43f1b34e8dSMatthias Ringwald 44f1b34e8dSMatthias Ringwald #include "btstack_config.h" 45f1b34e8dSMatthias Ringwald #include <stdint.h> 46f1b34e8dSMatthias Ringwald 4783f1bca0SMatthias Ringwald // max len of phone number used for lookup in pbap_lookup_by_number 4883f1bca0SMatthias Ringwald #define PBAP_MAX_PHONE_NUMBER_LEN 32 4983f1bca0SMatthias Ringwald 5083f1bca0SMatthias Ringwald // max len of name reported in PBAP_SUBEVENT_CARD_RESULT 5183f1bca0SMatthias Ringwald #define PBAP_MAX_NAME_LEN 32 5283f1bca0SMatthias Ringwald // max len of vcard handle reported in PBAP_SUBEVENT_CARD_RESULT 5383f1bca0SMatthias Ringwald #define PBAP_MAX_HANDLE_LEN 16 5483f1bca0SMatthias Ringwald 55f1b34e8dSMatthias Ringwald /* API_START */ 56f1b34e8dSMatthias Ringwald 57f1b34e8dSMatthias Ringwald /** 58f1b34e8dSMatthias Ringwald * Setup PhoneBook Access Client 59f1b34e8dSMatthias Ringwald */ 60f1b34e8dSMatthias Ringwald void pbap_client_init(void); 61f1b34e8dSMatthias Ringwald 62f1b34e8dSMatthias Ringwald /** 63f1b34e8dSMatthias Ringwald * @brief Create PBAP connection to a Phone Book Server (PSE) server on a remote deivce. 64f1b34e8dSMatthias Ringwald * @param handler 65f1b34e8dSMatthias Ringwald * @param addr 66f1b34e8dSMatthias Ringwald * @param out_cid to use for further commands 67f1b34e8dSMatthias Ringwald * @result status 68f1b34e8dSMatthias Ringwald */ 69f1b34e8dSMatthias Ringwald uint8_t pbap_connect(btstack_packet_handler_t handler, bd_addr_t addr, uint16_t * out_cid); 70f1b34e8dSMatthias Ringwald 71f1b34e8dSMatthias Ringwald /** 72c1bc0b8eSMatthias Ringwald * @brief Provide password for OBEX Authentication after receiving PBAP_SUBEVENT_AUTHENTICATION_REQUEST 73c1bc0b8eSMatthias Ringwald * @param pbap_cid 74c1bc0b8eSMatthias Ringwald * @param password (null terminated string) - not copied, needs to stay valid until connection completed 75c1bc0b8eSMatthias Ringwald */ 76c1bc0b8eSMatthias Ringwald uint8_t pbap_authentication_password(uint16_t pbap_cid, const char * password); 77c1bc0b8eSMatthias Ringwald 78c1bc0b8eSMatthias Ringwald /** 79f1b34e8dSMatthias Ringwald * @brief Disconnects PBAP connection with given identifier. 80f1b34e8dSMatthias Ringwald * @param pbap_cid 81f1b34e8dSMatthias Ringwald * @return status 82f1b34e8dSMatthias Ringwald */ 83f1b34e8dSMatthias Ringwald uint8_t pbap_disconnect(uint16_t pbap_cid); 84f1b34e8dSMatthias Ringwald 85f1b34e8dSMatthias Ringwald /** 86f1b34e8dSMatthias Ringwald * @brief Set current folder on PSE 87f1b34e8dSMatthias Ringwald * @param pbap_cid 88f1b34e8dSMatthias Ringwald * @param path - note: path is not copied 89f1b34e8dSMatthias Ringwald * @return status 90f1b34e8dSMatthias Ringwald */ 91f1b34e8dSMatthias Ringwald uint8_t pbap_set_phonebook(uint16_t pbap_cid, const char * path); 92f1b34e8dSMatthias Ringwald 93f1b34e8dSMatthias Ringwald /** 943a7447a3SMatthias Ringwald * @brief Get size of phone book from PSE 953a7447a3SMatthias Ringwald * @param pbap_cid 96*8c94c044SMatthias Ringwald * @param path - note: path is not copied, common path 'telecom/pb.vcf' 973a7447a3SMatthias Ringwald * @return status 983a7447a3SMatthias Ringwald */ 99*8c94c044SMatthias Ringwald uint8_t pbap_get_phonebook_size(uint16_t pbap_cid, const char * path); 1003a7447a3SMatthias Ringwald 1013a7447a3SMatthias Ringwald /** 102f1b34e8dSMatthias Ringwald * @brief Pull phone book from PSE 103f1b34e8dSMatthias Ringwald * @param pbap_cid 104*8c94c044SMatthias Ringwald * @param path - note: path is not copied, common path 'telecom/pb.vcf' 105f1b34e8dSMatthias Ringwald * @return status 106f1b34e8dSMatthias Ringwald */ 107*8c94c044SMatthias Ringwald uint8_t pbap_pull_phonebook(uint16_t pbap_cid, const char * path); 108e03b79abSMatthias Ringwald 109e03b79abSMatthias Ringwald /** 110e03b79abSMatthias Ringwald * @brief Lookup contact(s) by phone number 111e03b79abSMatthias Ringwald * @param pbap_cid 112e03b79abSMatthias Ringwald * @param phone_number 113e03b79abSMatthias Ringwald * @return status 114e03b79abSMatthias Ringwald */ 115e03b79abSMatthias Ringwald uint8_t pbap_lookup_by_number(uint16_t pbap_cid, const char * phone_number); 116f1b34e8dSMatthias Ringwald 117f1b34e8dSMatthias Ringwald /* API_END */ 118f1b34e8dSMatthias Ringwald 119f1b34e8dSMatthias Ringwald #if defined __cplusplus 120f1b34e8dSMatthias Ringwald } 121f1b34e8dSMatthias Ringwald #endif 122f1b34e8dSMatthias Ringwald #endif 123