location-reporting.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. *
  3. * oFono - Open Source Telephony
  4. *
  5. * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
  6. * Copyright (C) 2010 ProFUSION embedded systems.
  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_LOCATION_REPORTING_H
  23. #define __OFONO_LOCATION_REPORTING_H
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. #include <ofono/types.h>
  28. struct ofono_location_reporting;
  29. enum ofono_location_reporting_type {
  30. OFONO_LOCATION_REPORTING_TYPE_NMEA = 0,
  31. };
  32. typedef void (*ofono_location_reporting_enable_cb_t)(
  33. const struct ofono_error *error,
  34. int fd, void *data);
  35. typedef void (*ofono_location_reporting_disable_cb_t)(
  36. const struct ofono_error *error,
  37. void *data);
  38. struct ofono_location_reporting_driver {
  39. const char *name;
  40. enum ofono_location_reporting_type type;
  41. int (*probe)(struct ofono_location_reporting *lr, unsigned int vendor,
  42. void *data);
  43. void (*remove)(struct ofono_location_reporting *lr);
  44. void (*enable)(struct ofono_location_reporting *lr,
  45. ofono_location_reporting_enable_cb_t cb, void *data);
  46. void (*disable)(struct ofono_location_reporting *lr,
  47. ofono_location_reporting_disable_cb_t cb, void *data);
  48. };
  49. int ofono_location_reporting_driver_register(
  50. const struct ofono_location_reporting_driver *d);
  51. void ofono_location_reporting_driver_unregister(
  52. const struct ofono_location_reporting_driver *d);
  53. struct ofono_location_reporting *ofono_location_reporting_create(
  54. struct ofono_modem *modem,
  55. unsigned int vendor,
  56. const char *driver, void *data);
  57. void ofono_location_reporting_register(struct ofono_location_reporting *lr);
  58. void ofono_location_reporting_remove(struct ofono_location_reporting *lr);
  59. void ofono_location_reporting_set_data(struct ofono_location_reporting *lr,
  60. void *data);
  61. void *ofono_location_reporting_get_data(struct ofono_location_reporting *lr);
  62. struct ofono_modem *ofono_location_reporting_get_modem(
  63. struct ofono_location_reporting *lr);
  64. #ifdef __cplusplus
  65. }
  66. #endif
  67. #endif /* __OFONO_LOCATION_REPORTING_H */