API сервер
Материал из AmbiBox
(Различия между версиями)
Ambibox (обсуждение | вклад) |
Ambibox (обсуждение | вклад) |
||
Строка 4: | Строка 4: | ||
Описание команд 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 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''' | |
− | '''Results:''' | + | ::Get the name of the current profile |
+ | |||
+ | :'''Results:''' | ||
"profile:SampleProfileName" | "profile:SampleProfileName" | ||
---- | ---- | ||
− | |||
− | 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:''' | |
− | '''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:''' | |
− | '''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:''' | |
− | '''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:''' | |
− | '''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:''' | |
− | '''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" | ||
---- | ---- | ||
− | |||
− | Closes connection | + | |
+ | :'''exit''' | ||
+ | |||
+ | ::Closes connection | ||
|} | |} |
Версия 15:56, 16 февраля 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;"
"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"
|