CAYIN SDK v1.0

CAYIN SDK v1.0

CAYIN digital signage system provides you with powerful SDK (software development kit), allowing you to create your proprietary management tools via HTTP-based APIs. There are four major sections:

Enable/Disable CAYIN SDK

Files & Folders

Login CMS’s Web Manager and go to SYSTEM > Service > SDK Configuration page. There are 3 modes for CAYIN SDK

  1. Disable
  2. Enable without authentication key
  3. Enable with authentication key
    • Manually (Default: 0000)
    • Generate one randomly
Note

Authentication key: 4 – 64 English alphabet and numbers

Back to Top

Usage of CAYIN SDK

Send an HTTP GET or POST request to SMP’s or CMS’ internal web server. You can write your own program by almost every modern language to send the request. If you want to make a try, entering the command in a browser’s address bar is usually the easiest way to send a HTTP GET request to SMP/CMS.
Send a command with the form of following example:
http://ip/cysdk/?cmd1=value1&cmd2=value2

Note

“ip” is the IP address (or domain name) of the SMP/CMS.

API interface:

  • Support HTTP GET and POST method
  • One command is able to contain many attributes.
  • Separate each attribute by character ‘;’
  • Separate each attribute by character ‘;’
  • Separate each command by character “&”
  • First in first execution

Example: Set display resolution with CySDK commands

http://ip/cysdk/?k=0000&dpyOutout=mode:distinct;rotate:left
&dpy1Setting=output:HDMI1;size:1920x1080@60&dpy2Setting=output:auto;size:1024x768

  • Authentication: k=0000 (You can ignore it if you choose to disable the authentication)
  • Command 1: dpyOutput=mode:distinct;rotate:left
    • Attribute 1: mode:distinct
    • Attribute 2: rotate:left
  • Command 2: dpy1Setting=output:HDMI1;size:1920x1080@60
    • Attribute 1: output:HDMI1
    • Attribute 2: size:1920x1080@60
  • Command 3: dpy2Setting=output:auto;size:1024x768
    • Attribute 1: output:auto
    • Attribute 2: size:1024x768

Command Result

SMP/CMS returns HTTP response status code to the client/calling program.

  • Success: return code 200 success with blank html page
  • Failure: return code 500 (Internal Server Error)
Note

For more information about HTTP response code, please refer to the following Wiki page: http://en.wikipedia.org/wiki/List_of_HTTP_status_codes

Back to Top

Functions

CAYIN SDK allows you to control the following functions:

  1. Security authentication (authentication key):
    Operation Attribute Value Description
    k   alphabets and numbers
    • Key: 4 - 64 length English alphabets and numbers
    • UI: System -> Service -> SDK Configuration -> Authentication
  2. System control (SMP and CMS):
    Operation Attribute Value Description
    sysRestart   0, 1
    0: No action
    1: Restart player/server
  3. Display configuration (SMP only):
    Operation Attribute Value Description
    dpyOutput mode single, clone, extended, distinct
     
    pos 1, 2 Display position:
    1: Top - Bottom
    2: Left - Right
    *For extended mode only

    dpy1

    dpy2
    output Auto, VGA, DVI, HDMI Set the display output
    size WxH[i][@R] Set the screen resolution and refresh rate
    W: Width
    H: Height
    i: Interlace (Optional)
    @R: Refresh rate (Optional)
    E.g.: 1920x1080@auto
    rotate 0, 1, 2 Display rotation:
    0: No rotate (Landscape)
    1: 90 degree clock-wise (Portrait)
    2: 90 degree counter clock-wise (Portrait)
    dpyPwSave  

    on

    off
    Set the screen on/off
    on: turn on the screen
    off: turn off the screen
  4. Video-input configuration (SMP only):
    Operation Attribute Value Description
    videoIn src internal, 1, 2
    internal: built-in capture card
    1, 2: external USB UVC device
    std NTSC, PAL Video Standard
    bri 0, 1, …, 100 Brightness
    con 0, 1, …, 100 Contrast
    sat 0, 1, …, 100 Saturation
    overScan 0, 1, …, 100 Over scan
  5. Sound configuration (SMP only):
    Operation Attribute Value Description
    sndOutput   analog
    digital
    Analog: Stereo out (phone jack or RCA)
    Digital: HDMI digital sound
    sound   0 – 100 For analog output only
  6. Time configuration: (SMP & CMS)
    Operation Attribute Value Description
    timeSetting date YYYYMMDDhhmmss,
    YYYYMMDD,
    hhmmss
    Example:
    Set date: 20150209
    Set time: 101530
    Set date & time: 20150209101530
    timezone City or region name See appendix for valid names
  7. Playback control (SMP):
    Operation Attribute Value Description
    play skin [Skin Name] Skin name
    program [Program Name] Program name
    playlist [Playlist Name] Playlist name
    centralctl 1 Central schedule
    display 1, 2 Choose playback on display 1 or display 2 (SMP-6000 distinct mode only)
    pbVo1Play
    pbVo2Play
    src file://file
    mms://url
    http://url
    rtb://[ip:]port
    rtp://ip:port
    src://local-all
    src://video-in
    src://usb-storage
    src://central-schedule
     
    ratio auto (default), 4:3, 16:9  
    mute 0, 1  
    random 0, 1  
    display 1, 2 Set the zone on display 1 or display 2 (SMP-6000 distinct mode only)
    pbIm1Play
    pbIm2Play
    src file://file
    src://local-all
    src://usb-storage
    src://central-schedule
     
    duration 1-999 Duration of displaying each image.
    sequence forward
    backward
    random
    Sequence
    scale_fit 0
    1 (default)
    2
    Scale to fit area
    0: Disable
    1: Fit to area (Proportional)
    2: Fit to area (Non-Proportional)
    transition_effect 0
    1
    2
    3
    4

    255
    0: No effect (default)
    1: Wipe Right (old name: Left to right)
    2: Wipe Left (old name: Right to left)
    3: Wipe Bottom (old name: Top to bottom)
    4: Wipe Top (old name: Bottom to top)

    255: Random
    Please refer to online user manual for the complete list of all transition effects.
    display 1, 2 Set the zone on display 1 or display 2 (SMP-6000 distinct mode only)
    pbTk1Play
    pbTk2Play
    src text://file
    http://rss-feed
    rss://url
    src://file
    src://central-schedule
     
    direction 1,2 1: Left to Right
    2: Right to left
    font [font name]  
    fsize 10 to 200  
    fcolor [font color] Default font color: 0xFFFFFF
    Example: 0x118A3F
    • First “11” means color Red
    • Mid “8A” means color Green
    • Last “3F” means color Blue
    All numbers use hexadecimal values.
    bcolor [background color] Default background color: 0x000000
    Example: 0x118A3F
    • First “11” means color Red
    • Mid “8A” means color Green
    • Last “3F” means color Blue
    All numbers use hexadecimal values.
    seffect 1, 2, 3, 4 Text scrolling effect
    1: No scrolling effect
    2: Simple crawl
    3: Simple Bottom up
    4: Bottom up and crawl
    speed 1, 2, 3, 4, 5, 6  
    pause 0, 0.5, 1, 1.5, 2, 2.5, 3 Pause
    spacing 0, 0.25, 0.5, 1, 1.25, 1.5 Line spacing
    display 1, 2 Set the zone on display 1 or display 2 (SMP-6000 distinct mode only)
    pbHtm1Play
    pbHtm2Play
    pbHtm3Play
    src file://file
    http://url
    https://url
    twitter://user
    weather://id
    central-schedule
     
    template 0, 1, … , 12 Twitter
    title [title] Twitter
    subject [subject] Twitter
    size 250x75
    285x170
    550x230
    Weather
    fcolor [foreground color] Weather
    bcolor [background color] Weather
    effect 0, 1 Weather
    units 0, 1 Weather
    pause 0-9 Weather
    icons 0, 1 Weather
    display 1, 2 Set the zone on display 1 or display 2 (SMP-6000 distinct mode only)
    pbAttr scrollbar auto, hide  
    hwaccel 0, 1 0: off, 1: on
    flashver 9, 11 Flash version 9 or 11
    autoUpdate 1-999
    disable
     

Examples

  1. Authentication key:
    Process a CAYIN SDK command with key protection
    http://<ip>/cysdk/?k=0123456789abcdef;play=skin:skin-1
    Process a CAYIN SDK command without key protection
    http://<ip>/cysdk/?play=skin:skin-1
  2. System control:
    Restart your system
    http://<ip>/cysdk/?sysRestart=1
  3. Display configuration:
    Set display layout to clone mode and Display1 choose HDMI output with 1920x1080i screen resolution
    http://<ip>/cysdk/?dpyOutput=mode:clone&dpy1=output:HDMI;size:1920x1080i@60;rotate:0
  4. Video-in configuration:
    Set Video-in source from internal video capture card with NTSC
    http://<ip>/cysdk/?videoIn=src:internal;std:NTSC;bri:50;con:50;sat:50;overScan:0
  5. Sound:
    Change sound output to analog output
    http://<ip>/cysdk/?sndOutput=analog
  6. Playback:
    Change playback to play skin “skin-1”
    http://<ip>/cysdk/?play=skin:skin-1;display:1
    Set Image zone 1 to play a file and a folder in media folder
    http://<ip>/cysdk/?pbIm1Play=src:file://file1.jpg;src:file://folder/;duration:1
    Set Ticker zone 1 to play a RSS feed
    http://<ip>/cysdk/?pbTk1Play=rss://url;seffect:1
    Set HTML zone 1 to play a file in media folder
    http://<ip>/cysdk/?pbHtm1Play=src:file://file1.html
    Change Adobe Flash player to version 9
    http://<ip>/cysdk/?pbAttr=flashver:9
Back to Top

Appendix: Valid cities for time zone setting

(GMT-12:00) Eniwetok, Kwajalein
(GMT-11:00) MidwayIsland, Samoa
(GMT-10:00) Hawaii
(GMT-09:00) Alaska
(GMT-08:00) Pacific Time (US & Canada); Tijuana
(GMT-07:00) Arizona
(GMT-07:00) Mountain Time (US & Canada)
(GMT-06:00) Central Time (US & Canada)
(GMT-06:00) Mexico City, Tegucigalpa
(GMT-06:00) Saskatchewan
(GMT-05:00) Bogota, Lima, Quito
(GMT-05:00) Eastern Time (US & Canada)
(GMT-05:00) Indiana (East)
(GMT-04:00) Atlantic Time (Canada)
(GMT-04:00) Caracas, La Paz
(GMT-04:00) Santiago
(GMT-03:30) Newfoundland
(GMT-03:00) Brasilia
(GMT-03:00) Buenos Aires, Georgetown
(GMT-02:00) Mid-Atlantic
(GMT-01:00) Azores, Cape Verde Is.
(GMT) Casablanca, Monrovia
(GMT) Greenwich Mean Time: Dublin, Edinburgh, Lisbon, London
(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna
(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague
(GMT+01:00) Brussels, Copenhagen, Madrid, Paris, Vilnius
(GMT+01:00) Sarajevo, Skopje, Sofija, Warsaw, Zagreb
(GMT+02:00) Athens, Istanbul, Minsk
(GMT+02:00) Bucharest
(GMT+02:00) Cairo
(GMT+02:00) Harare, Pretoria
(GMT+02:00) Helsinki, Riga, Tallinn
(GMT+02:00) Israel
(GMT+03:00) Baghdad, Kuwait, Riyadh
(GMT+03:00) Moscow, St. Petersburg, Volgograd
(GMT+03:00) Nairobi
(GMT+03:30) Tehran
(GMT+04:00) Abu Dhabi, Muscat
(GMT+04:00) Baku, Tbilisi
(GMT+04:30) Kabul
(GMT+05:00) Eekaterinburg
(GMT+05:00) Islamabad, Karachi, Tashkent
(GMT+05:30) Bombay, Calcutta, Madras, New Delhi
(GMT+06:00) Almaty, Dhaka
(GMT+06:00) Colombo
(GMT+07:00) Bangkok, Hanoi, Jakarta
(GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi
(GMT+08:00)  Perth
(GMT+08:00) Singapore
(GMT+08:00) Taipei
(GMT+09:00) Osaka, Sapporo, Tokyo
(GMT+09:00) Seoul
(GMT+09:00) Yakutsk
(GMT+09:30) Adelaide
(GMT+09:30) Darwin
(GMT+10:00) Brisbane
(GMT+10:00) Canberra, Melbourne, Sydney
(GMT+10:00) Guam, Port Moresby
(GMT+10:00) Hobart
(GMT+10:00) Vladivostok
(GMT+11:00) Magadan, Solomon Is., New Caledonia
(GMT+12:00) Auckland, Wellington
(GMT+12:00) Fiji, Kamchatka, Marshall Is.

Example:

http://<ip>/cysdk/?timeSetting=timezone:Eastern Time
http://<ip>/cysdk/?timeSetting=timezone:London
http://<ip>/cysdk/?timeSetting=timezone:Taipei

Back to Top