2N Indoor Touch Manuale utente

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

The 2N TELEKOMUNIKACE a.s. is a Czech manufacturer and supplier of
telecommunications equipment.
The product family developed by 2N TELEKOMUNIKACE a.s. includes GSM gateways,
private branch exchanges (PBX), and door and lift communicators. 2N
TELEKOMUNIKACE a.s. has been ranked among the Czech top companies for years
and represented a symbol of stability and prosperity on the telecommunications
market for almost two decades. At present, we export our products into over 120
countries worldwide and have exclusive distributors on all continents.
2N is a registered trademark of 2N TELEKOMUNIKACE a.s. Any product and/or other
®
names mentioned herein are registered trademarks 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 services. On www.
faq.2n.cz you can find information regarding products adjustment and instructions for
optimum use and procedures „What to do if...".
2N TELEKOMUNIKACE a.s. hereby declares that the 2N product complies with all
®
basic requirements and other relevant provisions of the 1999/5/EC directive. For the
full wording of the Declaration of Conformity see the CD-ROM (if enclosed) or our
website at www.2n.cz.
The 2N TELEKOMUNIKACE a.s. is the holder of the ISO 9001:2009 certificate. All
development, production and distribution processes of the company are managed by
this standard and guarantee a high quality, technical level and professional aspect of
all our products.

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

2N TELEKOMUNIKACE a.s., www.2n.cz 5/42
2. Purpose of Document
2N IndoorTouch
® is used for isolating the specific API (IA) 2N IndoorTouch
®
functionality 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 system parts and the calling application.2N IP Mobile
®
Caution
The HTTP API service is licensed under the 91378395 2N Indoor Touch
.HTTP API licence

2N TELEKOMUNIKACE a.s., www.2n.cz 7/42
3.1 Architecture and Function
2N IndoorTouch
® is based on a daemon written in C, which forms a layer above API
the OS Linux core. It periodically executes such necessary actions as network
configuration check, licence validity 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 recovery modes, e.g.) too.
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 8/42
3.2 Hardware
3.2.1 Inputs and Outputs
3.2.1 Inputs and Outputs
3.2.1.1 HW v4-00-00
3.2.1.1 HW v4-00-00
ID Mark Name Restriction
AIN0/1 ANALOG IN 1/2 Analogue Input 0–5 V DC 1,5 M Ω
GP_OUT1/2 OUTPUT 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 resistor)Ω
Relay0/1 REL1/2 Relay contact data: max 30 V DC 2 A.
DC 12 V +/- IN = power input:
Vinmax = 12 V DC Imax = 1 A.
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
GND Ground

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.

2N TELEKOMUNIKACE a.s., www.2n.cz 10/42
3. Transitions means a string of transitions in the following format: <initial
brightness>,<target brightness>,<transition time in ms>, … . The count of
numbers in the string must be divisible by 3 and contain one transition at least.
4. Mask of used LEDs for the effect itself. These LEDs are affected by the
transition defined.
5. Mask of used LEDs. It contains all bits from the argument 4 mask plus others
in which the brightness value is 0. The other LEDs are not affected by the effect
and can use other effects that use a set of LEDs disjunctive with this effect. The
following LEDs are available for effects at present:
LED_RED = 0x01;
LED_GREEN = 0x02
LED_BLUE = 0x04;
LED_NFC = 0x08;
Example of effect definition 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-missedcalls“ for red blinking.
The return value is as follows:
IndoorTouch.RC_OK = 0;
IndoorTouch.RC_ERR_CONN = -1; API daemon connection error
IndoorTouch.RC_ERR_EXIST = -3; the effect name already exists
IndoorTouch.RC_ERR_INVALID = -5; invalid function arguments
IndoorTouch.RC_ERR_MAXREACHED = -10; maximum count of defined effects
exceeded
3.3.1.2 Effect Removing
int IndoorTouch.LedsRemoveEffect(String effectName);
Removes an effect from the list of defined effects. If the so-defined effect is active, it
is not affected by the call.
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
Altri manuali per Indoor Touch
4
Indice
Altri manuali 2N Pannello touch




















