LIKO-12
  • Docs
  • Help
  • Blog

›Peripherals

Introduction

  • What is LIKO-12
  • How to install LIKO-12
  • Getting started
  • Your first LIKO-12 program

Peripherals

  • Audio
  • BIOS - Basic Integrated Operating System
  • CPU - Central Processing Unit
  • FDD - Floppy Disk Drive
  • Gamepad
  • GPU - Graphics Processing Unit
  • HDD - Hard Disk Drive
  • Keyboard
  • RAM - Random Access Memory
  • TouchControls - The Touch Gamepad Input
  • WEB

Peripherals' Objects

  • GPU / fontData
  • GPU / image
  • GPU / imageData
  • GPU / quad
  • GPU / spriteBatch
  • WEB / response
Edit

WEB

This peripheral gives access into the Internet.

  • Version: v1.0.0
  • Available since: LIKO-12 v0.6.0
  • Last updated in: LIKO-12 v0.8.0

Methods:


WEB.hasLuaSec

Checks if it has Luasec.

  • Available since: WEB: v1.0.0, LIKO-12: v0.6.0
  • Last updated in: WEB: v1.0.0, LIKO-12: v0.6.0
hasLuaSec = WEB.hasLuaSec()

Returns:

  • hasLuaSec (boolean): True if it has LuaSec, false otherwise.

WEB.luasec

Load a luasec submodule.

  • Available since: WEB: v1.0.0, LIKO-12: v0.6.0
  • Last updated in: WEB: v1.0.0, LIKO-12: v0.6.0
submodule = WEB.luasec(name)

Arguments:

  • <name> (string): Name of submodule to load.

Returns:

  • submodule (table): The loaded submodule.

WEB.luasocket

Load a submodule.

  • Available since: WEB: v1.0.0, LIKO-12: v0.6.0
  • Last updated in: WEB: v1.0.0, LIKO-12: v0.6.0
submodule = WEB.luasocket(name)

Arguments:

  • <name> (string): Name of submodule to load.

Returns:

  • submodule (table): The loaded submodule.

WEB.send

Send a request to a URL.

  • Available since: WEB: v1.0.0, LIKO-12: v0.6.0
  • Last updated in: WEB: v1.0.0, LIKO-12: v0.6.0
requestID = WEB.send(url, args)

Arguments:

  • <url> (string): URL to send request to.
  • [args] (table) (Default:nil): Arguements to send in the request.

Returns:

  • requestID (number): The request's id, used to read it later.

WEB.urlEncode

Encode a url to send it.

  • Available since: WEB: v1.0.0, LIKO-12: v0.6.0
  • Last updated in: WEB: v1.0.0, LIKO-12: v0.6.0
url = WEB.urlEncode(url)

Arguments:

  • <url> (string): URL to encode.

Returns:

  • url (string): The encoded URL.

Events:

Please note that the example functions won't be called automatically, there must be some kind of an events handler for CPU.pullEvent, check if the LIKO-12 OS you're using has one.


HTTP_Body

Triggered when a chunk of the HTTP response body is recieved.

  • Available since: WEB: v1.0.0, LIKO-12: v1.0.0
  • Last updated in: WEB: v1.0.0, LIKO-12: v1.0.0
function _HTTP_Body(requestID, chunk)
    --Content run when the event is triggered
end

Arguments:

  • requestID (number): The requestID returned by WEB.send().
  • chunk (string): A chunk (part) of the response body, they're recieved in the correct order.

HTTP_Failed

Triggered when a HTTP request fails.

  • Available since: WEB: v1.0.0, LIKO-12: v1.0.0
  • Last updated in: WEB: v1.0.0, LIKO-12: v1.0.0
function _HTTP_Failed(requestID, reason)
    --Content run when the event is triggered
end

Arguments:

  • requestID (number): The requestID returned by WEB.send().
  • reason (string): The reason of the request failure.

HTTP_Respond

Triggered when a HTTP response is received.

  • Available since: WEB: v1.0.0, LIKO-12: v1.0.0
  • Last updated in: WEB: v1.0.0, LIKO-12: v1.0.0
function _HTTP_Respond(requestID, response)
    --Content run when the event is triggered
end

Arguments:

  • requestID (number): The requestID returned by WEB.send().
  • response (WEB/response): The content of the response.

Objects:

  • response - The response table returnd when a HTTP response is received.
← TouchControls - The Touch Gamepad InputGPU / fontData →
  • Methods:
    • WEB.hasLuaSec
    • WEB.luasec
    • WEB.luasocket
    • WEB.send
    • WEB.urlEncode
  • Events:
    • HTTP_Body
    • HTTP_Failed
    • HTTP_Respond
  • Objects:
LIKO-12
Docs
Getting Started (or other categories)Guides (or other categories)API Reference (or other categories)
Community
Project Chat (Discord)Twitter
More
BlogGitHubStar
Copyright © 2020 The LIKO-12 Organization