"use strict";(self.webpackChunkdocs_site=self.webpackChunkdocs_site||[]).push([[3218],{6201:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>l,default:()=>u,frontMatter:()=>i,metadata:()=>o,toc:()=>a});const o=JSON.parse('{"id":"XXTLanControl.lua/core/README","title":"Core","description":"Import the Module","source":"@site/i18n/en/docusaurus-plugin-content-docs/current/XXTLanControl.lua/core/README.md","sourceDirName":"XXTLanControl.lua/core","slug":"/XXTLanControl.lua/core/","permalink":"/docs/en/XXTLanControl.lua/core/","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":1,"frontMatter":{"sidebar_position":1},"sidebar":"tutorialSidebar","previous":{"title":"XXTLanControl Module","permalink":"/docs/en/XXTLanControl.lua/"},"next":{"title":"Set Controller Endpoint (LCC.set_api_url)","permalink":"/docs/en/XXTLanControl.lua/core/set_api_url"}}');var r=n(4848),s=n(8453);const i={sidebar_position:1},l="Core",c={},a=[{value:"Import the Module",id:"import-the-module",level:2},{value:"Before You Start",id:"before-you-start",level:2},{value:"What This Section Covers",id:"what-this-section-covers",level:2}];function d(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.header,{children:(0,r.jsx)(t.h1,{id:"core",children:"Core"})}),"\n",(0,r.jsx)(t.h2,{id:"import-the-module",children:"Import the Module"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-lua",children:'local LCC = require("XXTLanControl")\n'})}),"\n",(0,r.jsx)(t.h2,{id:"before-you-start",children:"Before You Start"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:"Make sure the XXTouch version on the device is new enough."}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"LCC.capture_ui_state()"})," requires device-side ",(0,r.jsx)(t.code,{children:"ui_element"})," version 0.6.0 or later. If the module is unavailable or outdated, update XXTouch before using ",(0,r.jsx)(t.strong,{children:"capture_ui_state"}),"."]}),"\n",(0,r.jsxs)(t.li,{children:["If the script is not started from the control center, call ",(0,r.jsx)(t.code,{children:"LCC.set_api_url()"})," first."]}),"\n",(0,r.jsxs)(t.li,{children:["Always call ",(0,r.jsx)(t.code,{children:"LCC.connect()"})," before using other helpers."]}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:["If the module version does not match, ",(0,r.jsx)(t.code,{children:"LCC.connect()"})," will try to download the newer module from the control center and reconnect automatically."]}),"\n",(0,r.jsx)(t.h2,{id:"what-this-section-covers",children:"What This Section Covers"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["set connection retry count with ",(0,r.jsx)(t.code,{children:"set_retry_count"})]}),"\n",(0,r.jsxs)(t.li,{children:["set the control center address with ",(0,r.jsx)(t.code,{children:"set_api_url"})]}),"\n",(0,r.jsxs)(t.li,{children:["set aliases for log channels 1 to 6 with ",(0,r.jsx)(t.code,{children:"set_log_aliases"})]}),"\n",(0,r.jsxs)(t.li,{children:["send logs back to the control center with ",(0,r.jsx)(t.code,{children:"log"})]}),"\n",(0,r.jsxs)(t.li,{children:["capture and save UI state with ",(0,r.jsx)(t.a,{href:"/docs/en/XXTLanControl.lua/core/capture_ui_state",children:(0,r.jsx)(t.code,{children:"capture_ui_state"})})]}),"\n",(0,r.jsxs)(t.li,{children:["read script UI configuration values with ",(0,r.jsx)(t.code,{children:"get_ui_config"})]}),"\n"]})]})}function u(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>i,x:()=>l});var o=n(6540);const r={},s=o.createContext(r);function i(e){const t=o.useContext(s);return o.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),o.createElement(s.Provider,{value:t},e.children)}}}]);