API сервер
Материал из AmbiBox
(Различия между версиями)
Ambibox (обсуждение | вклад) (Новая страница: «==Описание встроенного протокола API сервера== В программе имеется встроенный API сервер дл…») |
Ambibox (обсуждение | вклад) |
||
(не показаны 4 промежуточные версии 1 участника) | |||
Строка 1: | Строка 1: | ||
− | ==Описание | + | ==Описание протокола встроенного API сервера== |
В программе имеется встроенный API сервер для управлением интеллектуальной подсветкой. Для доступа достаточно любого telnet клиента, который должен соединяться по порту 3636. API протокол полностью идентичен протоколу [http://code.google.com/p/lightpack/wiki/API API Lightpack] за исключением поддержки команды '''apikey'''. | В программе имеется встроенный API сервер для управлением интеллектуальной подсветкой. Для доступа достаточно любого telnet клиента, который должен соединяться по порту 3636. API протокол полностью идентичен протоколу [http://code.google.com/p/lightpack/wiki/API API Lightpack] за исключением поддержки команды '''apikey'''. | ||
Описание команд API сервера: | Описание команд API сервера: | ||
− | {| | + | {| 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 | + | ::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 | + | ::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" | ||
Строка 41: | Строка 45: | ||
"status:unknown" | "status:unknown" | ||
---- | ---- | ||
− | '''getstatusapi''' | + | |
+ | |||
+ | :'''getstatusapi''' | ||
− | Get status of the lightpack API | + | ::Get status of the lightpack API |
− | '''Results:''' | + | :'''Results:''' |
"statusapi:busy" | "statusapi:busy" | ||
"statusapi:idle" | "statusapi:idle" | ||
---- | ---- | ||
− | |||
− | |||
− | '''Results:''' | + | :'''getprofile''' |
+ | |||
+ | ::Get the name of the current profile | ||
+ | |||
+ | :'''Results:''' | ||
"profile:SampleProfileName" | "profile:SampleProfileName" | ||
---- | ---- | ||
− | |||
− | |||
− | '''Results:''' | + | :'''getprofiles''' |
+ | |||
+ | ::Get names of the all available profiles | ||
+ | |||
+ | :'''Results:''' | ||
"profiles:Default;New profile 1;New profile 2;" | "profiles:Default;New profile 1;New profile 2;" | ||
---- | ---- | ||
− | |||
− | |||
− | |||
− | |||
− | '''Examples:''' | + | :'''getcountleds''' |
+ | ::Get count leds of the current device | ||
+ | |||
+ | :'''Results:''' | ||
+ | "getcountleds:10" | ||
+ | ---- | ||
+ | |||
+ | |||
+ | :'''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;" | ||
"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" | ||
Строка 79: | Строка 97: | ||
"not locked" | "not locked" | ||
---- | ---- | ||
− | '''setgamma:''' | + | |
+ | |||
+ | :'''setgamma:''' | ||
− | Set device gamma correction value [0.2 - 6]. Works only on locking | + | ::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" | ||
Строка 93: | Строка 112: | ||
"not locked" | "not locked" | ||
---- | ---- | ||
− | |||
− | |||
− | |||
− | '''Examples:''' | + | :'''setbrightness:''' |
+ | |||
+ | ::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" | ||
Строка 108: | Строка 128: | ||
"not locked" | "not locked" | ||
---- | ---- | ||
− | |||
− | |||
− | |||
− | '''Examples:''' | + | :'''setsmooth:''' |
+ | |||
+ | ::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" | ||
Строка 123: | Строка 144: | ||
"not locked" | "not locked" | ||
---- | ---- | ||
− | |||
− | |||
− | '''Examples:''' | + | :'''setprofile:''' |
+ | |||
+ | ::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" | ||
Строка 137: | Строка 160: | ||
"not locked" | "not locked" | ||
---- | ---- | ||
− | |||
− | |||
− | '''Examples:''' | + | :'''setstatus:''' |
+ | |||
+ | ::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" | ||
Строка 151: | Строка 176: | ||
"not locked" | "not locked" | ||
---- | ---- | ||
− | '''exit''' | + | |
− | Closes connection | + | |
+ | :'''exit''' | ||
+ | |||
+ | ::Closes connection. | ||
+ | |||
+ | :'''Examples:''' | ||
+ | "exit" | ||
+ | |||
+ | :'''Results:''' | ||
+ | "Goodbye !" | ||
|} | |} |
Текущая версия на 01:56, 18 ноября 2014
[править] Описание протокола встроенного API сервера
В программе имеется встроенный API сервер для управлением интеллектуальной подсветкой. Для доступа достаточно любого telnet клиента, который должен соединяться по порту 3636. API протокол полностью идентичен протоколу API Lightpack за исключением поддержки команды apikey.
Описание команд API сервера:
"lock:success" "lock:busy"
"unlock:success" "unlock:not locked"
"status:on" "status:off" "status:device error" "status:unknown"
"statusapi:busy" "statusapi:idle"
"profile:SampleProfileName"
"profiles:Default;New profile 1;New profile 2;"
"getcountleds:10"
"setcolor:1-255,255,30;" "setcolor:1-255,255,30;2-12,12,12;3-1,2,3;"
"ok" "error" "busy" "not locked"
"setgamma:2.5"
"ok" "error" "busy" "not locked"
"setbrightness:0" "setbrightness:93"
"ok" "error" "busy" "not locked"
"setsmooth:10" "setsmooth:128"
"ok" "error" "busy" "not locked"
"setprofile:Default" "setprofile:16x9"
"ok" "error" "busy" "not locked"
"setstatus:on" "setstatus:off"
"ok" "error" "busy" "not locked"
"exit"
"Goodbye !" |