background image

2N TELEKOMUNIKACE a.s., www.2n.cz

9/42

3.3 API Functions

The API functions are encased in the Java class android.hardware.IndoorTouch. All the 

methods are static and require no class instance. API is divided into:

3.3.1 LEDs

3.3.2 GPIO

3.3.3 System

3.3.4 Licence

3.3.5 Ethernet

3.3.1 LEDs

The  LED  notification  interface  has  been  designed  both  for  GPIO  and  PWM  LED 

control.  Notifications  are  executed  by  so-called  effects.  The  effect  is  a  vector  of 

brightness transitions for each defined LED colour with a defined transition time. With 

GPIO LEDs, intensity is thresholded for the on/off value. The library contains some pre-

defined effects and the user can define additional effects of its own.

3.3.1.1 Effect Adding

3.3.1.2 Effect Removing

3.3.1.3 Effect Activation

3.3.1.4 Effect Deactivation

3.3.1.5 Effect Existence

3.3.1.6 Effect Enable

3.3.1.7 Display Backlight Notification

3.3.1.1 Effect Adding

int

 IndoorTouch.LedsAddEffect(String effectName, 

int

 continuity, String 

transitions, 

int

 effectLedMask, 

int

 usedLedMask);

1. The argument specifies the effect name. If the effect exists, RC_ERR_EXIST is 
returned.

2. 

The 

argument 

can 

have 

the 

following 

values: 

LED_EFFECT_CONTINUITY_SINGLE,  LED_EFFECT_CONTINUITY_REPEATING, 
LED_EFFECT_CONTINUITY_KEEP. These values define what happens when the 
transition vector ends. 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.

Содержание Indoor Touch

Страница 1: ...www 2n cz Indoor Touch API API guide Version 3 4 x...

Страница 2: ...ademarks and or trademarks or brands protected by law 2N TELEKOMUNIKACE a s administers the FAQ database to help you quickly find information and to answer your questions about 2N products and service...

Страница 3: ...pgrade 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 a...

Страница 4: ...2N TELEKOMUNIKACE a s www 2n cz 4 42 1 Upgrade Date Version Changes 01 04 2015 1 0 First version 04 05 2015 1 1 Hardware section added 08 03 2016 2 0 x HTTP API section added...

Страница 5: ...and helps share it with third party applications or can be used by a customer launcher 2N IndoorTouch HTTP API HA provides third party applications a possibility to configure and control selected sys...

Страница 6: ...LEKOMUNIKACE a s www 2n cz 6 42 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 Installa...

Страница 7: ...lidity check LED control etc and provides a function interface via the C library It communicates with the library via the Unix socket This library can be used by other C programs for update and recove...

Страница 8: ...1 2 Digital Output Voh 3 3 V DC 0 33 mA GP_IN1 2 INPUT 1 2 Digital Input Vihmax 5 V DC 100 k GP_IO1 2 IN OUT 1 2 Digital Input Output Vihmax 3 3 V DC 100 serial resistor Voh 3 3 V DC 4 mA 100 serial...

Страница 9: ...dditional effects of its own 3 3 1 1 Effect Adding 3 3 1 2 Effect Removing 3 3 1 3 Effect Activation 3 3 1 4 Effect Deactivation 3 3 1 5 Effect Existence 3 3 1 6 Effect Enable 3 3 1 7 Display Backligh...

Страница 10: ...tion for red LED blinking IndoorTouch LedsAddEffect test r LED_EFFECT_CONTINUITY_REPEATING 0 2 55 1000 255 0 1000 LED_RED LED_RED LED_GREEN LED_BLUE The library includes a pre defined effect red blink...

Страница 11: ...n 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 IndoorTouch RC_ERR_DENIED 7 notifications a...

Страница 12: ...n the selected database 3 3 1 6 Effect Enable int IndoorTouch LedsEffectsEnable boolean enable Effects are enabled by default If disabled effect activation is ignored and all the effects are switched...

Страница 13: ...ons IndoorTouch GPIO_PIN_IN1 0x01 IndoorTouch GPIO_PIN_IN2 0x02 IndoorTouch GPIO_PIN_OUT1 0x04 IndoorTouch GPIO_PIN_OUT2 0x08 IndoorTouch GPIO_PIN_IO1 0x10 IndoorTouch GPIO_PIN_IO2 0x20 IndoorTouch GP...

Страница 14: ...process can read the value but the setting ends with R C _ E R R _ L O C K E D The return value is as follows IndoorTouch RC_OK 0 IndoorTouch RC_ERR_CONN 1 API daemon connection error IndoorTouch RC_...

Страница 15: ...be read etc IndoorTouch RC_ERR_DENIED 7 GPIO does not exist or is unswitchable 3 3 2 6 Switchable GPIO Direction Setting int IndoorTouch GPIOSetDirection int pin int direction Sets the direction of th...

Страница 16: ...ed by Java daemon communication intervals an auxiliary nested static class is available for detection of IndoorTouch GPIOWatcher GPIO value changes When its instance is created starts a IndoorTouch GP...

Страница 17: ...is disabled and CPU scaling enabled the module reduces the CPU rate from 1 Ghz to 300 Mhz Enable disable this functionality with the following command int IndoorTouch SysEnableCPUDownscale boolean en...

Страница 18: ...rTouch SysSetMaxTemperature float tempDeg where temperature in Celsius degrees is the argument The GUI can get the current temperature value using the following function float IndoorTouch SysGetDevice...

Страница 19: ...the product key in the following format The function unpacks information into the IndoorTouch LicInfo static class static public class LicInfo public boolean valid public int hours public int flags Va...

Страница 20: ...e method 2N IndoorTouch returns Otherwise is returned false true 3 3 5 Ethernet As Android JB basic version supports only DHCP Ethernet setting and there are no such support and UI settings options in...

Страница 21: ...y n o t b e i n c l u d e d gateway If a system error occurs the method will return null 3 3 5 2 DHCP Active Network Setting The call activates the Ethernet interface with a dynamically retrieved add...

Страница 22: ...oped applications in Eclipse or AndroidStudio include the IndoorTouch java source code file to your project using path src java android After that import this file to your source code using hardware I...

Страница 23: ...utput Value Setting 4 2 3 2N IP Mobile Control 4 2 3 1 Call Dialling 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...

Страница 24: ...xecution request and the server sends a response The request consists of URL and optional data in the following format https IP api v1 subsystem parameters IP is the IDT IP address subsystem designate...

Страница 25: ...ny reasons At present the HTTP API cannot distinguish errors and specific error messages will be implemented in the next versions if necessary The short list of potential errors is as follows Request...

Страница 26: ...e obvious when the user enters another request via the web and is forwarded to the login dialogue This means that the web is used by another user and data might be overwritten HTTP API has no such lim...

Страница 27: ...ord URL https IP api v1 login HTTP method PUT Request body login username password password Response code 200 if everything is OK otherwise 401 405 Response data N A In case the solution requires the...

Страница 28: ...hod GET Request body N A Response code 200 if everything is OK otherwise 401 405 Response data N A 4 2 2 GPIO 4 2 2 1 GPIO List Getting 4 2 2 2 Input Value Getting 4 2 2 3 Output Value Setting 4 2 2 1...

Страница 29: ...tting Get the input value and or switchable IO direction Name GPIO name refer to 4 2 2 1 Type can have the values value direction Z sk n seznamu GPIO vstup a v stup GPIO name in1 in2 type value Value...

Страница 30: ...be false if GPIO is locked for setting via another application URL https IP api v1 gpio action set name string type string value bit HTTP method GET Request body N A Response code Response data data s...

Страница 31: ...4 2 3 2 Call Accept Accepts currently ringing incoming call URL https IP api v1 call accept HTTP Metoda GET Request body N A Response code Standard HTTP response code treating syntactic errors Respons...

Страница 32: ...dByRemote EarlyUpdating Refer to for more information http www linphone org URL https IP api v1 call status HTTP method GET Request body N A Response code Standard HTTP response code treating syntacti...

Страница 33: ...293 name 2N IP Vario 4 2 3 6 Getting 2N IP intercoms Added to Devices Get the list of the added to the list of devices 2N IP intercoms URL https IP api v1 devices action get type add HTTP method GET R...

Страница 34: ...treating syntactic errors Response data N A 4 2 3 8 Door Lock Activation Send a request to activate the door lock for a selected Make sure that 2N IP intercom the serial number is in the list of adde...

Страница 35: ...ndard HTTP response code treating syntactic errors Response data data success true running boolean 4 2 3 11 2N IP Mobile Restart Restart if running and start if not running Once the 2N IP Mobile 2N IP...

Страница 36: ...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...

Страница 37: ...data storage size totalMemory total available internal memory size keys licence keys for additional IDT functions namely APP possibility to install additional applications LAUNCHER possibility to swi...

Страница 38: ...8 42 4 2 4 2 2N Indoor Touch Restart Restart the unit 2N Indoor Touch URL https IP api v1 maintenance resetdevice HTTP method GET Request body N A Response code Standard HTTP response code treatting s...

Страница 39: ...2N TELEKOMUNIKACE a s www 2n cz 39 42 5 Supplementary Information 5 1 Directives Laws and Regulation General Instructions and Cautions...

Страница 40: ...e or destruction of the product caused by incompetent replacement of parts or due to the use of reproduction parts or components The manufacturer shall not be liable and responsible for any loss or da...

Страница 41: ...c Waste and Used Battery Pack Handling Do not place used electric devices and battery packs into municipal waste containers An undue disposal thereof might impair the environment Deliver your expired...

Страница 42: ...2N TELEKOMUNIKACE a s www 2n cz 42 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...

Отзывы: