handsfree.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. *
  3. * oFono - Open Source Telephony
  4. *
  5. * Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
  6. * Copyright (C) 2011 BMW Car IT GmbH. All rights reserved.
  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 version 2 as
  10. * published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  20. *
  21. */
  22. #ifndef __OFONO_HANDSFREE_H
  23. #define __OFONO_HANDSFREE_H
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. #include <ofono/types.h>
  28. struct ofono_handsfree;
  29. typedef void (*ofono_handsfree_cb_t)(const struct ofono_error *error,
  30. void *data);
  31. typedef void (*ofono_handsfree_phone_cb_t)(const struct ofono_error *error,
  32. const struct ofono_phone_number *number,
  33. void *data);
  34. typedef void (*ofono_handsfree_cnum_query_cb_t)(const struct ofono_error *error,
  35. int total,
  36. const struct ofono_phone_number *numbers,
  37. void *data);
  38. struct ofono_handsfree_driver {
  39. const char *name;
  40. int (*probe)(struct ofono_handsfree *hf, unsigned int vendor,
  41. void *data);
  42. void (*remove)(struct ofono_handsfree *hf);
  43. void (*cnum_query)(struct ofono_handsfree *hf,
  44. ofono_handsfree_cnum_query_cb_t cb, void *data);
  45. void (*request_phone_number) (struct ofono_handsfree *hf,
  46. ofono_handsfree_phone_cb_t cb,
  47. void *data);
  48. void (*voice_recognition)(struct ofono_handsfree *hf,
  49. ofono_bool_t enabled,
  50. ofono_handsfree_cb_t cb, void *data);
  51. void (*disable_nrec)(struct ofono_handsfree *hf,
  52. ofono_handsfree_cb_t cb, void *data);
  53. void (*hf_indicator)(struct ofono_handsfree *hf,
  54. unsigned short indicator, unsigned int value,
  55. ofono_handsfree_cb_t cb, void *data);
  56. };
  57. void ofono_handsfree_set_ag_features(struct ofono_handsfree *hf,
  58. unsigned int ag_features);
  59. void ofono_handsfree_set_ag_chld_features(struct ofono_handsfree *hf,
  60. unsigned int ag_chld_features);
  61. void ofono_handsfree_set_inband_ringing(struct ofono_handsfree *hf,
  62. ofono_bool_t enabled);
  63. void ofono_handsfree_voice_recognition_notify(struct ofono_handsfree *hf,
  64. ofono_bool_t enabled);
  65. void ofono_handsfree_set_hf_indicators(struct ofono_handsfree *hf,
  66. const unsigned short *indicators,
  67. unsigned int num);
  68. void ofono_handsfree_hf_indicator_active_notify(struct ofono_handsfree *hf,
  69. unsigned int indicator,
  70. ofono_bool_t active);
  71. void ofono_handsfree_battchg_notify(struct ofono_handsfree *hf,
  72. unsigned char level);
  73. int ofono_handsfree_driver_register(const struct ofono_handsfree_driver *d);
  74. void ofono_handsfree_driver_unregister(
  75. const struct ofono_handsfree_driver *d);
  76. struct ofono_handsfree *ofono_handsfree_create(struct ofono_modem *modem,
  77. unsigned int vendor, const char *driver, void *data);
  78. void ofono_handsfree_register(struct ofono_handsfree *hf);
  79. void ofono_handsfree_remove(struct ofono_handsfree *hf);
  80. void ofono_handsfree_set_data(struct ofono_handsfree *hf, void *data);
  81. void *ofono_handsfree_get_data(struct ofono_handsfree *hf);
  82. #ifdef __cplusplus
  83. }
  84. #endif
  85. #endif /* __OFONO_HANDSFREE_H */