174386ee0SMatthias Ringwald /* 274386ee0SMatthias Ringwald * Copyright (C) 2014 BlueKitchen GmbH 374386ee0SMatthias Ringwald * 474386ee0SMatthias Ringwald * Redistribution and use in source and binary forms, with or without 574386ee0SMatthias Ringwald * modification, are permitted provided that the following conditions 674386ee0SMatthias Ringwald * are met: 774386ee0SMatthias Ringwald * 874386ee0SMatthias Ringwald * 1. Redistributions of source code must retain the above copyright 974386ee0SMatthias Ringwald * notice, this list of conditions and the following disclaimer. 1074386ee0SMatthias Ringwald * 2. Redistributions in binary form must reproduce the above copyright 1174386ee0SMatthias Ringwald * notice, this list of conditions and the following disclaimer in the 1274386ee0SMatthias Ringwald * documentation and/or other materials provided with the distribution. 1374386ee0SMatthias Ringwald * 3. Neither the name of the copyright holders nor the names of 1474386ee0SMatthias Ringwald * contributors may be used to endorse or promote products derived 1574386ee0SMatthias Ringwald * from this software without specific prior written permission. 1674386ee0SMatthias Ringwald * 4. Any redistribution, use, or modification is done solely for 1774386ee0SMatthias Ringwald * personal benefit and not for any commercial purpose or for 1874386ee0SMatthias Ringwald * monetary gain. 1974386ee0SMatthias Ringwald * 2074386ee0SMatthias Ringwald * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS 2174386ee0SMatthias Ringwald * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 2274386ee0SMatthias Ringwald * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 2374386ee0SMatthias Ringwald * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MATTHIAS 2474386ee0SMatthias Ringwald * RINGWALD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 2574386ee0SMatthias Ringwald * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 2674386ee0SMatthias Ringwald * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 2774386ee0SMatthias Ringwald * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 2874386ee0SMatthias Ringwald * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 2974386ee0SMatthias Ringwald * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 3074386ee0SMatthias Ringwald * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3174386ee0SMatthias Ringwald * SUCH DAMAGE. 3274386ee0SMatthias Ringwald * 3374386ee0SMatthias Ringwald * Please inquire about commercial licensing options at 3474386ee0SMatthias Ringwald * [email protected] 3574386ee0SMatthias Ringwald * 3674386ee0SMatthias Ringwald */ 3774386ee0SMatthias Ringwald 3874386ee0SMatthias Ringwald // ***************************************************************************** 3974386ee0SMatthias Ringwald // 409cae807eSMatthias Ringwald // GSM model 4174386ee0SMatthias Ringwald // 4274386ee0SMatthias Ringwald // ***************************************************************************** 4374386ee0SMatthias Ringwald 4474386ee0SMatthias Ringwald 4574386ee0SMatthias Ringwald #ifndef BTSTACK_HFP_GSM_MODEL_H 4674386ee0SMatthias Ringwald #define BTSTACK_HFP_GSM_MODEL_H 4774386ee0SMatthias Ringwald 4874386ee0SMatthias Ringwald #include "hci.h" 49*efda0b48SMatthias Ringwald #include "sdp_client_rfcomm.h" 5074386ee0SMatthias Ringwald #include "hfp.h" 5174386ee0SMatthias Ringwald 5274386ee0SMatthias Ringwald #if defined __cplusplus 5374386ee0SMatthias Ringwald extern "C" { 5474386ee0SMatthias Ringwald #endif 5574386ee0SMatthias Ringwald 5674386ee0SMatthias Ringwald /* API_START */ 579cae807eSMatthias Ringwald typedef struct { 5866a048abSMatthias Ringwald uint8_t used_slot; 599cae807eSMatthias Ringwald hfp_enhanced_call_status_t enhanced_status; 6066a048abSMatthias Ringwald hfp_enhanced_call_dir_t direction; 619cae807eSMatthias Ringwald hfp_enhanced_call_mode_t mode; 629cae807eSMatthias Ringwald hfp_enhanced_call_mpty_t mpty; 639cae807eSMatthias Ringwald // TODO: sort on drop call, so that index corresponds to table index 649cae807eSMatthias Ringwald int index; 659cae807eSMatthias Ringwald uint8_t clip_type; 669cae807eSMatthias Ringwald char clip_number[25]; 679cae807eSMatthias Ringwald } hfp_gsm_call_t; 689cae807eSMatthias Ringwald 699cae807eSMatthias Ringwald hfp_callheld_status_t hfp_gsm_callheld_status(void); 709cae807eSMatthias Ringwald hfp_call_status_t hfp_gsm_call_status(void); 719cae807eSMatthias Ringwald hfp_callsetup_status_t hfp_gsm_callsetup_status(void); 729cae807eSMatthias Ringwald 739cae807eSMatthias Ringwald int hfp_gsm_get_number_of_calls(void); 749cae807eSMatthias Ringwald char * hfp_gsm_last_dialed_number(void); 759cae807eSMatthias Ringwald void hfp_gsm_clear_last_dialed_number(void); 769cae807eSMatthias Ringwald 779cae807eSMatthias Ringwald 789cae807eSMatthias Ringwald hfp_gsm_call_t * hfp_gsm_call(int index); 7974386ee0SMatthias Ringwald 80d210d9c4SMatthias Ringwald int hfp_gsm_call_possible(void); 81d210d9c4SMatthias Ringwald 829cae807eSMatthias Ringwald uint8_t hfp_gsm_clip_type(void); 839cae807eSMatthias Ringwald char * hfp_gsm_clip_number(void); 84d0c20769SMatthias Ringwald 85d210d9c4SMatthias Ringwald void hfp_gsm_init(void); 86d210d9c4SMatthias Ringwald 87d0c20769SMatthias Ringwald void hfp_gsm_handle_event_with_clip(hfp_ag_call_event_t event, uint8_t type, const char * number); 88d0c20769SMatthias Ringwald void hfp_gsm_handle_event_with_call_index(hfp_ag_call_event_t event, uint8_t index); 899cae807eSMatthias Ringwald void hfp_gsm_handle_event_with_call_number(hfp_ag_call_event_t event, const char * number); 9074386ee0SMatthias Ringwald void hfp_gsm_handle_event(hfp_ag_call_event_t event); 9174386ee0SMatthias Ringwald 9274386ee0SMatthias Ringwald /* API_END */ 9374386ee0SMatthias Ringwald 9474386ee0SMatthias Ringwald #if defined __cplusplus 9574386ee0SMatthias Ringwald } 9674386ee0SMatthias Ringwald #endif 9774386ee0SMatthias Ringwald 9874386ee0SMatthias Ringwald #endif