1
0

a5ec7539.0404de49.js 5.1 KB

1
  1. "use strict";(self.webpackChunkwebserial_docs=self.webpackChunkwebserial_docs||[]).push([[818],{3905:(e,t,r)=>{r.d(t,{Zo:()=>u,kt:()=>m});var n=r(7294);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function l(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var s=n.createContext({}),c=function(e){var t=n.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},u=function(e){var t=c(e.components);return n.createElement(s.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var r=e.components,i=e.mdxType,a=e.originalType,s=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),d=c(r),m=i,f=d["".concat(s,".").concat(m)]||d[m]||p[m]||a;return r?n.createElement(f,o(o({ref:t},u),{},{components:r})):n.createElement(f,o({ref:t},u))}));function m(e,t){var r=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=r.length,o=new Array(a);o[0]=d;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l.mdxType="string"==typeof e?e:i,o[1]=l;for(var c=2;c<a;c++)o[c]=r[c];return n.createElement.apply(null,o)}return n.createElement.apply(null,r)}d.displayName="MDXCreateElement"},3991:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>p,frontMatter:()=>a,metadata:()=>l,toc:()=>c});var n=r(7462),i=(r(7294),r(3905));const a={title:"Custom Title",sidebar_label:"Custom Title (Pro)",sidebar_position:12},o=void 0,l={unversionedId:"custom-title",id:"custom-title",title:"Custom Title",description:"This is an exclusive feature of WebSerial Pro. Check it out here.",source:"@site/docs/custom-title.md",sourceDirName:".",slug:"/custom-title",permalink:"/custom-title",draft:!1,tags:[],version:"current",sidebarPosition:12,frontMatter:{title:"Custom Title",sidebar_label:"Custom Title (Pro)",sidebar_position:12},sidebar:"tutorialSidebar",previous:{title:"Hardware ID (Pro)",permalink:"/hardware-id"},next:{title:"Branding (Pro)",permalink:"/branding"}},s={},c=[{value:"Overview",id:"overview",level:2},{value:"Syntax",id:"syntax",level:2},{value:"Example",id:"example",level:2},{value:"Usage",id:"usage",level:2}],u={toc:c};function p(e){let{components:t,...r}=e;return(0,i.kt)("wrapper",(0,n.Z)({},u,r,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("admonition",{title:"Pro Feature",type:"danger"},(0,i.kt)("p",{parentName:"admonition"},"This is an exclusive feature of WebSerial Pro. Check it out ",(0,i.kt)("a",{parentName:"p",href:"https://webserial.pro"},"here"),".")),(0,i.kt)("br",null),(0,i.kt)("img",{src:"/v2/img/custom-title.png",alt:"Custom Title",width:"400px",className:"card-preview"}),(0,i.kt)("br",null),(0,i.kt)("h2",{id:"overview"},"Overview"),(0,i.kt)("p",null,"The ",(0,i.kt)("inlineCode",{parentName:"p"},"setTitle()")," function is a method provided by the WebSerial Pro library. This title is displayed at the top of the webserial interface/webpage, providing a user-friendly and customizable interface for managing firmware updates."),(0,i.kt)("h2",{id:"syntax"},"Syntax"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-cpp"},"void setTitle(const char* title);\n")),(0,i.kt)("h2",{id:"example"},"Example"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-cpp"},'#include <WebSerial.h>\n\nvoid setup() {\n ...\n\n // Set the title of your webserial terminal\n WebSerial.setTitle("Remote Terminal - XYZ Inc");\n}\n\nvoid loop() {\n ...\n}\n')),(0,i.kt)("h2",{id:"usage"},"Usage"),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},"Include the WebSerial library in your Arduino sketch."),(0,i.kt)("li",{parentName:"ol"},"In the ",(0,i.kt)("inlineCode",{parentName:"li"},"setup()")," function of your sketch, initialize the WebSerial library using ",(0,i.kt)("inlineCode",{parentName:"li"},"WebSerial.begin()"),"."),(0,i.kt)("li",{parentName:"ol"},"Use the ",(0,i.kt)("inlineCode",{parentName:"li"},"setTitle()")," function to set a meaningful title for your webserial interface. This title will be displayed at the top of the webserial interface/webpage when users access it."),(0,i.kt)("li",{parentName:"ol"},"Continue with the rest of your sketch's setup and loop functions.")))}p.isMDXComponent=!0}}]);