pando_object.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*******************************************************
  2. * File name: pando_object.h
  3. * Author: razr
  4. * Versions: 1.0
  5. * Description: pando object interfaces
  6. * History:
  7. * 1.Date: Sep 11, 2015
  8. * Author: razr
  9. * Modification:
  10. *********************************************************/
  11. #ifndef PANDO_OBJECTS_H_
  12. #define PANDO_OBJECTS_H_
  13. //#include "pando_types.h"
  14. #include "../protocol/sub_device_protocol.h"
  15. typedef struct TLVs PARAMS;
  16. typedef struct {
  17. uint8_t no;
  18. void (*pack)(PARAMS*);
  19. void (*unpack)(PARAMS*);
  20. }pando_object;
  21. typedef struct {
  22. uint8_t cur;
  23. }pando_objects_iterator;
  24. /******************************************************************************
  25. * FunctionName : register_pando_object.
  26. * Description : register a pando object to framework.
  27. * Parameters : a pando object.
  28. * Returns : none.
  29. *******************************************************************************/
  30. void register_pando_object(pando_object object);
  31. /******************************************************************************
  32. * FunctionName : find_pando_object.
  33. * Description : find a pando object by object no.
  34. * Parameters : the object no.
  35. * Returns : the pando object of specified no, NULL if not found.
  36. *******************************************************************************/
  37. pando_object* find_pando_object(uint8_t no);
  38. /******************************************************************************
  39. * FunctionName : create_pando_objects_iterator, delete_pando_objects_iterator.
  40. * Description : iterator for pando object list.
  41. * Parameters : .
  42. * Returns : .
  43. *******************************************************************************/
  44. pando_objects_iterator* create_pando_objects_iterator(void);
  45. void delete_pando_objects_iterator(pando_objects_iterator*);
  46. pando_object* pando_objects_iterator_next(pando_objects_iterator*);
  47. #endif /* PANDO_OBJECTS_H_ */