devinfo.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. *
  3. * oFono - Open Telephony stack for Linux
  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_DEVINFO_H
  22. #define __OFONO_DEVINFO_H
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. #include <ofono/types.h>
  27. struct ofono_devinfo;
  28. typedef void (*ofono_devinfo_query_cb_t)(const struct ofono_error *error,
  29. const char *attribute, void *data);
  30. struct ofono_devinfo_driver {
  31. const char *name;
  32. int (*probe)(struct ofono_devinfo *info, unsigned int vendor,
  33. void *data);
  34. void (*remove)(struct ofono_devinfo *info);
  35. void (*query_manufacturer)(struct ofono_devinfo *info,
  36. ofono_devinfo_query_cb_t cb, void *data);
  37. void (*query_serial)(struct ofono_devinfo *info,
  38. ofono_devinfo_query_cb_t cb, void *data);
  39. void (*query_model)(struct ofono_devinfo *info,
  40. ofono_devinfo_query_cb_t cb, void *data);
  41. void (*query_revision)(struct ofono_devinfo *info,
  42. ofono_devinfo_query_cb_t cb, void *data);
  43. void (*query_svn)(struct ofono_devinfo *info,
  44. ofono_devinfo_query_cb_t cb, void *data);
  45. };
  46. int ofono_devinfo_driver_register(const struct ofono_devinfo_driver *d);
  47. void ofono_devinfo_driver_unregister(const struct ofono_devinfo_driver *d);
  48. struct ofono_devinfo *ofono_devinfo_create(struct ofono_modem *modem,
  49. unsigned int vendor,
  50. const char *driver,
  51. void *data);
  52. void ofono_devinfo_register(struct ofono_devinfo *info);
  53. void ofono_devinfo_remove(struct ofono_devinfo *info);
  54. void ofono_devinfo_set_data(struct ofono_devinfo *info, void *data);
  55. void *ofono_devinfo_get_data(struct ofono_devinfo *info);
  56. #ifdef __cplusplus
  57. }
  58. #endif
  59. #endif /* __OFONO_MODEM_INFO_H */