wt5001: Added functions that throw exceptions when failing to read from sensors. Added java exception handling, and modified examples.
Signed-off-by: Stefan Andritoiu <stefan.andritoiu@intel.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
committed by
Mihai Tudor Panu
parent
7f7fdb8441
commit
fcb36276b7
@@ -292,6 +292,14 @@ namespace upm {
|
||||
*/
|
||||
bool getVolume(uint8_t *vol);
|
||||
|
||||
/**
|
||||
* Gets the current volume
|
||||
*
|
||||
* @return Volume
|
||||
* @throws std::runtime_error if reading from the sensor failed
|
||||
*/
|
||||
uint8_t getVolume();
|
||||
|
||||
/**
|
||||
* Gets the current play state: 1 = playing, 2 = stopped, 3 = paused
|
||||
*
|
||||
@@ -300,6 +308,14 @@ namespace upm {
|
||||
*/
|
||||
bool getPlayState(uint8_t *ps);
|
||||
|
||||
/**
|
||||
* Gets the current play state: 1 = playing, 2 = stopped, 3 = paused
|
||||
*
|
||||
* @return Play state
|
||||
* @throws std::runtime_error if reading from the sensor failed
|
||||
*/
|
||||
uint8_t getPlayState();
|
||||
|
||||
/**
|
||||
* Gets the number of files present on the source device
|
||||
*
|
||||
@@ -309,6 +325,15 @@ namespace upm {
|
||||
*/
|
||||
bool getNumFiles(WT5001_PLAYSOURCE_T psrc, uint16_t *numf);
|
||||
|
||||
/**
|
||||
* Gets the number of files present on the source device
|
||||
*
|
||||
* @param psrc Storage source
|
||||
* @return Number of files
|
||||
* @throws std::runtime_error if reading from the sensor failed
|
||||
*/
|
||||
uint16_t getNumFiles(WT5001_PLAYSOURCE_T psrc);
|
||||
|
||||
/**
|
||||
* Gets the index of the current file
|
||||
*
|
||||
@@ -317,6 +342,14 @@ namespace upm {
|
||||
*/
|
||||
bool getCurrentFile(uint16_t *curf);
|
||||
|
||||
/**
|
||||
* Gets the index of the current file
|
||||
*
|
||||
* @return Index of the curretn file
|
||||
* @throws std::runtime_error if reading from the sensor failed
|
||||
*/
|
||||
uint16_t getCurrentFile();
|
||||
|
||||
/**
|
||||
* Gets the device date
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user