API сервер

Материал из AmbiBox
(Различия между версиями)
Перейти к: навигация, поиск
Строка 4: Строка 4:
 
Описание команд API сервера:
 
Описание команд API сервера:
  
{| class="wikitable" border="1"
+
{| style="color:#000000;background-color:#f0ffff;border-collapse:collapse;border: 1px solid #AAAAAA" border="1" width="100%"
 
|-
 
|-
 
|
 
|
version: 1.3 (enter "help" for more info)<br>
+
:version: 1.3 (enter "help" for more info)<br>
>>help
+
:>>'''help'''
  
AmbiBox. API Server version 1.3
+
:'''AmbiBox. API Server version 1.3'''
  
 
----
 
----
  
'''lock'''
+
 
 +
:'''lock'''
 
   
 
   
Opens access to set-commands, If success - suspends capture and blocking access for other clients to set-commands.
+
::Opens access to set-commands, If success - suspends capture and blocking access for other clients to set-commands.
  
'''Results:'''  
+
:'''Results:'''  
 
         "lock:success"
 
         "lock:success"
 
         "lock:busy"
 
         "lock:busy"
 
----
 
----
  
'''unlock'''
+
 
 +
:'''unlock'''
 
   
 
   
Closes access to set-commands. Restores device settings from the current profile, and continues the normal execution of the application.
+
::Closes access to set-commands. Restores device settings from the current profile, and continues the normal execution of the application.
  
'''Results:'''  
+
:'''Results:'''  
 
         "unlock:success"
 
         "unlock:success"
 
         "unlock:not locked"
 
         "unlock:not locked"
 
----
 
----
  
'''getstatus'''
+
 
 +
:'''getstatus'''
 
   
 
   
Get status of the backlight
+
::Get status of the backlight
  
'''Results:'''  
+
:'''Results:'''  
 
         "status:on"
 
         "status:on"
 
         "status:off"
 
         "status:off"
Строка 43: Строка 46:
 
----
 
----
  
'''getstatusapi'''
+
 
 +
:'''getstatusapi'''
 
   
 
   
Get status of the lightpack API
+
::Get status of the lightpack API
  
'''Results:'''  
+
:'''Results:'''  
 
         "statusapi:busy"
 
         "statusapi:busy"
 
         "statusapi:idle"
 
         "statusapi:idle"
 
----
 
----
  
'''getprofile'''
 
  
Get the name of the current profile
+
:'''getprofile'''
  
'''Results:'''  
+
::Get the name of the current profile
 +
 
 +
:'''Results:'''  
 
         "profile:SampleProfileName"
 
         "profile:SampleProfileName"
 
----
 
----
  
'''getprofiles'''
 
  
Get names of the all available profiles
+
:'''getprofiles'''
 +
 
 +
::Get names of the all available profiles
  
'''Results:'''  
+
:'''Results:'''  
 
         "profiles:Default;New profile 1;New profile 2;"
 
         "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).
+
:'''setcolor:'''
  
'''Examples:'''  
+
::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;"
 
         "setcolor:1-255,255,30;2-12,12,12;3-1,2,3;"
 
         "setcolor:1-255,255,30;2-12,12,12;3-1,2,3;"
  
'''Results:'''  
+
:'''Results:'''  
 
         "ok"
 
         "ok"
 
         "error"
 
         "error"
Строка 83: Строка 90:
 
----
 
----
  
'''setgamma:'''
+
 
 +
:'''setgamma:'''
 
   
 
   
Set device gamma correction value [0.2 - 6]. Works only on locking time (see lock).
+
::Set device gamma correction value [0.2 - 6]. Works only on locking time (see lock).
  
'''Examples:'''  
+
:'''Examples:'''  
 
         "setgamma:2.5"
 
         "setgamma:2.5"
  
'''Results:'''  
+
:'''Results:'''  
 
         "ok"
 
         "ok"
 
         "error"
 
         "error"
Строка 97: Строка 105:
 
----
 
----
  
'''setbrightness:'''
 
  
Set device brightness value [0 - 100]. Works only on locking time (see lock).
+
:'''setbrightness:'''
  
'''Examples:'''  
+
::Set device brightness value [0 - 100]. Works only on locking time (see lock).
 +
 
 +
:'''Examples:'''  
 
         "setbrightness:0"
 
         "setbrightness:0"
 
         "setbrightness:93"
 
         "setbrightness:93"
  
'''Results:'''  
+
:'''Results:'''  
 
         "ok"
 
         "ok"
 
         "error"
 
         "error"
Строка 112: Строка 121:
 
----
 
----
  
'''setsmooth:'''
 
  
Set device smooth value [0 - 128]. Works only on locking time (see lock).
+
:'''setsmooth:'''
  
'''Examples:'''  
+
::Set device smooth value [0 - 128]. Works only on locking time (see lock).
 +
 
 +
:'''Examples:'''  
 
         "setsmooth:10"
 
         "setsmooth:10"
 
         "setsmooth:128"
 
         "setsmooth:128"
  
'''Results:'''  
+
:'''Results:'''  
 
         "ok"
 
         "ok"
 
         "error"
 
         "error"
Строка 127: Строка 137:
 
----
 
----
  
'''setprofile:'''
 
  
Set current profile. Works only on locking time (see lock).
+
:'''setprofile:'''
  
'''Examples:'''  
+
::Set current profile. Works only on locking time (see lock).
 +
 
 +
:'''Examples:'''  
 
         "setprofile:Default"
 
         "setprofile:Default"
 
         "setprofile:16x9"
 
         "setprofile:16x9"
  
'''Results:'''  
+
:'''Results:'''  
 
         "ok"
 
         "ok"
 
         "error"
 
         "error"
Строка 142: Строка 153:
 
----
 
----
  
'''setstatus:'''
 
  
Set backlight status. Works only on locking time (see lock).
+
:'''setstatus:'''
  
'''Examples:'''  
+
::Set backlight status. Works only on locking time (see lock).
 +
 
 +
:'''Examples:'''  
 
         "setstatus:on"
 
         "setstatus:on"
 
         "setstatus:off"
 
         "setstatus:off"
  
'''Results:'''  
+
:'''Results:'''  
 
         "ok"
 
         "ok"
 
         "error"
 
         "error"
Строка 156: Строка 168:
 
         "not locked"
 
         "not locked"
 
----
 
----
'''exit'''
 
  
Closes connection
+
 
 +
:'''exit'''
 +
 
 +
::Closes connection
  
 
|}
 
|}

Версия 15:56, 16 февраля 2014

Описание встроенного протокола 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