summaryrefslogtreecommitdiffstats
path: root/example
Commit message (Collapse)AuthorAgeFilesLines
* serialization: Add cereal support for tuplesBrad Bishop2019-04-121-0/+5
| | | | | | | | Add cereal/types/tuple.hpp to our pimgen generated serialization code so we can serialize xyz.openbmc_project.Association.Definitions Change-Id: I0fff8eb7c07cbc427aeb6dd65c557b773a9592c2 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* serialization: use the same inflection as sdbus++Brad Bishop2019-04-121-0/+4
| | | | | | | | | | | | | | When generating code sdbus++ uses python inflection to normalize names. Use the sdbus++ module that does this when we generate the code that calls methods in code generated by sdbus++. This avoids build failures like: gen_serialization.hpp:22:68: error: ‘const class sdbusplus::xyz::openbmc_project::Example::server::Iface2’ has no member named ‘example_Property4’; did you mean ‘exampleProperty4’? Change-Id: I4b6dbb1f977465ea176f27d021ed2633ae40c37b Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Generate functor to read a propertyMatthew Barth2018-10-231-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given the dbus member class for an interface and property hosted by inventory manager, generate the getProperty functor for retrieving that property from inventory. This ability is only supported when using the `PropertyIs` functor to compare a property within inventory to a given value before triggering an action. Example yaml: filters: - name: propertyIs service: xyz.openbmc_project.Inventory.Manager path: /system/chassis interface: xyz.openbmc_project.Inventory.Decorator.CoolingType property: WaterCooled value: value: true type: boolean dbusMember: "sdbusplus::xyz::openbmc_project::Inventory::\ Decorator::server::CoolingType" Generates: make_filter(functor::propertyIs( "/system/chassis", "xyz.openbmc_project.Inventory.Decorator.CoolingType", "WaterCooled", true, "xyz.openbmc_project.Inventory.Manager", make_get_property<> ( functor::getProperty<sdbusplus::xyz::openbmc_project:: Inventory::Decorator::server::CoolingType> ( "/system/chassis", "xyz.openbmc_project.Inventory.Decorator.CoolingType", &sdbusplus::xyz::openbmc_project::Inventory:: Decorator::server::CoolingType::getPropertyByName, "WaterCooled" ) ) )) Tested: Code generated as expected with service name given Code generated as expected without service name given Resolves: openbmc/phosphor-inventory-manager#1 Change-Id: I5600854a1b0b9ce3e1511d3bcd9a452d6b1107ba Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Add support for type-only interfacesMarri Devender Rao2017-09-291-0/+4
| | | | | | | | | | Modify Maker template for type-only interfaces that do not have properties. Resolves openbmc/openbmc#1786 Change-Id: I2c48b37cf273943a0c696f6b92db0bc901a1c9b4 Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
* pimgen: Remove interfaces.dBrad Bishop2017-02-151-5/+0
| | | | | | | | | | Obtain the information encoded in this file via scanning the filesystem for interface files. Add an interfaces-dir option to specify the filesystem path to scan. Change-Id: I7f5220b515a012d6c6e504f54e4fcb324e6f1f87 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>wip
* Add path conditionsBrad Bishop2017-02-152-0/+73
| | | | | | | | | Add support to setProperty and destroyObject to conditionally perform their action based on the result of a condition testing functor. Change-Id: I67ded31f4a7ee0f7a29bb6edc06ebf9249cdc070 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* setProperty: Allow multiple objectsBrad Bishop2017-02-151-1/+2
| | | | | | | Allow multiple objects when using the setProperty action. Change-Id: Ie65b9abee6240d6a6541b9778d4bf776010f865d Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Improve example descriptionsBrad Bishop2017-02-023-7/+15
| | | | | | | | These were all labeled: Example Match - improve the description slightly. Change-Id: I1ec78c6512fb66423193b5ce0f42b0fc41cdcc45 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add support for application startup events.Brad Bishop2017-02-021-0/+13
| | | | | | | | Allow clients to specify filters and actions that trigger on application startup. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: Ib36c5bab778d7c87906dd3f61a3a6e033c7ccde1
* Add support for createObjects actionBrad Bishop2017-02-011-1/+46
| | | | | Change-Id: I999a5e506a236eac8ca0944b0e2b003c57612e54 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add propertyIs filterBrad Bishop2017-01-311-0/+32
| | | | | | | | | | | The existing property match filter tests a property in the PropertiesChanged signal payload. Add a match filter that tests any arbitrary property on any object. Change-Id: I1c238c03a3ccbf45f7b338693a4342fbd4f670c2 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Fix hardcoded string in propertyChangedToBrad Bishop2017-01-312-2/+29
| | | | | | | | | | Prior to this change this template will not build with types other than strings. Add an example that tests this. Change-Id: I71e5c4136e7e4fd52fea3e8e027e42634011d630 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* test: Move trigger objects to dedicated threadBrad Bishop2017-01-312-4/+4
| | | | | | | | | Put the trigger object in its own thread rather than the inventory manager thread. This allows the thread under test to make calls to it. Change-Id: I181d2d46a10e4193653df61205ac3380a1d4db2e Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Allow multiple objects to be destroyedBrad Bishop2017-01-311-4/+4
| | | | | | | | Enhance the destroyObject action to take an array rather than a single path. Change-Id: Ic1de7274afc253042b590c71ca200618a6ff54d2 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* pimgen: Switch to new Mako templatesBrad Bishop2017-01-242-23/+18
| | | | | | | | | | | | | | | | | | | | | A substantial structural update to pimgen. The existing template and supporting code is difficult to enhance. Given that the code being generated by pimgen is primarily a large map, with map elements being initialized by simple types, initializers lists or the result of method calls - structure pimgen types in a way that track these givens. yaml: Simplify the yaml structures. MethodCall: become an argument. Mako: Simplify main template. Use new convenience types. Use new decorator types. Remove unused function throughout. Change-Id: I1c3c16776ef8d5d7e005142999817e0371f9ce89 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add a testcase for setPropertyBrad Bishop2017-01-121-3/+14
| | | | | Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: Ifade8963ebc8d18dbdca46ece16800cf8ea8a6ad
* pimgen: Add support for setPropertyBrad Bishop2017-01-121-1/+8
| | | | | | | Add code generation support for setProperty actions. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: Id367f6da075035824c8f2ae6302505ef625a629a
* Add a testcase for destroyObjectBrad Bishop2017-01-121-7/+12
| | | | | | | | | | Validate that: -Dbus signal callbacks are established. -The propertyChangedTo filter works correctly. -The destroyObject action works correctly. Change-Id: I0981fed76aa26ff275a401ae81fd230833dfc4cc Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Rewrite pimgen in the image of sdbus++Brad Bishop2017-01-122-19/+23
| | | | | | | | | | | Almost complete rewrite of pimgen and the mako template. Adopt the sdbus++ application structure. The hope is that this will encourage additional sdbusplus features deemed general purpose enough for reuse with other applications. Change-Id: I007ff9f5fc9a64f0465159bd1301475ada139d55 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* React to sdbus++ updatesBrad Bishop2016-11-222-2/+2
| | | | | | | | Update example interfaces to use non language specific type specifiers. React to namespace shuffling in sdbusplus 7aa8a1e2e. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: Ib0688056d6fcfbe298d8a24ae9df604cd05fa620
* pimgen: Enable multiple interface filesBrad Bishop2016-11-211-1/+1
| | | | | | | | | Allow more than one interface file and put declared interface yaml files in interfaces.d, to draw attention to the intent is for packages to install their interface requirements there. Change-Id: Iab0d85eca7c5c3370978dc692d6ab8807108a2f7 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* pimgen: Rename interfaces to extra_interfaces.dBrad Bishop2016-11-212-0/+0
| | | | | | | | | | Draw attention to the intent is that other packages install files here. Additionally these are 'extra' in that they are above and beyond the standard OpenBMC interfaces that will eventually be provided by a shared library. Change-Id: I8e50d39a1004ff24b1ea7de63e6534447c05a9d3 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* pimgen: Move events to events.dBrad Bishop2016-11-212-0/+0
| | | | | | | | Draw attention to the intent is that other packages install files here. Change-Id: I0a6fbe86a16f39f4bb71a0bea367ec3508b14369 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add brief description to example interfacesBrad Bishop2016-11-121-0/+3
| | | | | Change-Id: I69ab3de21da08e320bccd122d1f194691784e7fd Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add example interfacesBrad Bishop2016-11-084-3/+23
| | | | | | | | Add example interfaces for testing. Add a script that generates sdbusplus bindings for example interfaces. Change-Id: I683ce9dca74d827d226833ed8a56f87243914e04 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Move examples->example/eventsBrad Bishop2016-11-082-0/+40
Change-Id: I072cd37217f982fa45d6fae7f1ebebdabe1a7800 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
OpenPOWER on IntegriCloud