Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
Lightsensor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Devices
Lightsensor
Commits
8d04e5e3
Commit
8d04e5e3
authored
Sep 25, 2015
by
aw613
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- a lot of renaming
parent
912a6c35
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
59 additions
and
21 deletions
+59
-21
src/org/ws4d/smartsensor/device/GetLightOperation.java
src/org/ws4d/smartsensor/device/GetLightOperation.java
+5
-5
src/org/ws4d/smartsensor/device/GetTemperatureOperation.java
src/org/ws4d/smartsensor/device/GetTemperatureOperation.java
+5
-5
src/org/ws4d/smartsensor/device/LightService.java
src/org/ws4d/smartsensor/device/LightService.java
+11
-7
src/org/ws4d/smartsensor/device/SensorDevice.java
src/org/ws4d/smartsensor/device/SensorDevice.java
+2
-2
src/org/ws4d/smartsensor/device/TempService.java
src/org/ws4d/smartsensor/device/TempService.java
+31
-0
src/org/ws4d/smartsensor/device/mainclass.java
src/org/ws4d/smartsensor/device/mainclass.java
+5
-2
No files found.
src/org/ws4d/smartsensor/device/GetLight
Ac
tion.java
→
src/org/ws4d/smartsensor/device/GetLight
Opera
tion.java
View file @
8d04e5e3
...
...
@@ -31,16 +31,16 @@ import com.pi4j.io.i2c.I2CFactory;
*
*
*/
public
class
GetLight
Ac
tion
extends
Operation
public
class
GetLight
Opera
tion
extends
Operation
{
public
static
final
String
ACT_HW_NAME
=
"Light
Ac
tion"
;
public
static
final
String
ACT_HW_NAME
=
"Light
Opera
tion"
;
//public static final String PARAM_HW_OUTPUT = "temperature";
public
static
final
String
PARAM_HW_OUTPUT
=
"light"
;
public
static
Tsl2561
sensor
;
public
GetLight
Ac
tion
()
{
super
(
ACT_HW_NAME
,
HelloWorld
Service
.
QN_PORTTYPE
);
public
GetLight
Opera
tion
()
{
super
(
ACT_HW_NAME
,
Light
Service
.
QN_PORTTYPE
);
I2CBus
bus
;
try
{
...
...
@@ -51,7 +51,7 @@ public class GetLightAction extends Operation
e
.
printStackTrace
();
}
Element
lightOutput
=
new
Element
(
PARAM_HW_OUTPUT
,
HelloWorld
Device
.
NAMESPACE
,
SchemaUtil
.
TYPE_INT
);
Element
lightOutput
=
new
Element
(
PARAM_HW_OUTPUT
,
Sensor
Device
.
NAMESPACE
,
SchemaUtil
.
TYPE_INT
);
setOutput
(
lightOutput
);
...
...
src/org/ws4d/smartsensor/device/GetTemperature
Ac
tion.java
→
src/org/ws4d/smartsensor/device/GetTemperature
Opera
tion.java
View file @
8d04e5e3
...
...
@@ -27,24 +27,24 @@ import org.ws4d.java.service.parameter.ParameterValueManagement;
*
*
*/
public
class
GetTemperature
Ac
tion
extends
Operation
public
class
GetTemperature
Opera
tion
extends
Operation
{
// private ITemperatureInput tempSensor = (ITemperatureInput) Resources.lookup(ITemperatureInput.class);
//private ILightSensor lightSensor = (ILightSensor) Resources.lookup(ILightSensor.class);
public
static
final
String
ACT_HW_NAME
=
"Temperature
Ac
tion"
;
public
static
final
String
ACT_HW_NAME
=
"Temperature
Opera
tion"
;
public
static
final
String
PARAM_HW_OUTPUT
=
"temperature"
;
//public static final String PARAM_HW_OUTPUT2 = "light";
public
PhySensor
sensor
;
public
GetTemperature
Ac
tion
()
{
public
GetTemperature
Opera
tion
()
{
super
(
ACT_HW_NAME
,
HelloWorld
Service
.
QN_PORTTYPE
);
super
(
ACT_HW_NAME
,
Temp
Service
.
QN_PORTTYPE
);
sensor
=
new
PhySensor
(
"28-0000045157c3"
);
//Sensor Thread is started in background
Element
temperatureOutput
=
new
Element
(
PARAM_HW_OUTPUT
,
HelloWorld
Device
.
NAMESPACE
,
SchemaUtil
.
TYPE_INT
);
Element
temperatureOutput
=
new
Element
(
PARAM_HW_OUTPUT
,
Sensor
Device
.
NAMESPACE
,
SchemaUtil
.
TYPE_INT
);
//Parameter lightOutput = new Parameter(PARAM_HW_OUTPUT2, HelloWorldDevice.NAMESPACE, ParameterType.PARAMETER_TYPE_INT);
setOutput
(
temperatureOutput
);
...
...
src/org/ws4d/smartsensor/device/
HelloWorld
Service.java
→
src/org/ws4d/smartsensor/device/
Light
Service.java
View file @
8d04e5e3
...
...
@@ -11,17 +11,18 @@ import org.ws4d.java.types.URI;
* In particular the service has one method HelloWorldAction.
*
*/
public
class
HelloWorld
Service
extends
DefaultService
{
public
class
Light
Service
extends
DefaultService
{
// global settings
public
static
final
String
NAMESPACE
=
HelloWorldDevice
.
NAMESPACE
;
public
static
final
String
PORTTYPE
=
"SensorInterface"
;
public
static
final
String
NAMESPACE
=
"http://www.demo.com/bbsr"
;
//HelloWorldDevice.NAMESPACE;
// public static final String PORTTYPE = "TemperatureInterface";
public
static
final
String
PORTTYPE
=
"Brightness"
;
public
static
final
String
ENDPOINT_PATH
=
"/SunSPOTSensor"
;
public
static
final
QName
QN_PORTTYPE
=
new
QName
(
PORTTYPE
,
NAMESPACE
);
public
final
static
URI
DOCU_EXAMPLE_SERVICE_ID
=
new
URI
(
NAMESPACE
+
ENDPOINT_PATH
);
public
HelloWorld
Service
()
{
public
Light
Service
()
{
super
(
DPWSCommunicationManager
.
COMMUNICATION_MANAGER_ID
);
// Set the property
// Properties.getInstance().setServiceProperty(this, Properties.PROP_SERVICE_SECURED, false);
...
...
@@ -34,11 +35,11 @@ public class HelloWorldService extends DefaultService {
//addAction(helloWorldAct);
// -- getTemperatureAction --
GetTemperatureAction
getTemperatureAct
=
new
GetTemperatureAc
tion
();
addOperation
(
getTemperatureAct
);
// GetTemperatureOperation getTemperatureAct = new GetTemperatureOpera
tion();
//
addOperation(getTemperatureAct);
// -- getValuesAction --
GetLight
Action
getLightAct
=
new
GetLightAc
tion
();
GetLight
Operation
getLightAct
=
new
GetLightOpera
tion
();
addOperation
(
getLightAct
);
// -- getValuesAction --
...
...
@@ -48,5 +49,8 @@ public class HelloWorldService extends DefaultService {
}
}
src/org/ws4d/smartsensor/device/
HelloWorld
Device.java
→
src/org/ws4d/smartsensor/device/
Sensor
Device.java
View file @
8d04e5e3
...
...
@@ -13,13 +13,13 @@ import org.ws4d.java.types.QNameSet;
* modified by Christin Groba
*
*/
public
class
HelloWorld
Device
extends
DefaultDevice
{
public
class
Sensor
Device
extends
DefaultDevice
{
public
static
final
String
NAMESPACE
=
"http://www.demo.com/bbsr"
;
public
static
final
String
PORTTYPE
=
"Sensor"
;
public
static
final
String
LOCALE_EN
=
"en_GB"
;
public
HelloWorld
Device
()
{
public
Sensor
Device
()
{
super
(
DPWSCommunicationManager
.
COMMUNICATION_MANAGER_ID
);
...
...
src/org/ws4d/smartsensor/device/TempService.java
0 → 100644
View file @
8d04e5e3
package
org.ws4d.smartsensor.device
;
import
org.ws4d.java.communication.DPWSCommunicationManager
;
import
org.ws4d.java.service.DefaultService
;
import
org.ws4d.java.types.QName
;
import
org.ws4d.java.types.URI
;
public
class
TempService
extends
DefaultService
{
// global settings
public
static
final
String
NAMESPACE
=
"http://www.demo.com/bbsr"
;
//HelloWorldDevice.NAMESPACE;
// public static final String PORTTYPE = "TemperatureInterface";
public
static
final
String
PORTTYPE
=
"TemperatureInterface"
;
public
static
final
String
ENDPOINT_PATH
=
"/SunSPOTSensor1"
;
public
static
final
QName
QN_PORTTYPE
=
new
QName
(
PORTTYPE
,
NAMESPACE
);
public
final
static
URI
DOCU_EXAMPLE_SERVICE_ID
=
new
URI
(
NAMESPACE
+
ENDPOINT_PATH
);
public
TempService
()
{
super
(
DPWSCommunicationManager
.
COMMUNICATION_MANAGER_ID
);
// Set the property
// Properties.getInstance().setServiceProperty(this, Properties.PROP_SERVICE_SECURED, false);
this
.
setServiceId
(
DOCU_EXAMPLE_SERVICE_ID
);
// -- getTemperatureAction --
GetTemperatureOperation
getTemperatureAct
=
new
GetTemperatureOperation
();
addOperation
(
getTemperatureAct
);
}
}
src/org/ws4d/smartsensor/device/mainclass.java
View file @
8d04e5e3
...
...
@@ -17,13 +17,16 @@ public class mainclass {
CoreFramework
.
start
(
args
);
HelloWorldDevice
device
=
new
HelloWorld
Device
();
SensorDevice
device
=
new
Sensor
Device
();
// create service
HelloWorldService
service
=
new
HelloWorldService
();
LightService
service
=
new
LightService
();
TempService
tempservice
=
new
TempService
();
// set device properties
// Properties.getInstance().setDeviceProperty(device, Properties.PROP_DEVICE_UUID, "urn:uuid:df0794e0-40d5-11dc-9999-40f84sunspot" );
// add service to device
device
.
addService
(
service
);
device
.
addService
(
tempservice
);
// start device
try
{
device
.
start
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment