aboutsummaryrefslogtreecommitdiffstats
path: root/signal-composer-binding/signal.hpp
AgeCommit message (Collapse)AuthorFilesLines
2018-11-23Use specific binder's event handlersguppy_6.99.2guppy/6.99.26.99.2Romain Forlot1-1/+0
Use specific binder's event handlers which allows you to bind a callback with an incoming event based on a pattern matching. This replace the global event listener and internal callback search algorythm which is now delegated to the binder. Clean unused constructor Bug-AGL: SPEC-1968 Change-Id: I4b22c003661189fb71498efc4d9021c1a54ae866 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-07-31Returns error in request responseRomain Forlot1-3/+3
Returns error in request response instead of binder log when you try to get a signal value. Change-Id: I12809591801db5718aa4713034f2bb1801b6bf2d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-07-25Improved performanceRomain Forlot1-36/+9
Before value was translated to a C type variable two times, at the reception then at the emission. Now it just receives and sends the signal value without translation nor interpretation except if you ask for an average, minimum or maximum value. Then in those cases it interprets the json to return you a value or an error if there is no numeric values to compute. Remove unneeded log message at event reception. Improved signal search engine, will search in source's signals map by the signal ID not the event name which lead to a more direct map match. Bugs-AGL: SPEC-1612 Depends-On: I43e79ed73a507ac2ca7ed4cdc3f16ec009392194 Change-Id: Ie253c3fe1e8cde42dabe8832da74e9f9bf442c14 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-07-23Adds a signal's metadata attributeflounder_5.99.2flounder/5.99.25.99.2Romain Forlot1-2/+2
This adds a signal's metadata attribute which lets you store any kind and number of metadata attributes to your signal. These metadata are just reissued at the event emission without alteration. Special case of "unit" attribute which is kept as a signal attribute and not as a metadata because it is an intrinsic signal attribute that all signals should have. Bug-AGL: SPEC-1419 Change-Id: I531b4012ac9b22f312a4ccebc1a07a8d93129403 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-07-05Use Nanosecond precision by defaultRomain Forlot1-1/+1
This is the default precision returned by the kernel when calling get_clocktime(), so this avoid useless division to get a less precise time. Also signaling event should have this kind of precision to be able to correctly debugging system on signals heavy load. Change-Id: I010b98305cff7387787fd8f8a1e8a0f9107a170a Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-07-05Implement the signal's update default methodRomain Forlot1-0/+2
Adding != operator to Signal class This operator is needed to exclude signal inclusion in notify function and make possible to add a signal at last position Change-Id: I95f3434019383e52928c37f396aae938f2cfae05 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-07-05Fix wrong initializationRomain Forlot1-2/+2
boolean and numerical case initialized the same way. Change-Id: I274b5d898761c12f555ea59a178e363efe18f81d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-07-05Improve signal handlingRomain Forlot1-1/+2
- Fix memleak: RRelease the Signal JSON representation once used - Change equality condition between signals - Use a REALTIME clock to retrieve the timestamp if not provided by the signal. This is the most simple to date a signal and use that time for further usage. - Add a method to retrieve the last_timestamp value from a signal This with the commit from ctl-utilities submodule "8ff0fe3c454ea32ba383a3cfa9c4e91237d6c494" fixes the issue. Change-Id: Ifed66796f92d789c80f10b161318f6bef788dda7 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-07-05Use signal subscription args if presentRomain Forlot1-0/+1
By default subscription argument request from signal are passed if present, else the one from the signal's source if present. If nothing is specified for sources then argument is set as a NULL pointer. Change-Id: I18db0a9922039f41d475cd08758a2afd4acaa9d4 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-03-22Add undefined value possibility in signal valuesRomain Forlot1-5/+6
By default, signal value are initialized to 0 which isn't acceptable to be accurate and be able to calculate virtual signals values as result would be false. Change-Id: I8ec40d8dcb9ce1fae42aeec9fb48369f0914fd9f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-12-14Use value instead of pointer for a memberRomain Forlot1-13/+14
no reason to keep it as pointer, and simpler to initiaze it at construction time. Change-Id: I0aee4483c834e66651d80998de81c99799451ff5 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-12-14Hold all contexts (plugin & source) in signalCtx_Romain Forlot1-0/+2
Keeping persistence between call data are kept in that member also subscription Action now use getSignals_ context and no more the signal one, this is more accurate and simples Change-Id: Idd7c56ba30f1daa9eaf9b99a7261d58189ef0bb2 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-12-14Migrate to ctl-utilities libraryRomain Forlot1-2/+3
New version of controller as a library. Loading additionnals files from each sections. Change-Id: I4f5e78d0baf9650cb8d1cc1da26f8e1fd73b792c Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-12-14LUA lib and bin embedded in projectRomain Forlot1-1/+19
Change-Id: I1a61b49f55e4daa305800e754a14b6041aa81b34 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-12-14Add default receive actionRomain Forlot1-0/+2
Change-Id: Icc23f135d4e65d6de131a60b978677e549738d78 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-12-14Inheritance of some signals parameters from sourceRomain Forlot1-0/+2
Stores sourceAPI as shared_ptr too. Change-Id: I2dcd919b3053f29812a9bece14feb4f620f23ce3 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-12-14Introduce retention setting in place of classRomain Forlot1-5/+6
Be able to tweak retention value for each signal in seconds Change-Id: I1cabe48a2660cdeb2e9b32b277e7c819c6b49bd9 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-12-14lua2c completely operationnalRomain Forlot1-0/+5
- Retrieve args from lua call correctly - Correctly push and set function pointer into plugin symbols Change-Id: I12d03e1101c458a042887a67a35a08082bd98f4c Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-12-14Enhance pointer manage and container browsingRomain Forlot1-10/+10
- SourceAPI now holds share_ptr of Signal - Signal are stored in a map<string,signal> that change way to browse the signals - subscribed property included in SourceAPI. - Clean old code - renaming struct SignalValue->signalValue Change-Id: Ic5c28296ddd7197c6562e12fbc91c504c1cc0b4d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-12-14Implement recursionCheck using observer patternRomain Forlot1-0/+9
Change-Id: Ic404c098f316106abe1918c3cd100ae047f4f555 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-12-14Migrating to real Observer design pattern usageRomain Forlot1-9/+11
Change-Id: I2fa4e1dc81f5dff852e619a425b8caf26b94b55a Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-12-14Rename bindingApp to ComposerRomain Forlot1-2/+2
Change-Id: Ib3256f5c89197a91d2bbfca7a92774e91de6f664 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-12-14Make LUA worksRomain Forlot1-3/+4
- Added LUA library at link - Make app-template crash build if a checked file fails - Fix old defined variable CONTROL_LUA_PATH to a default one in the binding data directory - Add an example with unit conversion made in LUA Change-Id: I1b4712bde32a38044ad6b14ebd38b6782fd01fe9 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-12-14Modification about conf definitionRomain Forlot1-2/+6
- Argument for each signal subscription. (getSignalsArgs) - differentiation between Signal as raw signal from another API and virtual signal depending upon other signals - changing way to specify function with uri that specify everythings that could be needed to invoke a function. Change-Id: I8917c5ae3c2c1e3fa48ddfdda41fc75eaba32bb7 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-12-14Return mathematical value on a period if askedRomain Forlot1-2/+2
Change-Id: I40799d054e56b3ae9462963d317d8fb458a21122 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-12-14Match signal if name found in source signal.Romain Forlot1-0/+1
Change-Id: Ia080cddac3973998a2dc8f8a143489298d6c8504 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-12-14Get CPP controller plugin worksRomain Forlot1-5/+14
Context passing variables not working well Change-Id: Ibc67bef353e5cc2e53ef9e5579d106baab92a604 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-12-14Adding new verb, implemented basic signal methodRomain Forlot1-4/+4
Change-Id: I453ddc0ca374436275e7d76cdc27b3d843a2770f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-12-14Subscription by plugin to signalsRomain Forlot1-3/+4
Change-Id: Icb923f87df2be8eb664106bc9077b3a8221dd3ce Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-12-14Attach and recursion check workingRomain Forlot1-17/+20
Change-Id: I2f9509d4b6aa63a16df8db2187810337fd802ef4 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-12-14Progression on config parsing.Romain Forlot1-16/+28
Change-Id: Idd8d8987ccabef381f6d79c1d508930a2d4bae3c Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-12-14Controller src integrationRomain Forlot1-0/+46
Change-Id: I0b18cd55057a784d183a5ba02c332810a34d1fca Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>