Arduino DLNA Server
DLNAServiceInfo.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "http/HttpServer.h"
4 
5 #define DLNA_MAX_URL_LEN 120
6 
7 namespace tiny_dlna {
8 
9 typedef void (*http_callback)(HttpServer* server, const char* requestPath,
11 
17  public:
18  DLNAServiceInfo(bool flag = true) { is_active = flag; }
19  void setup(const char* type, const char* id, const char* scp,
20  http_callback cbScp, const char* control, http_callback cbControl,
21  const char* event, http_callback cbEvent) {
22  DlnaLogger.log(DlnaInfo, "setting up: %s | %s | %s", scp, control, event);
23 
24  service_type = type;
25  service_id = id;
26  scpd_url = scp;
27  control_url = control;
28  event_sub_url = event;
29  scp_cb = cbScp;
30  control_cb = cbControl;
31  event_sub_cb = cbEvent;
32  }
33  const char* service_type = nullptr;
34  const char* service_id = nullptr;
35  const char* scpd_url = nullptr;
36  const char* control_url = nullptr;
37  const char* event_sub_url = nullptr;
38  http_callback scp_cb = nullptr;
41  bool is_active = true;
42  operator bool() { return is_active; }
43 };
44 
45 } // namespace tiny_dlna
Attributes needed for the DLNA Service Definition.
Definition: DLNAServiceInfo.h:16
const char * scpd_url
Definition: DLNAServiceInfo.h:35
http_callback control_cb
Definition: DLNAServiceInfo.h:39
const char * service_type
Definition: DLNAServiceInfo.h:33
http_callback scp_cb
Definition: DLNAServiceInfo.h:38
void setup(const char *type, const char *id, const char *scp, http_callback cbScp, const char *control, http_callback cbControl, const char *event, http_callback cbEvent)
Definition: DLNAServiceInfo.h:19
DLNAServiceInfo(bool flag=true)
Definition: DLNAServiceInfo.h:18
const char * service_id
Definition: DLNAServiceInfo.h:34
const char * control_url
Definition: DLNAServiceInfo.h:36
http_callback event_sub_cb
Definition: DLNAServiceInfo.h:40
bool is_active
Definition: DLNAServiceInfo.h:41
const char * event_sub_url
Definition: DLNAServiceInfo.h:37
Used to register and process callbacks.
Definition: HttpRequestHandlerLine.h:19
A Simple Header only implementation of Http Server that allows the registration of callback functions...
Definition: HttpServer.h:24
void log(DlnaLogLevel current_level, const char *fmt...)
Print log message.
Definition: Logger.h:40
Definition: Allocator.h:6
void(* http_callback)(HttpServer *server, const char *requestPath, HttpRequestHandlerLine *hl)
Definition: DLNAServiceInfo.h:9
@ DlnaInfo
Definition: Logger.h:16
LoggerClass DlnaLogger
Definition: Logger.cpp:5