sms.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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_SMS_H
  22. #define __OFONO_SMS_H
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. #include <ofono/types.h>
  27. struct ofono_sms;
  28. typedef void (*ofono_sms_sca_query_cb_t)(const struct ofono_error *error,
  29. const struct ofono_phone_number *ph,
  30. void *data);
  31. typedef void (*ofono_sms_submit_cb_t)(const struct ofono_error *error, int mr,
  32. void *data);
  33. typedef void (*ofono_sms_sca_set_cb_t)(const struct ofono_error *error,
  34. void *data);
  35. typedef void (*ofono_sms_bearer_set_cb_t)(const struct ofono_error *error,
  36. void *data);
  37. typedef void (*ofono_sms_bearer_query_cb_t)(const struct ofono_error *error,
  38. int bearer, void *data);
  39. struct ofono_sms_driver {
  40. const char *name;
  41. int (*probe)(struct ofono_sms *sms, unsigned int vendor, void *data);
  42. void (*remove)(struct ofono_sms *sms);
  43. void (*sca_query)(struct ofono_sms *sms, ofono_sms_sca_query_cb_t cb,
  44. void *data);
  45. void (*sca_set)(struct ofono_sms *sms,
  46. const struct ofono_phone_number *sca,
  47. ofono_sms_sca_set_cb_t cb, void *data);
  48. void (*submit)(struct ofono_sms *sms, const unsigned char *pdu,
  49. int pdu_len, int tpdu_len, int mms,
  50. ofono_sms_submit_cb_t cb, void *data);
  51. void (*bearer_query)(struct ofono_sms *sms,
  52. ofono_sms_bearer_query_cb_t, void *data);
  53. void (*bearer_set)(struct ofono_sms *sms, int bearer,
  54. ofono_sms_bearer_set_cb_t, void *data);
  55. };
  56. void ofono_sms_deliver_notify(struct ofono_sms *sms, const unsigned char *pdu,
  57. int len, int tpdu_len);
  58. void ofono_sms_status_notify(struct ofono_sms *sms, const unsigned char *pdu,
  59. int len, int tpdu_len);
  60. int ofono_sms_driver_register(const struct ofono_sms_driver *d);
  61. void ofono_sms_driver_unregister(const struct ofono_sms_driver *d);
  62. struct ofono_sms *ofono_sms_create(struct ofono_modem *modem,
  63. unsigned int vendor,
  64. const char *driver, void *data);
  65. void ofono_sms_register(struct ofono_sms *sms);
  66. void ofono_sms_remove(struct ofono_sms *sms);
  67. void ofono_sms_set_data(struct ofono_sms *sms, void *data);
  68. void *ofono_sms_get_data(struct ofono_sms *sms);
  69. #ifdef __cplusplus
  70. }
  71. #endif
  72. #endif /* __OFONO_SMS_H */