"use strict";(self.webpackChunkdocs_site=self.webpackChunkdocs_site||[]).push([[4546],{4517:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>a,contentTitle:()=>i,default:()=>d,frontMatter:()=>l,metadata:()=>t,toc:()=>c});const t=JSON.parse('{"id":"XXTLanControl.lua/core/set_api_url","title":"Set Controller Endpoint (LCC.set_api_url)","description":"Signature","source":"@site/i18n/en/docusaurus-plugin-content-docs/current/XXTLanControl.lua/core/set_api_url.md","sourceDirName":"XXTLanControl.lua/core","slug":"/XXTLanControl.lua/core/set_api_url","permalink":"/docs/en/XXTLanControl.lua/core/set_api_url","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":10,"frontMatter":{"sidebar_position":10},"sidebar":"tutorialSidebar","previous":{"title":"Core","permalink":"/docs/en/XXTLanControl.lua/core/"},"next":{"title":"Configure Request Retries (LCC.set_retry_count)","permalink":"/docs/en/XXTLanControl.lua/core/set_retry_count"}}');var s=r(4848),o=r(8453);const l={sidebar_position:10},i="Set Controller Endpoint (LCC.set_api_url)",a={},c=[{value:"Signature",id:"signature",level:2},{value:"Parameters",id:"parameters",level:2},{value:"Returns",id:"returns",level:2},{value:"Notes",id:"notes",level:2},{value:"Example",id:"example",level:2}];function u(e){const n={blockquote:"blockquote",br:"br",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.header,{children:(0,s.jsx)(n.h1,{id:"set-controller-endpoint-lccset_api_url",children:"Set Controller Endpoint (LCC.set_api_url)"})}),"\n",(0,s.jsx)(n.h2,{id:"signature",children:"Signature"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-lua",children:"LCC.set_api_url(url)\n"})}),"\n",(0,s.jsx)(n.h2,{id:"parameters",children:"Parameters"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["url",(0,s.jsx)(n.br,{}),"\n","String. HTTP base URL of the controller server (for example ",(0,s.jsx)(n.code,{children:"http://192.168.1.100:46990"}),")."]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"returns",children:"Returns"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"none"}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"notes",children:"Notes"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsxs)(n.p,{children:["Stores the controller address for all subsequent API calls.",(0,s.jsx)(n.br,{}),"\n","When the script is not launched by the controller, you must invoke this before ",(0,s.jsx)(n.code,{children:"LCC.connect()"}),".",(0,s.jsx)(n.br,{}),"\n","Calling it overwrites the previously saved address and refreshes the in-memory module settings."]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-lua",children:'LCC.set_api_url("http://192.168.1.100:46990")\nif not LCC.connect() then\n    error("Unable to reach controller")\nend\n'})})]})}function d(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(u,{...e})}):u(e)}},8453:(e,n,r)=>{r.d(n,{R:()=>l,x:()=>i});var t=r(6540);const s={},o=t.createContext(s);function l(e){const n=t.useContext(o);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:l(e.components),t.createElement(o.Provider,{value:n},e.children)}}}]);