API сервер

Материал из AmbiBox
Перейти к: навигация, поиск

Описание встроенного протокола API сервера

В программе имеется встроенный API сервер для управлением интеллектуальной подсветкой. Для доступа достаточно любого telnet клиента, который должен соединяться по порту 3636. API протокол полностью идентичен протоколу API Lightpack за исключением поддержки команды apikey.

Описание команд API сервера:

version: 1.3 (enter "help" for more info)
>>help

AmbiBox. API Server version 1.3


lock

Opens access to set-commands, If success - suspends capture and blocking access for other clients to set-commands.

Results:

       "lock:success"
       "lock:busy"

unlock

Closes access to set-commands. Restores device settings from the current profile, and continues the normal execution of the application.

Results:

       "unlock:success"
       "unlock:not locked"

getstatus

Get status of the backlight

Results:

       "status:on"
       "status:off"
       "status:device error"
       "status:unknown"

getstatusapi

Get status of the lightpack API

Results:

       "statusapi:busy"
       "statusapi:idle"

getprofile

Get the name of the current profile

Results:

       "profile:SampleProfileName"

getprofiles

Get names of the all available profiles

Results:

       "profiles:Default;New profile 1;New profile 2;"

setcolor:

Set colors on several LEDs. Format: "N-R,G,B;", where N - number of led, R, G, B - red, green and blue color components. Works only on locking time (see lock).

Examples:

       "setcolor:1-255,255,30;"
       "setcolor:1-255,255,30;2-12,12,12;3-1,2,3;"

Results:

       "ok"
       "error"
       "busy"
       "not locked"

setgamma:

Set device gamma correction value [0.2 - 6]. Works only on locking time (see lock).

Examples:

       "setgamma:2.5"

Results:

       "ok"
       "error"
       "busy"
       "not locked"

setbrightness:

Set device brightness value [0 - 100]. Works only on locking time (see lock).

Examples:

       "setbrightness:0"
       "setbrightness:93"

Results:

       "ok"
       "error"
       "busy"
       "not locked"

setsmooth:

Set device smooth value [0 - 128]. Works only on locking time (see lock).

Examples:

       "setsmooth:10"
       "setsmooth:128"

Results:

       "ok"
       "error"
       "busy"
       "not locked"

setprofile:

Set current profile. Works only on locking time (see lock).

Examples:

       "setprofile:Default"
       "setprofile:16x9"

Results:

       "ok"
       "error"
       "busy"
       "not locked"

setstatus:

Set backlight status. Works only on locking time (see lock).

Examples:

       "setstatus:on"
       "setstatus:off"

Results:

       "ok"
       "error"
       "busy"
       "not locked"

exit

Closes connection

Персональные инструменты
Пространства имён

Варианты
Действия
AmbiBox
In other languages
Описание
Фото-видео галерея
Поддержка
Инструменты
donate