Skip to content

Commit

Permalink
"New build based on revison 33636"
Browse files Browse the repository at this point in the history
  • Loading branch information
yoctopuce committed Dec 10, 2018
1 parent 0701309 commit b4fe67d
Show file tree
Hide file tree
Showing 10 changed files with 282 additions and 233 deletions.
Binary file modified Binaries/osx32/objs/yapi_dyn.o
Binary file not shown.
Binary file modified Binaries/osx32/objs/yprog_dyn.o
Binary file not shown.
157 changes: 79 additions & 78 deletions Documentation/yoctolib-cpp-EN.html

Large diffs are not rendered by default.

153 changes: 77 additions & 76 deletions Documentation/yoctolib-cpp-FR.html

Large diffs are not rendered by default.

140 changes: 70 additions & 70 deletions FILES.txt

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions RELEASE.txt
@@ -1,4 +1,3 @@
CPP v1.10.33576
CPP v1.10.33636

- Fix missing measure in YDataSet
- Improve disconnection detection of YoctoHubs/VirtualHub.
- Add support for data logger usage attribute
4 changes: 2 additions & 2 deletions Sources/yapi/yapi.c
@@ -1,6 +1,6 @@
/*********************************************************************
*
* $Id: yapi.c 33576 2018-12-07 08:13:18Z seb $
* $Id: yapi.c 33615 2018-12-10 08:12:08Z seb $
*
* Implementation of public entry points to the low-level API
*
Expand Down Expand Up @@ -1677,7 +1677,7 @@ static int yNetHubEnum(HubSt* hub, int forceupdate, char* errmsg)
// the hub send ping notification -> we can rely on helperthread status
res = yNetHubEnumEx(hub, &enus, errmsg);
if (YISERR(res)) {
dbglog("error with hub %s : %s",hub->name,errmsg);
dbglog("error with hub %s : %s\n",hub->name,errmsg);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/yapi/yversion.h
@@ -1,7 +1,7 @@
#ifndef YOCTO_API_BUILD_NO
#define YOCTO_API_BUILD_NO "33576"
#define YOCTO_API_BUILD_NO "33636"
#endif
#define YBUILD_33576
#define YBUILD_33636

#ifndef YOCTO_API_BUILD_DATE
#ifndef RC_INVOKED
Expand Down
35 changes: 34 additions & 1 deletion Sources/yocto_api.cpp
@@ -1,6 +1,6 @@
/*********************************************************************
*
* $Id: yocto_api.cpp 33505 2018-12-05 14:45:46Z seb $
* $Id: yocto_api.cpp 33601 2018-12-09 14:30:31Z mvuilleu $
*
* High-level programming interface, common to all modules
*
Expand Down Expand Up @@ -8635,6 +8635,7 @@ YDataLogger::YDataLogger(const string& func): YFunction(func)
,_recording(RECORDING_INVALID)
,_autoStart(AUTOSTART_INVALID)
,_beaconDriven(BEACONDRIVEN_INVALID)
,_usage(USAGE_INVALID)
,_clearHistory(CLEARHISTORY_INVALID)
,_valueCallbackDataLogger(NULL)
//--- (end of generated code: YDataLogger initialization)
Expand Down Expand Up @@ -8669,6 +8670,9 @@ int YDataLogger::_parseAttr(YJSONObject* json_val)
if(json_val->has("beaconDriven")) {
_beaconDriven = (Y_BEACONDRIVEN_enum)json_val->getInt("beaconDriven");
}
if(json_val->has("usage")) {
_usage = json_val->getInt("usage");
}
if(json_val->has("clearHistory")) {
_clearHistory = (Y_CLEARHISTORY_enum)json_val->getInt("clearHistory");
}
Expand Down Expand Up @@ -8933,6 +8937,35 @@ int YDataLogger::set_beaconDriven(Y_BEACONDRIVEN_enum newval)
return res;
}

/**
* Returns the percentage of datalogger memory in use.
*
* @return an integer corresponding to the percentage of datalogger memory in use
*
* On failure, throws an exception or returns Y_USAGE_INVALID.
*/
int YDataLogger::get_usage(void)
{
int res = 0;
yEnterCriticalSection(&_this_cs);
try {
if (_cacheExpiration <= YAPI::GetTickCount()) {
if (this->_load_unsafe(YAPI::_yapiContext.GetCacheValidity()) != YAPI_SUCCESS) {
{
yLeaveCriticalSection(&_this_cs);
return YDataLogger::USAGE_INVALID;
}
}
}
res = _usage;
} catch (std::exception) {
yLeaveCriticalSection(&_this_cs);
throw;
}
yLeaveCriticalSection(&_this_cs);
return res;
}

Y_CLEARHISTORY_enum YDataLogger::get_clearHistory(void)
{
Y_CLEARHISTORY_enum res;
Expand Down
17 changes: 16 additions & 1 deletion Sources/yocto_api.h
@@ -1,6 +1,6 @@
/*********************************************************************
*
* $Id: yocto_api.h 33499 2018-12-04 14:53:08Z seb $
* $Id: yocto_api.h 33601 2018-12-09 14:30:31Z mvuilleu $
*
* High-level programming interface, common to all modules
*
Expand Down Expand Up @@ -201,6 +201,7 @@ typedef enum {
#endif
#define Y_CURRENTRUNINDEX_INVALID (YAPI_INVALID_UINT)
#define Y_TIMEUTC_INVALID (YAPI_INVALID_LONG)
#define Y_USAGE_INVALID (YAPI_INVALID_UINT)
//--- (end of generated code: YDataLogger definitions)


Expand Down Expand Up @@ -3828,6 +3829,7 @@ class YOCTO_CLASS_EXPORT YDataLogger: public YFunction {
Y_RECORDING_enum _recording;
Y_AUTOSTART_enum _autoStart;
Y_BEACONDRIVEN_enum _beaconDriven;
int _usage;
Y_CLEARHISTORY_enum _clearHistory;
YDataLoggerValueCallback _valueCallbackDataLogger;

Expand Down Expand Up @@ -3867,6 +3869,7 @@ class YOCTO_CLASS_EXPORT YDataLogger: public YFunction {
static const Y_BEACONDRIVEN_enum BEACONDRIVEN_OFF = Y_BEACONDRIVEN_OFF;
static const Y_BEACONDRIVEN_enum BEACONDRIVEN_ON = Y_BEACONDRIVEN_ON;
static const Y_BEACONDRIVEN_enum BEACONDRIVEN_INVALID = Y_BEACONDRIVEN_INVALID;
static const int USAGE_INVALID = YAPI_INVALID_UINT;
static const Y_CLEARHISTORY_enum CLEARHISTORY_FALSE = Y_CLEARHISTORY_FALSE;
static const Y_CLEARHISTORY_enum CLEARHISTORY_TRUE = Y_CLEARHISTORY_TRUE;
static const Y_CLEARHISTORY_enum CLEARHISTORY_INVALID = Y_CLEARHISTORY_INVALID;
Expand Down Expand Up @@ -3995,6 +3998,18 @@ class YOCTO_CLASS_EXPORT YDataLogger: public YFunction {
inline int setBeaconDriven(Y_BEACONDRIVEN_enum newval)
{ return this->set_beaconDriven(newval); }

/**
* Returns the percentage of datalogger memory in use.
*
* @return an integer corresponding to the percentage of datalogger memory in use
*
* On failure, throws an exception or returns Y_USAGE_INVALID.
*/
int get_usage(void);

inline int usage(void)
{ return this->get_usage(); }

Y_CLEARHISTORY_enum get_clearHistory(void);

inline Y_CLEARHISTORY_enum clearHistory(void)
Expand Down

0 comments on commit b4fe67d

Please sign in to comment.