2N Indoor Touch Api Manual

2N Indoor Touch Api Manual

Api
Hide thumbs Also See for Indoor Touch:

Advertisement

Quick Links

Indoor Touch API
API guide
Version:
3.4.x
www.2n.cz

Advertisement

Table of Contents
loading

Summary of Contents for 2N Indoor Touch

  • Page 1 Indoor Touch API API guide Version: 3.4.x www.2n.cz...
  • Page 2 2N TELEKOMUNIKACE a.s. administers the FAQ database to help you quickly find information and to answer your questions about 2N products and services. On www. faq.2n.cz you can find information regarding products adjustment and instructions for optimum use and procedures „What to do if...".
  • Page 3: Table Of Contents

    2. Purpose of Document 3. API 3.1 Architecture and Function 3.2 Hardware 3.3 API Functions 3.4 Installation 4. HTTP API 4.1 Interface 4.2 Commands 5. Supplementary Information 5.1 Directives, Laws and Regulation - General Instructions and Cautions 2N TELEKOMUNIKACE a.s., www.2n.cz 3/42...
  • Page 4: Upgrade

    1. Upgrade Date Version Changes 01/04/2015 First version 04/05/2015 Hardware section added 08/03/2016 2.0.x HTTP API section added 2N TELEKOMUNIKACE a.s., www.2n.cz 4/42...
  • Page 5: Purpose Of Document

    ® configure and control selected system parts and the IP Mobile calling application. Caution The HTTP API service is licensed under the 91378395 2N Indoor Touch HTTP API licence 2N TELEKOMUNIKACE a.s., www.2n.cz 5/42...
  • Page 6: Api

    3. API 3.1 Architecture and Function 3.2 Hardware 3.2.1 Inputs and Outputs 3.3 API Functions 3.3.1 LEDs 3.3.2 GPIO 3.3.3 System 3.3.4 Licence 3.3.5 Ethernet 3.4 Installation 2N TELEKOMUNIKACE a.s., www.2n.cz 6/42...
  • Page 7: Architecture And Function

    The library is also included in Android API, where a Java interface android.hardware. IndoorTouch is created that makes it possible to call the library functions via the JNI. The interface in Java is the android.hardware.IndoorTouch class. 2N TELEKOMUNIKACE a.s., www.2n.cz 7/42...
  • Page 8: Hardware

    DC 12 V + OUT = power output: Vout = 12 V DC Imax = 100 mA   DC12V+ OUT + 12V output Imax = 300 mA   DC12V+ IN + 12V input Imin = 1000 mA   Ground   2N TELEKOMUNIKACE a.s., www.2n.cz 8/42...
  • Page 9: Api Functions

    With SINGLE, the effect is terminated and removed from the active effect database. With REPEATING, the effect starts from the beginning again. With KEEP, the effect remains active displaying the last final transition value. 2N TELEKOMUNIKACE a.s., www.2n.cz 9/42...
  • Page 10 . The return value is as follows: IndoorTouch.RC_OK = 0; IndoorTouch.RC_ERR_CONN = -1; API daemon connection error IndoorTouch.RC_ERR_NOTEXIST = -4; the effect name does not exist 3.3.1.3 Effect Activation 2N TELEKOMUNIKACE a.s., www.2n.cz 10/42...
  • Page 11 . The return value is as follows: IndoorTouch.RC_OK = 0; IndoorTouch.RC_ERR_CONN = -1; API daemon connection error IndoorTouch.RC_ERR_NOTEXIST = -4; the effect name does not exist 2N TELEKOMUNIKACE a.s., www.2n.cz 11/42...
  • Page 12 If enabled, the blue LED is displayed when the display is switched off (switched into t h e s l e e p m o d e ) . The return value is as follows: IndoorTouch.RC_OK = 0; IndoorTouch.RC_ERR_CONN = -1; API daemon connection error 2N TELEKOMUNIKACE a.s., www.2n.cz 12/42...
  • Page 13 IndoorTouch.RC_ERR_DENIED = -7; system error (GPIO does not exist) 3.3.2.2 GPIO Pin Setting int IndoorTouch.GPIOSet(int pin, value); Pin is the PIN index, refer to 3.3.2.1 GPIO Pin Reading , and value is {0,1}. The return value is as follows: 2N TELEKOMUNIKACE a.s., www.2n.cz 13/42...
  • Page 14 The return value is as follows: IndoorTouch.RC_OK = 0; IndoorTouch.RC_ERR_CONN = -1; API daemon connection error IndoorTouch.RC_ERR_LOCKED = -8; already locked by another process via GPIOLock IndoorTouch.RC_ERR_NOTLOCKED = -9; PIN is not locked and need not be unlocked 2N TELEKOMUNIKACE a.s., www.2n.cz 14/42...
  • Page 15 The return value is as follows: IndoorTouch.RC_OK = 0; IndoorTouch.RC_ERR_CONN = -1; API daemon connection error IndoorTouch.RC_ERR_SYS = -6; system error (the value cannot be set, etc.) IndoorTouch.RC_ERR_DENIED = -7; GPIO does not exist or is unswitchable 2N TELEKOMUNIKACE a.s., www.2n.cz 15/42...
  • Page 16 { super(mask); @Override public void OnGPIOChanged(int gpio, value) { (gpio == IndoorTouch.GPIO_PIN_IN1) { // do the magic protected IndoorTouch.GPIOWatcher mWatch = MyWatcher( IndoorTouch. GPIO_PIN_IN1 | IndoorTouch.GPIO_PIN_IN2); GPIOWatcher has the following two constructors: public GPIOWatcher(int watchMask) 2N TELEKOMUNIKACE a.s., www.2n.cz 16/42...
  • Page 17 EEPROM every two minutes (saving the count of write cycles). The value is intended for technicians and can be obtained using the following Telnet command: setpkey get hw_cfg.cfg.display_uptime (value in seconds). To get the total IndoorTouch operation time enter the following command: 2N TELEKOMUNIKACE a.s., www.2n.cz 17/42...
  • Page 18 The IndoorTouch launcher disables boot animation (a custom launcher must disable animation to display the system). 3.3.3.5 Telnet Telnet is enabled by the library upon start up by default. The launcher can disable it as configured. Enable/disable Telnet as follows: boolean IndoorTouch.SysEnableTelnet(boolean enable); 2N TELEKOMUNIKACE a.s., www.2n.cz 18/42...
  • Page 19 The function allows 10 calls in 5 seconds at most. Further 10 calls are allowed in the next 5 seconds. When all the attempts are exhausted or a system error occurs, the method returns null 3.3.4.2 Product Key Getting String IndoorTouch.LicGetProductKey(); 2N TELEKOMUNIKACE a.s., www.2n.cz 19/42...
  • Page 20 3.3.5.1 Network Info Getting 3.3.5.2 DHCP Active Network Setting 3.3.5.3 Network Static Address Setting 3.3.5.4 Ethernet Interface Deactivation 3.3.5.1 Network Info Getting NetInfo IndoorTouch.NetEthGetInfo(); The function returns the static class IndoorTouch.NetInfo 2N TELEKOMUNIKACE a.s., www.2n.cz 20/42...
  • Page 21 The call activates the Ethernet interface with a dynamically retrieved address. IndoorTouch.NetEthSetDHCP() 3.3.5.3 Network Static Address Setting The call activates the Ethernet interface with statically defined network parameters. IndoorTouch.NetEthSetStatic(String ip, String mask, String dns1, String gateway); 3.3.5.4 Ethernet Interface Deactivation IndoorTouch.NetEthSetOff(); 2N TELEKOMUNIKACE a.s., www.2n.cz 21/42...
  • Page 22: Installation

    . After that import this file to your source code using import android.hardware.IndoorTouch . You will be able to use all functions after this. Source code file IndoorTouch.java can be downloaded here ® Debug directly on the IndoorTouch or emulate the library functions. 2N TELEKOMUNIKACE a.s., www.2n.cz 22/42...
  • Page 23: Http Api

    4.2.3.2 Call Accept 4.2.3.3 Call Termination 4.2.3.4 Call State 4.2.3.5 2N IP Intercom List Getting 4.2.3.6 Getting 2N IP intercoms Added to Devices 4.2.3.7 Change of Items in Added Device List 4.2.3.8 Door Lock Activation 4.2.3.9 2N® IP Mobile Minimisation 4.2.3.10 2N®...
  • Page 24: Interface

    The HTTP method GET is used for the requests that do not transmit data. The PUT method is used for the requests that include data. 4.1.2 Responses to Requests A response to a request always includes JSON data in the following format: 2N TELEKOMUNIKACE a.s., www.2n.cz 24/42...
  • Page 25 ® Helios IP Mobile command is entered but the application is not running. ® Therefore, make sure that the application has been started before sending a 2N Helios IP Mobile command. data container can include more items whose names and contents depend on the request to be sent.
  • Page 26 This means that the web is used by another user and data might be overwritten. HTTP API has no such limitation. This means that more users may be authenticated, but mutual data overwriting is not checked and has to be solved by the developer. 2N TELEKOMUNIKACE a.s., www.2n.cz 26/42...
  • Page 27: Commands

    4.2.1.2 Logout 4.2.1.1 Login The login helps you get access to the selected HTTPS session using a username and password. The login is Admin by default and the password is identical with the 2N launcher configuration access password. URL: https://<IP>/api/v1/login...
  • Page 28 {in1, in2, out1, out2, io1, io2, relay1, relay2} is the input identifier that is subsequently used for GPIO identification in the HTTP API communication too. Direction takes the values {in, out, io}. URL: https://<IP>/api/v1/gpio/caps HTTP method: Request body: 2N TELEKOMUNIKACE a.s., www.2n.cz 28/42...
  • Page 29 GPIO name {in1, in2}, type=value: Value can be {0, 1} GPIO name {io1, io2}, type = direction: Value can be {in, out} URL: https://<IP>/api/v1/gpio? action=get&name=<string>&type=<string> HTTP method: Request body: Response Standard HTTP response code, treating syntactic errors code: 2N TELEKOMUNIKACE a.s., www.2n.cz 29/42...
  • Page 30 4.2.3.2 Call Accept 4.2.3.3 Call Termination 4.2.3.4 Call State 4.2.3.5 2N IP Intercom List Getting 4.2.3.6 Getting 2N IP intercoms Added to Devices 4.2.3.7 Change of Items in Added Device List 4.2.3.8 Door Lock Activation 4.2.3.9 2N® IP Mobile Minimisation 4.2.3.10 2N®...
  • Page 31 Standard HTTP response code, treating syntactic errors Response data: {"data":{"success":true}} 4.2.3.3 Call Termination Terminates the active call. URL: https://<IP>/api/v1/call/hangup HTTP method: Request body: Response code: Standard HTTP response code, treating syntactic errors Response data: {"data":{"success":true}} 2N TELEKOMUNIKACE a.s., www.2n.cz 31/42...
  • Page 32 HTTP method: Request body: Response code: Standard HTTP response code, treating syntactic errors Response data: {"data":{"success":<boolean>, "call_state":"<string>"}} 4.2.3.5 2N IP Intercom List Getting ® Get the list of the 2N IP intercoms that are registered with IP Mobile and can be displayed and edited in the device list.
  • Page 33 "sip_uri": "sip: 192.168.254.222", "serial_number": "54- 0562-0293", "name": "2N IP Vario" 4.2.3.6 Getting 2N IP intercoms Added to Devices Get the list of the 2N IP intercoms added to the list of devices. URL: https://<IP>/api/v1/devices?action=get&type=add HTTP method: Request body: Response code:...
  • Page 34 URL: https://<IP>/api/v1/door?action=open&serial=<string>&switchid=<integer> HTTP method: Request body: Response code: Standard HTTP response code, treating syntactic errors Response data: {"data":{"success":true}} 4.2.3.9 2N® IP Mobile Minimisation ® ® Send the IP Mobile application to the background (displaying the Indoor Touch launcher).
  • Page 35 URL: https://<IP>/api/v1/hipm?action=restart HTTP method: Request body: Response code: Standard HTTP response code, treating syntactic errors Response data: {"data":{"success":true}} 4.2.4 System 4.2.4.1 System Info and Status 4.2.4.2 2N® Indoor Touch Restart 2N TELEKOMUNIKACE a.s., www.2n.cz 35/42...
  • Page 36 "temperature":"0.0 °C", "uptimeHours":"4012 hours", "time":"10:51AM", "totalCache":"92 MB", ":key":"J52RF-NVDD4-YW3P4-WCM9K-2TAIM", "os":"Android OS 4.2.2", "sn":"99-9999-9999", "lanmac":"D0-39-72-1F-56-C8", "freeStorage":"989 MB", "totalMemory":"496 MB", "keys":"APP LAUNCHER ROOT", "freeMemory":"363 MB", "freeCache":"88 MB", "system":"2N® Indoor Touch", "wifimac":"D0-39-72-1F-56- CA", "uptimeM":9, "wificapable":true, "uptimeH":0}}". Meaning of items: uptimeD – count of days for which IDT has been working and available, uptimeH, uptimeM totalStorage –...
  • Page 37 IDT has been working and available , see uptimeD, uptimeH wificapable – true if IDT is equipped with a WiFi interface uptimeH – count of hours for which IDT has been working and available , see uptimeD, uptimeM 2N TELEKOMUNIKACE a.s., www.2n.cz 37/42...
  • Page 38 4.2.4.2 2N® Indoor Touch Restart ® Restart the Indoor Touch unit. URL: https://<IP>/api/v1/maintenance/resetdevice HTTP method: Request body: Response code: Standard HTTP response code, treatting syntactic errors Response data: 2N TELEKOMUNIKACE a.s., www.2n.cz 38/42...
  • Page 39: Supplementary Information

    5. Supplementary Information 5.1 Directives, Laws and Regulation - General Instructions and Cautions 2N TELEKOMUNIKACE a.s., www.2n.cz 39/42...
  • Page 40: Directives, Laws And Regulation - General Instructions And Cautions

    The consumer shall, at its own expense, obtain software protection of the product. The manufacturer shall not be held liable and responsible for any damage incurred as a result of the use of deficient or substandard security software. 2N TELEKOMUNIKACE a.s., www.2n.cz 40/42...
  • Page 41 Make sure that the devices to be disposed of are complete. Do not throw battery packs into fire. Battery packs may not be taken into parts or short-circuited either. 2N TELEKOMUNIKACE a.s., www.2n.cz 41/42...
  • Page 42 2N TELEKOMUNIKACE a.s. Modřanská 621, 143 01 Prague 4, Czech Republic Phone: +420 261 301 500, Fax: +420 261 301 599 E-mail: sales@2n.cz Web: www.2n.cz v3.4.x 2N TELEKOMUNIKACE a.s., www.2n.cz 42/42...

Table of Contents