cdma-voicecall.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. *
  3. * oFono - Open Source Telephony
  4. *
  5. * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  19. *
  20. */
  21. #ifndef __OFONO_CDMA_VOICECALL_H
  22. #define __OFONO_CDMA_VOICECALL_H
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. #include <ofono/types.h>
  27. struct ofono_cdma_voicecall;
  28. enum cdma_call_status {
  29. CDMA_CALL_STATUS_ACTIVE,
  30. CDMA_CALL_STATUS_DIALING,
  31. CDMA_CALL_STATUS_ALERTING,
  32. CDMA_CALL_STATUS_INCOMING,
  33. CDMA_CALL_STATUS_DISCONNECTED
  34. };
  35. typedef void (*ofono_cdma_voicecall_cb_t)(const struct ofono_error *error,
  36. void *data);
  37. /* Voice call related functionality, including AT+CDV, AT+CHV */
  38. struct ofono_cdma_voicecall_driver {
  39. const char *name;
  40. int (*probe)(struct ofono_cdma_voicecall *vc,
  41. unsigned int vendor, void *data);
  42. void (*remove)(struct ofono_cdma_voicecall *vc);
  43. void (*dial)(struct ofono_cdma_voicecall *vc,
  44. const struct ofono_cdma_phone_number *number,
  45. ofono_cdma_voicecall_cb_t cb, void *data);
  46. /* Hangs up active, dialing, alerting or incoming calls */
  47. void (*hangup)(struct ofono_cdma_voicecall *vc,
  48. ofono_cdma_voicecall_cb_t cb, void *data);
  49. void (*answer)(struct ofono_cdma_voicecall *vc,
  50. ofono_cdma_voicecall_cb_t cb, void *data);
  51. void (*send_flash)(struct ofono_cdma_voicecall *vc, const char *string,
  52. ofono_cdma_voicecall_cb_t cb, void *data);
  53. void (*send_tones)(struct ofono_cdma_voicecall *vc, const char *tones,
  54. ofono_cdma_voicecall_cb_t cb, void *data);
  55. };
  56. void ofono_cdma_voicecall_disconnected(struct ofono_cdma_voicecall *vc,
  57. enum ofono_disconnect_reason reason,
  58. const struct ofono_error *error);
  59. int ofono_cdma_voicecall_driver_register(
  60. const struct ofono_cdma_voicecall_driver *d);
  61. void ofono_cdma_voicecall_driver_unregister(
  62. const struct ofono_cdma_voicecall_driver *d);
  63. struct ofono_cdma_voicecall *ofono_cdma_voicecall_create(
  64. struct ofono_modem *modem,
  65. unsigned int vendor,
  66. const char *driver, void *data);
  67. void ofono_cdma_voicecall_register(struct ofono_cdma_voicecall *vc);
  68. void ofono_cdma_voicecall_remove(struct ofono_cdma_voicecall *vc);
  69. void ofono_cdma_voicecall_set_data(struct ofono_cdma_voicecall *vc,
  70. void *data);
  71. void *ofono_cdma_voicecall_get_data(struct ofono_cdma_voicecall *vc);
  72. #ifdef __cplusplus
  73. }
  74. #endif
  75. #endif /* __OFONO_CDMA_VOICECALL_H */