
Own fork of MbedSmartRestMain
Dependencies: C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed
Fork of MbedSmartRestMain by
operation/OperationExecutor.cpp@62:86a04c5bda18, 2014-10-29 (annotated)
- Committer:
- vwochnik
- Date:
- Wed Oct 29 21:09:29 2014 +0000
- Revision:
- 62:86a04c5bda18
- Child:
- 63:010bbbb4732a
introduced operation store
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
vwochnik | 62:86a04c5bda18 | 1 | #include "OperationExecutor.h" |
vwochnik | 62:86a04c5bda18 | 2 | #include "ComposedRecord.h" |
vwochnik | 62:86a04c5bda18 | 3 | #include "CharValue.h" |
vwochnik | 62:86a04c5bda18 | 4 | #include "IntegerValue.h" |
vwochnik | 62:86a04c5bda18 | 5 | |
vwochnik | 62:86a04c5bda18 | 6 | OperationExecutor::OperationExecutor(AbstractSmartRest& client, SmartRestTemplate& tpl, long& deviceId) : |
vwochnik | 62:86a04c5bda18 | 7 | _client(client), |
vwochnik | 62:86a04c5bda18 | 8 | _tpl(tpl), |
vwochnik | 62:86a04c5bda18 | 9 | _deviceId(deviceId) |
vwochnik | 62:86a04c5bda18 | 10 | { |
vwochnik | 62:86a04c5bda18 | 11 | _init = false; |
vwochnik | 62:86a04c5bda18 | 12 | } |
vwochnik | 62:86a04c5bda18 | 13 | |
vwochnik | 62:86a04c5bda18 | 14 | bool OperationExecutor::init() |
vwochnik | 62:86a04c5bda18 | 15 | { |
vwochnik | 62:86a04c5bda18 | 16 | if (_init) |
vwochnik | 62:86a04c5bda18 | 17 | return false; |
vwochnik | 62:86a04c5bda18 | 18 | |
vwochnik | 62:86a04c5bda18 | 19 | // Get operation |
vwochnik | 62:86a04c5bda18 | 20 | // USAGE: 110,<OPERATION/ID>,<STATE> |
vwochnik | 62:86a04c5bda18 | 21 | if (!_tpl.add("10,112,GET,/devicecontrol/operations/%%,,application/vnd.com.nsn.cumulocity.operation+json,%%,UNSIGNED,\r\n")) |
vwochnik | 62:86a04c5bda18 | 22 | return false; |
vwochnik | 62:86a04c5bda18 | 23 | |
vwochnik | 62:86a04c5bda18 | 24 | _init = true; |
vwochnik | 62:86a04c5bda18 | 25 | return true; |
vwochnik | 62:86a04c5bda18 | 26 | } |
vwochnik | 62:86a04c5bda18 | 27 | |
vwochnik | 62:86a04c5bda18 | 28 | bool OperationExecutor::executeOperation(OperationStore::Operation& op) |
vwochnik | 62:86a04c5bda18 | 29 | { |
vwochnik | 62:86a04c5bda18 | 30 | } |