2017-09-25 16:56:53 -07:00
|
|
|
<p align="center">
|
2019-07-29 20:52:14 -07:00
|
|
|
<img src="https://github.com/eclipse/upm/blob/master/docs/icons/upm_logo.png" height="150px" width="auto" algt="UPM Logo"/>
|
2017-09-25 16:56:53 -07:00
|
|
|
</p>
|
|
|
|
|
2019-07-29 20:52:14 -07:00
|
|
|
Eclipse UPM Sensor and Actuator Repository
|
2014-04-30 15:47:12 +01:00
|
|
|
==============
|
2014-04-25 14:48:43 +01:00
|
|
|
|
2019-05-08 16:17:34 -07:00
|
|
|
The Eclipse UPM repository provides software drivers for a wide variety of
|
|
|
|
commonly used sensors and actuators. These software drivers interact with the
|
2016-05-06 12:00:53 -07:00
|
|
|
underlying hardware platform (or microcontroller), as well as with the attached
|
2019-07-29 20:52:14 -07:00
|
|
|
sensors, through calls to [Eclipse MRAA](https://github.com/eclipse/mraa) APIs.
|
2014-04-25 15:48:27 +01:00
|
|
|
|
2019-07-29 20:52:14 -07:00
|
|
|
Programmers can access the interfaces for each sensor by including the sensor's
|
2016-05-06 12:00:53 -07:00
|
|
|
corresponding header file and instantiating the associated sensor class. In the
|
|
|
|
typical use case, a constructor initializes the sensor based on parameters that
|
|
|
|
identify the sensor, the I/O protocol used and the pin location of the sensor.
|
2019-05-07 18:01:46 -07:00
|
|
|
As of UPM 2.0, sensor initialization can also be done, in most cases, via
|
|
|
|
overloaded constructors that accept string identifiers.
|
2014-04-25 15:48:27 +01:00
|
|
|
|
2017-06-11 13:23:31 -07:00
|
|
|
We endorse additions that implement the generic C and C++ interfaces provided
|
2019-05-07 18:01:46 -07:00
|
|
|
with the libraries. With the 2.0 release, UPM introduces the following sensor
|
2019-07-29 20:52:14 -07:00
|
|
|
interfaces:
|
|
|
|
```
|
|
|
|
iAcceleration, iAngle, iButton, iClock, iCollision, iDistance,
|
2019-05-07 18:01:46 -07:00
|
|
|
iDistanceInterrupter, iEC, iElectromagnet, iEmg, iGas, iGps, iGyroscope,
|
|
|
|
iHallEffect, iHeartRate, iHumidity, iLight, iLineFinder, iMagnetometer,
|
|
|
|
iMoisture, iMotion, iOrp, iPH, iPressure, iProximity, iTemperature, iVDiv,
|
|
|
|
iWater.
|
2019-07-29 20:52:14 -07:00
|
|
|
```
|
2019-05-07 18:01:46 -07:00
|
|
|
The developer community is invited to propose new interfaces for actuator types.
|
2016-01-06 15:49:16 -08:00
|
|
|
|
2019-05-07 18:01:46 -07:00
|
|
|
The UPM project is joining the Eclipse Foundation as an Eclipse IoT project.
|
|
|
|
You can read more about this [here](https://projects.eclipse.org/proposals/eclipse-upm).
|
2016-01-06 15:49:16 -08:00
|
|
|
|
2014-06-13 11:53:51 +01:00
|
|
|
### Example
|
|
|
|
|
2015-09-23 15:06:11 -07:00
|
|
|
A sensor/actuator is expected to work as such (here is the MMA7660 accelerometer API):
|
|
|
|
```C++
|
|
|
|
// Instantiate an MMA7660 on I2C bus 0
|
2017-04-04 13:31:25 -07:00
|
|
|
upm::MMA7660 *accel = new upm::MMA7660(MMA7660_DEFAULT_I2C_BUS,
|
2015-09-23 15:06:11 -07:00
|
|
|
MMA7660_DEFAULT_I2C_ADDR);
|
|
|
|
|
|
|
|
// place device in standby mode so we can write registers
|
|
|
|
accel->setModeStandby();
|
|
|
|
|
|
|
|
// enable 64 samples per second
|
2017-04-05 12:37:11 -06:00
|
|
|
accel->setSampleRate(MMA7660_AUTOSLEEP_64);
|
|
|
|
|
2015-09-23 15:06:11 -07:00
|
|
|
// place device into active mode
|
|
|
|
accel->setModeActive();
|
|
|
|
|
|
|
|
while (shouldRun)
|
|
|
|
{
|
|
|
|
float ax, ay, az;
|
2017-04-05 12:37:11 -06:00
|
|
|
|
2015-09-23 15:06:11 -07:00
|
|
|
accel->getAcceleration(&ax, &ay, &az);
|
2017-04-05 12:37:11 -06:00
|
|
|
cout << "Acceleration: x = " << ax
|
2015-09-23 15:06:11 -07:00
|
|
|
<< "g y = " << ay
|
|
|
|
<< "g z = " << az
|
|
|
|
<< "g" << endl;
|
2017-04-05 12:37:11 -06:00
|
|
|
|
2015-09-23 15:06:11 -07:00
|
|
|
usleep(500000);
|
|
|
|
}
|
|
|
|
```
|
2014-04-25 15:48:27 +01:00
|
|
|
|
2019-07-29 20:52:14 -07:00
|
|
|
Browse through the list of all [examples](https://github.com/eclipse/upm/tree/master/examples).
|
2014-08-29 15:37:11 +01:00
|
|
|
|
2019-07-29 20:52:14 -07:00
|
|
|
Multi-sensor samples for starter and specialized kits can be found in the
|
2015-06-04 15:16:25 -07:00
|
|
|
[iot-devkit-samples](https://github.com/intel-iot-devkit/iot-devkit-samples) repository.
|
|
|
|
|
2015-02-25 15:14:25 -08:00
|
|
|
### Supported Sensors
|
2014-08-29 15:37:11 +01:00
|
|
|
|
2015-02-25 15:14:25 -08:00
|
|
|
Supported [sensor list](http://iotdk.intel.com/docs/master/upm/modules.html) from API documentation.
|
2014-09-01 15:31:55 +01:00
|
|
|
|
2019-07-29 20:52:14 -07:00
|
|
|
### IDE Support and More
|
2015-05-05 17:49:06 -07:00
|
|
|
|
2019-07-29 20:52:14 -07:00
|
|
|
The UPM project includes support for multiple industrial-grade sensors, actuators, radios,
|
|
|
|
protocols and standards in use today. It is also highly integrated with the Eclipse IDE
|
|
|
|
through the help of the Foundation's partners.
|
|
|
|
Learn more about [tools](https://software.intel.com/en-us/tools-by-segment/systems-iot).
|
2017-09-25 16:56:53 -07:00
|
|
|
|
2017-02-02 17:32:43 -08:00
|
|
|
### Installing UPM
|
|
|
|
|
|
|
|
Find notes on how to install UPM on various OS'es on this [page](docs/installing.md).
|
|
|
|
|
2015-02-25 15:14:25 -08:00
|
|
|
### Building UPM
|
2014-08-29 15:37:11 +01:00
|
|
|
|
2015-09-23 15:06:11 -07:00
|
|
|
See building documentation [here](docs/building.md).
|
2014-08-29 15:37:11 +01:00
|
|
|
|
2016-08-30 12:44:30 -07:00
|
|
|
[](https://travis-ci.org/intel-iot-devkit/upm)
|
2019-07-29 20:52:14 -07:00
|
|
|
[](https://sonarcloud.io/dashboard?id=upm-master)
|
2015-12-15 18:46:20 +02:00
|
|
|
|
2017-02-09 16:45:48 -08:00
|
|
|
### Guidelines and rules for new UPM contributions
|
2014-06-13 11:53:51 +01:00
|
|
|
|
2015-09-23 15:06:11 -07:00
|
|
|
Before you begin development, take a look at our naming [conventions](docs/naming.md).
|
2017-02-09 16:45:48 -08:00
|
|
|
The name you pick for a newly added sensor needs to be unique in the UPM library.
|
2014-06-13 11:53:51 +01:00
|
|
|
|
2019-07-29 20:52:14 -07:00
|
|
|
Next, review the project's [contribution guide](docs/contributions.md).
|
|
|
|
|
2015-02-25 15:14:25 -08:00
|
|
|
Make sure you add yourself as an author on every new code file submitted.
|
|
|
|
If you are providing a fix with significant changes, feel free to add yourself
|
2019-07-29 20:52:14 -07:00
|
|
|
as a contributor. Signing-off your commits and accepting the ECA is mandatory
|
|
|
|
for making new contributions to this project.
|
2014-06-13 11:53:51 +01:00
|
|
|
|
2017-02-09 16:45:48 -08:00
|
|
|
Documenting your code is also a big part of the task. We have a strict set of
|
|
|
|
tags used to classify our sensors and their capabilities. You can find out more
|
|
|
|
about this in our [section](docs/documentation.md) on documenting a sensor API.
|
2019-07-29 20:52:14 -07:00
|
|
|
|
2017-02-09 16:45:48 -08:00
|
|
|
Finally, if you really want to ensure consistency with the rest of the library,
|
|
|
|
and the intel-iot-devkit repositories in general, take a look at our extensive
|
|
|
|
[author guide](docs/guidelines.md).
|
|
|
|
|
2015-06-03 10:33:46 -07:00
|
|
|
API Documentation
|
2015-02-25 15:14:25 -08:00
|
|
|
==============
|
2014-09-23 10:29:18 +01:00
|
|
|
|
2015-09-24 16:37:40 -07:00
|
|
|
<a href="http://iotdk.intel.com/docs/master/upm"><img src="docs/icons/c++.png"/></a>
|
2015-09-23 03:18:10 +03:00
|
|
|
<a href="http://iotdk.intel.com/docs/master/upm/java"><img src="docs/icons/java.png"/></a>
|
2015-06-29 14:00:57 -07:00
|
|
|
<a href="http://iotdk.intel.com/docs/master/upm/python"><img src="docs/icons/python.png"/></a>
|
|
|
|
<a href="http://iotdk.intel.com/docs/master/upm/node"><img src="docs/icons/node.png"/></a>
|
2015-06-03 10:33:46 -07:00
|
|
|
|
2016-04-05 17:02:31 -07:00
|
|
|
### API Compatibility
|
|
|
|
Even if we try our best not to, every once in a while we are forced to modify
|
|
|
|
our API in a way that will break backwards compatibility. If you find yourself
|
|
|
|
unable to compile code that was working fine before a library update, make sure
|
|
|
|
you check the [API changes](docs/apichanges.md) section first.
|
|
|
|
|
2015-09-24 17:00:37 -07:00
|
|
|
### Changelog
|
2015-09-23 15:06:11 -07:00
|
|
|
Version changelog [here](docs/changelog.md).
|
2015-05-06 15:20:02 -07:00
|
|
|
|
2015-09-24 17:00:37 -07:00
|
|
|
### Known Limitations
|
2015-09-23 15:06:11 -07:00
|
|
|
List of known limitations [here](docs/knownlimitations.md).
|