1
0

api_ssdp.h 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. #pragma once
  2. #include "service/types.h"
  3. #include "nx/nxuri.h"
  4. #include "nx/nxstring.h"
  5. #include "cb_ssdp.h"
  6. // {A2EF43B6-5044-4D44-AE38-71C2CE20587B}
  7. static const GUID ssdp_api_service_guid =
  8. { 0xa2ef43b6, 0x5044, 0x4d44, { 0xae, 0x38, 0x71, 0xc2, 0xce, 0x20, 0x58, 0x7b } };
  9. class api_ssdp : public Wasabi2::Dispatchable
  10. {
  11. protected:
  12. api_ssdp() : Wasabi2::Dispatchable(DISPATCHABLE_VERSION) {}
  13. ~api_ssdp() {}
  14. public:
  15. static GUID GetServiceType() { return SVC_TYPE_UNIQUE; }
  16. static GUID GetServiceGUID() { return ssdp_api_service_guid; }
  17. int RegisterService(nx_uri_t location, nx_string_t st, nx_string_t usn) { return SSDP_RegisterService(location, st, usn); }
  18. int RegisterCallback(cb_ssdp *callback) { return SSDP_RegisterCallback(callback); }
  19. int UnregisterCallback(cb_ssdp *callback) { return SSDP_UnregisterCallback(callback); }
  20. int Search(nx_string_t st) { return SSDP_Search(st); }
  21. private:
  22. virtual int WASABICALL SSDP_RegisterService(nx_uri_t location, nx_string_t st, nx_string_t usn)=0;
  23. virtual int WASABICALL SSDP_RegisterCallback(cb_ssdp *callback)=0;
  24. virtual int WASABICALL SSDP_UnregisterCallback(cb_ssdp *callback)=0;
  25. virtual int WASABICALL SSDP_Search(nx_string_t st)=0;
  26. enum
  27. {
  28. DISPATCHABLE_VERSION=0,
  29. };
  30. };