cbs.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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_CBS_H
  22. #define __OFONO_CBS_H
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. #include <ofono/types.h>
  27. struct ofono_cbs;
  28. typedef void (*ofono_cbs_set_cb_t)(const struct ofono_error *error,
  29. void *data);
  30. struct ofono_cbs_driver {
  31. const char *name;
  32. int (*probe)(struct ofono_cbs *cbs, unsigned int vendor, void *data);
  33. void (*remove)(struct ofono_cbs *cbs);
  34. void (*set_topics)(struct ofono_cbs *cbs, const char *topics,
  35. ofono_cbs_set_cb_t cb, void *data);
  36. void (*clear_topics)(struct ofono_cbs *cbs,
  37. ofono_cbs_set_cb_t cb, void *data);
  38. };
  39. void ofono_cbs_notify(struct ofono_cbs *cbs, const unsigned char *pdu, int len);
  40. int ofono_cbs_driver_register(const struct ofono_cbs_driver *d);
  41. void ofono_cbs_driver_unregister(const struct ofono_cbs_driver *d);
  42. struct ofono_cbs *ofono_cbs_create(struct ofono_modem *modem,
  43. unsigned int vendor,
  44. const char *driver, void *data);
  45. void ofono_cbs_register(struct ofono_cbs *cbs);
  46. void ofono_cbs_remove(struct ofono_cbs *cbs);
  47. void ofono_cbs_set_data(struct ofono_cbs *cbs, void *data);
  48. void *ofono_cbs_get_data(struct ofono_cbs *cbs);
  49. #ifdef __cplusplus
  50. }
  51. #endif
  52. #endif /* __OFONO_CBS_H */