forked from espressif/esp-protocols
Deploying to gh-pages from @ espressif/esp-protocols@467fec5c9b 🚀
This commit is contained in:
1 parent
4b9ce98431
commit
bbf20fdfa0
56 files changed
+1383
-975
No files matched your search
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
# Sphinx build info version 1
|
# Sphinx build info version 1
|
||||||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
|
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
|
||||||
config: bdb9c4058bb57ea76ea7b85c00a2c40f
|
config: 2bccfe8e104e823c5c6f1fd9ba510b65
|
||||||
tags: 549b3d6d0415232fb7e35403b330ff49
|
tags: 549b3d6d0415232fb7e35403b330ff49
|
||||||
+11
-119
@@ -10,6 +10,13 @@
|
|||||||
*/
|
*/
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([
|
||||||
|
"TEXTAREA",
|
||||||
|
"INPUT",
|
||||||
|
"SELECT",
|
||||||
|
"BUTTON",
|
||||||
|
]);
|
||||||
|
|
||||||
const _ready = (callback) => {
|
const _ready = (callback) => {
|
||||||
if (document.readyState !== "loading") {
|
if (document.readyState !== "loading") {
|
||||||
callback();
|
callback();
|
||||||
@@ -18,73 +25,11 @@ const _ready = (callback) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* highlight a given string on a node by wrapping it in
|
|
||||||
* span elements with the given class name.
|
|
||||||
*/
|
|
||||||
const _highlight = (node, addItems, text, className) => {
|
|
||||||
if (node.nodeType === Node.TEXT_NODE) {
|
|
||||||
const val = node.nodeValue;
|
|
||||||
const parent = node.parentNode;
|
|
||||||
const pos = val.toLowerCase().indexOf(text);
|
|
||||||
if (
|
|
||||||
pos >= 0 &&
|
|
||||||
!parent.classList.contains(className) &&
|
|
||||||
!parent.classList.contains("nohighlight")
|
|
||||||
) {
|
|
||||||
let span;
|
|
||||||
|
|
||||||
const closestNode = parent.closest("body, svg, foreignObject");
|
|
||||||
const isInSVG = closestNode && closestNode.matches("svg");
|
|
||||||
if (isInSVG) {
|
|
||||||
span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
||||||
} else {
|
|
||||||
span = document.createElement("span");
|
|
||||||
span.classList.add(className);
|
|
||||||
}
|
|
||||||
|
|
||||||
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
|
|
||||||
parent.insertBefore(
|
|
||||||
span,
|
|
||||||
parent.insertBefore(
|
|
||||||
document.createTextNode(val.substr(pos + text.length)),
|
|
||||||
node.nextSibling
|
|
||||||
)
|
|
||||||
);
|
|
||||||
node.nodeValue = val.substr(0, pos);
|
|
||||||
|
|
||||||
if (isInSVG) {
|
|
||||||
const rect = document.createElementNS(
|
|
||||||
"http://www.w3.org/2000/svg",
|
|
||||||
"rect"
|
|
||||||
);
|
|
||||||
const bbox = parent.getBBox();
|
|
||||||
rect.x.baseVal.value = bbox.x;
|
|
||||||
rect.y.baseVal.value = bbox.y;
|
|
||||||
rect.width.baseVal.value = bbox.width;
|
|
||||||
rect.height.baseVal.value = bbox.height;
|
|
||||||
rect.setAttribute("class", className);
|
|
||||||
addItems.push({ parent: parent, target: rect });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (node.matches && !node.matches("button, select, textarea")) {
|
|
||||||
node.childNodes.forEach((el) => _highlight(el, addItems, text, className));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const _highlightText = (thisNode, text, className) => {
|
|
||||||
let addItems = [];
|
|
||||||
_highlight(thisNode, addItems, text, className);
|
|
||||||
addItems.forEach((obj) =>
|
|
||||||
obj.parent.insertAdjacentElement("beforebegin", obj.target)
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Small JavaScript module for the documentation.
|
* Small JavaScript module for the documentation.
|
||||||
*/
|
*/
|
||||||
const Documentation = {
|
const Documentation = {
|
||||||
init: () => {
|
init: () => {
|
||||||
Documentation.highlightSearchWords();
|
|
||||||
Documentation.initDomainIndexTable();
|
Documentation.initDomainIndexTable();
|
||||||
Documentation.initOnKeyListeners();
|
Documentation.initOnKeyListeners();
|
||||||
},
|
},
|
||||||
@@ -126,51 +71,6 @@ const Documentation = {
|
|||||||
Documentation.LOCALE = catalog.locale;
|
Documentation.LOCALE = catalog.locale;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* highlight the search words provided in the url in the text
|
|
||||||
*/
|
|
||||||
highlightSearchWords: () => {
|
|
||||||
const highlight =
|
|
||||||
new URLSearchParams(window.location.search).get("highlight") || "";
|
|
||||||
const terms = highlight.toLowerCase().split(/\s+/).filter(x => x);
|
|
||||||
if (terms.length === 0) return; // nothing to do
|
|
||||||
|
|
||||||
// There should never be more than one element matching "div.body"
|
|
||||||
const divBody = document.querySelectorAll("div.body");
|
|
||||||
const body = divBody.length ? divBody[0] : document.querySelector("body");
|
|
||||||
window.setTimeout(() => {
|
|
||||||
terms.forEach((term) => _highlightText(body, term, "highlighted"));
|
|
||||||
}, 10);
|
|
||||||
|
|
||||||
const searchBox = document.getElementById("searchbox");
|
|
||||||
if (searchBox === null) return;
|
|
||||||
searchBox.appendChild(
|
|
||||||
document
|
|
||||||
.createRange()
|
|
||||||
.createContextualFragment(
|
|
||||||
'<p class="highlight-link">' +
|
|
||||||
'<a href="javascript:Documentation.hideSearchWords()">' +
|
|
||||||
Documentation.gettext("Hide Search Matches") +
|
|
||||||
"</a></p>"
|
|
||||||
)
|
|
||||||
);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* helper function to hide the search marks again
|
|
||||||
*/
|
|
||||||
hideSearchWords: () => {
|
|
||||||
document
|
|
||||||
.querySelectorAll("#searchbox .highlight-link")
|
|
||||||
.forEach((el) => el.remove());
|
|
||||||
document
|
|
||||||
.querySelectorAll("span.highlighted")
|
|
||||||
.forEach((el) => el.classList.remove("highlighted"));
|
|
||||||
const url = new URL(window.location);
|
|
||||||
url.searchParams.delete("highlight");
|
|
||||||
window.history.replaceState({}, "", url);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* helper function to focus on search bar
|
* helper function to focus on search bar
|
||||||
*/
|
*/
|
||||||
@@ -210,15 +110,11 @@ const Documentation = {
|
|||||||
)
|
)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const blacklistedElements = new Set([
|
|
||||||
"TEXTAREA",
|
|
||||||
"INPUT",
|
|
||||||
"SELECT",
|
|
||||||
"BUTTON",
|
|
||||||
]);
|
|
||||||
document.addEventListener("keydown", (event) => {
|
document.addEventListener("keydown", (event) => {
|
||||||
if (blacklistedElements.has(document.activeElement.tagName)) return; // bail for input elements
|
// bail for input elements
|
||||||
if (event.altKey || event.ctrlKey || event.metaKey) return; // bail with special keys
|
if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return;
|
||||||
|
// bail with special keys
|
||||||
|
if (event.altKey || event.ctrlKey || event.metaKey) return;
|
||||||
|
|
||||||
if (!event.shiftKey) {
|
if (!event.shiftKey) {
|
||||||
switch (event.key) {
|
switch (event.key) {
|
||||||
@@ -240,10 +136,6 @@ const Documentation = {
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "Escape":
|
|
||||||
if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break;
|
|
||||||
Documentation.hideSearchWords();
|
|
||||||
event.preventDefault();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
|
pre { line-height: 125%; }
|
||||||
|
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
|
||||||
|
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
|
||||||
|
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
|
||||||
|
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
|
||||||
.highlight .hll { background-color: #ffffcc }
|
.highlight .hll { background-color: #ffffcc }
|
||||||
.highlight { background: #eeffcc; }
|
.highlight { background: #eeffcc; }
|
||||||
.highlight .c { color: #408090; font-style: italic } /* Comment */
|
.highlight .c { color: #408090; font-style: italic } /* Comment */
|
||||||
.highlight .err { border: 1px solid #FF0000 } /* Error */
|
.highlight .err { border: 1px solid #FF0000 } /* Error */
|
||||||
.highlight .k { color: #007020; font-weight: bold } /* Keyword */
|
.highlight .k { color: #007020; font-weight: bold } /* Keyword */
|
||||||
|
|||||||
+55
-19
@@ -57,14 +57,14 @@ const _removeChildren = (element) => {
|
|||||||
const _escapeRegExp = (string) =>
|
const _escapeRegExp = (string) =>
|
||||||
string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
|
string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
|
||||||
|
|
||||||
const _displayItem = (item, highlightTerms, searchTerms) => {
|
const _displayItem = (item, searchTerms) => {
|
||||||
const docBuilder = DOCUMENTATION_OPTIONS.BUILDER;
|
const docBuilder = DOCUMENTATION_OPTIONS.BUILDER;
|
||||||
const docUrlRoot = DOCUMENTATION_OPTIONS.URL_ROOT;
|
const docUrlRoot = DOCUMENTATION_OPTIONS.URL_ROOT;
|
||||||
const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX;
|
const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX;
|
||||||
const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX;
|
const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX;
|
||||||
const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY;
|
const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY;
|
||||||
|
|
||||||
const [docName, title, anchor, descr] = item;
|
const [docName, title, anchor, descr, score, _filename] = item;
|
||||||
|
|
||||||
let listItem = document.createElement("li");
|
let listItem = document.createElement("li");
|
||||||
let requestUrl;
|
let requestUrl;
|
||||||
@@ -82,10 +82,9 @@ const _displayItem = (item, highlightTerms, searchTerms) => {
|
|||||||
requestUrl = docUrlRoot + docName + docFileSuffix;
|
requestUrl = docUrlRoot + docName + docFileSuffix;
|
||||||
linkUrl = docName + docLinkSuffix;
|
linkUrl = docName + docLinkSuffix;
|
||||||
}
|
}
|
||||||
const params = new URLSearchParams();
|
|
||||||
params.set("highlight", [...highlightTerms].join(" "));
|
|
||||||
let linkEl = listItem.appendChild(document.createElement("a"));
|
let linkEl = listItem.appendChild(document.createElement("a"));
|
||||||
linkEl.href = linkUrl + "?" + params.toString() + anchor;
|
linkEl.href = linkUrl + anchor;
|
||||||
|
linkEl.dataset.score = score;
|
||||||
linkEl.innerHTML = title;
|
linkEl.innerHTML = title;
|
||||||
if (descr)
|
if (descr)
|
||||||
listItem.appendChild(document.createElement("span")).innerHTML =
|
listItem.appendChild(document.createElement("span")).innerHTML =
|
||||||
@@ -96,7 +95,7 @@ const _displayItem = (item, highlightTerms, searchTerms) => {
|
|||||||
.then((data) => {
|
.then((data) => {
|
||||||
if (data)
|
if (data)
|
||||||
listItem.appendChild(
|
listItem.appendChild(
|
||||||
Search.makeSearchSummary(data, searchTerms, highlightTerms)
|
Search.makeSearchSummary(data, searchTerms)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
Search.output.appendChild(listItem);
|
Search.output.appendChild(listItem);
|
||||||
@@ -116,15 +115,14 @@ const _finishSearch = (resultCount) => {
|
|||||||
const _displayNextItem = (
|
const _displayNextItem = (
|
||||||
results,
|
results,
|
||||||
resultCount,
|
resultCount,
|
||||||
highlightTerms,
|
|
||||||
searchTerms
|
searchTerms
|
||||||
) => {
|
) => {
|
||||||
// results left, load the summary and display it
|
// results left, load the summary and display it
|
||||||
// this is intended to be dynamic (don't sub resultsCount)
|
// this is intended to be dynamic (don't sub resultsCount)
|
||||||
if (results.length) {
|
if (results.length) {
|
||||||
_displayItem(results.pop(), highlightTerms, searchTerms);
|
_displayItem(results.pop(), searchTerms);
|
||||||
setTimeout(
|
setTimeout(
|
||||||
() => _displayNextItem(results, resultCount, highlightTerms, searchTerms),
|
() => _displayNextItem(results, resultCount, searchTerms),
|
||||||
5
|
5
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -237,6 +235,12 @@ const Search = {
|
|||||||
* execute search (requires search index to be loaded)
|
* execute search (requires search index to be loaded)
|
||||||
*/
|
*/
|
||||||
query: (query) => {
|
query: (query) => {
|
||||||
|
const filenames = Search._index.filenames;
|
||||||
|
const docNames = Search._index.docnames;
|
||||||
|
const titles = Search._index.titles;
|
||||||
|
const allTitles = Search._index.alltitles;
|
||||||
|
const indexEntries = Search._index.indexentries;
|
||||||
|
|
||||||
// stem the search terms and add them to the correct list
|
// stem the search terms and add them to the correct list
|
||||||
const stemmer = new Stemmer();
|
const stemmer = new Stemmer();
|
||||||
const searchTerms = new Set();
|
const searchTerms = new Set();
|
||||||
@@ -264,6 +268,10 @@ const Search = {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (SPHINX_HIGHLIGHT_ENABLED) { // set in sphinx_highlight.js
|
||||||
|
localStorage.setItem("sphinx_highlight_terms", [...highlightTerms].join(" "))
|
||||||
|
}
|
||||||
|
|
||||||
// console.debug("SEARCH: searching for:");
|
// console.debug("SEARCH: searching for:");
|
||||||
// console.info("required: ", [...searchTerms]);
|
// console.info("required: ", [...searchTerms]);
|
||||||
// console.info("excluded: ", [...excludedTerms]);
|
// console.info("excluded: ", [...excludedTerms]);
|
||||||
@@ -272,6 +280,40 @@ const Search = {
|
|||||||
let results = [];
|
let results = [];
|
||||||
_removeChildren(document.getElementById("search-progress"));
|
_removeChildren(document.getElementById("search-progress"));
|
||||||
|
|
||||||
|
const queryLower = query.toLowerCase();
|
||||||
|
for (const [title, foundTitles] of Object.entries(allTitles)) {
|
||||||
|
if (title.toLowerCase().includes(queryLower) && (queryLower.length >= title.length/2)) {
|
||||||
|
for (const [file, id] of foundTitles) {
|
||||||
|
let score = Math.round(100 * queryLower.length / title.length)
|
||||||
|
results.push([
|
||||||
|
docNames[file],
|
||||||
|
titles[file] !== title ? `${titles[file]} > ${title}` : title,
|
||||||
|
id !== null ? "#" + id : "",
|
||||||
|
null,
|
||||||
|
score,
|
||||||
|
filenames[file],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// search for explicit entries in index directives
|
||||||
|
for (const [entry, foundEntries] of Object.entries(indexEntries)) {
|
||||||
|
if (entry.includes(queryLower) && (queryLower.length >= entry.length/2)) {
|
||||||
|
for (const [file, id] of foundEntries) {
|
||||||
|
let score = Math.round(100 * queryLower.length / entry.length)
|
||||||
|
results.push([
|
||||||
|
docNames[file],
|
||||||
|
titles[file],
|
||||||
|
id ? "#" + id : "",
|
||||||
|
null,
|
||||||
|
score,
|
||||||
|
filenames[file],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// lookup as object
|
// lookup as object
|
||||||
objectTerms.forEach((term) =>
|
objectTerms.forEach((term) =>
|
||||||
results.push(...Search.performObjectSearch(term, objectTerms))
|
results.push(...Search.performObjectSearch(term, objectTerms))
|
||||||
@@ -318,7 +360,7 @@ const Search = {
|
|||||||
// console.info("search results:", Search.lastresults);
|
// console.info("search results:", Search.lastresults);
|
||||||
|
|
||||||
// print the results
|
// print the results
|
||||||
_displayNextItem(results, results.length, highlightTerms, searchTerms);
|
_displayNextItem(results, results.length, searchTerms);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -399,8 +441,8 @@ const Search = {
|
|||||||
// prepare search
|
// prepare search
|
||||||
const terms = Search._index.terms;
|
const terms = Search._index.terms;
|
||||||
const titleTerms = Search._index.titleterms;
|
const titleTerms = Search._index.titleterms;
|
||||||
const docNames = Search._index.docnames;
|
|
||||||
const filenames = Search._index.filenames;
|
const filenames = Search._index.filenames;
|
||||||
|
const docNames = Search._index.docnames;
|
||||||
const titles = Search._index.titles;
|
const titles = Search._index.titles;
|
||||||
|
|
||||||
const scoreMap = new Map();
|
const scoreMap = new Map();
|
||||||
@@ -497,11 +539,9 @@ const Search = {
|
|||||||
/**
|
/**
|
||||||
* helper function to return a node containing the
|
* helper function to return a node containing the
|
||||||
* search summary for a given text. keywords is a list
|
* search summary for a given text. keywords is a list
|
||||||
* of stemmed words, highlightWords is the list of normal, unstemmed
|
* of stemmed words.
|
||||||
* words. the first one is used to find the occurrence, the
|
|
||||||
* latter for highlighting it.
|
|
||||||
*/
|
*/
|
||||||
makeSearchSummary: (htmlText, keywords, highlightWords) => {
|
makeSearchSummary: (htmlText, keywords) => {
|
||||||
const text = Search.htmlToText(htmlText);
|
const text = Search.htmlToText(htmlText);
|
||||||
if (text === "") return null;
|
if (text === "") return null;
|
||||||
|
|
||||||
@@ -519,10 +559,6 @@ const Search = {
|
|||||||
summary.classList.add("context");
|
summary.classList.add("context");
|
||||||
summary.textContent = top + text.substr(startWithContext, 240).trim() + tail;
|
summary.textContent = top + text.substr(startWithContext, 240).trim() + tail;
|
||||||
|
|
||||||
highlightWords.forEach((highlightWord) =>
|
|
||||||
_highlightText(summary, highlightWord, "highlighted")
|
|
||||||
);
|
|
||||||
|
|
||||||
return summary;
|
return summary;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,144 @@
|
|||||||
|
/* Highlighting utilities for Sphinx HTML documentation. */
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
const SPHINX_HIGHLIGHT_ENABLED = true
|
||||||
|
|
||||||
|
/**
|
||||||
|
* highlight a given string on a node by wrapping it in
|
||||||
|
* span elements with the given class name.
|
||||||
|
*/
|
||||||
|
const _highlight = (node, addItems, text, className) => {
|
||||||
|
if (node.nodeType === Node.TEXT_NODE) {
|
||||||
|
const val = node.nodeValue;
|
||||||
|
const parent = node.parentNode;
|
||||||
|
const pos = val.toLowerCase().indexOf(text);
|
||||||
|
if (
|
||||||
|
pos >= 0 &&
|
||||||
|
!parent.classList.contains(className) &&
|
||||||
|
!parent.classList.contains("nohighlight")
|
||||||
|
) {
|
||||||
|
let span;
|
||||||
|
|
||||||
|
const closestNode = parent.closest("body, svg, foreignObject");
|
||||||
|
const isInSVG = closestNode && closestNode.matches("svg");
|
||||||
|
if (isInSVG) {
|
||||||
|
span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
||||||
|
} else {
|
||||||
|
span = document.createElement("span");
|
||||||
|
span.classList.add(className);
|
||||||
|
}
|
||||||
|
|
||||||
|
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
|
||||||
|
parent.insertBefore(
|
||||||
|
span,
|
||||||
|
parent.insertBefore(
|
||||||
|
document.createTextNode(val.substr(pos + text.length)),
|
||||||
|
node.nextSibling
|
||||||
|
)
|
||||||
|
);
|
||||||
|
node.nodeValue = val.substr(0, pos);
|
||||||
|
|
||||||
|
if (isInSVG) {
|
||||||
|
const rect = document.createElementNS(
|
||||||
|
"http://www.w3.org/2000/svg",
|
||||||
|
"rect"
|
||||||
|
);
|
||||||
|
const bbox = parent.getBBox();
|
||||||
|
rect.x.baseVal.value = bbox.x;
|
||||||
|
rect.y.baseVal.value = bbox.y;
|
||||||
|
rect.width.baseVal.value = bbox.width;
|
||||||
|
rect.height.baseVal.value = bbox.height;
|
||||||
|
rect.setAttribute("class", className);
|
||||||
|
addItems.push({ parent: parent, target: rect });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (node.matches && !node.matches("button, select, textarea")) {
|
||||||
|
node.childNodes.forEach((el) => _highlight(el, addItems, text, className));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const _highlightText = (thisNode, text, className) => {
|
||||||
|
let addItems = [];
|
||||||
|
_highlight(thisNode, addItems, text, className);
|
||||||
|
addItems.forEach((obj) =>
|
||||||
|
obj.parent.insertAdjacentElement("beforebegin", obj.target)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Small JavaScript module for the documentation.
|
||||||
|
*/
|
||||||
|
const SphinxHighlight = {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* highlight the search words provided in localstorage in the text
|
||||||
|
*/
|
||||||
|
highlightSearchWords: () => {
|
||||||
|
if (!SPHINX_HIGHLIGHT_ENABLED) return; // bail if no highlight
|
||||||
|
|
||||||
|
// get and clear terms from localstorage
|
||||||
|
const url = new URL(window.location);
|
||||||
|
const highlight =
|
||||||
|
localStorage.getItem("sphinx_highlight_terms")
|
||||||
|
|| url.searchParams.get("highlight")
|
||||||
|
|| "";
|
||||||
|
localStorage.removeItem("sphinx_highlight_terms")
|
||||||
|
url.searchParams.delete("highlight");
|
||||||
|
window.history.replaceState({}, "", url);
|
||||||
|
|
||||||
|
// get individual terms from highlight string
|
||||||
|
const terms = highlight.toLowerCase().split(/\s+/).filter(x => x);
|
||||||
|
if (terms.length === 0) return; // nothing to do
|
||||||
|
|
||||||
|
// There should never be more than one element matching "div.body"
|
||||||
|
const divBody = document.querySelectorAll("div.body");
|
||||||
|
const body = divBody.length ? divBody[0] : document.querySelector("body");
|
||||||
|
window.setTimeout(() => {
|
||||||
|
terms.forEach((term) => _highlightText(body, term, "highlighted"));
|
||||||
|
}, 10);
|
||||||
|
|
||||||
|
const searchBox = document.getElementById("searchbox");
|
||||||
|
if (searchBox === null) return;
|
||||||
|
searchBox.appendChild(
|
||||||
|
document
|
||||||
|
.createRange()
|
||||||
|
.createContextualFragment(
|
||||||
|
'<p class="highlight-link">' +
|
||||||
|
'<a href="javascript:SphinxHighlight.hideSearchWords()">' +
|
||||||
|
_("Hide Search Matches") +
|
||||||
|
"</a></p>"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* helper function to hide the search marks again
|
||||||
|
*/
|
||||||
|
hideSearchWords: () => {
|
||||||
|
document
|
||||||
|
.querySelectorAll("#searchbox .highlight-link")
|
||||||
|
.forEach((el) => el.remove());
|
||||||
|
document
|
||||||
|
.querySelectorAll("span.highlighted")
|
||||||
|
.forEach((el) => el.classList.remove("highlighted"));
|
||||||
|
localStorage.removeItem("sphinx_highlight_terms")
|
||||||
|
},
|
||||||
|
|
||||||
|
initEscapeListener: () => {
|
||||||
|
// only install a listener if it is really needed
|
||||||
|
if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) return;
|
||||||
|
|
||||||
|
document.addEventListener("keydown", (event) => {
|
||||||
|
// bail for input elements
|
||||||
|
if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return;
|
||||||
|
// bail with special keys
|
||||||
|
if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return;
|
||||||
|
if (DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS && (event.key === "Escape")) {
|
||||||
|
SphinxHighlight.hideSearchWords();
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
_ready(SphinxHighlight.highlightSearchWords);
|
||||||
|
_ready(SphinxHighlight.initEscapeListener);
|
||||||
+2
-1
@@ -17,6 +17,7 @@
|
|||||||
<script src="_static/underscore.js"></script>
|
<script src="_static/underscore.js"></script>
|
||||||
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
||||||
<script src="_static/doctools.js"></script>
|
<script src="_static/doctools.js"></script>
|
||||||
|
<script src="_static/sphinx_highlight.js"></script>
|
||||||
<script src="_static/clipboard.min.js"></script>
|
<script src="_static/clipboard.min.js"></script>
|
||||||
<script src="_static/copybutton.js"></script>
|
<script src="_static/copybutton.js"></script>
|
||||||
<script src="_static/js/theme.js"></script>
|
<script src="_static/js/theme.js"></script>
|
||||||
@@ -90,7 +91,7 @@
|
|||||||
<li><a href="index.html" class="icon icon-home"></a> »</li>
|
<li><a href="index.html" class="icon icon-home"></a> »</li>
|
||||||
<li>Index</li>
|
<li>Index</li>
|
||||||
<li class="wy-breadcrumbs-aside">
|
<li class="wy-breadcrumbs-aside">
|
||||||
<a href="https://github.com/espressif/esp-protocols/blob/7310a7a/docs/en/genindex" class="fa fa-github"> Edit on GitHub</a>
|
<a href="https://github.com/espressif/esp-protocols/blob/467fec5/docs/en/genindex" class="fa fa-github"> Edit on GitHub</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|||||||
+7
-6
@@ -18,6 +18,7 @@
|
|||||||
<script src="_static/underscore.js"></script>
|
<script src="_static/underscore.js"></script>
|
||||||
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
||||||
<script src="_static/doctools.js"></script>
|
<script src="_static/doctools.js"></script>
|
||||||
|
<script src="_static/sphinx_highlight.js"></script>
|
||||||
<script src="_static/clipboard.min.js"></script>
|
<script src="_static/clipboard.min.js"></script>
|
||||||
<script src="_static/copybutton.js"></script>
|
<script src="_static/copybutton.js"></script>
|
||||||
<script src="_static/js/theme.js"></script>
|
<script src="_static/js/theme.js"></script>
|
||||||
@@ -102,7 +103,7 @@
|
|||||||
<li><a href="#" class="icon icon-home"></a> »</li>
|
<li><a href="#" class="icon icon-home"></a> »</li>
|
||||||
<li>ASIO port</li>
|
<li>ASIO port</li>
|
||||||
<li class="wy-breadcrumbs-aside">
|
<li class="wy-breadcrumbs-aside">
|
||||||
<a href="https://github.com/espressif/esp-protocols/blob/7310a7a/docs/en/index.rst" class="fa fa-github"> Edit on GitHub</a>
|
<a href="https://github.com/espressif/esp-protocols/blob/467fec5/docs/en/index.rst" class="fa fa-github"> Edit on GitHub</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<hr/>
|
<hr/>
|
||||||
@@ -143,12 +144,12 @@ SSL/TLS support is disabled by default and could be enabled in component configu
|
|||||||
</section>
|
</section>
|
||||||
<section id="application-example">
|
<section id="application-example">
|
||||||
<h2>Application Example<a class="headerlink" href="#application-example" title="Permalink to this heading"></a></h2>
|
<h2>Application Example<a class="headerlink" href="#application-example" title="Permalink to this heading"></a></h2>
|
||||||
<p>ESP examples are based on standard asio <a class="reference external" href="https://github.com/espressif/esp-protocols/tree/7310a7a/examples/../examples">examples </a>:</p>
|
<p>ESP examples are based on standard asio <a class="reference external" href="https://github.com/espressif/esp-protocols/tree/467fec5/examples/../examples">examples </a>:</p>
|
||||||
<ul class="simple">
|
<ul class="simple">
|
||||||
<li><p><a class="reference external" href="https://github.com/espressif/esp-protocols/tree/7310a7a/examples/../examples/udp_echo_server">udp_echo_server </a></p></li>
|
<li><p><a class="reference external" href="https://github.com/espressif/esp-protocols/tree/467fec5/examples/../examples/udp_echo_server">udp_echo_server </a></p></li>
|
||||||
<li><p><a class="reference external" href="https://github.com/espressif/esp-protocols/tree/7310a7a/examples/../examples/tcp_echo_server">tcp_echo_server </a></p></li>
|
<li><p><a class="reference external" href="https://github.com/espressif/esp-protocols/tree/467fec5/examples/../examples/tcp_echo_server">tcp_echo_server </a></p></li>
|
||||||
<li><p><a class="reference external" href="https://github.com/espressif/esp-protocols/tree/7310a7a/examples/../examples/asio_chat">asio_chat </a></p></li>
|
<li><p><a class="reference external" href="https://github.com/espressif/esp-protocols/tree/467fec5/examples/../examples/asio_chat">asio_chat </a></p></li>
|
||||||
<li><p><a class="reference external" href="https://github.com/espressif/esp-protocols/tree/7310a7a/examples/../examples/ssl_client_server">ssl_client_server </a></p></li>
|
<li><p><a class="reference external" href="https://github.com/espressif/esp-protocols/tree/467fec5/examples/../examples/ssl_client_server">ssl_client_server </a></p></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>Please refer to the specific example README.md for details</p>
|
<p>Please refer to the specific example README.md for details</p>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
<script src="_static/underscore.js"></script>
|
<script src="_static/underscore.js"></script>
|
||||||
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
||||||
<script src="_static/doctools.js"></script>
|
<script src="_static/doctools.js"></script>
|
||||||
|
<script src="_static/sphinx_highlight.js"></script>
|
||||||
<script src="_static/clipboard.min.js"></script>
|
<script src="_static/clipboard.min.js"></script>
|
||||||
<script src="_static/copybutton.js"></script>
|
<script src="_static/copybutton.js"></script>
|
||||||
<script src="_static/js/theme.js"></script>
|
<script src="_static/js/theme.js"></script>
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
Search.setIndex({"docnames": ["index"], "filenames": ["index.rst"], "titles": ["ASIO port"], "terms": {"i": 0, "cross": 0, "platform": 0, "c": 0, "librari": 0, "see": 0, "http": 0, "think": 0, "async": 0, "com": 0, "It": 0, "provid": 0, "consist": 0, "asynchron": 0, "model": 0, "us": 0, "modern": 0, "approach": 0, "pleas": 0, "refer": 0, "origin": 0, "also": 0, "come": 0, "number": 0, "which": 0, "could": 0, "find": 0, "under": 0, "web": 0, "site": 0, "esp": 0, "current": 0, "onli": 0, "network": 0, "socket": 0, "oper": 0, "doe": 0, "serial": 0, "ssl": 0, "tl": 0, "disabl": 0, "default": 0, "enabl": 0, "compon": 0, "configur": 0, "menu": 0, "choos": 0, "from": 0, "mbedtl": 0, "openssl": 0, "translat": 0, "layer": 0, "option": 0, "wolfssl": 0, "veri": 0, "basic": 0, "thi": 0, "stage": 0, "includ": 0, "follow": 0, "verif": 0, "callback": 0, "dh": 0, "properti": 0, "file": 0, "certif": 0, "privat": 0, "kei": 0, "api": 0, "intern": 0, "set": 0, "except": 0, "ar": 0, "menuconfig": 0, "typeid": 0, "base": 0, "standard": 0, "udp_echo_serv": 0, "tcp_echo_serv": 0, "asio_chat": 0, "ssl_client_serv": 0, "specif": 0, "readm": 0, "md": 0, "detail": 0}, "objects": {}, "objtypes": {}, "objnames": {}, "titleterms": {"asio": 0, "port": 0, "overview": 0, "document": 0, "support": 0, "featur": 0, "applic": 0, "exampl": 0}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 6, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.todo": 2, "sphinx": 56}})
|
Search.setIndex({"docnames": ["index"], "filenames": ["index.rst"], "titles": ["ASIO port"], "terms": {"i": 0, "cross": 0, "platform": 0, "c": 0, "librari": 0, "see": 0, "http": 0, "think": 0, "async": 0, "com": 0, "It": 0, "provid": 0, "consist": 0, "asynchron": 0, "model": 0, "us": 0, "modern": 0, "approach": 0, "pleas": 0, "refer": 0, "origin": 0, "also": 0, "come": 0, "number": 0, "which": 0, "could": 0, "find": 0, "under": 0, "web": 0, "site": 0, "esp": 0, "current": 0, "onli": 0, "network": 0, "socket": 0, "oper": 0, "doe": 0, "serial": 0, "ssl": 0, "tl": 0, "disabl": 0, "default": 0, "enabl": 0, "compon": 0, "configur": 0, "menu": 0, "choos": 0, "from": 0, "mbedtl": 0, "openssl": 0, "translat": 0, "layer": 0, "option": 0, "wolfssl": 0, "veri": 0, "basic": 0, "thi": 0, "stage": 0, "includ": 0, "follow": 0, "verif": 0, "callback": 0, "dh": 0, "properti": 0, "file": 0, "certif": 0, "privat": 0, "kei": 0, "api": 0, "intern": 0, "set": 0, "except": 0, "ar": 0, "menuconfig": 0, "typeid": 0, "base": 0, "standard": 0, "udp_echo_serv": 0, "tcp_echo_serv": 0, "asio_chat": 0, "ssl_client_serv": 0, "specif": 0, "readm": 0, "md": 0, "detail": 0}, "objects": {}, "objtypes": {}, "objnames": {}, "titleterms": {"asio": 0, "port": 0, "overview": 0, "document": 0, "support": 0, "featur": 0, "applic": 0, "exampl": 0}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 8, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.todo": 2, "sphinx": 57}, "alltitles": {"ASIO port": [[0, "asio-port"]], "Overview": [[0, "overview"]], "ASIO documentation": [[0, "asio-documentation"]], "Supported features": [[0, "supported-features"]], "Application Example": [[0, "application-example"]]}, "indexentries": {}})
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -14,6 +14,7 @@
|
|||||||
<script src="_static/underscore.js"></script>
|
<script src="_static/underscore.js"></script>
|
||||||
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
||||||
<script src="_static/doctools.js"></script>
|
<script src="_static/doctools.js"></script>
|
||||||
|
<script src="_static/sphinx_highlight.js"></script>
|
||||||
<link rel="index" title="Index" href="genindex.html" />
|
<link rel="index" title="Index" href="genindex.html" />
|
||||||
<link rel="search" title="Search" href="search.html" />
|
<link rel="search" title="Search" href="search.html" />
|
||||||
<link rel="next" title="C API Documentation" href="api_docs.html" />
|
<link rel="next" title="C API Documentation" href="api_docs.html" />
|
||||||
@@ -201,7 +202,7 @@ as a class derived from <code class="docutils literal notranslate"><span class="
|
|||||||
©2016 - 2021, Espressif Systems (Shanghai) Co., Ltd.
|
©2016 - 2021, Espressif Systems (Shanghai) Co., Ltd.
|
||||||
|
|
||||||
|
|
|
|
||||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 5.1.1</a>
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 5.2.2</a>
|
||||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
||||||
|
|
||||||
|
|
|
|
||||||
|
|||||||
+11
-119
@@ -10,6 +10,13 @@
|
|||||||
*/
|
*/
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([
|
||||||
|
"TEXTAREA",
|
||||||
|
"INPUT",
|
||||||
|
"SELECT",
|
||||||
|
"BUTTON",
|
||||||
|
]);
|
||||||
|
|
||||||
const _ready = (callback) => {
|
const _ready = (callback) => {
|
||||||
if (document.readyState !== "loading") {
|
if (document.readyState !== "loading") {
|
||||||
callback();
|
callback();
|
||||||
@@ -18,73 +25,11 @@ const _ready = (callback) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* highlight a given string on a node by wrapping it in
|
|
||||||
* span elements with the given class name.
|
|
||||||
*/
|
|
||||||
const _highlight = (node, addItems, text, className) => {
|
|
||||||
if (node.nodeType === Node.TEXT_NODE) {
|
|
||||||
const val = node.nodeValue;
|
|
||||||
const parent = node.parentNode;
|
|
||||||
const pos = val.toLowerCase().indexOf(text);
|
|
||||||
if (
|
|
||||||
pos >= 0 &&
|
|
||||||
!parent.classList.contains(className) &&
|
|
||||||
!parent.classList.contains("nohighlight")
|
|
||||||
) {
|
|
||||||
let span;
|
|
||||||
|
|
||||||
const closestNode = parent.closest("body, svg, foreignObject");
|
|
||||||
const isInSVG = closestNode && closestNode.matches("svg");
|
|
||||||
if (isInSVG) {
|
|
||||||
span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
||||||
} else {
|
|
||||||
span = document.createElement("span");
|
|
||||||
span.classList.add(className);
|
|
||||||
}
|
|
||||||
|
|
||||||
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
|
|
||||||
parent.insertBefore(
|
|
||||||
span,
|
|
||||||
parent.insertBefore(
|
|
||||||
document.createTextNode(val.substr(pos + text.length)),
|
|
||||||
node.nextSibling
|
|
||||||
)
|
|
||||||
);
|
|
||||||
node.nodeValue = val.substr(0, pos);
|
|
||||||
|
|
||||||
if (isInSVG) {
|
|
||||||
const rect = document.createElementNS(
|
|
||||||
"http://www.w3.org/2000/svg",
|
|
||||||
"rect"
|
|
||||||
);
|
|
||||||
const bbox = parent.getBBox();
|
|
||||||
rect.x.baseVal.value = bbox.x;
|
|
||||||
rect.y.baseVal.value = bbox.y;
|
|
||||||
rect.width.baseVal.value = bbox.width;
|
|
||||||
rect.height.baseVal.value = bbox.height;
|
|
||||||
rect.setAttribute("class", className);
|
|
||||||
addItems.push({ parent: parent, target: rect });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (node.matches && !node.matches("button, select, textarea")) {
|
|
||||||
node.childNodes.forEach((el) => _highlight(el, addItems, text, className));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const _highlightText = (thisNode, text, className) => {
|
|
||||||
let addItems = [];
|
|
||||||
_highlight(thisNode, addItems, text, className);
|
|
||||||
addItems.forEach((obj) =>
|
|
||||||
obj.parent.insertAdjacentElement("beforebegin", obj.target)
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Small JavaScript module for the documentation.
|
* Small JavaScript module for the documentation.
|
||||||
*/
|
*/
|
||||||
const Documentation = {
|
const Documentation = {
|
||||||
init: () => {
|
init: () => {
|
||||||
Documentation.highlightSearchWords();
|
|
||||||
Documentation.initDomainIndexTable();
|
Documentation.initDomainIndexTable();
|
||||||
Documentation.initOnKeyListeners();
|
Documentation.initOnKeyListeners();
|
||||||
},
|
},
|
||||||
@@ -126,51 +71,6 @@ const Documentation = {
|
|||||||
Documentation.LOCALE = catalog.locale;
|
Documentation.LOCALE = catalog.locale;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* highlight the search words provided in the url in the text
|
|
||||||
*/
|
|
||||||
highlightSearchWords: () => {
|
|
||||||
const highlight =
|
|
||||||
new URLSearchParams(window.location.search).get("highlight") || "";
|
|
||||||
const terms = highlight.toLowerCase().split(/\s+/).filter(x => x);
|
|
||||||
if (terms.length === 0) return; // nothing to do
|
|
||||||
|
|
||||||
// There should never be more than one element matching "div.body"
|
|
||||||
const divBody = document.querySelectorAll("div.body");
|
|
||||||
const body = divBody.length ? divBody[0] : document.querySelector("body");
|
|
||||||
window.setTimeout(() => {
|
|
||||||
terms.forEach((term) => _highlightText(body, term, "highlighted"));
|
|
||||||
}, 10);
|
|
||||||
|
|
||||||
const searchBox = document.getElementById("searchbox");
|
|
||||||
if (searchBox === null) return;
|
|
||||||
searchBox.appendChild(
|
|
||||||
document
|
|
||||||
.createRange()
|
|
||||||
.createContextualFragment(
|
|
||||||
'<p class="highlight-link">' +
|
|
||||||
'<a href="javascript:Documentation.hideSearchWords()">' +
|
|
||||||
Documentation.gettext("Hide Search Matches") +
|
|
||||||
"</a></p>"
|
|
||||||
)
|
|
||||||
);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* helper function to hide the search marks again
|
|
||||||
*/
|
|
||||||
hideSearchWords: () => {
|
|
||||||
document
|
|
||||||
.querySelectorAll("#searchbox .highlight-link")
|
|
||||||
.forEach((el) => el.remove());
|
|
||||||
document
|
|
||||||
.querySelectorAll("span.highlighted")
|
|
||||||
.forEach((el) => el.classList.remove("highlighted"));
|
|
||||||
const url = new URL(window.location);
|
|
||||||
url.searchParams.delete("highlight");
|
|
||||||
window.history.replaceState({}, "", url);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* helper function to focus on search bar
|
* helper function to focus on search bar
|
||||||
*/
|
*/
|
||||||
@@ -210,15 +110,11 @@ const Documentation = {
|
|||||||
)
|
)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const blacklistedElements = new Set([
|
|
||||||
"TEXTAREA",
|
|
||||||
"INPUT",
|
|
||||||
"SELECT",
|
|
||||||
"BUTTON",
|
|
||||||
]);
|
|
||||||
document.addEventListener("keydown", (event) => {
|
document.addEventListener("keydown", (event) => {
|
||||||
if (blacklistedElements.has(document.activeElement.tagName)) return; // bail for input elements
|
// bail for input elements
|
||||||
if (event.altKey || event.ctrlKey || event.metaKey) return; // bail with special keys
|
if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return;
|
||||||
|
// bail with special keys
|
||||||
|
if (event.altKey || event.ctrlKey || event.metaKey) return;
|
||||||
|
|
||||||
if (!event.shiftKey) {
|
if (!event.shiftKey) {
|
||||||
switch (event.key) {
|
switch (event.key) {
|
||||||
@@ -240,10 +136,6 @@ const Documentation = {
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "Escape":
|
|
||||||
if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break;
|
|
||||||
Documentation.hideSearchWords();
|
|
||||||
event.preventDefault();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
|
pre { line-height: 125%; }
|
||||||
|
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
|
||||||
|
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
|
||||||
|
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
|
||||||
|
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
|
||||||
.highlight .hll { background-color: #ffffcc }
|
.highlight .hll { background-color: #ffffcc }
|
||||||
.highlight { background: #f8f8f8; }
|
.highlight { background: #f8f8f8; }
|
||||||
.highlight .c { color: #8f5902; font-style: italic } /* Comment */
|
.highlight .c { color: #8f5902; font-style: italic } /* Comment */
|
||||||
.highlight .err { color: #a40000; border: 1px solid #ef2929 } /* Error */
|
.highlight .err { color: #a40000; border: 1px solid #ef2929 } /* Error */
|
||||||
.highlight .g { color: #000000 } /* Generic */
|
.highlight .g { color: #000000 } /* Generic */
|
||||||
@@ -49,6 +54,7 @@
|
|||||||
.highlight .nt { color: #004461; font-weight: bold } /* Name.Tag */
|
.highlight .nt { color: #004461; font-weight: bold } /* Name.Tag */
|
||||||
.highlight .nv { color: #000000 } /* Name.Variable */
|
.highlight .nv { color: #000000 } /* Name.Variable */
|
||||||
.highlight .ow { color: #004461; font-weight: bold } /* Operator.Word */
|
.highlight .ow { color: #004461; font-weight: bold } /* Operator.Word */
|
||||||
|
.highlight .pm { color: #000000; font-weight: bold } /* Punctuation.Marker */
|
||||||
.highlight .w { color: #f8f8f8; text-decoration: underline } /* Text.Whitespace */
|
.highlight .w { color: #f8f8f8; text-decoration: underline } /* Text.Whitespace */
|
||||||
.highlight .mb { color: #990000 } /* Literal.Number.Bin */
|
.highlight .mb { color: #990000 } /* Literal.Number.Bin */
|
||||||
.highlight .mf { color: #990000 } /* Literal.Number.Float */
|
.highlight .mf { color: #990000 } /* Literal.Number.Float */
|
||||||
|
|||||||
@@ -57,14 +57,14 @@ const _removeChildren = (element) => {
|
|||||||
const _escapeRegExp = (string) =>
|
const _escapeRegExp = (string) =>
|
||||||
string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
|
string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
|
||||||
|
|
||||||
const _displayItem = (item, highlightTerms, searchTerms) => {
|
const _displayItem = (item, searchTerms) => {
|
||||||
const docBuilder = DOCUMENTATION_OPTIONS.BUILDER;
|
const docBuilder = DOCUMENTATION_OPTIONS.BUILDER;
|
||||||
const docUrlRoot = DOCUMENTATION_OPTIONS.URL_ROOT;
|
const docUrlRoot = DOCUMENTATION_OPTIONS.URL_ROOT;
|
||||||
const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX;
|
const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX;
|
||||||
const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX;
|
const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX;
|
||||||
const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY;
|
const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY;
|
||||||
|
|
||||||
const [docName, title, anchor, descr] = item;
|
const [docName, title, anchor, descr, score, _filename] = item;
|
||||||
|
|
||||||
let listItem = document.createElement("li");
|
let listItem = document.createElement("li");
|
||||||
let requestUrl;
|
let requestUrl;
|
||||||
@@ -82,10 +82,9 @@ const _displayItem = (item, highlightTerms, searchTerms) => {
|
|||||||
requestUrl = docUrlRoot + docName + docFileSuffix;
|
requestUrl = docUrlRoot + docName + docFileSuffix;
|
||||||
linkUrl = docName + docLinkSuffix;
|
linkUrl = docName + docLinkSuffix;
|
||||||
}
|
}
|
||||||
const params = new URLSearchParams();
|
|
||||||
params.set("highlight", [...highlightTerms].join(" "));
|
|
||||||
let linkEl = listItem.appendChild(document.createElement("a"));
|
let linkEl = listItem.appendChild(document.createElement("a"));
|
||||||
linkEl.href = linkUrl + "?" + params.toString() + anchor;
|
linkEl.href = linkUrl + anchor;
|
||||||
|
linkEl.dataset.score = score;
|
||||||
linkEl.innerHTML = title;
|
linkEl.innerHTML = title;
|
||||||
if (descr)
|
if (descr)
|
||||||
listItem.appendChild(document.createElement("span")).innerHTML =
|
listItem.appendChild(document.createElement("span")).innerHTML =
|
||||||
@@ -96,7 +95,7 @@ const _displayItem = (item, highlightTerms, searchTerms) => {
|
|||||||
.then((data) => {
|
.then((data) => {
|
||||||
if (data)
|
if (data)
|
||||||
listItem.appendChild(
|
listItem.appendChild(
|
||||||
Search.makeSearchSummary(data, searchTerms, highlightTerms)
|
Search.makeSearchSummary(data, searchTerms)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
Search.output.appendChild(listItem);
|
Search.output.appendChild(listItem);
|
||||||
@@ -116,15 +115,14 @@ const _finishSearch = (resultCount) => {
|
|||||||
const _displayNextItem = (
|
const _displayNextItem = (
|
||||||
results,
|
results,
|
||||||
resultCount,
|
resultCount,
|
||||||
highlightTerms,
|
|
||||||
searchTerms
|
searchTerms
|
||||||
) => {
|
) => {
|
||||||
// results left, load the summary and display it
|
// results left, load the summary and display it
|
||||||
// this is intended to be dynamic (don't sub resultsCount)
|
// this is intended to be dynamic (don't sub resultsCount)
|
||||||
if (results.length) {
|
if (results.length) {
|
||||||
_displayItem(results.pop(), highlightTerms, searchTerms);
|
_displayItem(results.pop(), searchTerms);
|
||||||
setTimeout(
|
setTimeout(
|
||||||
() => _displayNextItem(results, resultCount, highlightTerms, searchTerms),
|
() => _displayNextItem(results, resultCount, searchTerms),
|
||||||
5
|
5
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -237,6 +235,12 @@ const Search = {
|
|||||||
* execute search (requires search index to be loaded)
|
* execute search (requires search index to be loaded)
|
||||||
*/
|
*/
|
||||||
query: (query) => {
|
query: (query) => {
|
||||||
|
const filenames = Search._index.filenames;
|
||||||
|
const docNames = Search._index.docnames;
|
||||||
|
const titles = Search._index.titles;
|
||||||
|
const allTitles = Search._index.alltitles;
|
||||||
|
const indexEntries = Search._index.indexentries;
|
||||||
|
|
||||||
// stem the search terms and add them to the correct list
|
// stem the search terms and add them to the correct list
|
||||||
const stemmer = new Stemmer();
|
const stemmer = new Stemmer();
|
||||||
const searchTerms = new Set();
|
const searchTerms = new Set();
|
||||||
@@ -264,6 +268,10 @@ const Search = {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (SPHINX_HIGHLIGHT_ENABLED) { // set in sphinx_highlight.js
|
||||||
|
localStorage.setItem("sphinx_highlight_terms", [...highlightTerms].join(" "))
|
||||||
|
}
|
||||||
|
|
||||||
// console.debug("SEARCH: searching for:");
|
// console.debug("SEARCH: searching for:");
|
||||||
// console.info("required: ", [...searchTerms]);
|
// console.info("required: ", [...searchTerms]);
|
||||||
// console.info("excluded: ", [...excludedTerms]);
|
// console.info("excluded: ", [...excludedTerms]);
|
||||||
@@ -272,6 +280,40 @@ const Search = {
|
|||||||
let results = [];
|
let results = [];
|
||||||
_removeChildren(document.getElementById("search-progress"));
|
_removeChildren(document.getElementById("search-progress"));
|
||||||
|
|
||||||
|
const queryLower = query.toLowerCase();
|
||||||
|
for (const [title, foundTitles] of Object.entries(allTitles)) {
|
||||||
|
if (title.toLowerCase().includes(queryLower) && (queryLower.length >= title.length/2)) {
|
||||||
|
for (const [file, id] of foundTitles) {
|
||||||
|
let score = Math.round(100 * queryLower.length / title.length)
|
||||||
|
results.push([
|
||||||
|
docNames[file],
|
||||||
|
titles[file] !== title ? `${titles[file]} > ${title}` : title,
|
||||||
|
id !== null ? "#" + id : "",
|
||||||
|
null,
|
||||||
|
score,
|
||||||
|
filenames[file],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// search for explicit entries in index directives
|
||||||
|
for (const [entry, foundEntries] of Object.entries(indexEntries)) {
|
||||||
|
if (entry.includes(queryLower) && (queryLower.length >= entry.length/2)) {
|
||||||
|
for (const [file, id] of foundEntries) {
|
||||||
|
let score = Math.round(100 * queryLower.length / entry.length)
|
||||||
|
results.push([
|
||||||
|
docNames[file],
|
||||||
|
titles[file],
|
||||||
|
id ? "#" + id : "",
|
||||||
|
null,
|
||||||
|
score,
|
||||||
|
filenames[file],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// lookup as object
|
// lookup as object
|
||||||
objectTerms.forEach((term) =>
|
objectTerms.forEach((term) =>
|
||||||
results.push(...Search.performObjectSearch(term, objectTerms))
|
results.push(...Search.performObjectSearch(term, objectTerms))
|
||||||
@@ -318,7 +360,7 @@ const Search = {
|
|||||||
// console.info("search results:", Search.lastresults);
|
// console.info("search results:", Search.lastresults);
|
||||||
|
|
||||||
// print the results
|
// print the results
|
||||||
_displayNextItem(results, results.length, highlightTerms, searchTerms);
|
_displayNextItem(results, results.length, searchTerms);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -399,8 +441,8 @@ const Search = {
|
|||||||
// prepare search
|
// prepare search
|
||||||
const terms = Search._index.terms;
|
const terms = Search._index.terms;
|
||||||
const titleTerms = Search._index.titleterms;
|
const titleTerms = Search._index.titleterms;
|
||||||
const docNames = Search._index.docnames;
|
|
||||||
const filenames = Search._index.filenames;
|
const filenames = Search._index.filenames;
|
||||||
|
const docNames = Search._index.docnames;
|
||||||
const titles = Search._index.titles;
|
const titles = Search._index.titles;
|
||||||
|
|
||||||
const scoreMap = new Map();
|
const scoreMap = new Map();
|
||||||
@@ -497,11 +539,9 @@ const Search = {
|
|||||||
/**
|
/**
|
||||||
* helper function to return a node containing the
|
* helper function to return a node containing the
|
||||||
* search summary for a given text. keywords is a list
|
* search summary for a given text. keywords is a list
|
||||||
* of stemmed words, highlightWords is the list of normal, unstemmed
|
* of stemmed words.
|
||||||
* words. the first one is used to find the occurrence, the
|
|
||||||
* latter for highlighting it.
|
|
||||||
*/
|
*/
|
||||||
makeSearchSummary: (htmlText, keywords, highlightWords) => {
|
makeSearchSummary: (htmlText, keywords) => {
|
||||||
const text = Search.htmlToText(htmlText);
|
const text = Search.htmlToText(htmlText);
|
||||||
if (text === "") return null;
|
if (text === "") return null;
|
||||||
|
|
||||||
@@ -519,10 +559,6 @@ const Search = {
|
|||||||
summary.classList.add("context");
|
summary.classList.add("context");
|
||||||
summary.textContent = top + text.substr(startWithContext, 240).trim() + tail;
|
summary.textContent = top + text.substr(startWithContext, 240).trim() + tail;
|
||||||
|
|
||||||
highlightWords.forEach((highlightWord) =>
|
|
||||||
_highlightText(summary, highlightWord, "highlighted")
|
|
||||||
);
|
|
||||||
|
|
||||||
return summary;
|
return summary;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,144 @@
|
|||||||
|
/* Highlighting utilities for Sphinx HTML documentation. */
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
const SPHINX_HIGHLIGHT_ENABLED = true
|
||||||
|
|
||||||
|
/**
|
||||||
|
* highlight a given string on a node by wrapping it in
|
||||||
|
* span elements with the given class name.
|
||||||
|
*/
|
||||||
|
const _highlight = (node, addItems, text, className) => {
|
||||||
|
if (node.nodeType === Node.TEXT_NODE) {
|
||||||
|
const val = node.nodeValue;
|
||||||
|
const parent = node.parentNode;
|
||||||
|
const pos = val.toLowerCase().indexOf(text);
|
||||||
|
if (
|
||||||
|
pos >= 0 &&
|
||||||
|
!parent.classList.contains(className) &&
|
||||||
|
!parent.classList.contains("nohighlight")
|
||||||
|
) {
|
||||||
|
let span;
|
||||||
|
|
||||||
|
const closestNode = parent.closest("body, svg, foreignObject");
|
||||||
|
const isInSVG = closestNode && closestNode.matches("svg");
|
||||||
|
if (isInSVG) {
|
||||||
|
span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
||||||
|
} else {
|
||||||
|
span = document.createElement("span");
|
||||||
|
span.classList.add(className);
|
||||||
|
}
|
||||||
|
|
||||||
|
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
|
||||||
|
parent.insertBefore(
|
||||||
|
span,
|
||||||
|
parent.insertBefore(
|
||||||
|
document.createTextNode(val.substr(pos + text.length)),
|
||||||
|
node.nextSibling
|
||||||
|
)
|
||||||
|
);
|
||||||
|
node.nodeValue = val.substr(0, pos);
|
||||||
|
|
||||||
|
if (isInSVG) {
|
||||||
|
const rect = document.createElementNS(
|
||||||
|
"http://www.w3.org/2000/svg",
|
||||||
|
"rect"
|
||||||
|
);
|
||||||
|
const bbox = parent.getBBox();
|
||||||
|
rect.x.baseVal.value = bbox.x;
|
||||||
|
rect.y.baseVal.value = bbox.y;
|
||||||
|
rect.width.baseVal.value = bbox.width;
|
||||||
|
rect.height.baseVal.value = bbox.height;
|
||||||
|
rect.setAttribute("class", className);
|
||||||
|
addItems.push({ parent: parent, target: rect });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (node.matches && !node.matches("button, select, textarea")) {
|
||||||
|
node.childNodes.forEach((el) => _highlight(el, addItems, text, className));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const _highlightText = (thisNode, text, className) => {
|
||||||
|
let addItems = [];
|
||||||
|
_highlight(thisNode, addItems, text, className);
|
||||||
|
addItems.forEach((obj) =>
|
||||||
|
obj.parent.insertAdjacentElement("beforebegin", obj.target)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Small JavaScript module for the documentation.
|
||||||
|
*/
|
||||||
|
const SphinxHighlight = {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* highlight the search words provided in localstorage in the text
|
||||||
|
*/
|
||||||
|
highlightSearchWords: () => {
|
||||||
|
if (!SPHINX_HIGHLIGHT_ENABLED) return; // bail if no highlight
|
||||||
|
|
||||||
|
// get and clear terms from localstorage
|
||||||
|
const url = new URL(window.location);
|
||||||
|
const highlight =
|
||||||
|
localStorage.getItem("sphinx_highlight_terms")
|
||||||
|
|| url.searchParams.get("highlight")
|
||||||
|
|| "";
|
||||||
|
localStorage.removeItem("sphinx_highlight_terms")
|
||||||
|
url.searchParams.delete("highlight");
|
||||||
|
window.history.replaceState({}, "", url);
|
||||||
|
|
||||||
|
// get individual terms from highlight string
|
||||||
|
const terms = highlight.toLowerCase().split(/\s+/).filter(x => x);
|
||||||
|
if (terms.length === 0) return; // nothing to do
|
||||||
|
|
||||||
|
// There should never be more than one element matching "div.body"
|
||||||
|
const divBody = document.querySelectorAll("div.body");
|
||||||
|
const body = divBody.length ? divBody[0] : document.querySelector("body");
|
||||||
|
window.setTimeout(() => {
|
||||||
|
terms.forEach((term) => _highlightText(body, term, "highlighted"));
|
||||||
|
}, 10);
|
||||||
|
|
||||||
|
const searchBox = document.getElementById("searchbox");
|
||||||
|
if (searchBox === null) return;
|
||||||
|
searchBox.appendChild(
|
||||||
|
document
|
||||||
|
.createRange()
|
||||||
|
.createContextualFragment(
|
||||||
|
'<p class="highlight-link">' +
|
||||||
|
'<a href="javascript:SphinxHighlight.hideSearchWords()">' +
|
||||||
|
_("Hide Search Matches") +
|
||||||
|
"</a></p>"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* helper function to hide the search marks again
|
||||||
|
*/
|
||||||
|
hideSearchWords: () => {
|
||||||
|
document
|
||||||
|
.querySelectorAll("#searchbox .highlight-link")
|
||||||
|
.forEach((el) => el.remove());
|
||||||
|
document
|
||||||
|
.querySelectorAll("span.highlighted")
|
||||||
|
.forEach((el) => el.classList.remove("highlighted"));
|
||||||
|
localStorage.removeItem("sphinx_highlight_terms")
|
||||||
|
},
|
||||||
|
|
||||||
|
initEscapeListener: () => {
|
||||||
|
// only install a listener if it is really needed
|
||||||
|
if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) return;
|
||||||
|
|
||||||
|
document.addEventListener("keydown", (event) => {
|
||||||
|
// bail for input elements
|
||||||
|
if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return;
|
||||||
|
// bail with special keys
|
||||||
|
if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return;
|
||||||
|
if (DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS && (event.key === "Escape")) {
|
||||||
|
SphinxHighlight.hideSearchWords();
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
_ready(SphinxHighlight.highlightSearchWords);
|
||||||
|
_ready(SphinxHighlight.initEscapeListener);
|
||||||
@@ -14,6 +14,7 @@
|
|||||||
<script src="_static/underscore.js"></script>
|
<script src="_static/underscore.js"></script>
|
||||||
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
||||||
<script src="_static/doctools.js"></script>
|
<script src="_static/doctools.js"></script>
|
||||||
|
<script src="_static/sphinx_highlight.js"></script>
|
||||||
<link rel="index" title="Index" href="genindex.html" />
|
<link rel="index" title="Index" href="genindex.html" />
|
||||||
<link rel="search" title="Search" href="search.html" />
|
<link rel="search" title="Search" href="search.html" />
|
||||||
<link rel="next" title="Internal design" href="internal_design.html" />
|
<link rel="next" title="Internal design" href="internal_design.html" />
|
||||||
@@ -288,7 +289,7 @@ a custom DTE object and supply it into <a class="reference internal" href="#dce-
|
|||||||
©2016 - 2021, Espressif Systems (Shanghai) Co., Ltd.
|
©2016 - 2021, Espressif Systems (Shanghai) Co., Ltd.
|
||||||
|
|
||||||
|
|
|
|
||||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 5.1.1</a>
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 5.2.2</a>
|
||||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
||||||
|
|
||||||
|
|
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
<script src="_static/underscore.js"></script>
|
<script src="_static/underscore.js"></script>
|
||||||
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
||||||
<script src="_static/doctools.js"></script>
|
<script src="_static/doctools.js"></script>
|
||||||
|
<script src="_static/sphinx_highlight.js"></script>
|
||||||
<link rel="index" title="Index" href="genindex.html" />
|
<link rel="index" title="Index" href="genindex.html" />
|
||||||
<link rel="search" title="Search" href="search.html" />
|
<link rel="search" title="Search" href="search.html" />
|
||||||
<link rel="next" title="C++ API Documentation" href="cxx_api_docs.html" />
|
<link rel="next" title="C++ API Documentation" href="cxx_api_docs.html" />
|
||||||
@@ -1028,7 +1029,7 @@ pointer as the return value. The API expects the output data to point to user al
|
|||||||
©2016 - 2021, Espressif Systems (Shanghai) Co., Ltd.
|
©2016 - 2021, Espressif Systems (Shanghai) Co., Ltd.
|
||||||
|
|
||||||
|
|
|
|
||||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 5.1.1</a>
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 5.2.2</a>
|
||||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
||||||
|
|
||||||
|
|
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
<script src="_static/underscore.js"></script>
|
<script src="_static/underscore.js"></script>
|
||||||
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
||||||
<script src="_static/doctools.js"></script>
|
<script src="_static/doctools.js"></script>
|
||||||
|
<script src="_static/sphinx_highlight.js"></script>
|
||||||
<link rel="index" title="Index" href="genindex.html" />
|
<link rel="index" title="Index" href="genindex.html" />
|
||||||
<link rel="search" title="Search" href="search.html" />
|
<link rel="search" title="Search" href="search.html" />
|
||||||
<link rel="next" title="Advanced esp-modem use cases" href="advanced_api.html" />
|
<link rel="next" title="Advanced esp-modem use cases" href="advanced_api.html" />
|
||||||
@@ -287,7 +288,7 @@ It simply gets destroyed and cleaned-up automatically if the object goes out of
|
|||||||
©2016 - 2021, Espressif Systems (Shanghai) Co., Ltd.
|
©2016 - 2021, Espressif Systems (Shanghai) Co., Ltd.
|
||||||
|
|
||||||
|
|
|
|
||||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 5.1.1</a>
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 5.2.2</a>
|
||||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
||||||
|
|
||||||
|
|
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
<script src="_static/underscore.js"></script>
|
<script src="_static/underscore.js"></script>
|
||||||
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
||||||
<script src="_static/doctools.js"></script>
|
<script src="_static/doctools.js"></script>
|
||||||
|
<script src="_static/sphinx_highlight.js"></script>
|
||||||
<link rel="index" title="Index" href="genindex.html" />
|
<link rel="index" title="Index" href="genindex.html" />
|
||||||
<link rel="search" title="Search" href="search.html" />
|
<link rel="search" title="Search" href="search.html" />
|
||||||
|
|
||||||
@@ -129,7 +130,7 @@
|
|||||||
©2016 - 2021, Espressif Systems (Shanghai) Co., Ltd.
|
©2016 - 2021, Espressif Systems (Shanghai) Co., Ltd.
|
||||||
|
|
||||||
|
|
|
|
||||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 5.1.1</a>
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 5.2.2</a>
|
||||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
||||||
|
|
||||||
|
|
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
<script src="_static/underscore.js"></script>
|
<script src="_static/underscore.js"></script>
|
||||||
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
||||||
<script src="_static/doctools.js"></script>
|
<script src="_static/doctools.js"></script>
|
||||||
|
<script src="_static/sphinx_highlight.js"></script>
|
||||||
<link rel="index" title="Index" href="#" />
|
<link rel="index" title="Index" href="#" />
|
||||||
<link rel="search" title="Search" href="search.html" />
|
<link rel="search" title="Search" href="search.html" />
|
||||||
|
|
||||||
@@ -607,7 +608,7 @@
|
|||||||
©2016 - 2021, Espressif Systems (Shanghai) Co., Ltd.
|
©2016 - 2021, Espressif Systems (Shanghai) Co., Ltd.
|
||||||
|
|
||||||
|
|
|
|
||||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 5.1.1</a>
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 5.2.2</a>
|
||||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
<script src="_static/underscore.js"></script>
|
<script src="_static/underscore.js"></script>
|
||||||
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
||||||
<script src="_static/doctools.js"></script>
|
<script src="_static/doctools.js"></script>
|
||||||
|
<script src="_static/sphinx_highlight.js"></script>
|
||||||
<link rel="index" title="Index" href="genindex.html" />
|
<link rel="index" title="Index" href="genindex.html" />
|
||||||
<link rel="search" title="Search" href="search.html" />
|
<link rel="search" title="Search" href="search.html" />
|
||||||
<link rel="next" title="ESP MODEM" href="README.html" />
|
<link rel="next" title="ESP MODEM" href="README.html" />
|
||||||
@@ -160,7 +161,7 @@
|
|||||||
©2016 - 2021, Espressif Systems (Shanghai) Co., Ltd.
|
©2016 - 2021, Espressif Systems (Shanghai) Co., Ltd.
|
||||||
|
|
||||||
|
|
|
|
||||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 5.1.1</a>
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 5.2.2</a>
|
||||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
||||||
|
|
||||||
|
|
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
<script src="_static/underscore.js"></script>
|
<script src="_static/underscore.js"></script>
|
||||||
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
||||||
<script src="_static/doctools.js"></script>
|
<script src="_static/doctools.js"></script>
|
||||||
|
<script src="_static/sphinx_highlight.js"></script>
|
||||||
<link rel="index" title="Index" href="genindex.html" />
|
<link rel="index" title="Index" href="genindex.html" />
|
||||||
<link rel="search" title="Search" href="search.html" />
|
<link rel="search" title="Search" href="search.html" />
|
||||||
<link rel="next" title="DCE Internal implementation" href="internal_docs.html" />
|
<link rel="next" title="DCE Internal implementation" href="internal_docs.html" />
|
||||||
@@ -146,7 +147,7 @@ to multiplex the terminal.</p>
|
|||||||
©2016 - 2021, Espressif Systems (Shanghai) Co., Ltd.
|
©2016 - 2021, Espressif Systems (Shanghai) Co., Ltd.
|
||||||
|
|
||||||
|
|
|
|
||||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 5.1.1</a>
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 5.2.2</a>
|
||||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
||||||
|
|
||||||
|
|
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
<script src="_static/underscore.js"></script>
|
<script src="_static/underscore.js"></script>
|
||||||
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
||||||
<script src="_static/doctools.js"></script>
|
<script src="_static/doctools.js"></script>
|
||||||
|
<script src="_static/sphinx_highlight.js"></script>
|
||||||
<link rel="index" title="Index" href="genindex.html" />
|
<link rel="index" title="Index" href="genindex.html" />
|
||||||
<link rel="search" title="Search" href="search.html" />
|
<link rel="search" title="Search" href="search.html" />
|
||||||
<link rel="prev" title="Internal design" href="internal_design.html" />
|
<link rel="prev" title="Internal design" href="internal_design.html" />
|
||||||
@@ -1401,7 +1402,7 @@ Please refer to the <a class="reference internal" href="api_docs.html#c-api"><sp
|
|||||||
©2016 - 2021, Espressif Systems (Shanghai) Co., Ltd.
|
©2016 - 2021, Espressif Systems (Shanghai) Co., Ltd.
|
||||||
|
|
||||||
|
|
|
|
||||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 5.1.1</a>
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 5.2.2</a>
|
||||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
||||||
|
|
||||||
|
|
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
<script src="_static/underscore.js"></script>
|
<script src="_static/underscore.js"></script>
|
||||||
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
||||||
<script src="_static/doctools.js"></script>
|
<script src="_static/doctools.js"></script>
|
||||||
|
<script src="_static/sphinx_highlight.js"></script>
|
||||||
<script src="_static/searchtools.js"></script>
|
<script src="_static/searchtools.js"></script>
|
||||||
<script src="_static/language_data.js"></script>
|
<script src="_static/language_data.js"></script>
|
||||||
<link rel="index" title="Index" href="genindex.html" />
|
<link rel="index" title="Index" href="genindex.html" />
|
||||||
@@ -116,7 +117,7 @@
|
|||||||
©2016 - 2021, Espressif Systems (Shanghai) Co., Ltd.
|
©2016 - 2021, Espressif Systems (Shanghai) Co., Ltd.
|
||||||
|
|
||||||
|
|
|
|
||||||
Powered by <a href="http://sphinx-doc.org/">Sphinx 5.1.1</a>
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 5.2.2</a>
|
||||||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
Search.setIndex({"docnames": ["README", "advanced_api", "api_docs", "cxx_api_docs", "cxx_api_links", "index", "internal_design", "internal_docs"], "filenames": ["README.md", "advanced_api.rst", "api_docs.rst", "cxx_api_docs.rst", "cxx_api_links.rst", "index.rst", "internal_design.md", "internal_docs.rst"], "titles": ["ESP MODEM", "Advanced esp-modem use cases", "C API Documentation", "C++ API Documentation", "<no title>", "ESP-MODEM Programmers manual", "Internal design", "DCE Internal implementation"], "terms": {"thi": [0, 1, 2, 7], "i": [0, 1, 2, 3, 6, 7], "commun": [0, 2, 3, 5, 7], "command": [0, 1, 5, 6], "mode": [0, 2, 5, 6, 7], "AT": [0, 1, 2, 3, 6, 7], "well": [0, 6, 7], "data": [0, 2, 3, 6, 7], "over": [0, 6], "pppo": 0, "protocol": [0, 7], "The": [0, 1, 2, 3, 6, 7], "model": [0, 1, 5], "equip": [0, 7], "object": [0, 1, 3, 7], "which": [0, 1, 2, 6, 7], "compos": [0, 6], "termin": [0, 1, 2, 5], "abstract": [0, 5, 6], "current": [0, 2, 7], "onli": [0, 1, 2, 6, 7], "uart": [0, 1, 2, 3, 6, 7], "implement": [0, 1, 2, 5, 6], "repres": [0, 1, 7], "network": [0, 1, 2, 3, 6, 7], "interfac": [0, 2, 3, 5, 6], "specif": [0, 1, 2, 3, 7], "its": [0, 2, 6, 7], "o": 0, "set_mod": [0, 7], "send_command": 0, "event": [0, 2], "basic": [0, 1, 2, 3, 6, 7], "oper": [0, 2, 7], "unit": [0, 7], "_": 0, "softwar": 0, "configur": [0, 1, 3, 5, 7], "media": 0, "defin": [0, 1, 2, 7], "librari": [0, 5], "support": [0, 1, 2, 7], "type": [0, 2, 5], "config": [0, 1, 2, 3, 7], "lwip": 0, "after": [0, 2, 7], "creat": [0, 2, 5, 7], "applic": [0, 1, 2, 3], "interact": 0, "issu": [0, 2], "switch": [0, 2, 5, 7], "between": [0, 7], "an": [0, 1, 2, 7], "physic": 0, "connect": [0, 1, 2, 7], "attach": [0, 2, 7], "sim800": [0, 1, 3, 7], "bg96": [0, 1, 3, 7], "sim7600": [0, 1, 3, 7], "user": [0, 1, 2, 7], "internet": 0, "via": [0, 7], "cellular": [0, 2, 7], "send": [0, 2, 3, 6, 7], "variou": 0, "e": [0, 1, 7], "g": [0, 1], "sm": [0, 2, 7], "typic": [0, 1, 2, 7], "regist": 0, "handler": 0, "receiv": [0, 7], "notif": 0, "avail": [0, 2, 6, 7], "ip": 0, "address": 0, "chang": 0, "common": [0, 1, 2, 6, 7], "ar": [0, 2, 3, 6, 7], "also": [0, 1, 2, 6, 7], "list": [0, 2, 7], "exampl": [0, 1], "pppos_client": 0, "simpl": [0, 2], "client": 0, "read": [0, 2, 6, 7], "some": [0, 6, 7], "properti": 0, "public": [0, 1, 2, 3, 7], "mqtt": 0, "broker": 0, "modem_consol": [0, 1], "exercis": 0, "all": [0, 1, 3, 7], "possibl": [0, 1], "consol": 0, "ap_to_pppo": 0, "focus": 0, "provid": [0, 1, 6, 7], "wifi": 0, "ap": 0, "forward": [0, 7], "packet": 0, "nat": 0, "from": [0, 1, 2, 6, 7], "virtual": [0, 1, 6, 7], "experiment": 0, "featur": 0, "allow": 0, "multipl": [0, 7], "design": [0, 5], "them": 0, "sole": [0, 7], "we": [0, 7], "modern": 0, "usb": 0, "spi": [0, 1], "ad": [0, 5], "new": [0, 2, 5, 6], "must": [0, 7], "have": [0, 3, 7], "requir": 0, "differ": [0, 1, 6, 7], "might": [0, 6], "mean": [0, 7], "class": [0, 1, 3, 6, 7], "deriv": [0, 1, 7], "genericmodul": [0, 1, 6, 7], "where": 0, "could": [0, 1, 6, 7], "add": [0, 6, 7], "modifi": 0, "exist": [0, 1, 7], "ones": 0, "chapter": [1, 7], "outlin": 1, "extens": [1, 5, 7], "compon": [1, 5, 7], "It": [1, 3, 7], "handl": [1, 2, 6], "mani": 1, "wai": [1, 7], "build": [1, 7], "top": 1, "gener": [1, 2, 3, 5, 6], "share": [1, 3, 7], "uniqu": [1, 3, 7], "vanilla": 1, "pointer": [1, 2, 7], "templat": [1, 3, 6, 7], "dce_t": [1, 3, 7], "one": [1, 7], "function": [1, 2, 3, 7], "group": [1, 2, 3, 7], "esp_modem_dce_factori": 1, "enum": [1, 2, 7], "modemtyp": 1, "choic": 1, "when": [1, 6], "valu": [1, 2, 7], "enumer": [1, 2, 7], "default": [1, 2, 3, 7], "most": [1, 2, 6, 7], "appli": 1, "sim7070": [1, 3, 7], "sim7000": [1, 3, 7], "bg69": 1, "factoryhelp": 1, "includ": [1, 2, 7], "hpp": [1, 7], "helper": [1, 7], "either": [1, 3, 7], "plain": [1, 2], "shared_ptr": [1, 3, 7], "unique_ptr": [1, 3, 7], "typenam": 1, "t_modul": 1, "creator": 1, "dte": [1, 2, 5, 6], "netif": [1, 2, 3, 5, 6], "throw": [1, 6], "base": [1, 3, 7], "suppli": [1, 2, 7], "app": [1, 2], "arg": 1, "inlin": [1, 3, 7], "std": [1, 3, 7], "build_uniqu": 1, "const": [1, 2, 3, 7], "cfg": 1, "chosen": [1, 2], "paramet": [1, 2, 3, 7], "argument": [1, 7], "builder": 1, "constructor": [1, 6], "esp_modem": [1, 3, 4, 7], "structur": [1, 5, 7], "esp_modem_dte_config": [1, 2, 3, 7], "ppp": [1, 2, 5, 6, 7], "return": [1, 2, 3, 7], "success": [1, 2, 3, 7], "static": 1, "necessari": [1, 3, 7], "need": [1, 2, 7], "devic": [1, 2, 5, 6], "ani": 1, "In": 1, "recommend": 1, "order": [1, 7], "appropri": [1, 7], "dce_factori": 1, "pleas": [1, 7], "refer": [1, 3, 7], "note": [1, 2], "trivial": 1, "overrid": [1, 7], "demonstr": 1, "purpos": 1, "unsupport": 1, "i2c": 1, "two": [1, 2, 7], "step": 1, "correspond": 1, "should": [1, 2, 7], "io": 1, "method": [1, 6, 7], "veri": 2, "consist": [2, 3, 7], "part": 2, "workflow": [2, 3], "dce": [2, 4, 5], "instanc": [2, 7], "us": [2, 3, 5, 6, 7], "esp_modem_new": 2, "call": [2, 7], "esp_modem_set_mod": 2, "perform": 2, "desir": [2, 7], "stLine truncated
|
Search.setIndex({"docnames": ["README", "advanced_api", "api_docs", "cxx_api_docs", "cxx_api_links", "index", "internal_design", "internal_docs"], "filenames": ["README.md", "advanced_api.rst", "api_docs.rst", "cxx_api_docs.rst", "cxx_api_links.rst", "index.rst", "internal_design.md", "internal_docs.rst"], "titles": ["ESP MODEM", "Advanced esp-modem use cases", "C API Documentation", "C++ API Documentation", "<no title>", "ESP-MODEM Programmers manual", "Internal design", "DCE Internal implementation"], "terms": {"thi": [0, 1, 2, 7], "i": [0, 1, 2, 3, 6, 7], "commun": [0, 2, 3, 5, 7], "command": [0, 1, 5, 6], "mode": [0, 2, 5, 6, 7], "AT": [0, 1, 2, 3, 6, 7], "well": [0, 6, 7], "data": [0, 2, 3, 6, 7], "over": [0, 6], "pppo": 0, "protocol": [0, 7], "The": [0, 1, 2, 3, 6, 7], "model": [0, 1, 5], "equip": [0, 7], "object": [0, 1, 3, 7], "which": [0, 1, 2, 6, 7], "compos": [0, 6], "termin": [0, 1, 2, 5], "abstract": [0, 5, 6], "current": [0, 2, 7], "onli": [0, 1, 2, 6, 7], "uart": [0, 1, 2, 3, 6, 7], "implement": [0, 1, 2, 5, 6], "repres": [0, 1, 7], "network": [0, 1, 2, 3, 6, 7], "interfac": [0, 2, 3, 5, 6], "specif": [0, 1, 2, 3, 7], "its": [0, 2, 6, 7], "o": 0, "set_mod": [0, 7], "send_command": 0, "event": [0, 2], "basic": [0, 1, 2, 3, 6, 7], "oper": [0, 2, 7], "unit": [0, 7], "_": 0, "softwar": 0, "configur": [0, 1, 3, 5, 7], "media": 0, "defin": [0, 1, 2, 7], "librari": [0, 5], "support": [0, 1, 2, 7], "type": [0, 2, 5], "config": [0, 1, 2, 3, 7], "lwip": 0, "after": [0, 2, 7], "creat": [0, 2, 5, 7], "applic": [0, 1, 2, 3], "interact": 0, "issu": [0, 2], "switch": [0, 2, 5, 7], "between": [0, 7], "an": [0, 1, 2, 7], "physic": 0, "connect": [0, 1, 2, 7], "attach": [0, 2, 7], "sim800": [0, 1, 3, 7], "bg96": [0, 1, 3, 7], "sim7600": [0, 1, 3, 7], "user": [0, 1, 2, 7], "internet": 0, "via": [0, 7], "cellular": [0, 2, 7], "send": [0, 2, 3, 6, 7], "variou": 0, "e": [0, 1, 7], "g": [0, 1], "sm": [0, 2, 7], "typic": [0, 1, 2, 7], "regist": 0, "handler": 0, "receiv": [0, 7], "notif": 0, "avail": [0, 2, 6, 7], "ip": 0, "address": 0, "chang": 0, "common": [0, 1, 2, 6, 7], "ar": [0, 2, 3, 6, 7], "also": [0, 1, 2, 6, 7], "list": [0, 2, 7], "exampl": [0, 1], "pppos_client": 0, "simpl": [0, 2], "client": 0, "read": [0, 2, 6, 7], "some": [0, 6, 7], "properti": 0, "public": [0, 1, 2, 3, 7], "mqtt": 0, "broker": 0, "modem_consol": [0, 1], "exercis": 0, "all": [0, 1, 3, 7], "possibl": [0, 1], "consol": 0, "ap_to_pppo": 0, "focus": 0, "provid": [0, 1, 6, 7], "wifi": 0, "ap": 0, "forward": [0, 7], "packet": 0, "nat": 0, "from": [0, 1, 2, 6, 7], "virtual": [0, 1, 6, 7], "experiment": 0, "featur": 0, "allow": 0, "multipl": [0, 7], "design": [0, 5], "them": 0, "sole": [0, 7], "we": [0, 7], "modern": 0, "usb": 0, "spi": [0, 1], "ad": [0, 5], "new": [0, 2, 5, 6], "must": [0, 7], "have": [0, 3, 7], "requir": 0, "differ": [0, 1, 6, 7], "might": [0, 6], "mean": [0, 7], "class": [0, 1, 3, 6, 7], "deriv": [0, 1, 7], "genericmodul": [0, 1, 6, 7], "where": 0, "could": [0, 1, 6, 7], "add": [0, 6, 7], "modifi": 0, "exist": [0, 1, 7], "ones": 0, "chapter": [1, 7], "outlin": 1, "extens": [1, 5, 7], "compon": [1, 5, 7], "It": [1, 3, 7], "handl": [1, 2, 6], "mani": 1, "wai": [1, 7], "build": [1, 7], "top": 1, "gener": [1, 2, 3, 5, 6], "share": [1, 3, 7], "uniqu": [1, 3, 7], "vanilla": 1, "pointer": [1, 2, 7], "templat": [1, 3, 6, 7], "dce_t": [1, 3, 7], "one": [1, 7], "function": [1, 2, 3, 7], "group": [1, 2, 3, 7], "esp_modem_dce_factori": 1, "enum": [1, 2, 7], "modemtyp": 1, "choic": 1, "when": [1, 6], "valu": [1, 2, 7], "enumer": [1, 2, 7], "default": [1, 2, 3, 7], "most": [1, 2, 6, 7], "appli": 1, "sim7070": [1, 3, 7], "sim7000": [1, 3, 7], "bg69": 1, "factoryhelp": 1, "includ": [1, 2, 7], "hpp": [1, 7], "helper": [1, 7], "either": [1, 3, 7], "plain": [1, 2], "shared_ptr": [1, 3, 7], "unique_ptr": [1, 3, 7], "typenam": 1, "t_modul": 1, "creator": 1, "dte": [1, 2, 5, 6], "netif": [1, 2, 3, 5, 6], "throw": [1, 6], "base": [1, 3, 7], "suppli": [1, 2, 7], "app": [1, 2], "arg": 1, "inlin": [1, 3, 7], "std": [1, 3, 7], "build_uniqu": 1, "const": [1, 2, 3, 7], "cfg": 1, "chosen": [1, 2], "paramet": [1, 2, 3, 7], "argument": [1, 7], "builder": 1, "constructor": [1, 6], "esp_modem": [1, 3, 4, 7], "structur": [1, 5, 7], "esp_modem_dte_config": [1, 2, 3, 7], "ppp": [1, 2, 5, 6, 7], "return": [1, 2, 3, 7], "success": [1, 2, 3, 7], "static": 1, "necessari": [1, 3, 7], "need": [1, 2, 7], "devic": [1, 2, 5, 6], "ani": 1, "In": 1, "recommend": 1, "order": [1, 7], "appropri": [1, 7], "dce_factori": 1, "pleas": [1, 7], "refer": [1, 3, 7], "note": [1, 2], "trivial": 1, "overrid": [1, 7], "demonstr": 1, "purpos": 1, "unsupport": 1, "i2c": 1, "two": [1, 2, 7], "step": 1, "correspond": 1, "should": [1, 2, 7], "io": 1, "method": [1, 6, 7], "veri": 2, "consist": [2, 3, 7], "part": 2, "workflow": [2, 3], "dce": [2, 4, 5], "instanc": [2, 7], "us": [2, 3, 5, 6, 7], "esp_modem_new": 2, "call": [2, 7], "esp_modem_set_mod": 2, "perform": 2, "desir": [2, 7], "stLine truncated
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# Sphinx build info version 1
|
# Sphinx build info version 1
|
||||||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
|
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
|
||||||
config: 498cce684b6373a44bc74358e7d65b40
|
config: 9789b27bdf7841a7eefb1ea43bf1774a
|
||||||
tags: 549b3d6d0415232fb7e35403b330ff49
|
tags: 549b3d6d0415232fb7e35403b330ff49
|
||||||
@@ -10,6 +10,13 @@
|
|||||||
*/
|
*/
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([
|
||||||
|
"TEXTAREA",
|
||||||
|
"INPUT",
|
||||||
|
"SELECT",
|
||||||
|
"BUTTON",
|
||||||
|
]);
|
||||||
|
|
||||||
const _ready = (callback) => {
|
const _ready = (callback) => {
|
||||||
if (document.readyState !== "loading") {
|
if (document.readyState !== "loading") {
|
||||||
callback();
|
callback();
|
||||||
@@ -18,73 +25,11 @@ const _ready = (callback) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* highlight a given string on a node by wrapping it in
|
|
||||||
* span elements with the given class name.
|
|
||||||
*/
|
|
||||||
const _highlight = (node, addItems, text, className) => {
|
|
||||||
if (node.nodeType === Node.TEXT_NODE) {
|
|
||||||
const val = node.nodeValue;
|
|
||||||
const parent = node.parentNode;
|
|
||||||
const pos = val.toLowerCase().indexOf(text);
|
|
||||||
if (
|
|
||||||
pos >= 0 &&
|
|
||||||
!parent.classList.contains(className) &&
|
|
||||||
!parent.classList.contains("nohighlight")
|
|
||||||
) {
|
|
||||||
let span;
|
|
||||||
|
|
||||||
const closestNode = parent.closest("body, svg, foreignObject");
|
|
||||||
const isInSVG = closestNode && closestNode.matches("svg");
|
|
||||||
if (isInSVG) {
|
|
||||||
span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
||||||
} else {
|
|
||||||
span = document.createElement("span");
|
|
||||||
span.classList.add(className);
|
|
||||||
}
|
|
||||||
|
|
||||||
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
|
|
||||||
parent.insertBefore(
|
|
||||||
span,
|
|
||||||
parent.insertBefore(
|
|
||||||
document.createTextNode(val.substr(pos + text.length)),
|
|
||||||
node.nextSibling
|
|
||||||
)
|
|
||||||
);
|
|
||||||
node.nodeValue = val.substr(0, pos);
|
|
||||||
|
|
||||||
if (isInSVG) {
|
|
||||||
const rect = document.createElementNS(
|
|
||||||
"http://www.w3.org/2000/svg",
|
|
||||||
"rect"
|
|
||||||
);
|
|
||||||
const bbox = parent.getBBox();
|
|
||||||
rect.x.baseVal.value = bbox.x;
|
|
||||||
rect.y.baseVal.value = bbox.y;
|
|
||||||
rect.width.baseVal.value = bbox.width;
|
|
||||||
rect.height.baseVal.value = bbox.height;
|
|
||||||
rect.setAttribute("class", className);
|
|
||||||
addItems.push({ parent: parent, target: rect });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (node.matches && !node.matches("button, select, textarea")) {
|
|
||||||
node.childNodes.forEach((el) => _highlight(el, addItems, text, className));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const _highlightText = (thisNode, text, className) => {
|
|
||||||
let addItems = [];
|
|
||||||
_highlight(thisNode, addItems, text, className);
|
|
||||||
addItems.forEach((obj) =>
|
|
||||||
obj.parent.insertAdjacentElement("beforebegin", obj.target)
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Small JavaScript module for the documentation.
|
* Small JavaScript module for the documentation.
|
||||||
*/
|
*/
|
||||||
const Documentation = {
|
const Documentation = {
|
||||||
init: () => {
|
init: () => {
|
||||||
Documentation.highlightSearchWords();
|
|
||||||
Documentation.initDomainIndexTable();
|
Documentation.initDomainIndexTable();
|
||||||
Documentation.initOnKeyListeners();
|
Documentation.initOnKeyListeners();
|
||||||
},
|
},
|
||||||
@@ -126,51 +71,6 @@ const Documentation = {
|
|||||||
Documentation.LOCALE = catalog.locale;
|
Documentation.LOCALE = catalog.locale;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* highlight the search words provided in the url in the text
|
|
||||||
*/
|
|
||||||
highlightSearchWords: () => {
|
|
||||||
const highlight =
|
|
||||||
new URLSearchParams(window.location.search).get("highlight") || "";
|
|
||||||
const terms = highlight.toLowerCase().split(/\s+/).filter(x => x);
|
|
||||||
if (terms.length === 0) return; // nothing to do
|
|
||||||
|
|
||||||
// There should never be more than one element matching "div.body"
|
|
||||||
const divBody = document.querySelectorAll("div.body");
|
|
||||||
const body = divBody.length ? divBody[0] : document.querySelector("body");
|
|
||||||
window.setTimeout(() => {
|
|
||||||
terms.forEach((term) => _highlightText(body, term, "highlighted"));
|
|
||||||
}, 10);
|
|
||||||
|
|
||||||
const searchBox = document.getElementById("searchbox");
|
|
||||||
if (searchBox === null) return;
|
|
||||||
searchBox.appendChild(
|
|
||||||
document
|
|
||||||
.createRange()
|
|
||||||
.createContextualFragment(
|
|
||||||
'<p class="highlight-link">' +
|
|
||||||
'<a href="javascript:Documentation.hideSearchWords()">' +
|
|
||||||
Documentation.gettext("Hide Search Matches") +
|
|
||||||
"</a></p>"
|
|
||||||
)
|
|
||||||
);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* helper function to hide the search marks again
|
|
||||||
*/
|
|
||||||
hideSearchWords: () => {
|
|
||||||
document
|
|
||||||
.querySelectorAll("#searchbox .highlight-link")
|
|
||||||
.forEach((el) => el.remove());
|
|
||||||
document
|
|
||||||
.querySelectorAll("span.highlighted")
|
|
||||||
.forEach((el) => el.classList.remove("highlighted"));
|
|
||||||
const url = new URL(window.location);
|
|
||||||
url.searchParams.delete("highlight");
|
|
||||||
window.history.replaceState({}, "", url);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* helper function to focus on search bar
|
* helper function to focus on search bar
|
||||||
*/
|
*/
|
||||||
@@ -210,15 +110,11 @@ const Documentation = {
|
|||||||
)
|
)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const blacklistedElements = new Set([
|
|
||||||
"TEXTAREA",
|
|
||||||
"INPUT",
|
|
||||||
"SELECT",
|
|
||||||
"BUTTON",
|
|
||||||
]);
|
|
||||||
document.addEventListener("keydown", (event) => {
|
document.addEventListener("keydown", (event) => {
|
||||||
if (blacklistedElements.has(document.activeElement.tagName)) return; // bail for input elements
|
// bail for input elements
|
||||||
if (event.altKey || event.ctrlKey || event.metaKey) return; // bail with special keys
|
if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return;
|
||||||
|
// bail with special keys
|
||||||
|
if (event.altKey || event.ctrlKey || event.metaKey) return;
|
||||||
|
|
||||||
if (!event.shiftKey) {
|
if (!event.shiftKey) {
|
||||||
switch (event.key) {
|
switch (event.key) {
|
||||||
@@ -240,10 +136,6 @@ const Documentation = {
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "Escape":
|
|
||||||
if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break;
|
|
||||||
Documentation.hideSearchWords();
|
|
||||||
event.preventDefault();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
|
pre { line-height: 125%; }
|
||||||
|
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
|
||||||
|
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
|
||||||
|
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
|
||||||
|
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
|
||||||
.highlight .hll { background-color: #ffffcc }
|
.highlight .hll { background-color: #ffffcc }
|
||||||
.highlight { background: #eeffcc; }
|
.highlight { background: #eeffcc; }
|
||||||
.highlight .c { color: #408090; font-style: italic } /* Comment */
|
.highlight .c { color: #408090; font-style: italic } /* Comment */
|
||||||
.highlight .err { border: 1px solid #FF0000 } /* Error */
|
.highlight .err { border: 1px solid #FF0000 } /* Error */
|
||||||
.highlight .k { color: #007020; font-weight: bold } /* Keyword */
|
.highlight .k { color: #007020; font-weight: bold } /* Keyword */
|
||||||
|
|||||||
@@ -57,14 +57,14 @@ const _removeChildren = (element) => {
|
|||||||
const _escapeRegExp = (string) =>
|
const _escapeRegExp = (string) =>
|
||||||
string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
|
string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
|
||||||
|
|
||||||
const _displayItem = (item, highlightTerms, searchTerms) => {
|
const _displayItem = (item, searchTerms) => {
|
||||||
const docBuilder = DOCUMENTATION_OPTIONS.BUILDER;
|
const docBuilder = DOCUMENTATION_OPTIONS.BUILDER;
|
||||||
const docUrlRoot = DOCUMENTATION_OPTIONS.URL_ROOT;
|
const docUrlRoot = DOCUMENTATION_OPTIONS.URL_ROOT;
|
||||||
const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX;
|
const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX;
|
||||||
const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX;
|
const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX;
|
||||||
const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY;
|
const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY;
|
||||||
|
|
||||||
const [docName, title, anchor, descr] = item;
|
const [docName, title, anchor, descr, score, _filename] = item;
|
||||||
|
|
||||||
let listItem = document.createElement("li");
|
let listItem = document.createElement("li");
|
||||||
let requestUrl;
|
let requestUrl;
|
||||||
@@ -82,10 +82,9 @@ const _displayItem = (item, highlightTerms, searchTerms) => {
|
|||||||
requestUrl = docUrlRoot + docName + docFileSuffix;
|
requestUrl = docUrlRoot + docName + docFileSuffix;
|
||||||
linkUrl = docName + docLinkSuffix;
|
linkUrl = docName + docLinkSuffix;
|
||||||
}
|
}
|
||||||
const params = new URLSearchParams();
|
|
||||||
params.set("highlight", [...highlightTerms].join(" "));
|
|
||||||
let linkEl = listItem.appendChild(document.createElement("a"));
|
let linkEl = listItem.appendChild(document.createElement("a"));
|
||||||
linkEl.href = linkUrl + "?" + params.toString() + anchor;
|
linkEl.href = linkUrl + anchor;
|
||||||
|
linkEl.dataset.score = score;
|
||||||
linkEl.innerHTML = title;
|
linkEl.innerHTML = title;
|
||||||
if (descr)
|
if (descr)
|
||||||
listItem.appendChild(document.createElement("span")).innerHTML =
|
listItem.appendChild(document.createElement("span")).innerHTML =
|
||||||
@@ -96,7 +95,7 @@ const _displayItem = (item, highlightTerms, searchTerms) => {
|
|||||||
.then((data) => {
|
.then((data) => {
|
||||||
if (data)
|
if (data)
|
||||||
listItem.appendChild(
|
listItem.appendChild(
|
||||||
Search.makeSearchSummary(data, searchTerms, highlightTerms)
|
Search.makeSearchSummary(data, searchTerms)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
Search.output.appendChild(listItem);
|
Search.output.appendChild(listItem);
|
||||||
@@ -116,15 +115,14 @@ const _finishSearch = (resultCount) => {
|
|||||||
const _displayNextItem = (
|
const _displayNextItem = (
|
||||||
results,
|
results,
|
||||||
resultCount,
|
resultCount,
|
||||||
highlightTerms,
|
|
||||||
searchTerms
|
searchTerms
|
||||||
) => {
|
) => {
|
||||||
// results left, load the summary and display it
|
// results left, load the summary and display it
|
||||||
// this is intended to be dynamic (don't sub resultsCount)
|
// this is intended to be dynamic (don't sub resultsCount)
|
||||||
if (results.length) {
|
if (results.length) {
|
||||||
_displayItem(results.pop(), highlightTerms, searchTerms);
|
_displayItem(results.pop(), searchTerms);
|
||||||
setTimeout(
|
setTimeout(
|
||||||
() => _displayNextItem(results, resultCount, highlightTerms, searchTerms),
|
() => _displayNextItem(results, resultCount, searchTerms),
|
||||||
5
|
5
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -237,6 +235,12 @@ const Search = {
|
|||||||
* execute search (requires search index to be loaded)
|
* execute search (requires search index to be loaded)
|
||||||
*/
|
*/
|
||||||
query: (query) => {
|
query: (query) => {
|
||||||
|
const filenames = Search._index.filenames;
|
||||||
|
const docNames = Search._index.docnames;
|
||||||
|
const titles = Search._index.titles;
|
||||||
|
const allTitles = Search._index.alltitles;
|
||||||
|
const indexEntries = Search._index.indexentries;
|
||||||
|
|
||||||
// stem the search terms and add them to the correct list
|
// stem the search terms and add them to the correct list
|
||||||
const stemmer = new Stemmer();
|
const stemmer = new Stemmer();
|
||||||
const searchTerms = new Set();
|
const searchTerms = new Set();
|
||||||
@@ -264,6 +268,10 @@ const Search = {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (SPHINX_HIGHLIGHT_ENABLED) { // set in sphinx_highlight.js
|
||||||
|
localStorage.setItem("sphinx_highlight_terms", [...highlightTerms].join(" "))
|
||||||
|
}
|
||||||
|
|
||||||
// console.debug("SEARCH: searching for:");
|
// console.debug("SEARCH: searching for:");
|
||||||
// console.info("required: ", [...searchTerms]);
|
// console.info("required: ", [...searchTerms]);
|
||||||
// console.info("excluded: ", [...excludedTerms]);
|
// console.info("excluded: ", [...excludedTerms]);
|
||||||
@@ -272,6 +280,40 @@ const Search = {
|
|||||||
let results = [];
|
let results = [];
|
||||||
_removeChildren(document.getElementById("search-progress"));
|
_removeChildren(document.getElementById("search-progress"));
|
||||||
|
|
||||||
|
const queryLower = query.toLowerCase();
|
||||||
|
for (const [title, foundTitles] of Object.entries(allTitles)) {
|
||||||
|
if (title.toLowerCase().includes(queryLower) && (queryLower.length >= title.length/2)) {
|
||||||
|
for (const [file, id] of foundTitles) {
|
||||||
|
let score = Math.round(100 * queryLower.length / title.length)
|
||||||
|
results.push([
|
||||||
|
docNames[file],
|
||||||
|
titles[file] !== title ? `${titles[file]} > ${title}` : title,
|
||||||
|
id !== null ? "#" + id : "",
|
||||||
|
null,
|
||||||
|
score,
|
||||||
|
filenames[file],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// search for explicit entries in index directives
|
||||||
|
for (const [entry, foundEntries] of Object.entries(indexEntries)) {
|
||||||
|
if (entry.includes(queryLower) && (queryLower.length >= entry.length/2)) {
|
||||||
|
for (const [file, id] of foundEntries) {
|
||||||
|
let score = Math.round(100 * queryLower.length / entry.length)
|
||||||
|
results.push([
|
||||||
|
docNames[file],
|
||||||
|
titles[file],
|
||||||
|
id ? "#" + id : "",
|
||||||
|
null,
|
||||||
|
score,
|
||||||
|
filenames[file],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// lookup as object
|
// lookup as object
|
||||||
objectTerms.forEach((term) =>
|
objectTerms.forEach((term) =>
|
||||||
results.push(...Search.performObjectSearch(term, objectTerms))
|
results.push(...Search.performObjectSearch(term, objectTerms))
|
||||||
@@ -318,7 +360,7 @@ const Search = {
|
|||||||
// console.info("search results:", Search.lastresults);
|
// console.info("search results:", Search.lastresults);
|
||||||
|
|
||||||
// print the results
|
// print the results
|
||||||
_displayNextItem(results, results.length, highlightTerms, searchTerms);
|
_displayNextItem(results, results.length, searchTerms);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -399,8 +441,8 @@ const Search = {
|
|||||||
// prepare search
|
// prepare search
|
||||||
const terms = Search._index.terms;
|
const terms = Search._index.terms;
|
||||||
const titleTerms = Search._index.titleterms;
|
const titleTerms = Search._index.titleterms;
|
||||||
const docNames = Search._index.docnames;
|
|
||||||
const filenames = Search._index.filenames;
|
const filenames = Search._index.filenames;
|
||||||
|
const docNames = Search._index.docnames;
|
||||||
const titles = Search._index.titles;
|
const titles = Search._index.titles;
|
||||||
|
|
||||||
const scoreMap = new Map();
|
const scoreMap = new Map();
|
||||||
@@ -497,11 +539,9 @@ const Search = {
|
|||||||
/**
|
/**
|
||||||
* helper function to return a node containing the
|
* helper function to return a node containing the
|
||||||
* search summary for a given text. keywords is a list
|
* search summary for a given text. keywords is a list
|
||||||
* of stemmed words, highlightWords is the list of normal, unstemmed
|
* of stemmed words.
|
||||||
* words. the first one is used to find the occurrence, the
|
|
||||||
* latter for highlighting it.
|
|
||||||
*/
|
*/
|
||||||
makeSearchSummary: (htmlText, keywords, highlightWords) => {
|
makeSearchSummary: (htmlText, keywords) => {
|
||||||
const text = Search.htmlToText(htmlText);
|
const text = Search.htmlToText(htmlText);
|
||||||
if (text === "") return null;
|
if (text === "") return null;
|
||||||
|
|
||||||
@@ -519,10 +559,6 @@ const Search = {
|
|||||||
summary.classList.add("context");
|
summary.classList.add("context");
|
||||||
summary.textContent = top + text.substr(startWithContext, 240).trim() + tail;
|
summary.textContent = top + text.substr(startWithContext, 240).trim() + tail;
|
||||||
|
|
||||||
highlightWords.forEach((highlightWord) =>
|
|
||||||
_highlightText(summary, highlightWord, "highlighted")
|
|
||||||
);
|
|
||||||
|
|
||||||
return summary;
|
return summary;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,144 @@
|
|||||||
|
/* Highlighting utilities for Sphinx HTML documentation. */
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
const SPHINX_HIGHLIGHT_ENABLED = true
|
||||||
|
|
||||||
|
/**
|
||||||
|
* highlight a given string on a node by wrapping it in
|
||||||
|
* span elements with the given class name.
|
||||||
|
*/
|
||||||
|
const _highlight = (node, addItems, text, className) => {
|
||||||
|
if (node.nodeType === Node.TEXT_NODE) {
|
||||||
|
const val = node.nodeValue;
|
||||||
|
const parent = node.parentNode;
|
||||||
|
const pos = val.toLowerCase().indexOf(text);
|
||||||
|
if (
|
||||||
|
pos >= 0 &&
|
||||||
|
!parent.classList.contains(className) &&
|
||||||
|
!parent.classList.contains("nohighlight")
|
||||||
|
) {
|
||||||
|
let span;
|
||||||
|
|
||||||
|
const closestNode = parent.closest("body, svg, foreignObject");
|
||||||
|
const isInSVG = closestNode && closestNode.matches("svg");
|
||||||
|
if (isInSVG) {
|
||||||
|
span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
||||||
|
} else {
|
||||||
|
span = document.createElement("span");
|
||||||
|
span.classList.add(className);
|
||||||
|
}
|
||||||
|
|
||||||
|
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
|
||||||
|
parent.insertBefore(
|
||||||
|
span,
|
||||||
|
parent.insertBefore(
|
||||||
|
document.createTextNode(val.substr(pos + text.length)),
|
||||||
|
node.nextSibling
|
||||||
|
)
|
||||||
|
);
|
||||||
|
node.nodeValue = val.substr(0, pos);
|
||||||
|
|
||||||
|
if (isInSVG) {
|
||||||
|
const rect = document.createElementNS(
|
||||||
|
"http://www.w3.org/2000/svg",
|
||||||
|
"rect"
|
||||||
|
);
|
||||||
|
const bbox = parent.getBBox();
|
||||||
|
rect.x.baseVal.value = bbox.x;
|
||||||
|
rect.y.baseVal.value = bbox.y;
|
||||||
|
rect.width.baseVal.value = bbox.width;
|
||||||
|
rect.height.baseVal.value = bbox.height;
|
||||||
|
rect.setAttribute("class", className);
|
||||||
|
addItems.push({ parent: parent, target: rect });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (node.matches && !node.matches("button, select, textarea")) {
|
||||||
|
node.childNodes.forEach((el) => _highlight(el, addItems, text, className));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const _highlightText = (thisNode, text, className) => {
|
||||||
|
let addItems = [];
|
||||||
|
_highlight(thisNode, addItems, text, className);
|
||||||
|
addItems.forEach((obj) =>
|
||||||
|
obj.parent.insertAdjacentElement("beforebegin", obj.target)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Small JavaScript module for the documentation.
|
||||||
|
*/
|
||||||
|
const SphinxHighlight = {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* highlight the search words provided in localstorage in the text
|
||||||
|
*/
|
||||||
|
highlightSearchWords: () => {
|
||||||
|
if (!SPHINX_HIGHLIGHT_ENABLED) return; // bail if no highlight
|
||||||
|
|
||||||
|
// get and clear terms from localstorage
|
||||||
|
const url = new URL(window.location);
|
||||||
|
const highlight =
|
||||||
|
localStorage.getItem("sphinx_highlight_terms")
|
||||||
|
|| url.searchParams.get("highlight")
|
||||||
|
|| "";
|
||||||
|
localStorage.removeItem("sphinx_highlight_terms")
|
||||||
|
url.searchParams.delete("highlight");
|
||||||
|
window.history.replaceState({}, "", url);
|
||||||
|
|
||||||
|
// get individual terms from highlight string
|
||||||
|
const terms = highlight.toLowerCase().split(/\s+/).filter(x => x);
|
||||||
|
if (terms.length === 0) return; // nothing to do
|
||||||
|
|
||||||
|
// There should never be more than one element matching "div.body"
|
||||||
|
const divBody = document.querySelectorAll("div.body");
|
||||||
|
const body = divBody.length ? divBody[0] : document.querySelector("body");
|
||||||
|
window.setTimeout(() => {
|
||||||
|
terms.forEach((term) => _highlightText(body, term, "highlighted"));
|
||||||
|
}, 10);
|
||||||
|
|
||||||
|
const searchBox = document.getElementById("searchbox");
|
||||||
|
if (searchBox === null) return;
|
||||||
|
searchBox.appendChild(
|
||||||
|
document
|
||||||
|
.createRange()
|
||||||
|
.createContextualFragment(
|
||||||
|
'<p class="highlight-link">' +
|
||||||
|
'<a href="javascript:SphinxHighlight.hideSearchWords()">' +
|
||||||
|
_("Hide Search Matches") +
|
||||||
|
"</a></p>"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* helper function to hide the search marks again
|
||||||
|
*/
|
||||||
|
hideSearchWords: () => {
|
||||||
|
document
|
||||||
|
.querySelectorAll("#searchbox .highlight-link")
|
||||||
|
.forEach((el) => el.remove());
|
||||||
|
document
|
||||||
|
.querySelectorAll("span.highlighted")
|
||||||
|
.forEach((el) => el.classList.remove("highlighted"));
|
||||||
|
localStorage.removeItem("sphinx_highlight_terms")
|
||||||
|
},
|
||||||
|
|
||||||
|
initEscapeListener: () => {
|
||||||
|
// only install a listener if it is really needed
|
||||||
|
if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) return;
|
||||||
|
|
||||||
|
document.addEventListener("keydown", (event) => {
|
||||||
|
// bail for input elements
|
||||||
|
if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return;
|
||||||
|
// bail with special keys
|
||||||
|
if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return;
|
||||||
|
if (DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS && (event.key === "Escape")) {
|
||||||
|
SphinxHighlight.hideSearchWords();
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
_ready(SphinxHighlight.highlightSearchWords);
|
||||||
|
_ready(SphinxHighlight.initEscapeListener);
|
||||||
@@ -17,6 +17,7 @@
|
|||||||
<script src="_static/underscore.js"></script>
|
<script src="_static/underscore.js"></script>
|
||||||
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
||||||
<script src="_static/doctools.js"></script>
|
<script src="_static/doctools.js"></script>
|
||||||
|
<script src="_static/sphinx_highlight.js"></script>
|
||||||
<script src="_static/clipboard.min.js"></script>
|
<script src="_static/clipboard.min.js"></script>
|
||||||
<script src="_static/copybutton.js"></script>
|
<script src="_static/copybutton.js"></script>
|
||||||
<script src="_static/js/theme.js"></script>
|
<script src="_static/js/theme.js"></script>
|
||||||
@@ -90,7 +91,7 @@
|
|||||||
<li><a href="index.html" class="icon icon-home"></a> »</li>
|
<li><a href="index.html" class="icon icon-home"></a> »</li>
|
||||||
<li>Index</li>
|
<li>Index</li>
|
||||||
<li class="wy-breadcrumbs-aside">
|
<li class="wy-breadcrumbs-aside">
|
||||||
<a href="https://github.com/espressif/esp-docs/blob/7310a7a/docs/en/genindex" class="fa fa-github"> Edit on GitHub</a>
|
<a href="https://github.com/espressif/esp-docs/blob/467fec5/docs/en/genindex" class="fa fa-github"> Edit on GitHub</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
<script src="_static/underscore.js"></script>
|
<script src="_static/underscore.js"></script>
|
||||||
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
||||||
<script src="_static/doctools.js"></script>
|
<script src="_static/doctools.js"></script>
|
||||||
|
<script src="_static/sphinx_highlight.js"></script>
|
||||||
<script src="_static/clipboard.min.js"></script>
|
<script src="_static/clipboard.min.js"></script>
|
||||||
<script src="_static/copybutton.js"></script>
|
<script src="_static/copybutton.js"></script>
|
||||||
<script src="_static/js/theme.js"></script>
|
<script src="_static/js/theme.js"></script>
|
||||||
@@ -118,7 +119,7 @@
|
|||||||
<li><a href="#" class="icon icon-home"></a> »</li>
|
<li><a href="#" class="icon icon-home"></a> »</li>
|
||||||
<li>ESP WebSocket Client</li>
|
<li>ESP WebSocket Client</li>
|
||||||
<li class="wy-breadcrumbs-aside">
|
<li class="wy-breadcrumbs-aside">
|
||||||
<a href="https://github.com/espressif/esp-docs/blob/7310a7a/docs/en/index.rst" class="fa fa-github"> Edit on GitHub</a>
|
<a href="https://github.com/espressif/esp-docs/blob/467fec5/docs/en/index.rst" class="fa fa-github"> Edit on GitHub</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<hr/>
|
<hr/>
|
||||||
@@ -156,24 +157,24 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>Minimal configurations:</p>
|
<p>Minimal configurations:</p>
|
||||||
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">const</span> <span class="n">esp_websocket_client_config_t</span> <span class="n">ws_cfg</span> <span class="o">=</span> <span class="p">{</span>
|
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">const</span><span class="w"> </span><span class="n">esp_websocket_client_config_t</span><span class="w"> </span><span class="n">ws_cfg</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
|
||||||
<span class="p">.</span><span class="n">uri</span> <span class="o">=</span> <span class="s">"ws://echo.websocket.org"</span><span class="p">,</span>
|
<span class="w"> </span><span class="p">.</span><span class="n">uri</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">"ws://echo.websocket.org"</span><span class="p">,</span><span class="w"></span>
|
||||||
<span class="p">};</span>
|
<span class="p">};</span><span class="w"></span>
|
||||||
</pre></div>
|
</pre></div>
|
||||||
</div>
|
</div>
|
||||||
<p>The WebSocket client supports the use of both path and query in the URI. Sample:</p>
|
<p>The WebSocket client supports the use of both path and query in the URI. Sample:</p>
|
||||||
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">const</span> <span class="n">esp_websocket_client_config_t</span> <span class="n">ws_cfg</span> <span class="o">=</span> <span class="p">{</span>
|
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">const</span><span class="w"> </span><span class="n">esp_websocket_client_config_t</span><span class="w"> </span><span class="n">ws_cfg</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
|
||||||
<span class="p">.</span><span class="n">uri</span> <span class="o">=</span> <span class="s">"ws://echo.websocket.org/connectionhandler?id=104"</span><span class="p">,</span>
|
<span class="w"> </span><span class="p">.</span><span class="n">uri</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">"ws://echo.websocket.org/connectionhandler?id=104"</span><span class="p">,</span><span class="w"></span>
|
||||||
<span class="p">};</span>
|
<span class="p">};</span><span class="w"></span>
|
||||||
</pre></div>
|
</pre></div>
|
||||||
</div>
|
</div>
|
||||||
<p>If there are any options related to the URI in
|
<p>If there are any options related to the URI in
|
||||||
<a class="reference internal" href="#_CPPv429esp_websocket_client_config_t" title="esp_websocket_client_config_t"><code class="xref cpp cpp-type docutils literal notranslate"><span class="pre">esp_websocket_client_config_t</span></code></a>, the option defined by the URI will be
|
<a class="reference internal" href="#_CPPv429esp_websocket_client_config_t" title="esp_websocket_client_config_t"><code class="xref cpp cpp-type docutils literal notranslate"><span class="pre">esp_websocket_client_config_t</span></code></a>, the option defined by the URI will be
|
||||||
overridden. Sample:</p>
|
overridden. Sample:</p>
|
||||||
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">const</span> <span class="n">esp_websocket_client_config_t</span> <span class="n">ws_cfg</span> <span class="o">=</span> <span class="p">{</span>
|
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">const</span><span class="w"> </span><span class="n">esp_websocket_client_config_t</span><span class="w"> </span><span class="n">ws_cfg</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
|
||||||
<span class="p">.</span><span class="n">uri</span> <span class="o">=</span> <span class="s">"ws://echo.websocket.org:123"</span><span class="p">,</span>
|
<span class="w"> </span><span class="p">.</span><span class="n">uri</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">"ws://echo.websocket.org:123"</span><span class="p">,</span><span class="w"></span>
|
||||||
<span class="p">.</span><span class="n">port</span> <span class="o">=</span> <span class="mi">4567</span><span class="p">,</span>
|
<span class="w"> </span><span class="p">.</span><span class="n">port</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">4567</span><span class="p">,</span><span class="w"></span>
|
||||||
<span class="p">};</span>
|
<span class="p">};</span><span class="w"></span>
|
||||||
<span class="c1">//WebSocket client will connect to websocket.org using port 4567</span>
|
<span class="c1">//WebSocket client will connect to websocket.org using port 4567</span>
|
||||||
</pre></div>
|
</pre></div>
|
||||||
</div>
|
</div>
|
||||||
@@ -181,10 +182,10 @@ overridden. Sample:</p>
|
|||||||
<section id="tls">
|
<section id="tls">
|
||||||
<h3>TLS<a class="headerlink" href="#tls" title="Permalink to this heading"></a></h3>
|
<h3>TLS<a class="headerlink" href="#tls" title="Permalink to this heading"></a></h3>
|
||||||
<p>Configuration:</p>
|
<p>Configuration:</p>
|
||||||
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">const</span> <span class="n">esp_websocket_client_config_t</span> <span class="n">ws_cfg</span> <span class="o">=</span> <span class="p">{</span>
|
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">const</span><span class="w"> </span><span class="n">esp_websocket_client_config_t</span><span class="w"> </span><span class="n">ws_cfg</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
|
||||||
<span class="p">.</span><span class="n">uri</span> <span class="o">=</span> <span class="s">"wss://echo.websocket.org"</span><span class="p">,</span>
|
<span class="w"> </span><span class="p">.</span><span class="n">uri</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">"wss://echo.websocket.org"</span><span class="p">,</span><span class="w"></span>
|
||||||
<span class="p">.</span><span class="n">cert_pem</span> <span class="o">=</span> <span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="p">)</span><span class="n">websocket_org_pem_start</span><span class="p">,</span>
|
<span class="w"> </span><span class="p">.</span><span class="n">cert_pem</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="k">const</span><span class="w"> </span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="p">)</span><span class="n">websocket_org_pem_start</span><span class="p">,</span><span class="w"></span>
|
||||||
<span class="p">};</span>
|
<span class="p">};</span><span class="w"></span>
|
||||||
</pre></div>
|
</pre></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="admonition note">
|
<div class="admonition note">
|
||||||
@@ -201,10 +202,10 @@ In case a host operating system has <cite>openssl</cite> and <cite>sed</cite> pa
|
|||||||
<section id="subprotocol">
|
<section id="subprotocol">
|
||||||
<h3>Subprotocol<a class="headerlink" href="#subprotocol" title="Permalink to this heading"></a></h3>
|
<h3>Subprotocol<a class="headerlink" href="#subprotocol" title="Permalink to this heading"></a></h3>
|
||||||
<p>The subprotocol field in the config struct can be used to request a subprotocol</p>
|
<p>The subprotocol field in the config struct can be used to request a subprotocol</p>
|
||||||
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">const</span> <span class="n">esp_websocket_client_config_t</span> <span class="n">ws_cfg</span> <span class="o">=</span> <span class="p">{</span>
|
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">const</span><span class="w"> </span><span class="n">esp_websocket_client_config_t</span><span class="w"> </span><span class="n">ws_cfg</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
|
||||||
<span class="p">.</span><span class="n">uri</span> <span class="o">=</span> <span class="s">"ws://websocket.org"</span><span class="p">,</span>
|
<span class="w"> </span><span class="p">.</span><span class="n">uri</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">"ws://websocket.org"</span><span class="p">,</span><span class="w"></span>
|
||||||
<span class="p">.</span><span class="n">subprotocol</span> <span class="o">=</span> <span class="s">"soap"</span><span class="p">,</span>
|
<span class="w"> </span><span class="p">.</span><span class="n">subprotocol</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">"soap"</span><span class="p">,</span><span class="w"></span>
|
||||||
<span class="p">};</span>
|
<span class="p">};</span><span class="w"></span>
|
||||||
</pre></div>
|
</pre></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="admonition note">
|
<div class="admonition note">
|
||||||
@@ -223,7 +224,7 @@ In case a host operating system has <cite>openssl</cite> and <cite>sed</cite> pa
|
|||||||
<li><p><cite>WEBSOCKET_EVENT_ERROR</cite>: Not used in the current implementation of the client.</p></li>
|
<li><p><cite>WEBSOCKET_EVENT_ERROR</cite>: Not used in the current implementation of the client.</p></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>If the client handle is needed in the event handler it can be accessed through the pointer passed to the event handler:</p>
|
<p>If the client handle is needed in the event handler it can be accessed through the pointer passed to the event handler:</p>
|
||||||
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n">esp_websocket_client_handle_t</span> <span class="n">client</span> <span class="o">=</span> <span class="p">(</span><span class="n">esp_websocket_client_handle_t</span><span class="p">)</span><span class="n">handler_args</span><span class="p">;</span>
|
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="n">esp_websocket_client_handle_t</span><span class="w"> </span><span class="n">client</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="n">esp_websocket_client_handle_t</span><span class="p">)</span><span class="n">handler_args</span><span class="p">;</span><span class="w"></span>
|
||||||
</pre></div>
|
</pre></div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@@ -235,11 +236,11 @@ In case a host operating system has <cite>openssl</cite> and <cite>sed</cite> pa
|
|||||||
</section>
|
</section>
|
||||||
<section id="application-example">
|
<section id="application-example">
|
||||||
<h2>Application Example<a class="headerlink" href="#application-example" title="Permalink to this heading"></a></h2>
|
<h2>Application Example<a class="headerlink" href="#application-example" title="Permalink to this heading"></a></h2>
|
||||||
<p>A simple WebSocket example that uses esp_websocket_client to establish a websocket connection and send/receive data with the <a class="reference external" href="https://websocket.org">websocket.org</a> server can be found here: <a class="reference external" href="https://github.com/espressif/esp-protocols/tree/7310a7a/examples/../examples">example </a>.</p>
|
<p>A simple WebSocket example that uses esp_websocket_client to establish a websocket connection and send/receive data with the <a class="reference external" href="https://websocket.org">websocket.org</a> server can be found here: <a class="reference external" href="https://github.com/espressif/esp-protocols/tree/467fec5/examples/../examples">example </a>.</p>
|
||||||
<section id="sending-text-data">
|
<section id="sending-text-data">
|
||||||
<h3>Sending Text Data<a class="headerlink" href="#sending-text-data" title="Permalink to this heading"></a></h3>
|
<h3>Sending Text Data<a class="headerlink" href="#sending-text-data" title="Permalink to this heading"></a></h3>
|
||||||
<p>The WebSocket client supports sending data as a text data frame, which informs the application layer that the payload data is text data encoded as UTF-8. Example:</p>
|
<p>The WebSocket client supports sending data as a text data frame, which informs the application layer that the payload data is text data encoded as UTF-8. Example:</p>
|
||||||
<div class="highlight-cpp notranslate"><div class="highlight"><pre><span></span><span class="n">esp_websocket_client_send_text</span><span class="p">(</span><span class="n">client</span><span class="p">,</span> <span class="n">data</span><span class="p">,</span> <span class="n">len</span><span class="p">,</span> <span class="n">portMAX_DELAY</span><span class="p">);</span>
|
<div class="highlight-cpp notranslate"><div class="highlight"><pre><span></span><span class="n">esp_websocket_client_send_text</span><span class="p">(</span><span class="n">client</span><span class="p">,</span><span class="w"> </span><span class="n">data</span><span class="p">,</span><span class="w"> </span><span class="n">len</span><span class="p">,</span><span class="w"> </span><span class="n">portMAX_DELAY</span><span class="p">);</span><span class="w"></span>
|
||||||
</pre></div>
|
</pre></div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@@ -249,7 +250,7 @@ In case a host operating system has <cite>openssl</cite> and <cite>sed</cite> pa
|
|||||||
<section id="header-file">
|
<section id="header-file">
|
||||||
<h3>Header File<a class="headerlink" href="#header-file" title="Permalink to this heading"></a></h3>
|
<h3>Header File<a class="headerlink" href="#header-file" title="Permalink to this heading"></a></h3>
|
||||||
<ul class="simple">
|
<ul class="simple">
|
||||||
<li><p><a class="reference external" href="https://github.com/espressif/esp-protocols/blob/7310a7a/include/esp_websocket_client.h">include/esp_websocket_client.h</a></p></li>
|
<li><p><a class="reference external" href="https://github.com/espressif/esp-protocols/blob/467fec5/include/esp_websocket_client.h">include/esp_websocket_client.h</a></p></li>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
<section id="functions">
|
<section id="functions">
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
<script src="_static/underscore.js"></script>
|
<script src="_static/underscore.js"></script>
|
||||||
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
||||||
<script src="_static/doctools.js"></script>
|
<script src="_static/doctools.js"></script>
|
||||||
|
<script src="_static/sphinx_highlight.js"></script>
|
||||||
<script src="_static/clipboard.min.js"></script>
|
<script src="_static/clipboard.min.js"></script>
|
||||||
<script src="_static/copybutton.js"></script>
|
<script src="_static/copybutton.js"></script>
|
||||||
<script src="_static/js/theme.js"></script>
|
<script src="_static/js/theme.js"></script>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
Search.setIndex({"docnames": ["index"], "filenames": ["index.rst"], "titles": ["ESP WebSocket Client"], "terms": {"The": 0, "i": 0, "an": 0, "implement": 0, "protocol": 0, "esp32": 0, "support": 0, "over": 0, "tcp": 0, "mbedtl": 0, "easi": 0, "setup": 0, "multipl": 0, "instanc": 0, "one": 0, "w": 0, "wss": 0, "scheme": 0, "sampl": 0, "echo": 0, "org": 0, "default": 0, "port": 0, "80": 0, "ssl": 0, "443": 0, "minim": 0, "const": 0, "esp_websocket_client_config_t": 0, "ws_cfg": 0, "us": 0, "both": 0, "path": 0, "queri": 0, "connectionhandl": 0, "id": 0, "104": 0, "If": 0, "ar": 0, "ani": 0, "option": 0, "relat": 0, "defin": 0, "overridden": 0, "123": 0, "4567": 0, "connect": 0, "cert_pem": 0, "char": 0, "websocket_org_pem_start": 0, "you": 0, "want": 0, "verifi": 0, "server": 0, "need": 0, "provid": 0, "certif": 0, "pem": 0, "format": 0, "websocket_client_config_t": 0, "certfic": 0, "requir": 0, "verif": 0, "thi": 0, "could": 0, "extract": 0, "from": 0, "openssl": 0, "s_client": 0, "command": 0, "In": 0, "case": 0, "host": 0, "oper": 0, "system": 0, "ha": 0, "sed": 0, "packag": 0, "instal": 0, "execut": 0, "follow": 0, "download": 0, "save": 0, "root": 0, "intermedi": 0, "note": 0, "window": 0, "user": 0, "linux": 0, "like": 0, "environ": 0, "nativ": 0, "mai": 0, "showcert": 0, "n": 0, "1": 0, "d": 0, "begin": 0, "end": 0, "p": 0, "x509": 0, "outform": 0, "websocket_org": 0, "second": 0, "chain": 0, "field": 0, "config": 0, "struct": 0, "can": 0, "request": 0, "soap": 0, "indiffer": 0, "respons": 0, "accept": 0, "matter": 0, "what": 0, "repli": 0, "For": 0, "more": 0, "pleas": 0, "below": 0, "websocket_event_connect": 0, "successfulli": 0, "establish": 0, "now": 0, "readi": 0, "receiv": 0, "contain": 0, "websocket_event_disconnect": 0, "abort": 0, "due": 0, "transport": 0, "layer": 0, "fail": 0, "read": 0, "e": 0, "g": 0, "becaus": 0, "unavail": 0, "websocket_event_data": 0, "pars": 0, "frame": 0, "pointer": 0, "payload": 0, "length": 0, "well": 0, "opcod": 0, "A": 0, "messag": 0, "fragment": 0, "exce": 0, "buffer": 0, "size": 0, "also": 0, "post": 0, "non": 0, "pong": 0, "close": 0, "websocket_event_error": 0, "Not": 0, "current": 0, "handl": 0, "handler": 0, "access": 0, "through": 0, "pass": 0, "esp_websocket_client_handle_t": 0, "handler_arg": 0, "abl": 0, "dure": 0, "handshak": 0, "doe": 0, "do": 0, "check": 0, "simpl": 0, "esp_websocket_cli": 0, "found": 0, "here": 0, "which": 0, "inform": 0, "encod": 0, "utf": 0, "8": 0, "esp_websocket_client_send_text": 0, "len": 0, "portmax_delai": 0, "includ": 0, "h": 0, "esp_websocket_client_init": 0, "start": 0, "session": 0, "must": 0, "first": 0, "call": 0, "return": 0, "input": 0, "other": 0, "interfac": 0, "have": 0, "correspond": 0, "esp_websocket_client_destroi": 0, "when": 0, "complet": 0, "paramet": 0, "null": 0, "error": 0, "esp_err_t": 0, "esp_websocket_client_set_uri": 0, "set": 0, "url": 0, "perform": 0, "behavior": 0, "replac": 0, "old": 0, "ones": 0, "stop": 0, "befor": 0, "been": 0, "esp_websocket_client_start": 0, "open": 0, "esp_websocket_client_stop": 0, "without": 0, "directli": 0, "It": 0, "good": 0, "practic": 0, "clean": 0, "wai": 0, "esp_websocket_client_clos": 0, "cannot": 0, "destroi": 0, "free": 0, "all": 0, "resourc": 0, "last": 0, "opposit": 0, "same": 0, "might": 0, "int": 0, "esp_websocket_client_send_bin": 0, "ticktype_t": 0, "timeout": 0, "write": 0, "binari": 0, "02": 0, "rto": 0, "tick": 0, "number": 0, "wa": 0, "sent": 0, "textual": 0, "01": 0, "sequenc": 0, "initi": 0, "wait": 0, "until": 0, "esp_websocket_client_close_with_cod": 0, "code": 0, "custom": 0, "statu": 0, "rfc6455": 0, "section": 0, "7": 0, "4": 0, "addit": 0, "bool": 0, "esp_websocket_client_is_connect": 0, "state": 0, "true": 0, "fals": 0, "size_t": 0, "esp_websocket_client_get_ping_interval_sec": 0, "get": 0, "ping": 0, "interv": 0, "sec": 0, "esp_websocket_client_set_ping_interval_sec": 0, "ping_interval_sec": 0, "new": 0, "esp_websocket_register_ev": 0, "esp_websocket_event_id_t": 0, "esp_event_handler_t": 0, "event_handl": 0, "void": 0, "event_handler_arg": 0, "regist": 0, "callback": 0, "context": 0, "esp_websocket_event_data_t": 0, "public": 0, "member": 0, "data_ptr": 0, "data_len": 0, "fin": 0, "flag": 0, "uint8_t": 0, "op_cod": 0, "user_context": 0, "user_data": 0, "payload_len": 0, "total": 0, "exceed": 0, "payload_offset": 0, "actual": 0, "offset": 0, "associ": 0, "overrid": 0, "domain": 0, "ip": 0, "string": 0, "depend": 0, "esp_websocket_transport_t": 0, "usernam": 0, "http": 0, "authent": 0, "password": 0, "disable_auto_reconnect": 0, "disabl": 0, "automat": 0, "reconnect": 0, "disconnect": 0, "task_prio": 0, "task": 0, "prioriti": 0, "task_stack": 0, "stack": 0, "buffer_s": 0, "der": 0, "termin": 0, "charact": 0, "cert_len": 0, "point": 0, "0": 0, "client_cert": 0, "mutual": 0, "client_kei": 0, "client_cert_len": 0, "privat": 0, "kei": 0, "client_key_len": 0, "client_key_pem": 0, "see": 0, "user_ag": 0, "agent": 0, "pingpong_timeout_sec": 0, "perioLine truncated
|
Search.setIndex({"docnames": ["index"], "filenames": ["index.rst"], "titles": ["ESP WebSocket Client"], "terms": {"The": 0, "i": 0, "an": 0, "implement": 0, "protocol": 0, "esp32": 0, "support": 0, "over": 0, "tcp": 0, "mbedtl": 0, "easi": 0, "setup": 0, "multipl": 0, "instanc": 0, "one": 0, "w": 0, "wss": 0, "scheme": 0, "sampl": 0, "echo": 0, "org": 0, "default": 0, "port": 0, "80": 0, "ssl": 0, "443": 0, "minim": 0, "const": 0, "esp_websocket_client_config_t": 0, "ws_cfg": 0, "us": 0, "both": 0, "path": 0, "queri": 0, "connectionhandl": 0, "id": 0, "104": 0, "If": 0, "ar": 0, "ani": 0, "option": 0, "relat": 0, "defin": 0, "overridden": 0, "123": 0, "4567": 0, "connect": 0, "cert_pem": 0, "char": 0, "websocket_org_pem_start": 0, "you": 0, "want": 0, "verifi": 0, "server": 0, "need": 0, "provid": 0, "certif": 0, "pem": 0, "format": 0, "websocket_client_config_t": 0, "certfic": 0, "requir": 0, "verif": 0, "thi": 0, "could": 0, "extract": 0, "from": 0, "openssl": 0, "s_client": 0, "command": 0, "In": 0, "case": 0, "host": 0, "oper": 0, "system": 0, "ha": 0, "sed": 0, "packag": 0, "instal": 0, "execut": 0, "follow": 0, "download": 0, "save": 0, "root": 0, "intermedi": 0, "note": 0, "window": 0, "user": 0, "linux": 0, "like": 0, "environ": 0, "nativ": 0, "mai": 0, "showcert": 0, "n": 0, "1": 0, "d": 0, "begin": 0, "end": 0, "p": 0, "x509": 0, "outform": 0, "websocket_org": 0, "second": 0, "chain": 0, "field": 0, "config": 0, "struct": 0, "can": 0, "request": 0, "soap": 0, "indiffer": 0, "respons": 0, "accept": 0, "matter": 0, "what": 0, "repli": 0, "For": 0, "more": 0, "pleas": 0, "below": 0, "websocket_event_connect": 0, "successfulli": 0, "establish": 0, "now": 0, "readi": 0, "receiv": 0, "contain": 0, "websocket_event_disconnect": 0, "abort": 0, "due": 0, "transport": 0, "layer": 0, "fail": 0, "read": 0, "e": 0, "g": 0, "becaus": 0, "unavail": 0, "websocket_event_data": 0, "pars": 0, "frame": 0, "pointer": 0, "payload": 0, "length": 0, "well": 0, "opcod": 0, "A": 0, "messag": 0, "fragment": 0, "exce": 0, "buffer": 0, "size": 0, "also": 0, "post": 0, "non": 0, "pong": 0, "close": 0, "websocket_event_error": 0, "Not": 0, "current": 0, "handl": 0, "handler": 0, "access": 0, "through": 0, "pass": 0, "esp_websocket_client_handle_t": 0, "handler_arg": 0, "abl": 0, "dure": 0, "handshak": 0, "doe": 0, "do": 0, "check": 0, "simpl": 0, "esp_websocket_cli": 0, "found": 0, "here": 0, "which": 0, "inform": 0, "encod": 0, "utf": 0, "8": 0, "esp_websocket_client_send_text": 0, "len": 0, "portmax_delai": 0, "includ": 0, "h": 0, "esp_websocket_client_init": 0, "start": 0, "session": 0, "must": 0, "first": 0, "call": 0, "return": 0, "input": 0, "other": 0, "interfac": 0, "have": 0, "correspond": 0, "esp_websocket_client_destroi": 0, "when": 0, "complet": 0, "paramet": 0, "null": 0, "error": 0, "esp_err_t": 0, "esp_websocket_client_set_uri": 0, "set": 0, "url": 0, "perform": 0, "behavior": 0, "replac": 0, "old": 0, "ones": 0, "stop": 0, "befor": 0, "been": 0, "esp_websocket_client_start": 0, "open": 0, "esp_websocket_client_stop": 0, "without": 0, "directli": 0, "It": 0, "good": 0, "practic": 0, "clean": 0, "wai": 0, "esp_websocket_client_clos": 0, "cannot": 0, "destroi": 0, "free": 0, "all": 0, "resourc": 0, "last": 0, "opposit": 0, "same": 0, "might": 0, "int": 0, "esp_websocket_client_send_bin": 0, "ticktype_t": 0, "timeout": 0, "write": 0, "binari": 0, "02": 0, "rto": 0, "tick": 0, "number": 0, "wa": 0, "sent": 0, "textual": 0, "01": 0, "sequenc": 0, "initi": 0, "wait": 0, "until": 0, "esp_websocket_client_close_with_cod": 0, "code": 0, "custom": 0, "statu": 0, "rfc6455": 0, "section": 0, "7": 0, "4": 0, "addit": 0, "bool": 0, "esp_websocket_client_is_connect": 0, "state": 0, "true": 0, "fals": 0, "size_t": 0, "esp_websocket_client_get_ping_interval_sec": 0, "get": 0, "ping": 0, "interv": 0, "sec": 0, "esp_websocket_client_set_ping_interval_sec": 0, "ping_interval_sec": 0, "new": 0, "esp_websocket_register_ev": 0, "esp_websocket_event_id_t": 0, "esp_event_handler_t": 0, "event_handl": 0, "void": 0, "event_handler_arg": 0, "regist": 0, "callback": 0, "context": 0, "esp_websocket_event_data_t": 0, "public": 0, "member": 0, "data_ptr": 0, "data_len": 0, "fin": 0, "flag": 0, "uint8_t": 0, "op_cod": 0, "user_context": 0, "user_data": 0, "payload_len": 0, "total": 0, "exceed": 0, "payload_offset": 0, "actual": 0, "offset": 0, "associ": 0, "overrid": 0, "domain": 0, "ip": 0, "string": 0, "depend": 0, "esp_websocket_transport_t": 0, "usernam": 0, "http": 0, "authent": 0, "password": 0, "disable_auto_reconnect": 0, "disabl": 0, "automat": 0, "reconnect": 0, "disconnect": 0, "task_prio": 0, "task": 0, "prioriti": 0, "task_stack": 0, "stack": 0, "buffer_s": 0, "der": 0, "termin": 0, "charact": 0, "cert_len": 0, "point": 0, "0": 0, "client_cert": 0, "mutual": 0, "client_kei": 0, "client_cert_len": 0, "privat": 0, "kei": 0, "client_key_len": 0, "client_key_pem": 0, "see": 0, "user_ag": 0, "agent": 0, "pingpong_timeout_sec": 0, "perioLine truncated
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
# Sphinx build info version 1
|
# Sphinx build info version 1
|
||||||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
|
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
|
||||||
config: bdb9c4058bb57ea76ea7b85c00a2c40f
|
config: 2bccfe8e104e823c5c6f1fd9ba510b65
|
||||||
tags: 549b3d6d0415232fb7e35403b330ff49
|
tags: 549b3d6d0415232fb7e35403b330ff49
|
||||||
+11
-119
@@ -10,6 +10,13 @@
|
|||||||
*/
|
*/
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([
|
||||||
|
"TEXTAREA",
|
||||||
|
"INPUT",
|
||||||
|
"SELECT",
|
||||||
|
"BUTTON",
|
||||||
|
]);
|
||||||
|
|
||||||
const _ready = (callback) => {
|
const _ready = (callback) => {
|
||||||
if (document.readyState !== "loading") {
|
if (document.readyState !== "loading") {
|
||||||
callback();
|
callback();
|
||||||
@@ -18,73 +25,11 @@ const _ready = (callback) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* highlight a given string on a node by wrapping it in
|
|
||||||
* span elements with the given class name.
|
|
||||||
*/
|
|
||||||
const _highlight = (node, addItems, text, className) => {
|
|
||||||
if (node.nodeType === Node.TEXT_NODE) {
|
|
||||||
const val = node.nodeValue;
|
|
||||||
const parent = node.parentNode;
|
|
||||||
const pos = val.toLowerCase().indexOf(text);
|
|
||||||
if (
|
|
||||||
pos >= 0 &&
|
|
||||||
!parent.classList.contains(className) &&
|
|
||||||
!parent.classList.contains("nohighlight")
|
|
||||||
) {
|
|
||||||
let span;
|
|
||||||
|
|
||||||
const closestNode = parent.closest("body, svg, foreignObject");
|
|
||||||
const isInSVG = closestNode && closestNode.matches("svg");
|
|
||||||
if (isInSVG) {
|
|
||||||
span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
||||||
} else {
|
|
||||||
span = document.createElement("span");
|
|
||||||
span.classList.add(className);
|
|
||||||
}
|
|
||||||
|
|
||||||
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
|
|
||||||
parent.insertBefore(
|
|
||||||
span,
|
|
||||||
parent.insertBefore(
|
|
||||||
document.createTextNode(val.substr(pos + text.length)),
|
|
||||||
node.nextSibling
|
|
||||||
)
|
|
||||||
);
|
|
||||||
node.nodeValue = val.substr(0, pos);
|
|
||||||
|
|
||||||
if (isInSVG) {
|
|
||||||
const rect = document.createElementNS(
|
|
||||||
"http://www.w3.org/2000/svg",
|
|
||||||
"rect"
|
|
||||||
);
|
|
||||||
const bbox = parent.getBBox();
|
|
||||||
rect.x.baseVal.value = bbox.x;
|
|
||||||
rect.y.baseVal.value = bbox.y;
|
|
||||||
rect.width.baseVal.value = bbox.width;
|
|
||||||
rect.height.baseVal.value = bbox.height;
|
|
||||||
rect.setAttribute("class", className);
|
|
||||||
addItems.push({ parent: parent, target: rect });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (node.matches && !node.matches("button, select, textarea")) {
|
|
||||||
node.childNodes.forEach((el) => _highlight(el, addItems, text, className));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const _highlightText = (thisNode, text, className) => {
|
|
||||||
let addItems = [];
|
|
||||||
_highlight(thisNode, addItems, text, className);
|
|
||||||
addItems.forEach((obj) =>
|
|
||||||
obj.parent.insertAdjacentElement("beforebegin", obj.target)
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Small JavaScript module for the documentation.
|
* Small JavaScript module for the documentation.
|
||||||
*/
|
*/
|
||||||
const Documentation = {
|
const Documentation = {
|
||||||
init: () => {
|
init: () => {
|
||||||
Documentation.highlightSearchWords();
|
|
||||||
Documentation.initDomainIndexTable();
|
Documentation.initDomainIndexTable();
|
||||||
Documentation.initOnKeyListeners();
|
Documentation.initOnKeyListeners();
|
||||||
},
|
},
|
||||||
@@ -126,51 +71,6 @@ const Documentation = {
|
|||||||
Documentation.LOCALE = catalog.locale;
|
Documentation.LOCALE = catalog.locale;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* highlight the search words provided in the url in the text
|
|
||||||
*/
|
|
||||||
highlightSearchWords: () => {
|
|
||||||
const highlight =
|
|
||||||
new URLSearchParams(window.location.search).get("highlight") || "";
|
|
||||||
const terms = highlight.toLowerCase().split(/\s+/).filter(x => x);
|
|
||||||
if (terms.length === 0) return; // nothing to do
|
|
||||||
|
|
||||||
// There should never be more than one element matching "div.body"
|
|
||||||
const divBody = document.querySelectorAll("div.body");
|
|
||||||
const body = divBody.length ? divBody[0] : document.querySelector("body");
|
|
||||||
window.setTimeout(() => {
|
|
||||||
terms.forEach((term) => _highlightText(body, term, "highlighted"));
|
|
||||||
}, 10);
|
|
||||||
|
|
||||||
const searchBox = document.getElementById("searchbox");
|
|
||||||
if (searchBox === null) return;
|
|
||||||
searchBox.appendChild(
|
|
||||||
document
|
|
||||||
.createRange()
|
|
||||||
.createContextualFragment(
|
|
||||||
'<p class="highlight-link">' +
|
|
||||||
'<a href="javascript:Documentation.hideSearchWords()">' +
|
|
||||||
Documentation.gettext("Hide Search Matches") +
|
|
||||||
"</a></p>"
|
|
||||||
)
|
|
||||||
);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* helper function to hide the search marks again
|
|
||||||
*/
|
|
||||||
hideSearchWords: () => {
|
|
||||||
document
|
|
||||||
.querySelectorAll("#searchbox .highlight-link")
|
|
||||||
.forEach((el) => el.remove());
|
|
||||||
document
|
|
||||||
.querySelectorAll("span.highlighted")
|
|
||||||
.forEach((el) => el.classList.remove("highlighted"));
|
|
||||||
const url = new URL(window.location);
|
|
||||||
url.searchParams.delete("highlight");
|
|
||||||
window.history.replaceState({}, "", url);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* helper function to focus on search bar
|
* helper function to focus on search bar
|
||||||
*/
|
*/
|
||||||
@@ -210,15 +110,11 @@ const Documentation = {
|
|||||||
)
|
)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const blacklistedElements = new Set([
|
|
||||||
"TEXTAREA",
|
|
||||||
"INPUT",
|
|
||||||
"SELECT",
|
|
||||||
"BUTTON",
|
|
||||||
]);
|
|
||||||
document.addEventListener("keydown", (event) => {
|
document.addEventListener("keydown", (event) => {
|
||||||
if (blacklistedElements.has(document.activeElement.tagName)) return; // bail for input elements
|
// bail for input elements
|
||||||
if (event.altKey || event.ctrlKey || event.metaKey) return; // bail with special keys
|
if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return;
|
||||||
|
// bail with special keys
|
||||||
|
if (event.altKey || event.ctrlKey || event.metaKey) return;
|
||||||
|
|
||||||
if (!event.shiftKey) {
|
if (!event.shiftKey) {
|
||||||
switch (event.key) {
|
switch (event.key) {
|
||||||
@@ -240,10 +136,6 @@ const Documentation = {
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "Escape":
|
|
||||||
if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break;
|
|
||||||
Documentation.hideSearchWords();
|
|
||||||
event.preventDefault();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
|
pre { line-height: 125%; }
|
||||||
|
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
|
||||||
|
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
|
||||||
|
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
|
||||||
|
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
|
||||||
.highlight .hll { background-color: #ffffcc }
|
.highlight .hll { background-color: #ffffcc }
|
||||||
.highlight { background: #eeffcc; }
|
.highlight { background: #eeffcc; }
|
||||||
.highlight .c { color: #408090; font-style: italic } /* Comment */
|
.highlight .c { color: #408090; font-style: italic } /* Comment */
|
||||||
.highlight .err { border: 1px solid #FF0000 } /* Error */
|
.highlight .err { border: 1px solid #FF0000 } /* Error */
|
||||||
.highlight .k { color: #007020; font-weight: bold } /* Keyword */
|
.highlight .k { color: #007020; font-weight: bold } /* Keyword */
|
||||||
|
|||||||
@@ -57,14 +57,14 @@ const _removeChildren = (element) => {
|
|||||||
const _escapeRegExp = (string) =>
|
const _escapeRegExp = (string) =>
|
||||||
string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
|
string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
|
||||||
|
|
||||||
const _displayItem = (item, highlightTerms, searchTerms) => {
|
const _displayItem = (item, searchTerms) => {
|
||||||
const docBuilder = DOCUMENTATION_OPTIONS.BUILDER;
|
const docBuilder = DOCUMENTATION_OPTIONS.BUILDER;
|
||||||
const docUrlRoot = DOCUMENTATION_OPTIONS.URL_ROOT;
|
const docUrlRoot = DOCUMENTATION_OPTIONS.URL_ROOT;
|
||||||
const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX;
|
const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX;
|
||||||
const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX;
|
const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX;
|
||||||
const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY;
|
const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY;
|
||||||
|
|
||||||
const [docName, title, anchor, descr] = item;
|
const [docName, title, anchor, descr, score, _filename] = item;
|
||||||
|
|
||||||
let listItem = document.createElement("li");
|
let listItem = document.createElement("li");
|
||||||
let requestUrl;
|
let requestUrl;
|
||||||
@@ -82,10 +82,9 @@ const _displayItem = (item, highlightTerms, searchTerms) => {
|
|||||||
requestUrl = docUrlRoot + docName + docFileSuffix;
|
requestUrl = docUrlRoot + docName + docFileSuffix;
|
||||||
linkUrl = docName + docLinkSuffix;
|
linkUrl = docName + docLinkSuffix;
|
||||||
}
|
}
|
||||||
const params = new URLSearchParams();
|
|
||||||
params.set("highlight", [...highlightTerms].join(" "));
|
|
||||||
let linkEl = listItem.appendChild(document.createElement("a"));
|
let linkEl = listItem.appendChild(document.createElement("a"));
|
||||||
linkEl.href = linkUrl + "?" + params.toString() + anchor;
|
linkEl.href = linkUrl + anchor;
|
||||||
|
linkEl.dataset.score = score;
|
||||||
linkEl.innerHTML = title;
|
linkEl.innerHTML = title;
|
||||||
if (descr)
|
if (descr)
|
||||||
listItem.appendChild(document.createElement("span")).innerHTML =
|
listItem.appendChild(document.createElement("span")).innerHTML =
|
||||||
@@ -96,7 +95,7 @@ const _displayItem = (item, highlightTerms, searchTerms) => {
|
|||||||
.then((data) => {
|
.then((data) => {
|
||||||
if (data)
|
if (data)
|
||||||
listItem.appendChild(
|
listItem.appendChild(
|
||||||
Search.makeSearchSummary(data, searchTerms, highlightTerms)
|
Search.makeSearchSummary(data, searchTerms)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
Search.output.appendChild(listItem);
|
Search.output.appendChild(listItem);
|
||||||
@@ -116,15 +115,14 @@ const _finishSearch = (resultCount) => {
|
|||||||
const _displayNextItem = (
|
const _displayNextItem = (
|
||||||
results,
|
results,
|
||||||
resultCount,
|
resultCount,
|
||||||
highlightTerms,
|
|
||||||
searchTerms
|
searchTerms
|
||||||
) => {
|
) => {
|
||||||
// results left, load the summary and display it
|
// results left, load the summary and display it
|
||||||
// this is intended to be dynamic (don't sub resultsCount)
|
// this is intended to be dynamic (don't sub resultsCount)
|
||||||
if (results.length) {
|
if (results.length) {
|
||||||
_displayItem(results.pop(), highlightTerms, searchTerms);
|
_displayItem(results.pop(), searchTerms);
|
||||||
setTimeout(
|
setTimeout(
|
||||||
() => _displayNextItem(results, resultCount, highlightTerms, searchTerms),
|
() => _displayNextItem(results, resultCount, searchTerms),
|
||||||
5
|
5
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -237,6 +235,12 @@ const Search = {
|
|||||||
* execute search (requires search index to be loaded)
|
* execute search (requires search index to be loaded)
|
||||||
*/
|
*/
|
||||||
query: (query) => {
|
query: (query) => {
|
||||||
|
const filenames = Search._index.filenames;
|
||||||
|
const docNames = Search._index.docnames;
|
||||||
|
const titles = Search._index.titles;
|
||||||
|
const allTitles = Search._index.alltitles;
|
||||||
|
const indexEntries = Search._index.indexentries;
|
||||||
|
|
||||||
// stem the search terms and add them to the correct list
|
// stem the search terms and add them to the correct list
|
||||||
const stemmer = new Stemmer();
|
const stemmer = new Stemmer();
|
||||||
const searchTerms = new Set();
|
const searchTerms = new Set();
|
||||||
@@ -264,6 +268,10 @@ const Search = {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (SPHINX_HIGHLIGHT_ENABLED) { // set in sphinx_highlight.js
|
||||||
|
localStorage.setItem("sphinx_highlight_terms", [...highlightTerms].join(" "))
|
||||||
|
}
|
||||||
|
|
||||||
// console.debug("SEARCH: searching for:");
|
// console.debug("SEARCH: searching for:");
|
||||||
// console.info("required: ", [...searchTerms]);
|
// console.info("required: ", [...searchTerms]);
|
||||||
// console.info("excluded: ", [...excludedTerms]);
|
// console.info("excluded: ", [...excludedTerms]);
|
||||||
@@ -272,6 +280,40 @@ const Search = {
|
|||||||
let results = [];
|
let results = [];
|
||||||
_removeChildren(document.getElementById("search-progress"));
|
_removeChildren(document.getElementById("search-progress"));
|
||||||
|
|
||||||
|
const queryLower = query.toLowerCase();
|
||||||
|
for (const [title, foundTitles] of Object.entries(allTitles)) {
|
||||||
|
if (title.toLowerCase().includes(queryLower) && (queryLower.length >= title.length/2)) {
|
||||||
|
for (const [file, id] of foundTitles) {
|
||||||
|
let score = Math.round(100 * queryLower.length / title.length)
|
||||||
|
results.push([
|
||||||
|
docNames[file],
|
||||||
|
titles[file] !== title ? `${titles[file]} > ${title}` : title,
|
||||||
|
id !== null ? "#" + id : "",
|
||||||
|
null,
|
||||||
|
score,
|
||||||
|
filenames[file],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// search for explicit entries in index directives
|
||||||
|
for (const [entry, foundEntries] of Object.entries(indexEntries)) {
|
||||||
|
if (entry.includes(queryLower) && (queryLower.length >= entry.length/2)) {
|
||||||
|
for (const [file, id] of foundEntries) {
|
||||||
|
let score = Math.round(100 * queryLower.length / entry.length)
|
||||||
|
results.push([
|
||||||
|
docNames[file],
|
||||||
|
titles[file],
|
||||||
|
id ? "#" + id : "",
|
||||||
|
null,
|
||||||
|
score,
|
||||||
|
filenames[file],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// lookup as object
|
// lookup as object
|
||||||
objectTerms.forEach((term) =>
|
objectTerms.forEach((term) =>
|
||||||
results.push(...Search.performObjectSearch(term, objectTerms))
|
results.push(...Search.performObjectSearch(term, objectTerms))
|
||||||
@@ -318,7 +360,7 @@ const Search = {
|
|||||||
// console.info("search results:", Search.lastresults);
|
// console.info("search results:", Search.lastresults);
|
||||||
|
|
||||||
// print the results
|
// print the results
|
||||||
_displayNextItem(results, results.length, highlightTerms, searchTerms);
|
_displayNextItem(results, results.length, searchTerms);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -399,8 +441,8 @@ const Search = {
|
|||||||
// prepare search
|
// prepare search
|
||||||
const terms = Search._index.terms;
|
const terms = Search._index.terms;
|
||||||
const titleTerms = Search._index.titleterms;
|
const titleTerms = Search._index.titleterms;
|
||||||
const docNames = Search._index.docnames;
|
|
||||||
const filenames = Search._index.filenames;
|
const filenames = Search._index.filenames;
|
||||||
|
const docNames = Search._index.docnames;
|
||||||
const titles = Search._index.titles;
|
const titles = Search._index.titles;
|
||||||
|
|
||||||
const scoreMap = new Map();
|
const scoreMap = new Map();
|
||||||
@@ -497,11 +539,9 @@ const Search = {
|
|||||||
/**
|
/**
|
||||||
* helper function to return a node containing the
|
* helper function to return a node containing the
|
||||||
* search summary for a given text. keywords is a list
|
* search summary for a given text. keywords is a list
|
||||||
* of stemmed words, highlightWords is the list of normal, unstemmed
|
* of stemmed words.
|
||||||
* words. the first one is used to find the occurrence, the
|
|
||||||
* latter for highlighting it.
|
|
||||||
*/
|
*/
|
||||||
makeSearchSummary: (htmlText, keywords, highlightWords) => {
|
makeSearchSummary: (htmlText, keywords) => {
|
||||||
const text = Search.htmlToText(htmlText);
|
const text = Search.htmlToText(htmlText);
|
||||||
if (text === "") return null;
|
if (text === "") return null;
|
||||||
|
|
||||||
@@ -519,10 +559,6 @@ const Search = {
|
|||||||
summary.classList.add("context");
|
summary.classList.add("context");
|
||||||
summary.textContent = top + text.substr(startWithContext, 240).trim() + tail;
|
summary.textContent = top + text.substr(startWithContext, 240).trim() + tail;
|
||||||
|
|
||||||
highlightWords.forEach((highlightWord) =>
|
|
||||||
_highlightText(summary, highlightWord, "highlighted")
|
|
||||||
);
|
|
||||||
|
|
||||||
return summary;
|
return summary;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,144 @@
|
|||||||
|
/* Highlighting utilities for Sphinx HTML documentation. */
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
const SPHINX_HIGHLIGHT_ENABLED = true
|
||||||
|
|
||||||
|
/**
|
||||||
|
* highlight a given string on a node by wrapping it in
|
||||||
|
* span elements with the given class name.
|
||||||
|
*/
|
||||||
|
const _highlight = (node, addItems, text, className) => {
|
||||||
|
if (node.nodeType === Node.TEXT_NODE) {
|
||||||
|
const val = node.nodeValue;
|
||||||
|
const parent = node.parentNode;
|
||||||
|
const pos = val.toLowerCase().indexOf(text);
|
||||||
|
if (
|
||||||
|
pos >= 0 &&
|
||||||
|
!parent.classList.contains(className) &&
|
||||||
|
!parent.classList.contains("nohighlight")
|
||||||
|
) {
|
||||||
|
let span;
|
||||||
|
|
||||||
|
const closestNode = parent.closest("body, svg, foreignObject");
|
||||||
|
const isInSVG = closestNode && closestNode.matches("svg");
|
||||||
|
if (isInSVG) {
|
||||||
|
span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
||||||
|
} else {
|
||||||
|
span = document.createElement("span");
|
||||||
|
span.classList.add(className);
|
||||||
|
}
|
||||||
|
|
||||||
|
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
|
||||||
|
parent.insertBefore(
|
||||||
|
span,
|
||||||
|
parent.insertBefore(
|
||||||
|
document.createTextNode(val.substr(pos + text.length)),
|
||||||
|
node.nextSibling
|
||||||
|
)
|
||||||
|
);
|
||||||
|
node.nodeValue = val.substr(0, pos);
|
||||||
|
|
||||||
|
if (isInSVG) {
|
||||||
|
const rect = document.createElementNS(
|
||||||
|
"http://www.w3.org/2000/svg",
|
||||||
|
"rect"
|
||||||
|
);
|
||||||
|
const bbox = parent.getBBox();
|
||||||
|
rect.x.baseVal.value = bbox.x;
|
||||||
|
rect.y.baseVal.value = bbox.y;
|
||||||
|
rect.width.baseVal.value = bbox.width;
|
||||||
|
rect.height.baseVal.value = bbox.height;
|
||||||
|
rect.setAttribute("class", className);
|
||||||
|
addItems.push({ parent: parent, target: rect });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (node.matches && !node.matches("button, select, textarea")) {
|
||||||
|
node.childNodes.forEach((el) => _highlight(el, addItems, text, className));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const _highlightText = (thisNode, text, className) => {
|
||||||
|
let addItems = [];
|
||||||
|
_highlight(thisNode, addItems, text, className);
|
||||||
|
addItems.forEach((obj) =>
|
||||||
|
obj.parent.insertAdjacentElement("beforebegin", obj.target)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Small JavaScript module for the documentation.
|
||||||
|
*/
|
||||||
|
const SphinxHighlight = {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* highlight the search words provided in localstorage in the text
|
||||||
|
*/
|
||||||
|
highlightSearchWords: () => {
|
||||||
|
if (!SPHINX_HIGHLIGHT_ENABLED) return; // bail if no highlight
|
||||||
|
|
||||||
|
// get and clear terms from localstorage
|
||||||
|
const url = new URL(window.location);
|
||||||
|
const highlight =
|
||||||
|
localStorage.getItem("sphinx_highlight_terms")
|
||||||
|
|| url.searchParams.get("highlight")
|
||||||
|
|| "";
|
||||||
|
localStorage.removeItem("sphinx_highlight_terms")
|
||||||
|
url.searchParams.delete("highlight");
|
||||||
|
window.history.replaceState({}, "", url);
|
||||||
|
|
||||||
|
// get individual terms from highlight string
|
||||||
|
const terms = highlight.toLowerCase().split(/\s+/).filter(x => x);
|
||||||
|
if (terms.length === 0) return; // nothing to do
|
||||||
|
|
||||||
|
// There should never be more than one element matching "div.body"
|
||||||
|
const divBody = document.querySelectorAll("div.body");
|
||||||
|
const body = divBody.length ? divBody[0] : document.querySelector("body");
|
||||||
|
window.setTimeout(() => {
|
||||||
|
terms.forEach((term) => _highlightText(body, term, "highlighted"));
|
||||||
|
}, 10);
|
||||||
|
|
||||||
|
const searchBox = document.getElementById("searchbox");
|
||||||
|
if (searchBox === null) return;
|
||||||
|
searchBox.appendChild(
|
||||||
|
document
|
||||||
|
.createRange()
|
||||||
|
.createContextualFragment(
|
||||||
|
'<p class="highlight-link">' +
|
||||||
|
'<a href="javascript:SphinxHighlight.hideSearchWords()">' +
|
||||||
|
_("Hide Search Matches") +
|
||||||
|
"</a></p>"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* helper function to hide the search marks again
|
||||||
|
*/
|
||||||
|
hideSearchWords: () => {
|
||||||
|
document
|
||||||
|
.querySelectorAll("#searchbox .highlight-link")
|
||||||
|
.forEach((el) => el.remove());
|
||||||
|
document
|
||||||
|
.querySelectorAll("span.highlighted")
|
||||||
|
.forEach((el) => el.classList.remove("highlighted"));
|
||||||
|
localStorage.removeItem("sphinx_highlight_terms")
|
||||||
|
},
|
||||||
|
|
||||||
|
initEscapeListener: () => {
|
||||||
|
// only install a listener if it is really needed
|
||||||
|
if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) return;
|
||||||
|
|
||||||
|
document.addEventListener("keydown", (event) => {
|
||||||
|
// bail for input elements
|
||||||
|
if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return;
|
||||||
|
// bail with special keys
|
||||||
|
if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return;
|
||||||
|
if (DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS && (event.key === "Escape")) {
|
||||||
|
SphinxHighlight.hideSearchWords();
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
_ready(SphinxHighlight.highlightSearchWords);
|
||||||
|
_ready(SphinxHighlight.initEscapeListener);
|
||||||
@@ -17,6 +17,7 @@
|
|||||||
<script src="_static/underscore.js"></script>
|
<script src="_static/underscore.js"></script>
|
||||||
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
||||||
<script src="_static/doctools.js"></script>
|
<script src="_static/doctools.js"></script>
|
||||||
|
<script src="_static/sphinx_highlight.js"></script>
|
||||||
<script src="_static/clipboard.min.js"></script>
|
<script src="_static/clipboard.min.js"></script>
|
||||||
<script src="_static/copybutton.js"></script>
|
<script src="_static/copybutton.js"></script>
|
||||||
<script src="_static/js/theme.js"></script>
|
<script src="_static/js/theme.js"></script>
|
||||||
@@ -90,7 +91,7 @@
|
|||||||
<li><a href="index.html" class="icon icon-home"></a> »</li>
|
<li><a href="index.html" class="icon icon-home"></a> »</li>
|
||||||
<li>Index</li>
|
<li>Index</li>
|
||||||
<li class="wy-breadcrumbs-aside">
|
<li class="wy-breadcrumbs-aside">
|
||||||
<a href="https://github.com/espressif/esp-protocols/blob/7310a7a/docs/en/genindex" class="fa fa-github"> Edit on GitHub</a>
|
<a href="https://github.com/espressif/esp-protocols/blob/467fec5/docs/en/genindex" class="fa fa-github"> Edit on GitHub</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|||||||
+115
-114
@@ -18,6 +18,7 @@
|
|||||||
<script src="_static/underscore.js"></script>
|
<script src="_static/underscore.js"></script>
|
||||||
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
||||||
<script src="_static/doctools.js"></script>
|
<script src="_static/doctools.js"></script>
|
||||||
|
<script src="_static/sphinx_highlight.js"></script>
|
||||||
<script src="_static/clipboard.min.js"></script>
|
<script src="_static/clipboard.min.js"></script>
|
||||||
<script src="_static/copybutton.js"></script>
|
<script src="_static/copybutton.js"></script>
|
||||||
<script src="_static/js/theme.js"></script>
|
<script src="_static/js/theme.js"></script>
|
||||||
@@ -115,7 +116,7 @@
|
|||||||
<li><a href="#" class="icon icon-home"></a> »</li>
|
<li><a href="#" class="icon icon-home"></a> »</li>
|
||||||
<li>mDNS Service</li>
|
<li>mDNS Service</li>
|
||||||
<li class="wy-breadcrumbs-aside">
|
<li class="wy-breadcrumbs-aside">
|
||||||
<a href="https://github.com/espressif/esp-protocols/blob/7310a7a/docs/en/index.rst" class="fa fa-github"> Edit on GitHub</a>
|
<a href="https://github.com/espressif/esp-protocols/blob/467fec5/docs/en/index.rst" class="fa fa-github"> Edit on GitHub</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<hr/>
|
<hr/>
|
||||||
@@ -139,20 +140,20 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div></blockquote>
|
</div></blockquote>
|
||||||
<p>Example method to start mDNS for the STA interface and set <code class="docutils literal notranslate"><span class="pre">hostname</span></code> and <code class="docutils literal notranslate"><span class="pre">default_instance</span></code>:</p>
|
<p>Example method to start mDNS for the STA interface and set <code class="docutils literal notranslate"><span class="pre">hostname</span></code> and <code class="docutils literal notranslate"><span class="pre">default_instance</span></code>:</p>
|
||||||
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">start_mdns_service</span><span class="p">()</span>
|
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="kt">void</span><span class="w"> </span><span class="nf">start_mdns_service</span><span class="p">()</span><span class="w"></span>
|
||||||
<span class="p">{</span>
|
<span class="p">{</span><span class="w"></span>
|
||||||
<span class="c1">//initialize mDNS service</span>
|
<span class="w"> </span><span class="c1">//initialize mDNS service</span>
|
||||||
<span class="n">esp_err_t</span> <span class="n">err</span> <span class="o">=</span> <span class="n">mdns_init</span><span class="p">();</span>
|
<span class="w"> </span><span class="n">esp_err_t</span><span class="w"> </span><span class="n">err</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">mdns_init</span><span class="p">();</span><span class="w"></span>
|
||||||
<span class="k">if</span> <span class="p">(</span><span class="n">err</span><span class="p">)</span> <span class="p">{</span>
|
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">err</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
|
||||||
<span class="n">printf</span><span class="p">(</span><span class="s">"MDNS Init failed: %d</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">err</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">"MDNS Init failed: %d</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span><span class="w"> </span><span class="n">err</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="k">return</span><span class="p">;</span>
|
<span class="w"> </span><span class="k">return</span><span class="p">;</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
||||||
|
|
||||||
<span class="c1">//set hostname</span>
|
<span class="w"> </span><span class="c1">//set hostname</span>
|
||||||
<span class="n">mdns_hostname_set</span><span class="p">(</span><span class="s">"my-esp32"</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">mdns_hostname_set</span><span class="p">(</span><span class="s">"my-esp32"</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="c1">//set default instance</span>
|
<span class="w"> </span><span class="c1">//set default instance</span>
|
||||||
<span class="n">mdns_instance_name_set</span><span class="p">(</span><span class="s">"Jhon's ESP32 Thing"</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">mdns_instance_name_set</span><span class="p">(</span><span class="s">"Jhon's ESP32 Thing"</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="p">}</span><span class="w"></span>
|
||||||
</pre></div>
|
</pre></div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@@ -169,28 +170,28 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div></blockquote>
|
</div></blockquote>
|
||||||
<p>Example method to add a few services and different properties:</p>
|
<p>Example method to add a few services and different properties:</p>
|
||||||
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">add_mdns_services</span><span class="p">()</span>
|
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="kt">void</span><span class="w"> </span><span class="nf">add_mdns_services</span><span class="p">()</span><span class="w"></span>
|
||||||
<span class="p">{</span>
|
<span class="p">{</span><span class="w"></span>
|
||||||
<span class="c1">//add our services</span>
|
<span class="w"> </span><span class="c1">//add our services</span>
|
||||||
<span class="n">mdns_service_add</span><span class="p">(</span><span class="nb">NULL</span><span class="p">,</span> <span class="s">"_http"</span><span class="p">,</span> <span class="s">"_tcp"</span><span class="p">,</span> <span class="mi">80</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">mdns_service_add</span><span class="p">(</span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="s">"_http"</span><span class="p">,</span><span class="w"> </span><span class="s">"_tcp"</span><span class="p">,</span><span class="w"> </span><span class="mi">80</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="n">mdns_service_add</span><span class="p">(</span><span class="nb">NULL</span><span class="p">,</span> <span class="s">"_arduino"</span><span class="p">,</span> <span class="s">"_tcp"</span><span class="p">,</span> <span class="mi">3232</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">mdns_service_add</span><span class="p">(</span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="s">"_arduino"</span><span class="p">,</span><span class="w"> </span><span class="s">"_tcp"</span><span class="p">,</span><span class="w"> </span><span class="mi">3232</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="n">mdns_service_add</span><span class="p">(</span><span class="nb">NULL</span><span class="p">,</span> <span class="s">"_myservice"</span><span class="p">,</span> <span class="s">"_udp"</span><span class="p">,</span> <span class="mi">1234</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">mdns_service_add</span><span class="p">(</span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="s">"_myservice"</span><span class="p">,</span><span class="w"> </span><span class="s">"_udp"</span><span class="p">,</span><span class="w"> </span><span class="mi">1234</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">);</span><span class="w"></span>
|
||||||
|
|
||||||
<span class="c1">//NOTE: services must be added before their properties can be set</span>
|
<span class="w"> </span><span class="c1">//NOTE: services must be added before their properties can be set</span>
|
||||||
<span class="c1">//use custom instance for the web server</span>
|
<span class="w"> </span><span class="c1">//use custom instance for the web server</span>
|
||||||
<span class="n">mdns_service_instance_name_set</span><span class="p">(</span><span class="s">"_http"</span><span class="p">,</span> <span class="s">"_tcp"</span><span class="p">,</span> <span class="s">"Jhon's ESP32 Web Server"</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">mdns_service_instance_name_set</span><span class="p">(</span><span class="s">"_http"</span><span class="p">,</span><span class="w"> </span><span class="s">"_tcp"</span><span class="p">,</span><span class="w"> </span><span class="s">"Jhon's ESP32 Web Server"</span><span class="p">);</span><span class="w"></span>
|
||||||
|
|
||||||
<span class="n">mdns_txt_item_t</span> <span class="n">serviceTxtData</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span> <span class="o">=</span> <span class="p">{</span>
|
<span class="w"> </span><span class="n">mdns_txt_item_t</span><span class="w"> </span><span class="n">serviceTxtData</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
|
||||||
<span class="p">{</span><span class="s">"board"</span><span class="p">,</span><span class="s">"{esp32}"</span><span class="p">},</span>
|
<span class="w"> </span><span class="p">{</span><span class="s">"board"</span><span class="p">,</span><span class="s">"{esp32}"</span><span class="p">},</span><span class="w"></span>
|
||||||
<span class="p">{</span><span class="s">"u"</span><span class="p">,</span><span class="s">"user"</span><span class="p">},</span>
|
<span class="w"> </span><span class="p">{</span><span class="s">"u"</span><span class="p">,</span><span class="s">"user"</span><span class="p">},</span><span class="w"></span>
|
||||||
<span class="p">{</span><span class="s">"p"</span><span class="p">,</span><span class="s">"password"</span><span class="p">}</span>
|
<span class="w"> </span><span class="p">{</span><span class="s">"p"</span><span class="p">,</span><span class="s">"password"</span><span class="p">}</span><span class="w"></span>
|
||||||
<span class="p">};</span>
|
<span class="w"> </span><span class="p">};</span><span class="w"></span>
|
||||||
<span class="c1">//set txt data for service (will free and replace current data)</span>
|
<span class="w"> </span><span class="c1">//set txt data for service (will free and replace current data)</span>
|
||||||
<span class="n">mdns_service_txt_set</span><span class="p">(</span><span class="s">"_http"</span><span class="p">,</span> <span class="s">"_tcp"</span><span class="p">,</span> <span class="n">serviceTxtData</span><span class="p">,</span> <span class="mi">3</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">mdns_service_txt_set</span><span class="p">(</span><span class="s">"_http"</span><span class="p">,</span><span class="w"> </span><span class="s">"_tcp"</span><span class="p">,</span><span class="w"> </span><span class="n">serviceTxtData</span><span class="p">,</span><span class="w"> </span><span class="mi">3</span><span class="p">);</span><span class="w"></span>
|
||||||
|
|
||||||
<span class="c1">//change service port</span>
|
<span class="w"> </span><span class="c1">//change service port</span>
|
||||||
<span class="n">mdns_service_port_set</span><span class="p">(</span><span class="s">"_myservice"</span><span class="p">,</span> <span class="s">"_udp"</span><span class="p">,</span> <span class="mi">4321</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">mdns_service_port_set</span><span class="p">(</span><span class="s">"_myservice"</span><span class="p">,</span><span class="w"> </span><span class="s">"_udp"</span><span class="p">,</span><span class="w"> </span><span class="mi">4321</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="p">}</span><span class="w"></span>
|
||||||
</pre></div>
|
</pre></div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@@ -199,100 +200,100 @@
|
|||||||
<p>mDNS provides methods for browsing for services and resolving host’s IP/IPv6 addresses.</p>
|
<p>mDNS provides methods for browsing for services and resolving host’s IP/IPv6 addresses.</p>
|
||||||
<p>Results for services are returned as a linked list of <code class="docutils literal notranslate"><span class="pre">mdns_result_t</span></code> objects.</p>
|
<p>Results for services are returned as a linked list of <code class="docutils literal notranslate"><span class="pre">mdns_result_t</span></code> objects.</p>
|
||||||
<p>Example method to resolve host IPs:</p>
|
<p>Example method to resolve host IPs:</p>
|
||||||
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">resolve_mdns_host</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span> <span class="n">host_name</span><span class="p">)</span>
|
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="kt">void</span><span class="w"> </span><span class="nf">resolve_mdns_host</span><span class="p">(</span><span class="k">const</span><span class="w"> </span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">host_name</span><span class="p">)</span><span class="w"></span>
|
||||||
<span class="p">{</span>
|
<span class="p">{</span><span class="w"></span>
|
||||||
<span class="n">printf</span><span class="p">(</span><span class="s">"Query A: %s.local"</span><span class="p">,</span> <span class="n">host_name</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">"Query A: %s.local"</span><span class="p">,</span><span class="w"> </span><span class="n">host_name</span><span class="p">);</span><span class="w"></span>
|
||||||
|
|
||||||
<span class="k">struct</span> <span class="n">ip4_addr</span> <span class="n">addr</span><span class="p">;</span>
|
<span class="w"> </span><span class="k">struct</span><span class="w"> </span><span class="nc">ip4_addr</span><span class="w"> </span><span class="n">addr</span><span class="p">;</span><span class="w"></span>
|
||||||
<span class="n">addr</span><span class="p">.</span><span class="n">addr</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
|
<span class="w"> </span><span class="n">addr</span><span class="p">.</span><span class="n">addr</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"></span>
|
||||||
|
|
||||||
<span class="n">esp_err_t</span> <span class="n">err</span> <span class="o">=</span> <span class="n">mdns_query_a</span><span class="p">(</span><span class="n">host_name</span><span class="p">,</span> <span class="mi">2000</span><span class="p">,</span> <span class="o">&</span><span class="n">addr</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">esp_err_t</span><span class="w"> </span><span class="n">err</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">mdns_query_a</span><span class="p">(</span><span class="n">host_name</span><span class="p">,</span><span class="w"> </span><span class="mi">2000</span><span class="p">,</span><span class="w"> </span><span class="o">&</span><span class="n">addr</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="k">if</span><span class="p">(</span><span class="n">err</span><span class="p">){</span>
|
<span class="w"> </span><span class="k">if</span><span class="p">(</span><span class="n">err</span><span class="p">){</span><span class="w"></span>
|
||||||
<span class="k">if</span><span class="p">(</span><span class="n">err</span> <span class="o">==</span> <span class="n">ESP_ERR_NOT_FOUND</span><span class="p">){</span>
|
<span class="w"> </span><span class="k">if</span><span class="p">(</span><span class="n">err</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">ESP_ERR_NOT_FOUND</span><span class="p">){</span><span class="w"></span>
|
||||||
<span class="n">printf</span><span class="p">(</span><span class="s">"Host was not found!"</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">"Host was not found!"</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="k">return</span><span class="p">;</span>
|
<span class="w"> </span><span class="k">return</span><span class="p">;</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
||||||
<span class="n">printf</span><span class="p">(</span><span class="s">"Query Failed"</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">"Query Failed"</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="k">return</span><span class="p">;</span>
|
<span class="w"> </span><span class="k">return</span><span class="p">;</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
||||||
|
|
||||||
<span class="n">printf</span><span class="p">(</span><span class="n">IPSTR</span><span class="p">,</span> <span class="n">IP2STR</span><span class="p">(</span><span class="o">&</span><span class="n">addr</span><span class="p">));</span>
|
<span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="n">IPSTR</span><span class="p">,</span><span class="w"> </span><span class="n">IP2STR</span><span class="p">(</span><span class="o">&</span><span class="n">addr</span><span class="p">));</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="p">}</span><span class="w"></span>
|
||||||
</pre></div>
|
</pre></div>
|
||||||
</div>
|
</div>
|
||||||
<p>Example method to resolve local services:</p>
|
<p>Example method to resolve local services:</p>
|
||||||
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">static</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span> <span class="n">if_str</span><span class="p">[]</span> <span class="o">=</span> <span class="p">{</span><span class="s">"STA"</span><span class="p">,</span> <span class="s">"AP"</span><span class="p">,</span> <span class="s">"ETH"</span><span class="p">,</span> <span class="s">"MAX"</span><span class="p">};</span>
|
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">static</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">if_str</span><span class="p">[]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">{</span><span class="s">"STA"</span><span class="p">,</span><span class="w"> </span><span class="s">"AP"</span><span class="p">,</span><span class="w"> </span><span class="s">"ETH"</span><span class="p">,</span><span class="w"> </span><span class="s">"MAX"</span><span class="p">};</span><span class="w"></span>
|
||||||
<span class="k">static</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span> <span class="n">ip_protocol_str</span><span class="p">[]</span> <span class="o">=</span> <span class="p">{</span><span class="s">"V4"</span><span class="p">,</span> <span class="s">"V6"</span><span class="p">,</span> <span class="s">"MAX"</span><span class="p">};</span>
|
<span class="k">static</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">ip_protocol_str</span><span class="p">[]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">{</span><span class="s">"V4"</span><span class="p">,</span><span class="w"> </span><span class="s">"V6"</span><span class="p">,</span><span class="w"> </span><span class="s">"MAX"</span><span class="p">};</span><span class="w"></span>
|
||||||
|
|
||||||
<span class="kt">void</span> <span class="nf">mdns_print_results</span><span class="p">(</span><span class="n">mdns_result_t</span> <span class="o">*</span> <span class="n">results</span><span class="p">){</span>
|
<span class="kt">void</span><span class="w"> </span><span class="nf">mdns_print_results</span><span class="p">(</span><span class="n">mdns_result_t</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">results</span><span class="p">){</span><span class="w"></span>
|
||||||
<span class="n">mdns_result_t</span> <span class="o">*</span> <span class="n">r</span> <span class="o">=</span> <span class="n">results</span><span class="p">;</span>
|
<span class="w"> </span><span class="n">mdns_result_t</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">r</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">results</span><span class="p">;</span><span class="w"></span>
|
||||||
<span class="n">mdns_ip_addr_t</span> <span class="o">*</span> <span class="n">a</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
|
<span class="w"> </span><span class="n">mdns_ip_addr_t</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">NULL</span><span class="p">;</span><span class="w"></span>
|
||||||
<span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">1</span><span class="p">,</span> <span class="n">t</span><span class="p">;</span>
|
<span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="n">t</span><span class="p">;</span><span class="w"></span>
|
||||||
<span class="k">while</span><span class="p">(</span><span class="n">r</span><span class="p">){</span>
|
<span class="w"> </span><span class="k">while</span><span class="p">(</span><span class="n">r</span><span class="p">){</span><span class="w"></span>
|
||||||
<span class="n">printf</span><span class="p">(</span><span class="s">"%d: Interface: %s, Type: %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">i</span><span class="o">++</span><span class="p">,</span> <span class="n">if_str</span><span class="p">[</span><span class="n">r</span><span class="o">-></span><span class="n">tcpip_if</span><span class="p">],</span> <span class="n">ip_protocol_str</span><span class="p">[</span><span class="n">r</span><span class="o">-></span><span class="n">ip_protocol</span><span class="p">]);</span>
|
<span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">"%d: Interface: %s, Type: %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">,</span><span class="w"> </span><span class="n">if_str</span><span class="p">[</span><span class="n">r</span><span class="o">-></span><span class="n">tcpip_if</span><span class="p">],</span><span class="w"> </span><span class="n">ip_protocol_str</span><span class="p">[</span><span class="n">r</span><span class="o">-></span><span class="n">ip_protocol</span><span class="p">]);</span><span class="w"></span>
|
||||||
<span class="k">if</span><span class="p">(</span><span class="n">r</span><span class="o">-></span><span class="n">instance_name</span><span class="p">){</span>
|
<span class="w"> </span><span class="k">if</span><span class="p">(</span><span class="n">r</span><span class="o">-></span><span class="n">instance_name</span><span class="p">){</span><span class="w"></span>
|
||||||
<span class="n">printf</span><span class="p">(</span><span class="s">" PTR : %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">r</span><span class="o">-></span><span class="n">instance_name</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">" PTR : %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span><span class="w"> </span><span class="n">r</span><span class="o">-></span><span class="n">instance_name</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
||||||
<span class="k">if</span><span class="p">(</span><span class="n">r</span><span class="o">-></span><span class="n">hostname</span><span class="p">){</span>
|
<span class="w"> </span><span class="k">if</span><span class="p">(</span><span class="n">r</span><span class="o">-></span><span class="n">hostname</span><span class="p">){</span><span class="w"></span>
|
||||||
<span class="n">printf</span><span class="p">(</span><span class="s">" SRV : %s.local:%u</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">r</span><span class="o">-></span><span class="n">hostname</span><span class="p">,</span> <span class="n">r</span><span class="o">-></span><span class="n">port</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">" SRV : %s.local:%u</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span><span class="w"> </span><span class="n">r</span><span class="o">-></span><span class="n">hostname</span><span class="p">,</span><span class="w"> </span><span class="n">r</span><span class="o">-></span><span class="n">port</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
||||||
<span class="k">if</span><span class="p">(</span><span class="n">r</span><span class="o">-></span><span class="n">txt_count</span><span class="p">){</span>
|
<span class="w"> </span><span class="k">if</span><span class="p">(</span><span class="n">r</span><span class="o">-></span><span class="n">txt_count</span><span class="p">){</span><span class="w"></span>
|
||||||
<span class="n">printf</span><span class="p">(</span><span class="s">" TXT : [%u] "</span><span class="p">,</span> <span class="n">r</span><span class="o">-></span><span class="n">txt_count</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">" TXT : [%u] "</span><span class="p">,</span><span class="w"> </span><span class="n">r</span><span class="o">-></span><span class="n">txt_count</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="k">for</span><span class="p">(</span><span class="n">t</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="n">t</span><span class="o"><</span><span class="n">r</span><span class="o">-></span><span class="n">txt_count</span><span class="p">;</span> <span class="n">t</span><span class="o">++</span><span class="p">){</span>
|
<span class="w"> </span><span class="k">for</span><span class="p">(</span><span class="n">t</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">t</span><span class="o"><</span><span class="n">r</span><span class="o">-></span><span class="n">txt_count</span><span class="p">;</span><span class="w"> </span><span class="n">t</span><span class="o">++</span><span class="p">){</span><span class="w"></span>
|
||||||
<span class="n">printf</span><span class="p">(</span><span class="s">"%s=%s; "</span><span class="p">,</span> <span class="n">r</span><span class="o">-></span><span class="n">txt</span><span class="p">[</span><span class="n">t</span><span class="p">].</span><span class="n">key</span><span class="p">,</span> <span class="n">r</span><span class="o">-></span><span class="n">txt</span><span class="p">[</span><span class="n">t</span><span class="p">].</span><span class="n">value</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">"%s=%s; "</span><span class="p">,</span><span class="w"> </span><span class="n">r</span><span class="o">-></span><span class="n">txt</span><span class="p">[</span><span class="n">t</span><span class="p">].</span><span class="n">key</span><span class="p">,</span><span class="w"> </span><span class="n">r</span><span class="o">-></span><span class="n">txt</span><span class="p">[</span><span class="n">t</span><span class="p">].</span><span class="n">value</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
||||||
<span class="n">printf</span><span class="p">(</span><span class="s">"</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">"</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
||||||
<span class="n">a</span> <span class="o">=</span> <span class="n">r</span><span class="o">-></span><span class="n">addr</span><span class="p">;</span>
|
<span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">r</span><span class="o">-></span><span class="n">addr</span><span class="p">;</span><span class="w"></span>
|
||||||
<span class="k">while</span><span class="p">(</span><span class="n">a</span><span class="p">){</span>
|
<span class="w"> </span><span class="k">while</span><span class="p">(</span><span class="n">a</span><span class="p">){</span><span class="w"></span>
|
||||||
<span class="k">if</span><span class="p">(</span><span class="n">a</span><span class="o">-></span><span class="n">addr</span><span class="p">.</span><span class="n">type</span> <span class="o">==</span> <span class="n">IPADDR_TYPE_V6</span><span class="p">){</span>
|
<span class="w"> </span><span class="k">if</span><span class="p">(</span><span class="n">a</span><span class="o">-></span><span class="n">addr</span><span class="p">.</span><span class="n">type</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">IPADDR_TYPE_V6</span><span class="p">){</span><span class="w"></span>
|
||||||
<span class="n">printf</span><span class="p">(</span><span class="s">" AAAA: "</span> <span class="n">IPV6STR</span> <span class="s">"</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">IPV62STR</span><span class="p">(</span><span class="n">a</span><span class="o">-></span><span class="n">addr</span><span class="p">.</span><span class="n">u_addr</span><span class="p">.</span><span class="n">ip6</span><span class="p">));</span>
|
<span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">" AAAA: "</span><span class="w"> </span><span class="n">IPV6STR</span><span class="w"> </span><span class="s">"</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span><span class="w"> </span><span class="n">IPV62STR</span><span class="p">(</span><span class="n">a</span><span class="o">-></span><span class="n">addr</span><span class="p">.</span><span class="n">u_addr</span><span class="p">.</span><span class="n">ip6</span><span class="p">));</span><span class="w"></span>
|
||||||
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
|
<span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
|
||||||
<span class="n">printf</span><span class="p">(</span><span class="s">" A : "</span> <span class="n">IPSTR</span> <span class="s">"</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">IP2STR</span><span class="p">(</span><span class="o">&</span><span class="p">(</span><span class="n">a</span><span class="o">-></span><span class="n">addr</span><span class="p">.</span><span class="n">u_addr</span><span class="p">.</span><span class="n">ip4</span><span class="p">)));</span>
|
<span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">" A : "</span><span class="w"> </span><span class="n">IPSTR</span><span class="w"> </span><span class="s">"</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span><span class="w"> </span><span class="n">IP2STR</span><span class="p">(</span><span class="o">&</span><span class="p">(</span><span class="n">a</span><span class="o">-></span><span class="n">addr</span><span class="p">.</span><span class="n">u_addr</span><span class="p">.</span><span class="n">ip4</span><span class="p">)));</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
||||||
<span class="n">a</span> <span class="o">=</span> <span class="n">a</span><span class="o">-></span><span class="n">next</span><span class="p">;</span>
|
<span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">a</span><span class="o">-></span><span class="n">next</span><span class="p">;</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
||||||
<span class="n">r</span> <span class="o">=</span> <span class="n">r</span><span class="o">-></span><span class="n">next</span><span class="p">;</span>
|
<span class="w"> </span><span class="n">r</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">r</span><span class="o">-></span><span class="n">next</span><span class="p">;</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
||||||
|
|
||||||
<span class="p">}</span>
|
<span class="p">}</span><span class="w"></span>
|
||||||
|
|
||||||
<span class="kt">void</span> <span class="nf">find_mdns_service</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span> <span class="n">service_name</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span> <span class="n">proto</span><span class="p">)</span>
|
<span class="kt">void</span><span class="w"> </span><span class="nf">find_mdns_service</span><span class="p">(</span><span class="k">const</span><span class="w"> </span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">service_name</span><span class="p">,</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">proto</span><span class="p">)</span><span class="w"></span>
|
||||||
<span class="p">{</span>
|
<span class="p">{</span><span class="w"></span>
|
||||||
<span class="n">ESP_LOGI</span><span class="p">(</span><span class="n">TAG</span><span class="p">,</span> <span class="s">"Query PTR: %s.%s.local"</span><span class="p">,</span> <span class="n">service_name</span><span class="p">,</span> <span class="n">proto</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">ESP_LOGI</span><span class="p">(</span><span class="n">TAG</span><span class="p">,</span><span class="w"> </span><span class="s">"Query PTR: %s.%s.local"</span><span class="p">,</span><span class="w"> </span><span class="n">service_name</span><span class="p">,</span><span class="w"> </span><span class="n">proto</span><span class="p">);</span><span class="w"></span>
|
||||||
|
|
||||||
<span class="n">mdns_result_t</span> <span class="o">*</span> <span class="n">results</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
|
<span class="w"> </span><span class="n">mdns_result_t</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">results</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">NULL</span><span class="p">;</span><span class="w"></span>
|
||||||
<span class="n">esp_err_t</span> <span class="n">err</span> <span class="o">=</span> <span class="n">mdns_query_ptr</span><span class="p">(</span><span class="n">service_name</span><span class="p">,</span> <span class="n">proto</span><span class="p">,</span> <span class="mi">3000</span><span class="p">,</span> <span class="mi">20</span><span class="p">,</span> <span class="o">&</span><span class="n">results</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">esp_err_t</span><span class="w"> </span><span class="n">err</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">mdns_query_ptr</span><span class="p">(</span><span class="n">service_name</span><span class="p">,</span><span class="w"> </span><span class="n">proto</span><span class="p">,</span><span class="w"> </span><span class="mi">3000</span><span class="p">,</span><span class="w"> </span><span class="mi">20</span><span class="p">,</span><span class="w"> </span><span class="o">&</span><span class="n">results</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="k">if</span><span class="p">(</span><span class="n">err</span><span class="p">){</span>
|
<span class="w"> </span><span class="k">if</span><span class="p">(</span><span class="n">err</span><span class="p">){</span><span class="w"></span>
|
||||||
<span class="n">ESP_LOGE</span><span class="p">(</span><span class="n">TAG</span><span class="p">,</span> <span class="s">"Query Failed"</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">ESP_LOGE</span><span class="p">(</span><span class="n">TAG</span><span class="p">,</span><span class="w"> </span><span class="s">"Query Failed"</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="k">return</span><span class="p">;</span>
|
<span class="w"> </span><span class="k">return</span><span class="p">;</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
||||||
<span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="n">results</span><span class="p">){</span>
|
<span class="w"> </span><span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="n">results</span><span class="p">){</span><span class="w"></span>
|
||||||
<span class="n">ESP_LOGW</span><span class="p">(</span><span class="n">TAG</span><span class="p">,</span> <span class="s">"No results found!"</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">ESP_LOGW</span><span class="p">(</span><span class="n">TAG</span><span class="p">,</span><span class="w"> </span><span class="s">"No results found!"</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="k">return</span><span class="p">;</span>
|
<span class="w"> </span><span class="k">return</span><span class="p">;</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
||||||
|
|
||||||
<span class="n">mdns_print_results</span><span class="p">(</span><span class="n">results</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">mdns_print_results</span><span class="p">(</span><span class="n">results</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="n">mdns_query_results_free</span><span class="p">(</span><span class="n">results</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">mdns_query_results_free</span><span class="p">(</span><span class="n">results</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="p">}</span><span class="w"></span>
|
||||||
</pre></div>
|
</pre></div>
|
||||||
</div>
|
</div>
|
||||||
<p>Example of using the methods above:</p>
|
<p>Example of using the methods above:</p>
|
||||||
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">my_app_some_method</span><span class="p">(){</span>
|
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="kt">void</span><span class="w"> </span><span class="nf">my_app_some_method</span><span class="p">(){</span><span class="w"></span>
|
||||||
<span class="c1">//search for esp32-mdns.local</span>
|
<span class="w"> </span><span class="c1">//search for esp32-mdns.local</span>
|
||||||
<span class="n">resolve_mdns_host</span><span class="p">(</span><span class="s">"esp32-mdns"</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">resolve_mdns_host</span><span class="p">(</span><span class="s">"esp32-mdns"</span><span class="p">);</span><span class="w"></span>
|
||||||
|
|
||||||
<span class="c1">//search for HTTP servers</span>
|
<span class="w"> </span><span class="c1">//search for HTTP servers</span>
|
||||||
<span class="n">find_mdns_service</span><span class="p">(</span><span class="s">"_http"</span><span class="p">,</span> <span class="s">"_tcp"</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">find_mdns_service</span><span class="p">(</span><span class="s">"_http"</span><span class="p">,</span><span class="w"> </span><span class="s">"_tcp"</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="c1">//or file servers</span>
|
<span class="w"> </span><span class="c1">//or file servers</span>
|
||||||
<span class="n">find_mdns_service</span><span class="p">(</span><span class="s">"_smb"</span><span class="p">,</span> <span class="s">"_tcp"</span><span class="p">);</span> <span class="c1">//windows sharing</span>
|
<span class="w"> </span><span class="n">find_mdns_service</span><span class="p">(</span><span class="s">"_smb"</span><span class="p">,</span><span class="w"> </span><span class="s">"_tcp"</span><span class="p">);</span><span class="w"> </span><span class="c1">//windows sharing</span>
|
||||||
<span class="n">find_mdns_service</span><span class="p">(</span><span class="s">"_afpovertcp"</span><span class="p">,</span> <span class="s">"_tcp"</span><span class="p">);</span> <span class="c1">//apple sharing</span>
|
<span class="w"> </span><span class="n">find_mdns_service</span><span class="p">(</span><span class="s">"_afpovertcp"</span><span class="p">,</span><span class="w"> </span><span class="s">"_tcp"</span><span class="p">);</span><span class="w"> </span><span class="c1">//apple sharing</span>
|
||||||
<span class="n">find_mdns_service</span><span class="p">(</span><span class="s">"_nfs"</span><span class="p">,</span> <span class="s">"_tcp"</span><span class="p">);</span> <span class="c1">//NFS server</span>
|
<span class="w"> </span><span class="n">find_mdns_service</span><span class="p">(</span><span class="s">"_nfs"</span><span class="p">,</span><span class="w"> </span><span class="s">"_tcp"</span><span class="p">);</span><span class="w"> </span><span class="c1">//NFS server</span>
|
||||||
<span class="n">find_mdns_service</span><span class="p">(</span><span class="s">"_ftp"</span><span class="p">,</span> <span class="s">"_tcp"</span><span class="p">);</span> <span class="c1">//FTP server</span>
|
<span class="w"> </span><span class="n">find_mdns_service</span><span class="p">(</span><span class="s">"_ftp"</span><span class="p">,</span><span class="w"> </span><span class="s">"_tcp"</span><span class="p">);</span><span class="w"> </span><span class="c1">//FTP server</span>
|
||||||
<span class="c1">//or networked printer</span>
|
<span class="w"> </span><span class="c1">//or networked printer</span>
|
||||||
<span class="n">find_mdns_service</span><span class="p">(</span><span class="s">"_printer"</span><span class="p">,</span> <span class="s">"_tcp"</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">find_mdns_service</span><span class="p">(</span><span class="s">"_printer"</span><span class="p">,</span><span class="w"> </span><span class="s">"_tcp"</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="n">find_mdns_service</span><span class="p">(</span><span class="s">"_ipp"</span><span class="p">,</span> <span class="s">"_tcp"</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">find_mdns_service</span><span class="p">(</span><span class="s">"_ipp"</span><span class="p">,</span><span class="w"> </span><span class="s">"_tcp"</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="p">}</span><span class="w"></span>
|
||||||
</pre></div>
|
</pre></div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@@ -318,14 +319,14 @@
|
|||||||
</section>
|
</section>
|
||||||
<section id="application-example">
|
<section id="application-example">
|
||||||
<h2>Application Example<a class="headerlink" href="#application-example" title="Permalink to this heading"></a></h2>
|
<h2>Application Example<a class="headerlink" href="#application-example" title="Permalink to this heading"></a></h2>
|
||||||
<p>mDNS server/scanner example: <a class="reference external" href="https://github.com/espressif/esp-protocols/tree/7310a7a/examples/../examples"></a>.</p>
|
<p>mDNS server/scanner example: <a class="reference external" href="https://github.com/espressif/esp-protocols/tree/467fec5/examples/../examples"></a>.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="api-reference">
|
<section id="api-reference">
|
||||||
<h2>API Reference<a class="headerlink" href="#api-reference" title="Permalink to this heading"></a></h2>
|
<h2>API Reference<a class="headerlink" href="#api-reference" title="Permalink to this heading"></a></h2>
|
||||||
<section id="header-file">
|
<section id="header-file">
|
||||||
<h3>Header File<a class="headerlink" href="#header-file" title="Permalink to this heading"></a></h3>
|
<h3>Header File<a class="headerlink" href="#header-file" title="Permalink to this heading"></a></h3>
|
||||||
<ul class="simple">
|
<ul class="simple">
|
||||||
<li><p><a class="reference external" href="https://github.com/espressif/esp-protocols/blob/7310a7a/include/mdns.h">include/mdns.h</a></p></li>
|
<li><p><a class="reference external" href="https://github.com/espressif/esp-protocols/blob/467fec5/include/mdns.h">include/mdns.h</a></p></li>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
<section id="functions">
|
<section id="functions">
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
<script src="_static/underscore.js"></script>
|
<script src="_static/underscore.js"></script>
|
||||||
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
||||||
<script src="_static/doctools.js"></script>
|
<script src="_static/doctools.js"></script>
|
||||||
|
<script src="_static/sphinx_highlight.js"></script>
|
||||||
<script src="_static/clipboard.min.js"></script>
|
<script src="_static/clipboard.min.js"></script>
|
||||||
<script src="_static/copybutton.js"></script>
|
<script src="_static/copybutton.js"></script>
|
||||||
<script src="_static/js/theme.js"></script>
|
<script src="_static/js/theme.js"></script>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
Search.setIndex({"docnames": ["index"], "filenames": ["index.rst"], "titles": ["mDNS Service"], "terms": {"\u4e2d\u6587": 0, "i": 0, "multicast": 0, "udp": 0, "us": 0, "provid": 0, "local": 0, "network": 0, "host": 0, "discoveri": 0, "instal": 0, "default": 0, "most": 0, "oper": 0, "system": 0, "avail": 0, "separ": 0, "packag": 0, "On": 0, "mac": 0, "o": 0, "call": 0, "bonjour": 0, "appl": 0, "releas": 0, "an": 0, "window": 0, "can": 0, "found": 0, "": 0, "support": 0, "page": 0, "linux": 0, "avahi": 0, "usual": 0, "hostnam": 0, "devic": 0, "respond": 0, "If": 0, "set": 0, "read": 0, "from": 0, "interfac": 0, "my": 0, "esp32": 0, "resolv": 0, "default_inst": 0, "friendli": 0, "name": 0, "your": 0, "like": 0, "jhon": 0, "thing": 0, "method": 0, "start": 0, "sta": 0, "void": 0, "start_mdns_servic": 0, "initi": 0, "esp_err_t": 0, "err": 0, "mdns_init": 0, "printf": 0, "init": 0, "fail": 0, "d": 0, "n": 0, "return": 0, "mdns_hostname_set": 0, "instanc": 0, "mdns_instance_name_set": 0, "advertis": 0, "inform": 0, "about": 0, "offer": 0, "each": 0, "defin": 0, "few": 0, "instance_nam": 0, "eesp32": 0, "web": 0, "server": 0, "service_typ": 0, "requir": 0, "prepend": 0, "underscor": 0, "some": 0, "common": 0, "here": 0, "proto": 0, "protocol": 0, "run": 0, "_tcp": 0, "_udp": 0, "port": 0, "txt": 0, "var": 0, "val": 0, "arrai": 0, "string": 0, "add": 0, "differ": 0, "add_mdns_servic": 0, "our": 0, "mdns_service_add": 0, "null": 0, "_http": 0, "80": 0, "0": 0, "_arduino": 0, "3232": 0, "_myservic": 0, "1234": 0, "note": 0, "must": 0, "ad": 0, "befor": 0, "custom": 0, "mdns_service_instance_name_set": 0, "mdns_txt_item_t": 0, "servicetxtdata": 0, "3": 0, "board": 0, "u": 0, "user": 0, "p": 0, "password": 0, "data": 0, "free": 0, "replac": 0, "current": 0, "mdns_service_txt_set": 0, "chang": 0, "mdns_service_port_set": 0, "4321": 0, "brows": 0, "ip": 0, "ipv6": 0, "address": 0, "result": 0, "ar": 0, "link": 0, "list": 0, "mdns_result_t": 0, "object": 0, "resolve_mdns_host": 0, "const": 0, "char": 0, "host_nam": 0, "A": 0, "struct": 0, "ip4_addr": 0, "addr": 0, "mdns_query_a": 0, "2000": 0, "esp_err_not_found": 0, "wa": 0, "ipstr": 0, "ip2str": 0, "static": 0, "if_str": 0, "ap": 0, "eth": 0, "max": 0, "ip_protocol_str": 0, "v4": 0, "v6": 0, "mdns_print_result": 0, "r": 0, "mdns_ip_addr_t": 0, "int": 0, "1": 0, "t": 0, "while": 0, "tcpip_if": 0, "ip_protocol": 0, "ptr": 0, "srv": 0, "txt_count": 0, "kei": 0, "valu": 0, "ipaddr_type_v6": 0, "aaaa": 0, "ipv6str": 0, "ipv62str": 0, "u_addr": 0, "ip6": 0, "els": 0, "ip4": 0, "next": 0, "find_mdns_servic": 0, "service_nam": 0, "esp_logi": 0, "tag": 0, "mdns_query_ptr": 0, "3000": 0, "20": 0, "esp_log": 0, "esp_logw": 0, "No": 0, "mdns_query_results_fre": 0, "abov": 0, "my_app_some_method": 0, "search": 0, "http": 0, "_smb": 0, "share": 0, "_afpovertcp": 0, "_nf": 0, "nf": 0, "_ftp": 0, "ftp": 0, "printer": 0, "_printer": 0, "_ipp": 0, "creat": 0, "task": 0, "low": 0, "prioriti": 0, "config_mdns_task_prior": 0, "config_freertos_unicor": 0, "enabel": 0, "pin": 0, "cpu0": 0, "config_mdns_task_affin": 0, "pleas": 0, "check": 0, "maxim": 0, "more": 0, "detail": 0, "stack": 0, "size": 0, "configur": 0, "config_mdns_task_stack_s": 0, "scanner": 0, "includ": 0, "h": 0, "given": 0, "esp_ok": 0, "success": 0, "esp_err_invalid_st": 0, "when": 0, "regist": 0, "event": 0, "handler": 0, "esp_err_no_mem": 0, "memori": 0, "error": 0, "esp_fail": 0, "mdns_free": 0, "stop": 0, "you": 0, "want": 0, "paramet": 0, "esp_err_invalid_arg": 0, "mdns_delegate_hostname_add": 0, "address_list": 0, "deleg": 0, "repli": 0, "thi": 0, "The": 0, "mdns_delegate_hostname_remov": 0, "remov": 0, "all": 0, "also": 0, "bool": 0, "mdns_hostname_exist": 0, "whether": 0, "ha": 0, "been": 0, "true": 0, "fals": 0, "uint16_t": 0, "size_t": 0, "num_item": 0, "length": 0, "item": 0, "automat": 0, "decid": 0, "strlen": 0, "global": 0, "mdns_multiple_inst": 0, "config": 0, "option": 0, "need": 0, "enabl": 0, "multipl": 0, "same": 0, "etc": 0, "eg": 0, "other": 0, "2": 0, "number": 0, "mdns_service_add_for_host": 0, "mdns_service_exist": 0, "correspond": 0, "mdns_service_exists_with_inst": 0, "mdns_service_remov": 0, "mdns_service_remove_for_host": 0, "mdns_service_instance_name_set_for_host": 0, "instance_old": 0, "origin": 0, "mdns_service_port_set_for_host": 0, "uint8_t": 0, "mdns_service_txt_set_for_host": 0, "mdns_service_txt_item_set": 0, "record": 0, "updat": 0, "new": 0, "mdns_service_txt_item_set_with_explicit_value_len": 0, "value_len": 0, "mdns_service_txt_item_set_for_host": 0, "mdns_service_txt_item_set_for_host_with_explicit_value_len": 0, "mdns_service_txt_item_remov": 0, "mdns_service_txt_item_remove_for_host": 0, "mdns_service_subtype_add_for_host": 0, "subtyp": 0, "find": 0, "first": 0, "mdns_service_remove_al": 0, "mdns_query_async_delet": 0, "mdns_search_once_t": 0, "delet": 0, "finish": 0, "onli": 0, "after": 0, "end": 0, "pointer": 0, "mdns_query_async_get_result": 0, "uint32_t": 0, "timeout": 0, "num_Line truncated
|
Search.setIndex({"docnames": ["index"], "filenames": ["index.rst"], "titles": ["mDNS Service"], "terms": {"\u4e2d\u6587": 0, "i": 0, "multicast": 0, "udp": 0, "us": 0, "provid": 0, "local": 0, "network": 0, "host": 0, "discoveri": 0, "instal": 0, "default": 0, "most": 0, "oper": 0, "system": 0, "avail": 0, "separ": 0, "packag": 0, "On": 0, "mac": 0, "o": 0, "call": 0, "bonjour": 0, "appl": 0, "releas": 0, "an": 0, "window": 0, "can": 0, "found": 0, "": 0, "support": 0, "page": 0, "linux": 0, "avahi": 0, "usual": 0, "hostnam": 0, "devic": 0, "respond": 0, "If": 0, "set": 0, "read": 0, "from": 0, "interfac": 0, "my": 0, "esp32": 0, "resolv": 0, "default_inst": 0, "friendli": 0, "name": 0, "your": 0, "like": 0, "jhon": 0, "thing": 0, "method": 0, "start": 0, "sta": 0, "void": 0, "start_mdns_servic": 0, "initi": 0, "esp_err_t": 0, "err": 0, "mdns_init": 0, "printf": 0, "init": 0, "fail": 0, "d": 0, "n": 0, "return": 0, "mdns_hostname_set": 0, "instanc": 0, "mdns_instance_name_set": 0, "advertis": 0, "inform": 0, "about": 0, "offer": 0, "each": 0, "defin": 0, "few": 0, "instance_nam": 0, "eesp32": 0, "web": 0, "server": 0, "service_typ": 0, "requir": 0, "prepend": 0, "underscor": 0, "some": 0, "common": 0, "here": 0, "proto": 0, "protocol": 0, "run": 0, "_tcp": 0, "_udp": 0, "port": 0, "txt": 0, "var": 0, "val": 0, "arrai": 0, "string": 0, "add": 0, "differ": 0, "add_mdns_servic": 0, "our": 0, "mdns_service_add": 0, "null": 0, "_http": 0, "80": 0, "0": 0, "_arduino": 0, "3232": 0, "_myservic": 0, "1234": 0, "note": 0, "must": 0, "ad": 0, "befor": 0, "custom": 0, "mdns_service_instance_name_set": 0, "mdns_txt_item_t": 0, "servicetxtdata": 0, "3": 0, "board": 0, "u": 0, "user": 0, "p": 0, "password": 0, "data": 0, "free": 0, "replac": 0, "current": 0, "mdns_service_txt_set": 0, "chang": 0, "mdns_service_port_set": 0, "4321": 0, "brows": 0, "ip": 0, "ipv6": 0, "address": 0, "result": 0, "ar": 0, "link": 0, "list": 0, "mdns_result_t": 0, "object": 0, "resolve_mdns_host": 0, "const": 0, "char": 0, "host_nam": 0, "A": 0, "struct": 0, "ip4_addr": 0, "addr": 0, "mdns_query_a": 0, "2000": 0, "esp_err_not_found": 0, "wa": 0, "ipstr": 0, "ip2str": 0, "static": 0, "if_str": 0, "ap": 0, "eth": 0, "max": 0, "ip_protocol_str": 0, "v4": 0, "v6": 0, "mdns_print_result": 0, "r": 0, "mdns_ip_addr_t": 0, "int": 0, "1": 0, "t": 0, "while": 0, "tcpip_if": 0, "ip_protocol": 0, "ptr": 0, "srv": 0, "txt_count": 0, "kei": 0, "valu": 0, "ipaddr_type_v6": 0, "aaaa": 0, "ipv6str": 0, "ipv62str": 0, "u_addr": 0, "ip6": 0, "els": 0, "ip4": 0, "next": 0, "find_mdns_servic": 0, "service_nam": 0, "esp_logi": 0, "tag": 0, "mdns_query_ptr": 0, "3000": 0, "20": 0, "esp_log": 0, "esp_logw": 0, "No": 0, "mdns_query_results_fre": 0, "abov": 0, "my_app_some_method": 0, "search": 0, "http": 0, "_smb": 0, "share": 0, "_afpovertcp": 0, "_nf": 0, "nf": 0, "_ftp": 0, "ftp": 0, "printer": 0, "_printer": 0, "_ipp": 0, "creat": 0, "task": 0, "low": 0, "prioriti": 0, "config_mdns_task_prior": 0, "config_freertos_unicor": 0, "enabel": 0, "pin": 0, "cpu0": 0, "config_mdns_task_affin": 0, "pleas": 0, "check": 0, "maxim": 0, "more": 0, "detail": 0, "stack": 0, "size": 0, "configur": 0, "config_mdns_task_stack_s": 0, "scanner": 0, "includ": 0, "h": 0, "given": 0, "esp_ok": 0, "success": 0, "esp_err_invalid_st": 0, "when": 0, "regist": 0, "event": 0, "handler": 0, "esp_err_no_mem": 0, "memori": 0, "error": 0, "esp_fail": 0, "mdns_free": 0, "stop": 0, "you": 0, "want": 0, "paramet": 0, "esp_err_invalid_arg": 0, "mdns_delegate_hostname_add": 0, "address_list": 0, "deleg": 0, "repli": 0, "thi": 0, "The": 0, "mdns_delegate_hostname_remov": 0, "remov": 0, "all": 0, "also": 0, "bool": 0, "mdns_hostname_exist": 0, "whether": 0, "ha": 0, "been": 0, "true": 0, "fals": 0, "uint16_t": 0, "size_t": 0, "num_item": 0, "length": 0, "item": 0, "automat": 0, "decid": 0, "strlen": 0, "global": 0, "mdns_multiple_inst": 0, "config": 0, "option": 0, "need": 0, "enabl": 0, "multipl": 0, "same": 0, "etc": 0, "eg": 0, "other": 0, "2": 0, "number": 0, "mdns_service_add_for_host": 0, "mdns_service_exist": 0, "correspond": 0, "mdns_service_exists_with_inst": 0, "mdns_service_remov": 0, "mdns_service_remove_for_host": 0, "mdns_service_instance_name_set_for_host": 0, "instance_old": 0, "origin": 0, "mdns_service_port_set_for_host": 0, "uint8_t": 0, "mdns_service_txt_set_for_host": 0, "mdns_service_txt_item_set": 0, "record": 0, "updat": 0, "new": 0, "mdns_service_txt_item_set_with_explicit_value_len": 0, "value_len": 0, "mdns_service_txt_item_set_for_host": 0, "mdns_service_txt_item_set_for_host_with_explicit_value_len": 0, "mdns_service_txt_item_remov": 0, "mdns_service_txt_item_remove_for_host": 0, "mdns_service_subtype_add_for_host": 0, "subtyp": 0, "find": 0, "first": 0, "mdns_service_remove_al": 0, "mdns_query_async_delet": 0, "mdns_search_once_t": 0, "delet": 0, "finish": 0, "onli": 0, "after": 0, "end": 0, "pointer": 0, "mdns_query_async_get_result": 0, "uint32_t": 0, "timeout": 0, "num_Line truncated
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# Sphinx build info version 1
|
# Sphinx build info version 1
|
||||||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
|
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
|
||||||
config: aae3f67767183490dfce579bf34d72be
|
config: ad680e541a9400d9e85e0b17096ae589
|
||||||
tags: 549b3d6d0415232fb7e35403b330ff49
|
tags: 549b3d6d0415232fb7e35403b330ff49
|
||||||
+11
-119
@@ -10,6 +10,13 @@
|
|||||||
*/
|
*/
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([
|
||||||
|
"TEXTAREA",
|
||||||
|
"INPUT",
|
||||||
|
"SELECT",
|
||||||
|
"BUTTON",
|
||||||
|
]);
|
||||||
|
|
||||||
const _ready = (callback) => {
|
const _ready = (callback) => {
|
||||||
if (document.readyState !== "loading") {
|
if (document.readyState !== "loading") {
|
||||||
callback();
|
callback();
|
||||||
@@ -18,73 +25,11 @@ const _ready = (callback) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* highlight a given string on a node by wrapping it in
|
|
||||||
* span elements with the given class name.
|
|
||||||
*/
|
|
||||||
const _highlight = (node, addItems, text, className) => {
|
|
||||||
if (node.nodeType === Node.TEXT_NODE) {
|
|
||||||
const val = node.nodeValue;
|
|
||||||
const parent = node.parentNode;
|
|
||||||
const pos = val.toLowerCase().indexOf(text);
|
|
||||||
if (
|
|
||||||
pos >= 0 &&
|
|
||||||
!parent.classList.contains(className) &&
|
|
||||||
!parent.classList.contains("nohighlight")
|
|
||||||
) {
|
|
||||||
let span;
|
|
||||||
|
|
||||||
const closestNode = parent.closest("body, svg, foreignObject");
|
|
||||||
const isInSVG = closestNode && closestNode.matches("svg");
|
|
||||||
if (isInSVG) {
|
|
||||||
span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
||||||
} else {
|
|
||||||
span = document.createElement("span");
|
|
||||||
span.classList.add(className);
|
|
||||||
}
|
|
||||||
|
|
||||||
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
|
|
||||||
parent.insertBefore(
|
|
||||||
span,
|
|
||||||
parent.insertBefore(
|
|
||||||
document.createTextNode(val.substr(pos + text.length)),
|
|
||||||
node.nextSibling
|
|
||||||
)
|
|
||||||
);
|
|
||||||
node.nodeValue = val.substr(0, pos);
|
|
||||||
|
|
||||||
if (isInSVG) {
|
|
||||||
const rect = document.createElementNS(
|
|
||||||
"http://www.w3.org/2000/svg",
|
|
||||||
"rect"
|
|
||||||
);
|
|
||||||
const bbox = parent.getBBox();
|
|
||||||
rect.x.baseVal.value = bbox.x;
|
|
||||||
rect.y.baseVal.value = bbox.y;
|
|
||||||
rect.width.baseVal.value = bbox.width;
|
|
||||||
rect.height.baseVal.value = bbox.height;
|
|
||||||
rect.setAttribute("class", className);
|
|
||||||
addItems.push({ parent: parent, target: rect });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (node.matches && !node.matches("button, select, textarea")) {
|
|
||||||
node.childNodes.forEach((el) => _highlight(el, addItems, text, className));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const _highlightText = (thisNode, text, className) => {
|
|
||||||
let addItems = [];
|
|
||||||
_highlight(thisNode, addItems, text, className);
|
|
||||||
addItems.forEach((obj) =>
|
|
||||||
obj.parent.insertAdjacentElement("beforebegin", obj.target)
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Small JavaScript module for the documentation.
|
* Small JavaScript module for the documentation.
|
||||||
*/
|
*/
|
||||||
const Documentation = {
|
const Documentation = {
|
||||||
init: () => {
|
init: () => {
|
||||||
Documentation.highlightSearchWords();
|
|
||||||
Documentation.initDomainIndexTable();
|
Documentation.initDomainIndexTable();
|
||||||
Documentation.initOnKeyListeners();
|
Documentation.initOnKeyListeners();
|
||||||
},
|
},
|
||||||
@@ -126,51 +71,6 @@ const Documentation = {
|
|||||||
Documentation.LOCALE = catalog.locale;
|
Documentation.LOCALE = catalog.locale;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* highlight the search words provided in the url in the text
|
|
||||||
*/
|
|
||||||
highlightSearchWords: () => {
|
|
||||||
const highlight =
|
|
||||||
new URLSearchParams(window.location.search).get("highlight") || "";
|
|
||||||
const terms = highlight.toLowerCase().split(/\s+/).filter(x => x);
|
|
||||||
if (terms.length === 0) return; // nothing to do
|
|
||||||
|
|
||||||
// There should never be more than one element matching "div.body"
|
|
||||||
const divBody = document.querySelectorAll("div.body");
|
|
||||||
const body = divBody.length ? divBody[0] : document.querySelector("body");
|
|
||||||
window.setTimeout(() => {
|
|
||||||
terms.forEach((term) => _highlightText(body, term, "highlighted"));
|
|
||||||
}, 10);
|
|
||||||
|
|
||||||
const searchBox = document.getElementById("searchbox");
|
|
||||||
if (searchBox === null) return;
|
|
||||||
searchBox.appendChild(
|
|
||||||
document
|
|
||||||
.createRange()
|
|
||||||
.createContextualFragment(
|
|
||||||
'<p class="highlight-link">' +
|
|
||||||
'<a href="javascript:Documentation.hideSearchWords()">' +
|
|
||||||
Documentation.gettext("Hide Search Matches") +
|
|
||||||
"</a></p>"
|
|
||||||
)
|
|
||||||
);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* helper function to hide the search marks again
|
|
||||||
*/
|
|
||||||
hideSearchWords: () => {
|
|
||||||
document
|
|
||||||
.querySelectorAll("#searchbox .highlight-link")
|
|
||||||
.forEach((el) => el.remove());
|
|
||||||
document
|
|
||||||
.querySelectorAll("span.highlighted")
|
|
||||||
.forEach((el) => el.classList.remove("highlighted"));
|
|
||||||
const url = new URL(window.location);
|
|
||||||
url.searchParams.delete("highlight");
|
|
||||||
window.history.replaceState({}, "", url);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* helper function to focus on search bar
|
* helper function to focus on search bar
|
||||||
*/
|
*/
|
||||||
@@ -210,15 +110,11 @@ const Documentation = {
|
|||||||
)
|
)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const blacklistedElements = new Set([
|
|
||||||
"TEXTAREA",
|
|
||||||
"INPUT",
|
|
||||||
"SELECT",
|
|
||||||
"BUTTON",
|
|
||||||
]);
|
|
||||||
document.addEventListener("keydown", (event) => {
|
document.addEventListener("keydown", (event) => {
|
||||||
if (blacklistedElements.has(document.activeElement.tagName)) return; // bail for input elements
|
// bail for input elements
|
||||||
if (event.altKey || event.ctrlKey || event.metaKey) return; // bail with special keys
|
if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return;
|
||||||
|
// bail with special keys
|
||||||
|
if (event.altKey || event.ctrlKey || event.metaKey) return;
|
||||||
|
|
||||||
if (!event.shiftKey) {
|
if (!event.shiftKey) {
|
||||||
switch (event.key) {
|
switch (event.key) {
|
||||||
@@ -240,10 +136,6 @@ const Documentation = {
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "Escape":
|
|
||||||
if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break;
|
|
||||||
Documentation.hideSearchWords();
|
|
||||||
event.preventDefault();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
|
pre { line-height: 125%; }
|
||||||
|
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
|
||||||
|
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
|
||||||
|
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
|
||||||
|
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
|
||||||
.highlight .hll { background-color: #ffffcc }
|
.highlight .hll { background-color: #ffffcc }
|
||||||
.highlight { background: #eeffcc; }
|
.highlight { background: #eeffcc; }
|
||||||
.highlight .c { color: #408090; font-style: italic } /* Comment */
|
.highlight .c { color: #408090; font-style: italic } /* Comment */
|
||||||
.highlight .err { border: 1px solid #FF0000 } /* Error */
|
.highlight .err { border: 1px solid #FF0000 } /* Error */
|
||||||
.highlight .k { color: #007020; font-weight: bold } /* Keyword */
|
.highlight .k { color: #007020; font-weight: bold } /* Keyword */
|
||||||
|
|||||||
@@ -57,14 +57,14 @@ const _removeChildren = (element) => {
|
|||||||
const _escapeRegExp = (string) =>
|
const _escapeRegExp = (string) =>
|
||||||
string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
|
string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
|
||||||
|
|
||||||
const _displayItem = (item, highlightTerms, searchTerms) => {
|
const _displayItem = (item, searchTerms) => {
|
||||||
const docBuilder = DOCUMENTATION_OPTIONS.BUILDER;
|
const docBuilder = DOCUMENTATION_OPTIONS.BUILDER;
|
||||||
const docUrlRoot = DOCUMENTATION_OPTIONS.URL_ROOT;
|
const docUrlRoot = DOCUMENTATION_OPTIONS.URL_ROOT;
|
||||||
const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX;
|
const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX;
|
||||||
const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX;
|
const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX;
|
||||||
const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY;
|
const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY;
|
||||||
|
|
||||||
const [docName, title, anchor, descr] = item;
|
const [docName, title, anchor, descr, score, _filename] = item;
|
||||||
|
|
||||||
let listItem = document.createElement("li");
|
let listItem = document.createElement("li");
|
||||||
let requestUrl;
|
let requestUrl;
|
||||||
@@ -82,10 +82,9 @@ const _displayItem = (item, highlightTerms, searchTerms) => {
|
|||||||
requestUrl = docUrlRoot + docName + docFileSuffix;
|
requestUrl = docUrlRoot + docName + docFileSuffix;
|
||||||
linkUrl = docName + docLinkSuffix;
|
linkUrl = docName + docLinkSuffix;
|
||||||
}
|
}
|
||||||
const params = new URLSearchParams();
|
|
||||||
params.set("highlight", [...highlightTerms].join(" "));
|
|
||||||
let linkEl = listItem.appendChild(document.createElement("a"));
|
let linkEl = listItem.appendChild(document.createElement("a"));
|
||||||
linkEl.href = linkUrl + "?" + params.toString() + anchor;
|
linkEl.href = linkUrl + anchor;
|
||||||
|
linkEl.dataset.score = score;
|
||||||
linkEl.innerHTML = title;
|
linkEl.innerHTML = title;
|
||||||
if (descr)
|
if (descr)
|
||||||
listItem.appendChild(document.createElement("span")).innerHTML =
|
listItem.appendChild(document.createElement("span")).innerHTML =
|
||||||
@@ -96,7 +95,7 @@ const _displayItem = (item, highlightTerms, searchTerms) => {
|
|||||||
.then((data) => {
|
.then((data) => {
|
||||||
if (data)
|
if (data)
|
||||||
listItem.appendChild(
|
listItem.appendChild(
|
||||||
Search.makeSearchSummary(data, searchTerms, highlightTerms)
|
Search.makeSearchSummary(data, searchTerms)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
Search.output.appendChild(listItem);
|
Search.output.appendChild(listItem);
|
||||||
@@ -116,15 +115,14 @@ const _finishSearch = (resultCount) => {
|
|||||||
const _displayNextItem = (
|
const _displayNextItem = (
|
||||||
results,
|
results,
|
||||||
resultCount,
|
resultCount,
|
||||||
highlightTerms,
|
|
||||||
searchTerms
|
searchTerms
|
||||||
) => {
|
) => {
|
||||||
// results left, load the summary and display it
|
// results left, load the summary and display it
|
||||||
// this is intended to be dynamic (don't sub resultsCount)
|
// this is intended to be dynamic (don't sub resultsCount)
|
||||||
if (results.length) {
|
if (results.length) {
|
||||||
_displayItem(results.pop(), highlightTerms, searchTerms);
|
_displayItem(results.pop(), searchTerms);
|
||||||
setTimeout(
|
setTimeout(
|
||||||
() => _displayNextItem(results, resultCount, highlightTerms, searchTerms),
|
() => _displayNextItem(results, resultCount, searchTerms),
|
||||||
5
|
5
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -237,6 +235,12 @@ const Search = {
|
|||||||
* execute search (requires search index to be loaded)
|
* execute search (requires search index to be loaded)
|
||||||
*/
|
*/
|
||||||
query: (query) => {
|
query: (query) => {
|
||||||
|
const filenames = Search._index.filenames;
|
||||||
|
const docNames = Search._index.docnames;
|
||||||
|
const titles = Search._index.titles;
|
||||||
|
const allTitles = Search._index.alltitles;
|
||||||
|
const indexEntries = Search._index.indexentries;
|
||||||
|
|
||||||
// stem the search terms and add them to the correct list
|
// stem the search terms and add them to the correct list
|
||||||
const stemmer = new Stemmer();
|
const stemmer = new Stemmer();
|
||||||
const searchTerms = new Set();
|
const searchTerms = new Set();
|
||||||
@@ -264,6 +268,10 @@ const Search = {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (SPHINX_HIGHLIGHT_ENABLED) { // set in sphinx_highlight.js
|
||||||
|
localStorage.setItem("sphinx_highlight_terms", [...highlightTerms].join(" "))
|
||||||
|
}
|
||||||
|
|
||||||
// console.debug("SEARCH: searching for:");
|
// console.debug("SEARCH: searching for:");
|
||||||
// console.info("required: ", [...searchTerms]);
|
// console.info("required: ", [...searchTerms]);
|
||||||
// console.info("excluded: ", [...excludedTerms]);
|
// console.info("excluded: ", [...excludedTerms]);
|
||||||
@@ -272,6 +280,40 @@ const Search = {
|
|||||||
let results = [];
|
let results = [];
|
||||||
_removeChildren(document.getElementById("search-progress"));
|
_removeChildren(document.getElementById("search-progress"));
|
||||||
|
|
||||||
|
const queryLower = query.toLowerCase();
|
||||||
|
for (const [title, foundTitles] of Object.entries(allTitles)) {
|
||||||
|
if (title.toLowerCase().includes(queryLower) && (queryLower.length >= title.length/2)) {
|
||||||
|
for (const [file, id] of foundTitles) {
|
||||||
|
let score = Math.round(100 * queryLower.length / title.length)
|
||||||
|
results.push([
|
||||||
|
docNames[file],
|
||||||
|
titles[file] !== title ? `${titles[file]} > ${title}` : title,
|
||||||
|
id !== null ? "#" + id : "",
|
||||||
|
null,
|
||||||
|
score,
|
||||||
|
filenames[file],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// search for explicit entries in index directives
|
||||||
|
for (const [entry, foundEntries] of Object.entries(indexEntries)) {
|
||||||
|
if (entry.includes(queryLower) && (queryLower.length >= entry.length/2)) {
|
||||||
|
for (const [file, id] of foundEntries) {
|
||||||
|
let score = Math.round(100 * queryLower.length / entry.length)
|
||||||
|
results.push([
|
||||||
|
docNames[file],
|
||||||
|
titles[file],
|
||||||
|
id ? "#" + id : "",
|
||||||
|
null,
|
||||||
|
score,
|
||||||
|
filenames[file],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// lookup as object
|
// lookup as object
|
||||||
objectTerms.forEach((term) =>
|
objectTerms.forEach((term) =>
|
||||||
results.push(...Search.performObjectSearch(term, objectTerms))
|
results.push(...Search.performObjectSearch(term, objectTerms))
|
||||||
@@ -318,7 +360,7 @@ const Search = {
|
|||||||
// console.info("search results:", Search.lastresults);
|
// console.info("search results:", Search.lastresults);
|
||||||
|
|
||||||
// print the results
|
// print the results
|
||||||
_displayNextItem(results, results.length, highlightTerms, searchTerms);
|
_displayNextItem(results, results.length, searchTerms);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -399,8 +441,8 @@ const Search = {
|
|||||||
// prepare search
|
// prepare search
|
||||||
const terms = Search._index.terms;
|
const terms = Search._index.terms;
|
||||||
const titleTerms = Search._index.titleterms;
|
const titleTerms = Search._index.titleterms;
|
||||||
const docNames = Search._index.docnames;
|
|
||||||
const filenames = Search._index.filenames;
|
const filenames = Search._index.filenames;
|
||||||
|
const docNames = Search._index.docnames;
|
||||||
const titles = Search._index.titles;
|
const titles = Search._index.titles;
|
||||||
|
|
||||||
const scoreMap = new Map();
|
const scoreMap = new Map();
|
||||||
@@ -497,11 +539,9 @@ const Search = {
|
|||||||
/**
|
/**
|
||||||
* helper function to return a node containing the
|
* helper function to return a node containing the
|
||||||
* search summary for a given text. keywords is a list
|
* search summary for a given text. keywords is a list
|
||||||
* of stemmed words, highlightWords is the list of normal, unstemmed
|
* of stemmed words.
|
||||||
* words. the first one is used to find the occurrence, the
|
|
||||||
* latter for highlighting it.
|
|
||||||
*/
|
*/
|
||||||
makeSearchSummary: (htmlText, keywords, highlightWords) => {
|
makeSearchSummary: (htmlText, keywords) => {
|
||||||
const text = Search.htmlToText(htmlText);
|
const text = Search.htmlToText(htmlText);
|
||||||
if (text === "") return null;
|
if (text === "") return null;
|
||||||
|
|
||||||
@@ -519,10 +559,6 @@ const Search = {
|
|||||||
summary.classList.add("context");
|
summary.classList.add("context");
|
||||||
summary.textContent = top + text.substr(startWithContext, 240).trim() + tail;
|
summary.textContent = top + text.substr(startWithContext, 240).trim() + tail;
|
||||||
|
|
||||||
highlightWords.forEach((highlightWord) =>
|
|
||||||
_highlightText(summary, highlightWord, "highlighted")
|
|
||||||
);
|
|
||||||
|
|
||||||
return summary;
|
return summary;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,144 @@
|
|||||||
|
/* Highlighting utilities for Sphinx HTML documentation. */
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
const SPHINX_HIGHLIGHT_ENABLED = true
|
||||||
|
|
||||||
|
/**
|
||||||
|
* highlight a given string on a node by wrapping it in
|
||||||
|
* span elements with the given class name.
|
||||||
|
*/
|
||||||
|
const _highlight = (node, addItems, text, className) => {
|
||||||
|
if (node.nodeType === Node.TEXT_NODE) {
|
||||||
|
const val = node.nodeValue;
|
||||||
|
const parent = node.parentNode;
|
||||||
|
const pos = val.toLowerCase().indexOf(text);
|
||||||
|
if (
|
||||||
|
pos >= 0 &&
|
||||||
|
!parent.classList.contains(className) &&
|
||||||
|
!parent.classList.contains("nohighlight")
|
||||||
|
) {
|
||||||
|
let span;
|
||||||
|
|
||||||
|
const closestNode = parent.closest("body, svg, foreignObject");
|
||||||
|
const isInSVG = closestNode && closestNode.matches("svg");
|
||||||
|
if (isInSVG) {
|
||||||
|
span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
||||||
|
} else {
|
||||||
|
span = document.createElement("span");
|
||||||
|
span.classList.add(className);
|
||||||
|
}
|
||||||
|
|
||||||
|
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
|
||||||
|
parent.insertBefore(
|
||||||
|
span,
|
||||||
|
parent.insertBefore(
|
||||||
|
document.createTextNode(val.substr(pos + text.length)),
|
||||||
|
node.nextSibling
|
||||||
|
)
|
||||||
|
);
|
||||||
|
node.nodeValue = val.substr(0, pos);
|
||||||
|
|
||||||
|
if (isInSVG) {
|
||||||
|
const rect = document.createElementNS(
|
||||||
|
"http://www.w3.org/2000/svg",
|
||||||
|
"rect"
|
||||||
|
);
|
||||||
|
const bbox = parent.getBBox();
|
||||||
|
rect.x.baseVal.value = bbox.x;
|
||||||
|
rect.y.baseVal.value = bbox.y;
|
||||||
|
rect.width.baseVal.value = bbox.width;
|
||||||
|
rect.height.baseVal.value = bbox.height;
|
||||||
|
rect.setAttribute("class", className);
|
||||||
|
addItems.push({ parent: parent, target: rect });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (node.matches && !node.matches("button, select, textarea")) {
|
||||||
|
node.childNodes.forEach((el) => _highlight(el, addItems, text, className));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const _highlightText = (thisNode, text, className) => {
|
||||||
|
let addItems = [];
|
||||||
|
_highlight(thisNode, addItems, text, className);
|
||||||
|
addItems.forEach((obj) =>
|
||||||
|
obj.parent.insertAdjacentElement("beforebegin", obj.target)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Small JavaScript module for the documentation.
|
||||||
|
*/
|
||||||
|
const SphinxHighlight = {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* highlight the search words provided in localstorage in the text
|
||||||
|
*/
|
||||||
|
highlightSearchWords: () => {
|
||||||
|
if (!SPHINX_HIGHLIGHT_ENABLED) return; // bail if no highlight
|
||||||
|
|
||||||
|
// get and clear terms from localstorage
|
||||||
|
const url = new URL(window.location);
|
||||||
|
const highlight =
|
||||||
|
localStorage.getItem("sphinx_highlight_terms")
|
||||||
|
|| url.searchParams.get("highlight")
|
||||||
|
|| "";
|
||||||
|
localStorage.removeItem("sphinx_highlight_terms")
|
||||||
|
url.searchParams.delete("highlight");
|
||||||
|
window.history.replaceState({}, "", url);
|
||||||
|
|
||||||
|
// get individual terms from highlight string
|
||||||
|
const terms = highlight.toLowerCase().split(/\s+/).filter(x => x);
|
||||||
|
if (terms.length === 0) return; // nothing to do
|
||||||
|
|
||||||
|
// There should never be more than one element matching "div.body"
|
||||||
|
const divBody = document.querySelectorAll("div.body");
|
||||||
|
const body = divBody.length ? divBody[0] : document.querySelector("body");
|
||||||
|
window.setTimeout(() => {
|
||||||
|
terms.forEach((term) => _highlightText(body, term, "highlighted"));
|
||||||
|
}, 10);
|
||||||
|
|
||||||
|
const searchBox = document.getElementById("searchbox");
|
||||||
|
if (searchBox === null) return;
|
||||||
|
searchBox.appendChild(
|
||||||
|
document
|
||||||
|
.createRange()
|
||||||
|
.createContextualFragment(
|
||||||
|
'<p class="highlight-link">' +
|
||||||
|
'<a href="javascript:SphinxHighlight.hideSearchWords()">' +
|
||||||
|
_("Hide Search Matches") +
|
||||||
|
"</a></p>"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* helper function to hide the search marks again
|
||||||
|
*/
|
||||||
|
hideSearchWords: () => {
|
||||||
|
document
|
||||||
|
.querySelectorAll("#searchbox .highlight-link")
|
||||||
|
.forEach((el) => el.remove());
|
||||||
|
document
|
||||||
|
.querySelectorAll("span.highlighted")
|
||||||
|
.forEach((el) => el.classList.remove("highlighted"));
|
||||||
|
localStorage.removeItem("sphinx_highlight_terms")
|
||||||
|
},
|
||||||
|
|
||||||
|
initEscapeListener: () => {
|
||||||
|
// only install a listener if it is really needed
|
||||||
|
if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) return;
|
||||||
|
|
||||||
|
document.addEventListener("keydown", (event) => {
|
||||||
|
// bail for input elements
|
||||||
|
if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return;
|
||||||
|
// bail with special keys
|
||||||
|
if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return;
|
||||||
|
if (DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS && (event.key === "Escape")) {
|
||||||
|
SphinxHighlight.hideSearchWords();
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
_ready(SphinxHighlight.highlightSearchWords);
|
||||||
|
_ready(SphinxHighlight.initEscapeListener);
|
||||||
@@ -17,6 +17,7 @@
|
|||||||
<script src="_static/underscore.js"></script>
|
<script src="_static/underscore.js"></script>
|
||||||
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
||||||
<script src="_static/doctools.js"></script>
|
<script src="_static/doctools.js"></script>
|
||||||
|
<script src="_static/sphinx_highlight.js"></script>
|
||||||
<script src="_static/clipboard.min.js"></script>
|
<script src="_static/clipboard.min.js"></script>
|
||||||
<script src="_static/copybutton.js"></script>
|
<script src="_static/copybutton.js"></script>
|
||||||
<script src="_static/translations.js"></script>
|
<script src="_static/translations.js"></script>
|
||||||
@@ -91,7 +92,7 @@
|
|||||||
<li><a href="index.html" class="icon icon-home"></a> »</li>
|
<li><a href="index.html" class="icon icon-home"></a> »</li>
|
||||||
<li>索引</li>
|
<li>索引</li>
|
||||||
<li class="wy-breadcrumbs-aside">
|
<li class="wy-breadcrumbs-aside">
|
||||||
<a href="https://github.com/espressif/esp-protocols/blob/7310a7a/docs/zh_CN/genindex" class="fa fa-github"> 在 GitHub 上修改</a>
|
<a href="https://github.com/espressif/esp-protocols/blob/467fec5/docs/zh_CN/genindex" class="fa fa-github"> 在 GitHub 上修改</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|||||||
+115
-114
@@ -18,6 +18,7 @@
|
|||||||
<script src="_static/underscore.js"></script>
|
<script src="_static/underscore.js"></script>
|
||||||
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
||||||
<script src="_static/doctools.js"></script>
|
<script src="_static/doctools.js"></script>
|
||||||
|
<script src="_static/sphinx_highlight.js"></script>
|
||||||
<script src="_static/clipboard.min.js"></script>
|
<script src="_static/clipboard.min.js"></script>
|
||||||
<script src="_static/copybutton.js"></script>
|
<script src="_static/copybutton.js"></script>
|
||||||
<script src="_static/translations.js"></script>
|
<script src="_static/translations.js"></script>
|
||||||
@@ -113,7 +114,7 @@
|
|||||||
<li><a href="#" class="icon icon-home"></a> »</li>
|
<li><a href="#" class="icon icon-home"></a> »</li>
|
||||||
<li>mDNS 服务</li>
|
<li>mDNS 服务</li>
|
||||||
<li class="wy-breadcrumbs-aside">
|
<li class="wy-breadcrumbs-aside">
|
||||||
<a href="https://github.com/espressif/esp-protocols/blob/7310a7a/docs/zh_CN/index.rst" class="fa fa-github"> 在 GitHub 上修改</a>
|
<a href="https://github.com/espressif/esp-protocols/blob/467fec5/docs/zh_CN/index.rst" class="fa fa-github"> 在 GitHub 上修改</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<hr/>
|
<hr/>
|
||||||
@@ -137,20 +138,20 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div></blockquote>
|
</div></blockquote>
|
||||||
<p>以下为 STA 接口启动 mDNS 服务并设置 <code class="docutils literal notranslate"><span class="pre">hostname</span></code> 和 <code class="docutils literal notranslate"><span class="pre">default_instance</span></code> 的示例方法:</p>
|
<p>以下为 STA 接口启动 mDNS 服务并设置 <code class="docutils literal notranslate"><span class="pre">hostname</span></code> 和 <code class="docutils literal notranslate"><span class="pre">default_instance</span></code> 的示例方法:</p>
|
||||||
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">start_mdns_service</span><span class="p">()</span>
|
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="kt">void</span><span class="w"> </span><span class="nf">start_mdns_service</span><span class="p">()</span><span class="w"></span>
|
||||||
<span class="p">{</span>
|
<span class="p">{</span><span class="w"></span>
|
||||||
<span class="c1">// 初始化 mDNS 服务</span>
|
<span class="w"> </span><span class="c1">// 初始化 mDNS 服务</span>
|
||||||
<span class="n">esp_err_t</span> <span class="n">err</span> <span class="o">=</span> <span class="n">mdns_init</span><span class="p">();</span>
|
<span class="w"> </span><span class="n">esp_err_t</span><span class="w"> </span><span class="n">err</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">mdns_init</span><span class="p">();</span><span class="w"></span>
|
||||||
<span class="k">if</span> <span class="p">(</span><span class="n">err</span><span class="p">)</span> <span class="p">{</span>
|
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">err</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
|
||||||
<span class="n">printf</span><span class="p">(</span><span class="s">"MDNS Init failed: %d</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">err</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">"MDNS Init failed: %d</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span><span class="w"> </span><span class="n">err</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="k">return</span><span class="p">;</span>
|
<span class="w"> </span><span class="k">return</span><span class="p">;</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
||||||
|
|
||||||
<span class="c1">// 设置 hostname</span>
|
<span class="w"> </span><span class="c1">// 设置 hostname</span>
|
||||||
<span class="n">mdns_hostname_set</span><span class="p">(</span><span class="s">"my-esp32"</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">mdns_hostname_set</span><span class="p">(</span><span class="s">"my-esp32"</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="c1">// 设置默认实例</span>
|
<span class="w"> </span><span class="c1">// 设置默认实例</span>
|
||||||
<span class="n">mdns_instance_name_set</span><span class="p">(</span><span class="s">"Jhon's ESP32 Thing"</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">mdns_instance_name_set</span><span class="p">(</span><span class="s">"Jhon's ESP32 Thing"</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="p">}</span><span class="w"></span>
|
||||||
</pre></div>
|
</pre></div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@@ -167,28 +168,28 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div></blockquote>
|
</div></blockquote>
|
||||||
<p>添加一些服务和不同属性的示例方法:</p>
|
<p>添加一些服务和不同属性的示例方法:</p>
|
||||||
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">add_mdns_services</span><span class="p">()</span>
|
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="kt">void</span><span class="w"> </span><span class="nf">add_mdns_services</span><span class="p">()</span><span class="w"></span>
|
||||||
<span class="p">{</span>
|
<span class="p">{</span><span class="w"></span>
|
||||||
<span class="c1">// 添加服务</span>
|
<span class="w"> </span><span class="c1">// 添加服务</span>
|
||||||
<span class="n">mdns_service_add</span><span class="p">(</span><span class="nb">NULL</span><span class="p">,</span> <span class="s">"_http"</span><span class="p">,</span> <span class="s">"_tcp"</span><span class="p">,</span> <span class="mi">80</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">mdns_service_add</span><span class="p">(</span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="s">"_http"</span><span class="p">,</span><span class="w"> </span><span class="s">"_tcp"</span><span class="p">,</span><span class="w"> </span><span class="mi">80</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="n">mdns_service_add</span><span class="p">(</span><span class="nb">NULL</span><span class="p">,</span> <span class="s">"_arduino"</span><span class="p">,</span> <span class="s">"_tcp"</span><span class="p">,</span> <span class="mi">3232</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">mdns_service_add</span><span class="p">(</span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="s">"_arduino"</span><span class="p">,</span><span class="w"> </span><span class="s">"_tcp"</span><span class="p">,</span><span class="w"> </span><span class="mi">3232</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="n">mdns_service_add</span><span class="p">(</span><span class="nb">NULL</span><span class="p">,</span> <span class="s">"_myservice"</span><span class="p">,</span> <span class="s">"_udp"</span><span class="p">,</span> <span class="mi">1234</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">mdns_service_add</span><span class="p">(</span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="s">"_myservice"</span><span class="p">,</span><span class="w"> </span><span class="s">"_udp"</span><span class="p">,</span><span class="w"> </span><span class="mi">1234</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">);</span><span class="w"></span>
|
||||||
|
|
||||||
<span class="c1">// 注意:必须先添加服务,然后才能设置其属性</span>
|
<span class="w"> </span><span class="c1">// 注意:必须先添加服务,然后才能设置其属性</span>
|
||||||
<span class="c1">// web 服务器使用自定义的实例名</span>
|
<span class="w"> </span><span class="c1">// web 服务器使用自定义的实例名</span>
|
||||||
<span class="n">mdns_service_instance_name_set</span><span class="p">(</span><span class="s">"_http"</span><span class="p">,</span> <span class="s">"_tcp"</span><span class="p">,</span> <span class="s">"Jhon's ESP32 Web Server"</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">mdns_service_instance_name_set</span><span class="p">(</span><span class="s">"_http"</span><span class="p">,</span><span class="w"> </span><span class="s">"_tcp"</span><span class="p">,</span><span class="w"> </span><span class="s">"Jhon's ESP32 Web Server"</span><span class="p">);</span><span class="w"></span>
|
||||||
|
|
||||||
<span class="n">mdns_txt_item_t</span> <span class="n">serviceTxtData</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span> <span class="o">=</span> <span class="p">{</span>
|
<span class="w"> </span><span class="n">mdns_txt_item_t</span><span class="w"> </span><span class="n">serviceTxtData</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
|
||||||
<span class="p">{</span><span class="s">"board"</span><span class="p">,</span><span class="s">"esp32"</span><span class="p">},</span>
|
<span class="w"> </span><span class="p">{</span><span class="s">"board"</span><span class="p">,</span><span class="s">"esp32"</span><span class="p">},</span><span class="w"></span>
|
||||||
<span class="p">{</span><span class="s">"u"</span><span class="p">,</span><span class="s">"user"</span><span class="p">},</span>
|
<span class="w"> </span><span class="p">{</span><span class="s">"u"</span><span class="p">,</span><span class="s">"user"</span><span class="p">},</span><span class="w"></span>
|
||||||
<span class="p">{</span><span class="s">"p"</span><span class="p">,</span><span class="s">"password"</span><span class="p">}</span>
|
<span class="w"> </span><span class="p">{</span><span class="s">"p"</span><span class="p">,</span><span class="s">"password"</span><span class="p">}</span><span class="w"></span>
|
||||||
<span class="p">};</span>
|
<span class="w"> </span><span class="p">};</span><span class="w"></span>
|
||||||
<span class="c1">// 设置服务的文本数据(会释放并替换当前数据)</span>
|
<span class="w"> </span><span class="c1">// 设置服务的文本数据(会释放并替换当前数据)</span>
|
||||||
<span class="n">mdns_service_txt_set</span><span class="p">(</span><span class="s">"_http"</span><span class="p">,</span> <span class="s">"_tcp"</span><span class="p">,</span> <span class="n">serviceTxtData</span><span class="p">,</span> <span class="mi">3</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">mdns_service_txt_set</span><span class="p">(</span><span class="s">"_http"</span><span class="p">,</span><span class="w"> </span><span class="s">"_tcp"</span><span class="p">,</span><span class="w"> </span><span class="n">serviceTxtData</span><span class="p">,</span><span class="w"> </span><span class="mi">3</span><span class="p">);</span><span class="w"></span>
|
||||||
|
|
||||||
<span class="c1">// 修改服务端口号</span>
|
<span class="w"> </span><span class="c1">// 修改服务端口号</span>
|
||||||
<span class="n">mdns_service_port_set</span><span class="p">(</span><span class="s">"_myservice"</span><span class="p">,</span> <span class="s">"_udp"</span><span class="p">,</span> <span class="mi">4321</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">mdns_service_port_set</span><span class="p">(</span><span class="s">"_myservice"</span><span class="p">,</span><span class="w"> </span><span class="s">"_udp"</span><span class="p">,</span><span class="w"> </span><span class="mi">4321</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="p">}</span><span class="w"></span>
|
||||||
</pre></div>
|
</pre></div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@@ -197,114 +198,114 @@
|
|||||||
<p>mDNS 提供查询服务和解析主机 IP/IPv6 地址的方法。</p>
|
<p>mDNS 提供查询服务和解析主机 IP/IPv6 地址的方法。</p>
|
||||||
<p>服务查询的结果会作为 <code class="docutils literal notranslate"><span class="pre">mdns_result_t</span></code> 类型对象的链表返回。</p>
|
<p>服务查询的结果会作为 <code class="docutils literal notranslate"><span class="pre">mdns_result_t</span></code> 类型对象的链表返回。</p>
|
||||||
<p>解析主机 IP 地址的示例方法:</p>
|
<p>解析主机 IP 地址的示例方法:</p>
|
||||||
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">resolve_mdns_host</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span> <span class="n">host_name</span><span class="p">)</span>
|
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="kt">void</span><span class="w"> </span><span class="nf">resolve_mdns_host</span><span class="p">(</span><span class="k">const</span><span class="w"> </span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">host_name</span><span class="p">)</span><span class="w"></span>
|
||||||
<span class="p">{</span>
|
<span class="p">{</span><span class="w"></span>
|
||||||
<span class="n">printf</span><span class="p">(</span><span class="s">"Query A: %s.local"</span><span class="p">,</span> <span class="n">host_name</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">"Query A: %s.local"</span><span class="p">,</span><span class="w"> </span><span class="n">host_name</span><span class="p">);</span><span class="w"></span>
|
||||||
|
|
||||||
<span class="k">struct</span> <span class="n">ip4_addr</span> <span class="n">addr</span><span class="p">;</span>
|
<span class="w"> </span><span class="k">struct</span><span class="w"> </span><span class="nc">ip4_addr</span><span class="w"> </span><span class="n">addr</span><span class="p">;</span><span class="w"></span>
|
||||||
<span class="n">addr</span><span class="p">.</span><span class="n">addr</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
|
<span class="w"> </span><span class="n">addr</span><span class="p">.</span><span class="n">addr</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"></span>
|
||||||
|
|
||||||
<span class="n">esp_err_t</span> <span class="n">err</span> <span class="o">=</span> <span class="n">mdns_query_a</span><span class="p">(</span><span class="n">host_name</span><span class="p">,</span> <span class="mi">2000</span><span class="p">,</span> <span class="o">&</span><span class="n">addr</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">esp_err_t</span><span class="w"> </span><span class="n">err</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">mdns_query_a</span><span class="p">(</span><span class="n">host_name</span><span class="p">,</span><span class="w"> </span><span class="mi">2000</span><span class="p">,</span><span class="w"> </span><span class="o">&</span><span class="n">addr</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="k">if</span><span class="p">(</span><span class="n">err</span><span class="p">){</span>
|
<span class="w"> </span><span class="k">if</span><span class="p">(</span><span class="n">err</span><span class="p">){</span><span class="w"></span>
|
||||||
<span class="k">if</span><span class="p">(</span><span class="n">err</span> <span class="o">==</span> <span class="n">ESP_ERR_NOT_FOUND</span><span class="p">){</span>
|
<span class="w"> </span><span class="k">if</span><span class="p">(</span><span class="n">err</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">ESP_ERR_NOT_FOUND</span><span class="p">){</span><span class="w"></span>
|
||||||
<span class="n">printf</span><span class="p">(</span><span class="s">"Host was not found!"</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">"Host was not found!"</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="k">return</span><span class="p">;</span>
|
<span class="w"> </span><span class="k">return</span><span class="p">;</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
||||||
<span class="n">printf</span><span class="p">(</span><span class="s">"Query Failed"</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">"Query Failed"</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="k">return</span><span class="p">;</span>
|
<span class="w"> </span><span class="k">return</span><span class="p">;</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
||||||
|
|
||||||
<span class="n">printf</span><span class="p">(</span><span class="n">IPSTR</span><span class="p">,</span> <span class="n">IP2STR</span><span class="p">(</span><span class="o">&</span><span class="n">addr</span><span class="p">));</span>
|
<span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="n">IPSTR</span><span class="p">,</span><span class="w"> </span><span class="n">IP2STR</span><span class="p">(</span><span class="o">&</span><span class="n">addr</span><span class="p">));</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="p">}</span><span class="w"></span>
|
||||||
</pre></div>
|
</pre></div>
|
||||||
</div>
|
</div>
|
||||||
<p>解析本地服务的示例方法:</p>
|
<p>解析本地服务的示例方法:</p>
|
||||||
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">static</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span> <span class="n">if_str</span><span class="p">[]</span> <span class="o">=</span> <span class="p">{</span><span class="s">"STA"</span><span class="p">,</span> <span class="s">"AP"</span><span class="p">,</span> <span class="s">"ETH"</span><span class="p">,</span> <span class="s">"MAX"</span><span class="p">};</span>
|
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">static</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">if_str</span><span class="p">[]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">{</span><span class="s">"STA"</span><span class="p">,</span><span class="w"> </span><span class="s">"AP"</span><span class="p">,</span><span class="w"> </span><span class="s">"ETH"</span><span class="p">,</span><span class="w"> </span><span class="s">"MAX"</span><span class="p">};</span><span class="w"></span>
|
||||||
<span class="k">static</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span> <span class="n">ip_protocol_str</span><span class="p">[]</span> <span class="o">=</span> <span class="p">{</span><span class="s">"V4"</span><span class="p">,</span> <span class="s">"V6"</span><span class="p">,</span> <span class="s">"MAX"</span><span class="p">};</span>
|
<span class="k">static</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">ip_protocol_str</span><span class="p">[]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">{</span><span class="s">"V4"</span><span class="p">,</span><span class="w"> </span><span class="s">"V6"</span><span class="p">,</span><span class="w"> </span><span class="s">"MAX"</span><span class="p">};</span><span class="w"></span>
|
||||||
|
|
||||||
<span class="kt">void</span> <span class="nf">mdns_print_results</span><span class="p">(</span><span class="n">mdns_result_t</span> <span class="o">*</span> <span class="n">results</span><span class="p">){</span>
|
<span class="kt">void</span><span class="w"> </span><span class="nf">mdns_print_results</span><span class="p">(</span><span class="n">mdns_result_t</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">results</span><span class="p">){</span><span class="w"></span>
|
||||||
<span class="n">mdns_result_t</span> <span class="o">*</span> <span class="n">r</span> <span class="o">=</span> <span class="n">results</span><span class="p">;</span>
|
<span class="w"> </span><span class="n">mdns_result_t</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">r</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">results</span><span class="p">;</span><span class="w"></span>
|
||||||
<span class="n">mdns_ip_addr_t</span> <span class="o">*</span> <span class="n">a</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
|
<span class="w"> </span><span class="n">mdns_ip_addr_t</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">NULL</span><span class="p">;</span><span class="w"></span>
|
||||||
<span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">1</span><span class="p">,</span> <span class="n">t</span><span class="p">;</span>
|
<span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="n">t</span><span class="p">;</span><span class="w"></span>
|
||||||
<span class="k">while</span><span class="p">(</span><span class="n">r</span><span class="p">){</span>
|
<span class="w"> </span><span class="k">while</span><span class="p">(</span><span class="n">r</span><span class="p">){</span><span class="w"></span>
|
||||||
<span class="n">printf</span><span class="p">(</span><span class="s">"%d: Interface: %s, Type: %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">i</span><span class="o">++</span><span class="p">,</span> <span class="n">if_str</span><span class="p">[</span><span class="n">r</span><span class="o">-></span><span class="n">tcpip_if</span><span class="p">],</span> <span class="n">ip_protocol_str</span><span class="p">[</span><span class="n">r</span><span class="o">-></span><span class="n">ip_protocol</span><span class="p">]);</span>
|
<span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">"%d: Interface: %s, Type: %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">,</span><span class="w"> </span><span class="n">if_str</span><span class="p">[</span><span class="n">r</span><span class="o">-></span><span class="n">tcpip_if</span><span class="p">],</span><span class="w"> </span><span class="n">ip_protocol_str</span><span class="p">[</span><span class="n">r</span><span class="o">-></span><span class="n">ip_protocol</span><span class="p">]);</span><span class="w"></span>
|
||||||
<span class="k">if</span><span class="p">(</span><span class="n">r</span><span class="o">-></span><span class="n">instance_name</span><span class="p">){</span>
|
<span class="w"> </span><span class="k">if</span><span class="p">(</span><span class="n">r</span><span class="o">-></span><span class="n">instance_name</span><span class="p">){</span><span class="w"></span>
|
||||||
<span class="n">printf</span><span class="p">(</span><span class="s">" PTR : %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">r</span><span class="o">-></span><span class="n">instance_name</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">" PTR : %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span><span class="w"> </span><span class="n">r</span><span class="o">-></span><span class="n">instance_name</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
||||||
<span class="k">if</span><span class="p">(</span><span class="n">r</span><span class="o">-></span><span class="n">hostname</span><span class="p">){</span>
|
<span class="w"> </span><span class="k">if</span><span class="p">(</span><span class="n">r</span><span class="o">-></span><span class="n">hostname</span><span class="p">){</span><span class="w"></span>
|
||||||
<span class="n">printf</span><span class="p">(</span><span class="s">" SRV : %s.local:%u</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">r</span><span class="o">-></span><span class="n">hostname</span><span class="p">,</span> <span class="n">r</span><span class="o">-></span><span class="n">port</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">" SRV : %s.local:%u</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span><span class="w"> </span><span class="n">r</span><span class="o">-></span><span class="n">hostname</span><span class="p">,</span><span class="w"> </span><span class="n">r</span><span class="o">-></span><span class="n">port</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
||||||
<span class="k">if</span><span class="p">(</span><span class="n">r</span><span class="o">-></span><span class="n">txt_count</span><span class="p">){</span>
|
<span class="w"> </span><span class="k">if</span><span class="p">(</span><span class="n">r</span><span class="o">-></span><span class="n">txt_count</span><span class="p">){</span><span class="w"></span>
|
||||||
<span class="n">printf</span><span class="p">(</span><span class="s">" TXT : [%u] "</span><span class="p">,</span> <span class="n">r</span><span class="o">-></span><span class="n">txt_count</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">" TXT : [%u] "</span><span class="p">,</span><span class="w"> </span><span class="n">r</span><span class="o">-></span><span class="n">txt_count</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="k">for</span><span class="p">(</span><span class="n">t</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="n">t</span><span class="o"><</span><span class="n">r</span><span class="o">-></span><span class="n">txt_count</span><span class="p">;</span> <span class="n">t</span><span class="o">++</span><span class="p">){</span>
|
<span class="w"> </span><span class="k">for</span><span class="p">(</span><span class="n">t</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">t</span><span class="o"><</span><span class="n">r</span><span class="o">-></span><span class="n">txt_count</span><span class="p">;</span><span class="w"> </span><span class="n">t</span><span class="o">++</span><span class="p">){</span><span class="w"></span>
|
||||||
<span class="n">printf</span><span class="p">(</span><span class="s">"%s=%s; "</span><span class="p">,</span> <span class="n">r</span><span class="o">-></span><span class="n">txt</span><span class="p">[</span><span class="n">t</span><span class="p">].</span><span class="n">key</span><span class="p">,</span> <span class="n">r</span><span class="o">-></span><span class="n">txt</span><span class="p">[</span><span class="n">t</span><span class="p">].</span><span class="n">value</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">"%s=%s; "</span><span class="p">,</span><span class="w"> </span><span class="n">r</span><span class="o">-></span><span class="n">txt</span><span class="p">[</span><span class="n">t</span><span class="p">].</span><span class="n">key</span><span class="p">,</span><span class="w"> </span><span class="n">r</span><span class="o">-></span><span class="n">txt</span><span class="p">[</span><span class="n">t</span><span class="p">].</span><span class="n">value</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
||||||
<span class="n">printf</span><span class="p">(</span><span class="s">"</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">"</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
||||||
<span class="n">a</span> <span class="o">=</span> <span class="n">r</span><span class="o">-></span><span class="n">addr</span><span class="p">;</span>
|
<span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">r</span><span class="o">-></span><span class="n">addr</span><span class="p">;</span><span class="w"></span>
|
||||||
<span class="k">while</span><span class="p">(</span><span class="n">a</span><span class="p">){</span>
|
<span class="w"> </span><span class="k">while</span><span class="p">(</span><span class="n">a</span><span class="p">){</span><span class="w"></span>
|
||||||
<span class="k">if</span><span class="p">(</span><span class="n">a</span><span class="o">-></span><span class="n">addr</span><span class="p">.</span><span class="n">type</span> <span class="o">==</span> <span class="n">IPADDR_TYPE_V6</span><span class="p">){</span>
|
<span class="w"> </span><span class="k">if</span><span class="p">(</span><span class="n">a</span><span class="o">-></span><span class="n">addr</span><span class="p">.</span><span class="n">type</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">IPADDR_TYPE_V6</span><span class="p">){</span><span class="w"></span>
|
||||||
<span class="n">printf</span><span class="p">(</span><span class="s">" AAAA: "</span> <span class="n">IPV6STR</span> <span class="s">"</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">IPV62STR</span><span class="p">(</span><span class="n">a</span><span class="o">-></span><span class="n">addr</span><span class="p">.</span><span class="n">u_addr</span><span class="p">.</span><span class="n">ip6</span><span class="p">));</span>
|
<span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">" AAAA: "</span><span class="w"> </span><span class="n">IPV6STR</span><span class="w"> </span><span class="s">"</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span><span class="w"> </span><span class="n">IPV62STR</span><span class="p">(</span><span class="n">a</span><span class="o">-></span><span class="n">addr</span><span class="p">.</span><span class="n">u_addr</span><span class="p">.</span><span class="n">ip6</span><span class="p">));</span><span class="w"></span>
|
||||||
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
|
<span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
|
||||||
<span class="n">printf</span><span class="p">(</span><span class="s">" A : "</span> <span class="n">IPSTR</span> <span class="s">"</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">IP2STR</span><span class="p">(</span><span class="o">&</span><span class="p">(</span><span class="n">a</span><span class="o">-></span><span class="n">addr</span><span class="p">.</span><span class="n">u_addr</span><span class="p">.</span><span class="n">ip4</span><span class="p">)));</span>
|
<span class="w"> </span><span class="n">printf</span><span class="p">(</span><span class="s">" A : "</span><span class="w"> </span><span class="n">IPSTR</span><span class="w"> </span><span class="s">"</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span><span class="w"> </span><span class="n">IP2STR</span><span class="p">(</span><span class="o">&</span><span class="p">(</span><span class="n">a</span><span class="o">-></span><span class="n">addr</span><span class="p">.</span><span class="n">u_addr</span><span class="p">.</span><span class="n">ip4</span><span class="p">)));</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
||||||
<span class="n">a</span> <span class="o">=</span> <span class="n">a</span><span class="o">-></span><span class="n">next</span><span class="p">;</span>
|
<span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">a</span><span class="o">-></span><span class="n">next</span><span class="p">;</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
||||||
<span class="n">r</span> <span class="o">=</span> <span class="n">r</span><span class="o">-></span><span class="n">next</span><span class="p">;</span>
|
<span class="w"> </span><span class="n">r</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">r</span><span class="o">-></span><span class="n">next</span><span class="p">;</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
||||||
|
|
||||||
<span class="p">}</span>
|
<span class="p">}</span><span class="w"></span>
|
||||||
|
|
||||||
<span class="kt">void</span> <span class="nf">find_mdns_service</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span> <span class="n">service_name</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span> <span class="n">proto</span><span class="p">)</span>
|
<span class="kt">void</span><span class="w"> </span><span class="nf">find_mdns_service</span><span class="p">(</span><span class="k">const</span><span class="w"> </span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">service_name</span><span class="p">,</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">proto</span><span class="p">)</span><span class="w"></span>
|
||||||
<span class="p">{</span>
|
<span class="p">{</span><span class="w"></span>
|
||||||
<span class="n">ESP_LOGI</span><span class="p">(</span><span class="n">TAG</span><span class="p">,</span> <span class="s">"Query PTR: %s.%s.local"</span><span class="p">,</span> <span class="n">service_name</span><span class="p">,</span> <span class="n">proto</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">ESP_LOGI</span><span class="p">(</span><span class="n">TAG</span><span class="p">,</span><span class="w"> </span><span class="s">"Query PTR: %s.%s.local"</span><span class="p">,</span><span class="w"> </span><span class="n">service_name</span><span class="p">,</span><span class="w"> </span><span class="n">proto</span><span class="p">);</span><span class="w"></span>
|
||||||
|
|
||||||
<span class="n">mdns_result_t</span> <span class="o">*</span> <span class="n">results</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
|
<span class="w"> </span><span class="n">mdns_result_t</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">results</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">NULL</span><span class="p">;</span><span class="w"></span>
|
||||||
<span class="n">esp_err_t</span> <span class="n">err</span> <span class="o">=</span> <span class="n">mdns_query_ptr</span><span class="p">(</span><span class="n">service_name</span><span class="p">,</span> <span class="n">proto</span><span class="p">,</span> <span class="mi">3000</span><span class="p">,</span> <span class="mi">20</span><span class="p">,</span> <span class="o">&</span><span class="n">results</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">esp_err_t</span><span class="w"> </span><span class="n">err</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">mdns_query_ptr</span><span class="p">(</span><span class="n">service_name</span><span class="p">,</span><span class="w"> </span><span class="n">proto</span><span class="p">,</span><span class="w"> </span><span class="mi">3000</span><span class="p">,</span><span class="w"> </span><span class="mi">20</span><span class="p">,</span><span class="w"> </span><span class="o">&</span><span class="n">results</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="k">if</span><span class="p">(</span><span class="n">err</span><span class="p">){</span>
|
<span class="w"> </span><span class="k">if</span><span class="p">(</span><span class="n">err</span><span class="p">){</span><span class="w"></span>
|
||||||
<span class="n">ESP_LOGE</span><span class="p">(</span><span class="n">TAG</span><span class="p">,</span> <span class="s">"Query Failed"</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">ESP_LOGE</span><span class="p">(</span><span class="n">TAG</span><span class="p">,</span><span class="w"> </span><span class="s">"Query Failed"</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="k">return</span><span class="p">;</span>
|
<span class="w"> </span><span class="k">return</span><span class="p">;</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
||||||
<span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="n">results</span><span class="p">){</span>
|
<span class="w"> </span><span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="n">results</span><span class="p">){</span><span class="w"></span>
|
||||||
<span class="n">ESP_LOGW</span><span class="p">(</span><span class="n">TAG</span><span class="p">,</span> <span class="s">"No results found!"</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">ESP_LOGW</span><span class="p">(</span><span class="n">TAG</span><span class="p">,</span><span class="w"> </span><span class="s">"No results found!"</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="k">return</span><span class="p">;</span>
|
<span class="w"> </span><span class="k">return</span><span class="p">;</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
||||||
|
|
||||||
<span class="n">mdns_print_results</span><span class="p">(</span><span class="n">results</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">mdns_print_results</span><span class="p">(</span><span class="n">results</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="n">mdns_query_results_free</span><span class="p">(</span><span class="n">results</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">mdns_query_results_free</span><span class="p">(</span><span class="n">results</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="p">}</span><span class="w"></span>
|
||||||
</pre></div>
|
</pre></div>
|
||||||
</div>
|
</div>
|
||||||
<p>使用上述方法的示例:</p>
|
<p>使用上述方法的示例:</p>
|
||||||
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">my_app_some_method</span><span class="p">(){</span>
|
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="kt">void</span><span class="w"> </span><span class="nf">my_app_some_method</span><span class="p">(){</span><span class="w"></span>
|
||||||
<span class="c1">// 搜索 esp32-mdns.local</span>
|
<span class="w"> </span><span class="c1">// 搜索 esp32-mdns.local</span>
|
||||||
<span class="n">resolve_mdns_host</span><span class="p">(</span><span class="s">"esp32-mdns"</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">resolve_mdns_host</span><span class="p">(</span><span class="s">"esp32-mdns"</span><span class="p">);</span><span class="w"></span>
|
||||||
|
|
||||||
<span class="c1">// 搜索 HTTP 服务器</span>
|
<span class="w"> </span><span class="c1">// 搜索 HTTP 服务器</span>
|
||||||
<span class="n">find_mdns_service</span><span class="p">(</span><span class="s">"_http"</span><span class="p">,</span> <span class="s">"_tcp"</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">find_mdns_service</span><span class="p">(</span><span class="s">"_http"</span><span class="p">,</span><span class="w"> </span><span class="s">"_tcp"</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="c1">// 或者搜索文件服务器</span>
|
<span class="w"> </span><span class="c1">// 或者搜索文件服务器</span>
|
||||||
<span class="n">find_mdns_service</span><span class="p">(</span><span class="s">"_smb"</span><span class="p">,</span> <span class="s">"_tcp"</span><span class="p">);</span> <span class="c1">// Windows 系统的共享服务</span>
|
<span class="w"> </span><span class="n">find_mdns_service</span><span class="p">(</span><span class="s">"_smb"</span><span class="p">,</span><span class="w"> </span><span class="s">"_tcp"</span><span class="p">);</span><span class="w"> </span><span class="c1">// Windows 系统的共享服务</span>
|
||||||
<span class="n">find_mdns_service</span><span class="p">(</span><span class="s">"_afpovertcp"</span><span class="p">,</span> <span class="s">"_tcp"</span><span class="p">);</span> <span class="c1">// Apple AFP 文件共享服务</span>
|
<span class="w"> </span><span class="n">find_mdns_service</span><span class="p">(</span><span class="s">"_afpovertcp"</span><span class="p">,</span><span class="w"> </span><span class="s">"_tcp"</span><span class="p">);</span><span class="w"> </span><span class="c1">// Apple AFP 文件共享服务</span>
|
||||||
<span class="n">find_mdns_service</span><span class="p">(</span><span class="s">"_nfs"</span><span class="p">,</span> <span class="s">"_tcp"</span><span class="p">);</span> <span class="c1">// NFS 服务器</span>
|
<span class="w"> </span><span class="n">find_mdns_service</span><span class="p">(</span><span class="s">"_nfs"</span><span class="p">,</span><span class="w"> </span><span class="s">"_tcp"</span><span class="p">);</span><span class="w"> </span><span class="c1">// NFS 服务器</span>
|
||||||
<span class="n">find_mdns_service</span><span class="p">(</span><span class="s">"_ftp"</span><span class="p">,</span> <span class="s">"_tcp"</span><span class="p">);</span> <span class="c1">// FTP 服务器</span>
|
<span class="w"> </span><span class="n">find_mdns_service</span><span class="p">(</span><span class="s">"_ftp"</span><span class="p">,</span><span class="w"> </span><span class="s">"_tcp"</span><span class="p">);</span><span class="w"> </span><span class="c1">// FTP 服务器</span>
|
||||||
<span class="c1">// 或者网络打印机</span>
|
<span class="w"> </span><span class="c1">// 或者网络打印机</span>
|
||||||
<span class="n">find_mdns_service</span><span class="p">(</span><span class="s">"_printer"</span><span class="p">,</span> <span class="s">"_tcp"</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">find_mdns_service</span><span class="p">(</span><span class="s">"_printer"</span><span class="p">,</span><span class="w"> </span><span class="s">"_tcp"</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="n">find_mdns_service</span><span class="p">(</span><span class="s">"_ipp"</span><span class="p">,</span> <span class="s">"_tcp"</span><span class="p">);</span>
|
<span class="w"> </span><span class="n">find_mdns_service</span><span class="p">(</span><span class="s">"_ipp"</span><span class="p">,</span><span class="w"> </span><span class="s">"_tcp"</span><span class="p">);</span><span class="w"></span>
|
||||||
<span class="p">}</span>
|
<span class="p">}</span><span class="w"></span>
|
||||||
</pre></div>
|
</pre></div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="id7">
|
<section id="id7">
|
||||||
<h2>应用示例<a class="headerlink" href="#id7" title="此标题的永久链接"></a></h2>
|
<h2>应用示例<a class="headerlink" href="#id7" title="此标题的永久链接"></a></h2>
|
||||||
<p>有关 mDNS 服务器和查询器的应用示例请参考 <a class="reference external" href="https://github.com/espressif/esp-protocols/tree/7310a7a/examples/../examples"></a>。</p>
|
<p>有关 mDNS 服务器和查询器的应用示例请参考 <a class="reference external" href="https://github.com/espressif/esp-protocols/tree/467fec5/examples/../examples"></a>。</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="api">
|
<section id="api">
|
||||||
<h2>API 参考<a class="headerlink" href="#api" title="此标题的永久链接"></a></h2>
|
<h2>API 参考<a class="headerlink" href="#api" title="此标题的永久链接"></a></h2>
|
||||||
<section id="header-file">
|
<section id="header-file">
|
||||||
<h3>Header File<a class="headerlink" href="#header-file" title="此标题的永久链接"></a></h3>
|
<h3>Header File<a class="headerlink" href="#header-file" title="此标题的永久链接"></a></h3>
|
||||||
<ul class="simple">
|
<ul class="simple">
|
||||||
<li><p><a class="reference external" href="https://github.com/espressif/esp-protocols/blob/7310a7a/include/mdns.h">include/mdns.h</a></p></li>
|
<li><p><a class="reference external" href="https://github.com/espressif/esp-protocols/blob/467fec5/include/mdns.h">include/mdns.h</a></p></li>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
<section id="functions">
|
<section id="functions">
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
<script src="_static/underscore.js"></script>
|
<script src="_static/underscore.js"></script>
|
||||||
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
||||||
<script src="_static/doctools.js"></script>
|
<script src="_static/doctools.js"></script>
|
||||||
|
<script src="_static/sphinx_highlight.js"></script>
|
||||||
<script src="_static/clipboard.min.js"></script>
|
<script src="_static/clipboard.min.js"></script>
|
||||||
<script src="_static/copybutton.js"></script>
|
<script src="_static/copybutton.js"></script>
|
||||||
<script src="_static/translations.js"></script>
|
<script src="_static/translations.js"></script>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
Search.setIndex({"docnames": ["index"], "filenames": ["index.rst"], "titles": ["mDNS \u670d\u52a1"], "terms": {"english": 0, "udp": 0, "mac": 0, "os": 0, "bonjour": 0, "appl": 0, "window": 0, "linux": 0, "avahi": 0, "hostnam": 0, "my": 0, "esp32": 0, "local": 0, "default_inst": 0, "jhon": 0, "thing": 0, "sta": 0, "void": 0, "start_mdns_servic": 0, "esp_err_t": 0, "err": 0, "mdns_init": 0, "if": 0, "printf": 0, "init": 0, "fail": 0, "return": 0, "mdns_hostname_set": 0, "mdns_instance_name_set": 0, "instance_nam": 0, "web": 0, "server": 0, "service_typ": 0, "proto": 0, "_tcp": 0, "_udp": 0, "port": 0, "txt": 0, "var": 0, "val": 0, "add_mdns_servic": 0, "mdns_service_add": 0, "null": 0, "_http": 0, "80": 0, "_arduino": 0, "3232": 0, "_myservic": 0, "1234": 0, "mdns_service_instance_name_set": 0, "mdns_txt_item_t": 0, "servicetxtdata": 0, "board": 0, "user": 0, "password": 0, "mdns_service_txt_set": 0, "mdns_service_port_set": 0, "4321": 0, "ip": 0, "ipv6": 0, "mdns_result_t": 0, "resolve_mdns_host": 0, "const": 0, "char": 0, "host_nam": 0, "queri": 0, "struct": 0, "ip4_addr": 0, "addr": 0, "mdns_query_a": 0, "2000": 0, "esp_err_not_found": 0, "host": 0, "was": 0, "not": 0, "found": 0, "ipstr": 0, "ip2str": 0, "static": 0, "if_str": 0, "ap": 0, "eth": 0, "max": 0, "ip_protocol_str": 0, "v4": 0, "v6": 0, "mdns_print_result": 0, "result": 0, "mdns_ip_addr_t": 0, "int": 0, "while": 0, "interfac": 0, "tcpip_if": 0, "ip_protocol": 0, "ptr": 0, "srv": 0, "txt_count": 0, "for": 0, "key": 0, "valu": 0, "ipaddr_type_v6": 0, "aaaa": 0, "ipv6str": 0, "ipv62str": 0, "u_addr": 0, "ip6": 0, "els": 0, "ip4": 0, "next": 0, "find_mdns_servic": 0, "service_nam": 0, "esp_log": 0, "tag": 0, "mdns_query_ptr": 0, "3000": 0, "20": 0, "esp_logw": 0, "no": 0, "mdns_query_results_fre": 0, "my_app_some_method": 0, "http": 0, "_smb": 0, "_afpovertcp": 0, "afp": 0, "_nfs": 0, "nfs": 0, "_ftp": 0, "ftp": 0, "_printer": 0, "_ipp": 0, "includ": 0, "initi": 0, "on": 0, "given": 0, "esp_ok": 0, "success": 0, "esp_err_invalid_st": 0, "when": 0, "to": 0, "regist": 0, "event": 0, "handler": 0, "esp_err_no_mem": 0, "memori": 0, "error": 0, "esp_fail": 0, "start": 0, "task": 0, "mdns_free": 0, "stop": 0, "and": 0, "free": 0, "set": 0, "the": 0, "requir": 0, "you": 0, "want": 0, "advertis": 0, "servic": 0, "esp_err_invalid_arg": 0, "paramet": 0, "mdns_delegate_hostname_add": 0, "address_list": 0, "add": 0, "address": 0, "be": 0, "deleg": 0, "will": 0, "repli": 0, "can": 0, "added": 0, "this": 0, "list": 0, "of": 0, "is": 0, "run": 0, "mdns_delegate_hostname_remov": 0, "remov": 0, "all": 0, "also": 0, "bool": 0, "mdns_hostname_exist": 0, "whether": 0, "has": 0, "been": 0, "true": 0, "fals": 0, "default": 0, "instanc": 0, "name": 0, "uint16_t": 0, "size_t": 0, "num_item": 0, "length": 0, "item": 0, "automat": 0, "decid": 0, "by": 0, "strlen": 0, "global": 0, "or": 0, "use": 0, "note": 0, "that": 0, "mdns_multiple_inst": 0, "config": 0, "option": 0, "need": 0, "enabl": 0, "adding": 0, "multipl": 0, "with": 0, "same": 0, "etc": 0, "protocol": 0, "string": 0, "array": 0, "data": 0, "eg": 0, "other": 0, "number": 0, "in": 0, "mdns_service_add_for_host": 0, "mdns_service_exist": 0, "check": 0, "correspond": 0, "mdns_service_exists_with_inst": 0, "mdns_service_remov": 0, "from": 0, "mdns_service_remove_for_host": 0, "mdns_service_instance_name_set_for_host": 0, "instance_old": 0, "origin": 0, "mdns_service_port_set_for_host": 0, "uint8_t": 0, "replac": 0, "mdns_service_txt_set_for_host": 0, "mdns_service_txt_item_set": 0, "record": 0, "updat": 0, "new": 0, "mdns_service_txt_item_set_with_explicit_value_len": 0, "value_len": 0, "mdns_service_txt_item_set_for_host": 0, "mdns_service_txt_item_set_for_host_with_explicit_value_len": 0, "mdns_service_txt_item_remov": 0, "mdns_service_txt_item_remove_for_host": 0, "mdns_service_subtype_add_for_host": 0, "subtyp": 0, "find": 0, "first": 0, "mdns_service_remove_al": 0, "mdns_query_async_delet": 0, "mdns_search_once_t": 0, "search": 0, "delet": 0, "finish": 0, "call": 0, "onli": 0, "after": 0, "end": 0, "pointer": 0, "object": 0, "mdns_query_async_get_result": 0, "uint32_t": 0, "timeout": 0, "num_result": 0, "get": 0, "avail": 0, "as": 0, "output": 0, "via": 0, "onc": 0, "although": 0, "have": 0, "freed": 0, "manual": 0, "time": 0, "millisecond": 0, "wait": 0, "answer": 0, "actual": 0, "ignor": 0, "befor": 0, "at": 0, "over": 0, "mdns_query_async_new": 0, "max_result": 0, "mdns_query_notify_t": 0, "notifi": 0, "asynchronous": 0, "test": 0, "progress": 0, "mdns_type_": 0, "dure": 0, "which": 0, "activ": 0, "maximum": 0, "collect": 0, "notif": 0, "readi": 0, "mdns_search_once_": 0, "otherwis": 0, "mdns_query_gener": 0, "mdns_query_transmission_type_t": 0, "transmission_typ": 0, "generic": 0, "follow": 0, "method": 0, "are": 0, "deriv": 0, "one": 0, "either": 0, "unicast": 0, "multicast": 0, "must": 0, "below": 0, "mdns_queri": 0, "send": 0, "link": 0, "mdns_query_srv": 0, "mdns_query_txt": 0, "esp_ip4_addr_t": 0, "lookLine truncated
|
Search.setIndex({"docnames": ["index"], "filenames": ["index.rst"], "titles": ["mDNS \u670d\u52a1"], "terms": {"english": 0, "udp": 0, "mac": 0, "os": 0, "bonjour": 0, "appl": 0, "window": 0, "linux": 0, "avahi": 0, "hostnam": 0, "my": 0, "esp32": 0, "local": 0, "default_inst": 0, "jhon": 0, "thing": 0, "sta": 0, "void": 0, "start_mdns_servic": 0, "esp_err_t": 0, "err": 0, "mdns_init": 0, "if": 0, "printf": 0, "init": 0, "fail": 0, "return": 0, "mdns_hostname_set": 0, "mdns_instance_name_set": 0, "instance_nam": 0, "web": 0, "server": 0, "service_typ": 0, "proto": 0, "_tcp": 0, "_udp": 0, "port": 0, "txt": 0, "var": 0, "val": 0, "add_mdns_servic": 0, "mdns_service_add": 0, "null": 0, "_http": 0, "80": 0, "_arduino": 0, "3232": 0, "_myservic": 0, "1234": 0, "mdns_service_instance_name_set": 0, "mdns_txt_item_t": 0, "servicetxtdata": 0, "board": 0, "user": 0, "password": 0, "mdns_service_txt_set": 0, "mdns_service_port_set": 0, "4321": 0, "ip": 0, "ipv6": 0, "mdns_result_t": 0, "resolve_mdns_host": 0, "const": 0, "char": 0, "host_nam": 0, "queri": 0, "struct": 0, "ip4_addr": 0, "addr": 0, "mdns_query_a": 0, "2000": 0, "esp_err_not_found": 0, "host": 0, "was": 0, "not": 0, "found": 0, "ipstr": 0, "ip2str": 0, "static": 0, "if_str": 0, "ap": 0, "eth": 0, "max": 0, "ip_protocol_str": 0, "v4": 0, "v6": 0, "mdns_print_result": 0, "result": 0, "mdns_ip_addr_t": 0, "int": 0, "while": 0, "interfac": 0, "tcpip_if": 0, "ip_protocol": 0, "ptr": 0, "srv": 0, "txt_count": 0, "for": 0, "key": 0, "valu": 0, "ipaddr_type_v6": 0, "aaaa": 0, "ipv6str": 0, "ipv62str": 0, "u_addr": 0, "ip6": 0, "els": 0, "ip4": 0, "next": 0, "find_mdns_servic": 0, "service_nam": 0, "esp_log": 0, "tag": 0, "mdns_query_ptr": 0, "3000": 0, "20": 0, "esp_logw": 0, "no": 0, "mdns_query_results_fre": 0, "my_app_some_method": 0, "http": 0, "_smb": 0, "_afpovertcp": 0, "afp": 0, "_nfs": 0, "nfs": 0, "_ftp": 0, "ftp": 0, "_printer": 0, "_ipp": 0, "includ": 0, "initi": 0, "on": 0, "given": 0, "esp_ok": 0, "success": 0, "esp_err_invalid_st": 0, "when": 0, "to": 0, "regist": 0, "event": 0, "handler": 0, "esp_err_no_mem": 0, "memori": 0, "error": 0, "esp_fail": 0, "start": 0, "task": 0, "mdns_free": 0, "stop": 0, "and": 0, "free": 0, "set": 0, "the": 0, "requir": 0, "you": 0, "want": 0, "advertis": 0, "servic": 0, "esp_err_invalid_arg": 0, "paramet": 0, "mdns_delegate_hostname_add": 0, "address_list": 0, "add": 0, "address": 0, "be": 0, "deleg": 0, "will": 0, "repli": 0, "can": 0, "added": 0, "this": 0, "list": 0, "of": 0, "is": 0, "run": 0, "mdns_delegate_hostname_remov": 0, "remov": 0, "all": 0, "also": 0, "bool": 0, "mdns_hostname_exist": 0, "whether": 0, "has": 0, "been": 0, "true": 0, "fals": 0, "default": 0, "instanc": 0, "name": 0, "uint16_t": 0, "size_t": 0, "num_item": 0, "length": 0, "item": 0, "automat": 0, "decid": 0, "by": 0, "strlen": 0, "global": 0, "or": 0, "use": 0, "note": 0, "that": 0, "mdns_multiple_inst": 0, "config": 0, "option": 0, "need": 0, "enabl": 0, "adding": 0, "multipl": 0, "with": 0, "same": 0, "etc": 0, "protocol": 0, "string": 0, "array": 0, "data": 0, "eg": 0, "other": 0, "number": 0, "in": 0, "mdns_service_add_for_host": 0, "mdns_service_exist": 0, "check": 0, "correspond": 0, "mdns_service_exists_with_inst": 0, "mdns_service_remov": 0, "from": 0, "mdns_service_remove_for_host": 0, "mdns_service_instance_name_set_for_host": 0, "instance_old": 0, "origin": 0, "mdns_service_port_set_for_host": 0, "uint8_t": 0, "replac": 0, "mdns_service_txt_set_for_host": 0, "mdns_service_txt_item_set": 0, "record": 0, "updat": 0, "new": 0, "mdns_service_txt_item_set_with_explicit_value_len": 0, "value_len": 0, "mdns_service_txt_item_set_for_host": 0, "mdns_service_txt_item_set_for_host_with_explicit_value_len": 0, "mdns_service_txt_item_remov": 0, "mdns_service_txt_item_remove_for_host": 0, "mdns_service_subtype_add_for_host": 0, "subtyp": 0, "find": 0, "first": 0, "mdns_service_remove_al": 0, "mdns_query_async_delet": 0, "mdns_search_once_t": 0, "search": 0, "delet": 0, "finish": 0, "call": 0, "onli": 0, "after": 0, "end": 0, "pointer": 0, "object": 0, "mdns_query_async_get_result": 0, "uint32_t": 0, "timeout": 0, "num_result": 0, "get": 0, "avail": 0, "as": 0, "output": 0, "via": 0, "onc": 0, "although": 0, "have": 0, "freed": 0, "manual": 0, "time": 0, "millisecond": 0, "wait": 0, "answer": 0, "actual": 0, "ignor": 0, "befor": 0, "at": 0, "over": 0, "mdns_query_async_new": 0, "max_result": 0, "mdns_query_notify_t": 0, "notifi": 0, "asynchronous": 0, "test": 0, "progress": 0, "mdns_type_": 0, "dure": 0, "which": 0, "activ": 0, "maximum": 0, "collect": 0, "notif": 0, "readi": 0, "mdns_search_once_": 0, "otherwis": 0, "mdns_query_gener": 0, "mdns_query_transmission_type_t": 0, "transmission_typ": 0, "generic": 0, "follow": 0, "method": 0, "are": 0, "deriv": 0, "one": 0, "either": 0, "unicast": 0, "multicast": 0, "must": 0, "below": 0, "mdns_queri": 0, "send": 0, "link": 0, "mdns_query_srv": 0, "mdns_query_txt": 0, "esp_ip4_addr_t": 0, "lookLine truncated
|
||||||
Reference in new issue
Block a user