Gemalto is now part of the Thales Group, find out more.

You are here

Terminal GPIO Demo

Showcase, July 7, 2017 - 12:19pm, 3325 views

Cinterion EHS6 Terminals - GPIO demo

Terminal GPIO usage and set-up showcase
AT Command parsing via SMS
Cell based location via SMS

Module hardware and network status via SMS
mullengers's picture
mullengers

Customer query:

I have a Project with an EHS6 USB Terminal which should be configured via a Java MIDlet.
It is an Alarm system which has 3 outputs which react to 3 different sensors and
are connected via the GPIOS of the terminal.

My task is to respond to which one of the sensors the terminal is sending an SMS.

EXAMPLE:
Sensor_1 GPIO12: Alert_01;       
Sensor_2 GPIO13: Alert_02;
Sensor_3 GPIO14: Alert_03;

My question would be, how do I have to change the Java code so that the MIDlet 3 different GPIOS
with 3 different SMS messages can process?

mullengers's picture
mullengers

You can copy, duplicate and modify the basic ButtonHandler.java file to create three buttons ButtonA, ButtonB etc...

Modify which GPIO to monitor:

    public  static String gpioPin = gpioPin11;

              // Actual GPIO to use

 

In the class ExternalDevice.java method "start()" you can link to the three ButtonHandlers A,B and C:

        // Allows Button Handler to tell us about a "button down" event on the Concept board

        if (buttonListenerA == null) {

            buttonListenerA = new ExternalDeviceButtonHandlerListenerA();

            if (buttonListenerA != null) {

                ButtonHandlerA.getInstance().addButtonListener(buttonListenerA);

            }

        }...

 

Of course, to take actions you'll need to make three ExternalDeviceButtonHandlerListeners too...

 

// ------------------------------------------------------------- //

 

class ExternalDeviceButtonHandlerListenerA implements InPortListener {

    final boolean DEBUG = false;

 

    public void ExternalDeviceButtonHandlerListenerA() {

    }

 

    public void portValueChanged(int changedInPortValue) {

        if (DEBUG) {System.out.println("[ExternalDeviceButtonHandlerListenerA]: " + changedInPortValue);}

 

        if (changedInPortValue == ButtonHandler.BUTTON_DOWN_ON) {

            ExternalDevice.alarmStateA = ButtonHandler.BUTTON_DOWN_ON;

            SubscriptionHandler.getInstance().sendAdhocBroadcastToAllSubscribersBySMS("Alarm_A", SmsHandler.CLASS1);

        }

 

        if (changedInPortValue == ButtonHandler.BUTTON_UP_OFF) {

            ExternalDevice.alarmStateA = ButtonHandler.BUTTON_UP_OFF;

            SubscriptionHandler.getInstance().sendAdhocBroadcastToAllSubscribersBySMS("Disarm_A", SmsHandler.CLASS1);

        }

    }

}

 

// ------------------------------------------------------------- //

 

delhis's picture
delhis

The 7-Segment display counts from 0 to 9 on each of its 8 digits. 

erp vendors

erp development company

belleriggs12's picture
belleriggs12

I think the last segment count from 1 to 9 only or so. It was one of those perfect spring days that held the promise of summer justbuild.lol

shoun11's picture
shoun11

We are best Professional SEO, Digital Marketing, Web Designing and Web Development Company in Bangalore.

best digital marketing agency in bangalore

best seo expert in bangalore

PPC services in bangalore

smo company in bangalore

mullengers