Skip to content

Commit

Permalink
Minor change to satisfy -Wall and -Wextra
Browse files Browse the repository at this point in the history
  • Loading branch information
yellobyte committed Dec 2, 2024
1 parent 6eab926 commit 702c521
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 38 deletions.
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SoapESP32",
"version": "1.4.0",
"version": "1.4.1",
"platforms":
[
"espressif32"
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=SoapESP32
version=1.4.0
version=1.4.1
author=Thomas Jentzsch
maintainer=Thomas Jentzsch <[email protected]>
sentence=Enables ESP32 devices to scan the local network for DLNA media servers, browse their content and download files.
Expand Down
7 changes: 4 additions & 3 deletions src/SoapESP32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ bool SoapESP32::soapSSDPquery(soapServerVect_t *result, int msWait)
if (i < result->size()) goto CONT;

// new server found: add to list
soapServer_t srv = {.ip = ip, .port = (uint16_t)port, .location = location};
soapServer_t srv = {.ip = ip, .port = (uint16_t)port, .location = location, .friendlyName = "", .controlURL = "" };
result->push_back(srv);
log_i("server added to list ip=%s, port=%d, loc=\"%s\"", ip.toString().c_str(), port, location);
}
Expand Down Expand Up @@ -573,7 +573,7 @@ unsigned int SoapESP32::seekServer(unsigned int scanDuration)
log_i("connected successfully to server %s:%d", rcvd[j].ip.toString().c_str(), rcvd[j].port);

// connection established
srv = { .ip = rcvd[j].ip, .port = rcvd[j].port, .location = rcvd[j].location, .friendlyName = "" };
srv = { .ip = rcvd[j].ip, .port = rcvd[j].port, .location = rcvd[j].location, .friendlyName = "", .controlURL = "" };
gotFriendlyName = false;
gotServiceType = false;

Expand Down Expand Up @@ -1226,7 +1226,8 @@ bool SoapESP32::getServerCapabilities(const unsigned int srv, eCapabilityType ca
}

if (strCaps.length()) {
unsigned int start = 0, index;
unsigned int start = 0;
int index;
String strItem((char *)0);

// itemize the comma separated list of capabilities
Expand Down
67 changes: 34 additions & 33 deletions src/SoapESP32.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,39 +79,40 @@
#define HEADER_EMPTY_LINE "\r\n"

// SOAP tag data
// TEST
//#define SOAP_ENVELOPE_START "<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" " \
// "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\r\n"
//
#define SOAP_ENVELOPE_START "<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" " \
"s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\r\n"
#define SOAP_ENVELOPE_END "</s:Envelope>\r\n\r\n"
#define SOAP_BODY_START "<s:Body>\r\n"
#define SOAP_BODY_END "</s:Body>\r\n"
#define SOAP_BROWSE_START "<u:Browse xmlns:u=\"urn:schemas-upnp-org:service:ContentDirectory:1\">\r\n"
#define SOAP_BROWSE_END "</u:Browse>\r\n"
#define SOAP_SEARCH_START "<u:Search xmlns:u=\"urn:schemas-upnp-org:service:ContentDirectory:1\">\r\n"
#define SOAP_SEARCH_END "</u:Search>\r\n"
#define SOAP_GETSEARCHCAP_START "<u:GetSearchCapabilities xmlns:u=\"urn:schemas-upnp-org:service:ContentDirectory:1\">\r\n"
#define SOAP_GETSEARCHCAP_END "</u:GetSearchCapabilities>\r\n"
#define SOAP_GETSORTCAP_START "<u:GetSortCapabilities xmlns:u=\"urn:schemas-upnp-org:service:ContentDirectory:1\">\r\n"
#define SOAP_GETSORTCAP_END "</u:GetSortCapabilities>\r\n"
#define SOAP_OBJECTID_START "<ObjectID>"
#define SOAP_OBJECTID_END "</ObjectID>\r\n"
#define SOAP_CONTAINERID_START "<ContainerID>"
#define SOAP_CONTAINERID_END "</ContainerID>\r\n"
#define SOAP_BROWSEFLAG_START "<BrowseFlag>"
#define SOAP_BROWSEFLAG_END "</BrowseFlag>\r\n"
#define SOAP_FILTER_START "<Filter>"
#define SOAP_FILTER_END "</Filter>\r\n"
#define SOAP_STARTINGINDEX_START "<StartingIndex>"
#define SOAP_STARTINGINDEX_END "</StartingIndex>\r\n"
#define SOAP_REQUESTEDCOUNT_START "<RequestedCount>"
#define SOAP_REQUESTEDCOUNT_END "</RequestedCount>\r\n"
#define SOAP_SEARCHCRITERIA_START "<SearchCriteria>"
#define SOAP_SEARCHCRITERIA_END "</SearchCriteria>\r\n"
#define SOAP_SORTCRITERIA_START "<SortCriteria>"
#define SOAP_SORTCRITERIA_END "</SortCriteria>\r\n"
#if 0 // TEST
#define SOAP_ENVELOPE_START "<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" " \
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\r\n"
#else
#define SOAP_ENVELOPE_START "<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" " \
"s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\r\n"
#endif
#define SOAP_ENVELOPE_END "</s:Envelope>\r\n\r\n"
#define SOAP_BODY_START "<s:Body>\r\n"
#define SOAP_BODY_END "</s:Body>\r\n"
#define SOAP_BROWSE_START "<u:Browse xmlns:u=\"urn:schemas-upnp-org:service:ContentDirectory:1\">\r\n"
#define SOAP_BROWSE_END "</u:Browse>\r\n"
#define SOAP_SEARCH_START "<u:Search xmlns:u=\"urn:schemas-upnp-org:service:ContentDirectory:1\">\r\n"
#define SOAP_SEARCH_END "</u:Search>\r\n"
#define SOAP_GETSEARCHCAP_START "<u:GetSearchCapabilities xmlns:u=\"urn:schemas-upnp-org:service:ContentDirectory:1\">\r\n"
#define SOAP_GETSEARCHCAP_END "</u:GetSearchCapabilities>\r\n"
#define SOAP_GETSORTCAP_START "<u:GetSortCapabilities xmlns:u=\"urn:schemas-upnp-org:service:ContentDirectory:1\">\r\n"
#define SOAP_GETSORTCAP_END "</u:GetSortCapabilities>\r\n"
#define SOAP_OBJECTID_START "<ObjectID>"
#define SOAP_OBJECTID_END "</ObjectID>\r\n"
#define SOAP_CONTAINERID_START "<ContainerID>"
#define SOAP_CONTAINERID_END "</ContainerID>\r\n"
#define SOAP_BROWSEFLAG_START "<BrowseFlag>"
#define SOAP_BROWSEFLAG_END "</BrowseFlag>\r\n"
#define SOAP_FILTER_START "<Filter>"
#define SOAP_FILTER_END "</Filter>\r\n"
#define SOAP_STARTINGINDEX_START "<StartingIndex>"
#define SOAP_STARTINGINDEX_END "</StartingIndex>\r\n"
#define SOAP_REQUESTEDCOUNT_START "<RequestedCount>"
#define SOAP_REQUESTEDCOUNT_END "</RequestedCount>\r\n"
#define SOAP_SEARCHCRITERIA_START "<SearchCriteria>"
#define SOAP_SEARCHCRITERIA_END "</SearchCriteria>\r\n"
#define SOAP_SORTCRITERIA_START "<SortCriteria>"
#define SOAP_SORTCRITERIA_END "</SortCriteria>\r\n"

// UPnP/SOAP browse/search default parameters
#define UPNP_URN_SCHEMA_CONTENT_DIRECTORY SSDP_SERVICE_TYPE_CD
Expand Down

0 comments on commit 702c521

Please sign in to comment.