stk.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. *
  3. * oFono - Open Source Telephony
  4. *
  5. * Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
  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_STK_H
  22. #define __OFONO_STK_H
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. #include <ofono/types.h>
  27. struct ofono_stk;
  28. typedef void (*ofono_stk_envelope_cb_t)(const struct ofono_error *error,
  29. const unsigned char *rdata,
  30. int length, void *data);
  31. typedef void (*ofono_stk_generic_cb_t)(const struct ofono_error *error,
  32. void *data);
  33. struct ofono_stk_driver {
  34. const char *name;
  35. int (*probe)(struct ofono_stk *stk, unsigned int vendor, void *data);
  36. void (*remove)(struct ofono_stk *stk);
  37. void (*envelope)(struct ofono_stk *stk,
  38. int length, const unsigned char *command,
  39. ofono_stk_envelope_cb_t cb, void *data);
  40. void (*terminal_response)(struct ofono_stk *stk,
  41. int length, const unsigned char *resp,
  42. ofono_stk_generic_cb_t cb, void *data);
  43. void (*user_confirmation)(struct ofono_stk *stk, ofono_bool_t confirm);
  44. };
  45. int ofono_stk_driver_register(const struct ofono_stk_driver *d);
  46. void ofono_stk_driver_unregister(const struct ofono_stk_driver *d);
  47. struct ofono_stk *ofono_stk_create(struct ofono_modem *modem,
  48. unsigned int vendor,
  49. const char *driver, void *data);
  50. void ofono_stk_register(struct ofono_stk *stk);
  51. void ofono_stk_remove(struct ofono_stk *stk);
  52. void ofono_stk_set_data(struct ofono_stk *stk, void *data);
  53. void *ofono_stk_get_data(struct ofono_stk *stk);
  54. void ofono_stk_proactive_command_notify(struct ofono_stk *stk,
  55. int length, const unsigned char *pdu);
  56. void ofono_stk_proactive_session_end_notify(struct ofono_stk *stk);
  57. void ofono_stk_proactive_command_handled_notify(struct ofono_stk *stk,
  58. int length,
  59. const unsigned char *pdu);
  60. #ifdef __cplusplus
  61. }
  62. #endif
  63. #endif /* __OFONO_STK_H */