API сервер

Материал из AmbiBox
(Различия между версиями)
Перейти к: навигация, поиск
(Новая страница: «==Описание встроенного протокола API сервера== В программе имеется встроенный API сервер дл…»)
 
Строка 8: Строка 8:
 
|
 
|
 
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 blocki
+
Opens access to set-commands, If success - suspends capture and blocking access for other clients to set-commands.
ng access for other clients to set-commands.
+
  
 
'''Results:'''  
 
'''Results:'''  
Строка 22: Строка 22:
 
         "lock:busy"
 
         "lock:busy"
 
----
 
----
 +
 
'''unlock'''
 
'''unlock'''
 
   
 
   
Closes access to set-commands. Restores device settings from the curre
+
Closes access to set-commands. Restores device settings from the current profile, and continues the normal execution of the application.
nt profile, and continues the normal execution of the application.
+
  
 
'''Results:'''  
 
'''Results:'''  
Строка 31: Строка 31:
 
         "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"
Строка 41: Строка 42:
 
         "status:unknown"
 
         "status:unknown"
 
----
 
----
 +
 
'''getstatusapi'''
 
'''getstatusapi'''
 
   
 
   
Строка 49: Строка 51:
 
         "statusapi:idle"
 
         "statusapi:idle"
 
----
 
----
 +
 
'''getprofile'''  
 
'''getprofile'''  
  
Строка 56: Строка 59:
 
         "profile:SampleProfileName"
 
         "profile:SampleProfileName"
 
----
 
----
 +
 
'''getprofiles'''  
 
'''getprofiles'''  
  
Строка 63: Строка 67:
 
         "profiles:Default;New profile 1;New profile 2;"
 
         "profiles:Default;New profile 1;New profile 2;"
 
----
 
----
 +
 
'''setcolor:'''  
 
'''setcolor:'''  
  
Set colors on several LEDs. Format: "N-R,G,B;", where N - number of le
+
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).
d, R, G, B - red, green and blue color components. Works only on loc
+
king time (see lock).
+
  
 
'''Examples:'''  
 
'''Examples:'''  
Строка 79: Строка 82:
 
         "not locked"
 
         "not locked"
 
----
 
----
 +
 
'''setgamma:'''
 
'''setgamma:'''
 
   
 
   
Set device gamma correction value [0.2 - 6]. Works only on locking tim
+
Set device gamma correction value [0.2 - 6]. Works only on locking time (see lock).
e (see lock).
+
  
 
'''Examples:'''  
 
'''Examples:'''  
Строка 93: Строка 96:
 
         "not locked"
 
         "not locked"
 
----
 
----
 +
 
'''setbrightness:'''  
 
'''setbrightness:'''  
  
Set device brightness value [0 - 100]. Works only on locking time (see
+
Set device brightness value [0 - 100]. Works only on locking time (see lock).
lock).
+
  
 
'''Examples:'''  
 
'''Examples:'''  
Строка 108: Строка 111:
 
         "not locked"
 
         "not locked"
 
----
 
----
 +
 
'''setsmooth:'''  
 
'''setsmooth:'''  
  
Set device smooth value [0 - 128]. Works only on locking time (see loc
+
Set device smooth value [0 - 128]. Works only on locking time (see lock).
k).
+
  
 
'''Examples:'''  
 
'''Examples:'''  
Строка 123: Строка 126:
 
         "not locked"
 
         "not locked"
 
----
 
----
 +
 
'''setprofile:'''  
 
'''setprofile:'''  
  
Строка 137: Строка 141:
 
         "not locked"
 
         "not locked"
 
----
 
----
 +
 
'''setstatus:'''  
 
'''setstatus:'''  
  
Строка 152: Строка 157:
 
----
 
----
 
'''exit'''  
 
'''exit'''  
 +
 
Closes connection
 
Closes connection
  
 
|}
 
|}

Версия 10:57, 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