Defining Smart Objects

We are now ready to add our first IPSO Smart Object. The IPSO Smart Object Guidelines, from the Smart Objects Starter Pack, contains the object definitions we need. If you haven't downloaded these already, do so now. The Digital Input smart object is defined as follows:

Name

Res.

R/W/E

M/O

Type

Description

Digital Input State

5500

R

M

Boolean

The current state of a digital input.

Digital Input Counter

5501

R

O

Integer

The cumulative value of the active state detected

Digital Input Polarity

5502

RW

O

Boolean

The polarity of the digital input as a Boolean (0 = Normal, 1= Reversed)

Digital Input Debounce Period

5503

RW

O

Integer

The debounce period in milliseconds.

Digital Input Edge Selection

5504

RW

O

Integer

The edge selection as an integer (1 = Falling edge, 2 = Rising edge, 3 = Both Rising and Falling edge)

Digital Input Counter Reset

5505

E

O

Reset the Counter value

Application Type

5750

RW

O

String

The application type of the sensor or actuator as a string, for instance, "Air Pressure".

Sensor Type

5751

R

O

String

The type of the sensor, for instance, PIR type.

 

We notice that the object only has one mandatory resource, the current state. In our implementation, we will also provide support for the counter and counter reset resources, as well as the two string resources describing the sensor. There is one command resource, the counter reset command. It can be executed (E). Four resources can be written to (W), and all, except the command, can be read (R).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset