Skip to content

Commit

Permalink
Merge branch 'next' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
kschrief authored Apr 2, 2024
2 parents 2ca3e70 + ef3fc8c commit 23bc305
Show file tree
Hide file tree
Showing 552 changed files with 10,943 additions and 318 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ node_modules/*
.DS_Store
.DS_Store
coverage
.vscode/settings.json
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# [3.0.0-next.1](https://github.com/rdkcentral/firebolt-openrpc/compare/v2.3.0-next.1...v3.0.0-next.1) (2024-03-26)


* Integration of CPPSDK support (#176) ([89294cc](https://github.com/rdkcentral/firebolt-openrpc/commit/89294cc37f23a94012621130858e01c946a3a9a6)), closes [#176](https://github.com/rdkcentral/firebolt-openrpc/issues/176) [#90](https://github.com/rdkcentral/firebolt-openrpc/issues/90) [#93](https://github.com/rdkcentral/firebolt-openrpc/issues/93) [#94](https://github.com/rdkcentral/firebolt-openrpc/issues/94) [#96](https://github.com/rdkcentral/firebolt-openrpc/issues/96) [#97](https://github.com/rdkcentral/firebolt-openrpc/issues/97) [#100](https://github.com/rdkcentral/firebolt-openrpc/issues/100) [#99](https://github.com/rdkcentral/firebolt-openrpc/issues/99) [#101](https://github.com/rdkcentral/firebolt-openrpc/issues/101) [#102](https://github.com/rdkcentral/firebolt-openrpc/issues/102) [#107](https://github.com/rdkcentral/firebolt-openrpc/issues/107) [#106](https://github.com/rdkcentral/firebolt-openrpc/issues/106) [#105](https://github.com/rdkcentral/firebolt-openrpc/issues/105) [#103](https://github.com/rdkcentral/firebolt-openrpc/issues/103) [#109](https://github.com/rdkcentral/firebolt-openrpc/issues/109) [#112](https://github.com/rdkcentral/firebolt-openrpc/issues/112) [#111](https://github.com/rdkcentral/firebolt-openrpc/issues/111) [#113](https://github.com/rdkcentral/firebolt-openrpc/issues/113) [#114](https://github.com/rdkcentral/firebolt-openrpc/issues/114) [#115](https://github.com/rdkcentral/firebolt-openrpc/issues/115) [#110](https://github.com/rdkcentral/firebolt-openrpc/issues/110) [#90](https://github.com/rdkcentral/firebolt-openrpc/issues/90) [#93](https://github.com/rdkcentral/firebolt-openrpc/issues/93) [#94](https://github.com/rdkcentral/firebolt-openrpc/issues/94) [#96](https://github.com/rdkcentral/firebolt-openrpc/issues/96) [#97](https://github.com/rdkcentral/firebolt-openrpc/issues/97) [#100](https://github.com/rdkcentral/firebolt-openrpc/issues/100) [#99](https://github.com/rdkcentral/firebolt-openrpc/issues/99) [#101](https://github.com/rdkcentral/firebolt-openrpc/issues/101) [#102](https://github.com/rdkcentral/firebolt-openrpc/issues/102) [#107](https://github.com/rdkcentral/firebolt-openrpc/issues/107) [#106](https://github.com/rdkcentral/firebolt-openrpc/issues/106) [#105](https://github.com/rdkcentral/firebolt-openrpc/issues/105) [#103](https://github.com/rdkcentral/firebolt-openrpc/issues/103) [#109](https://github.com/rdkcentral/firebolt-openrpc/issues/109) [#112](https://github.com/rdkcentral/firebolt-openrpc/issues/112) [#111](https://github.com/rdkcentral/firebolt-openrpc/issues/111) [#113](https://github.com/rdkcentral/firebolt-openrpc/issues/113) [#114](https://github.com/rdkcentral/firebolt-openrpc/issues/114) [#115](https://github.com/rdkcentral/firebolt-openrpc/issues/115) [#110](https://github.com/rdkcentral/firebolt-openrpc/issues/110) [#117](https://github.com/rdkcentral/firebolt-openrpc/issues/117) [#116](https://github.com/rdkcentral/firebolt-openrpc/issues/116) [#118](https://github.com/rdkcentral/firebolt-openrpc/issues/118) [#121](https://github.com/rdkcentral/firebolt-openrpc/issues/121) [#119](https://github.com/rdkcentral/firebolt-openrpc/issues/119) [#90](https://github.com/rdkcentral/firebolt-openrpc/issues/90) [#93](https://github.com/rdkcentral/firebolt-openrpc/issues/93) [#94](https://github.com/rdkcentral/firebolt-openrpc/issues/94) [#96](https://github.com/rdkcentral/firebolt-openrpc/issues/96) [#97](https://github.com/rdkcentral/firebolt-openrpc/issues/97) [#100](https://github.com/rdkcentral/firebolt-openrpc/issues/100) [#99](https://github.com/rdkcentral/firebolt-openrpc/issues/99) [#101](https://github.com/rdkcentral/firebolt-openrpc/issues/101) [#102](https://github.com/rdkcentral/firebolt-openrpc/issues/102) [#107](https://github.com/rdkcentral/firebolt-openrpc/issues/107) [#106](https://github.com/rdkcentral/firebolt-openrpc/issues/106) [#105](https://github.com/rdkcentral/firebolt-openrpc/issues/105) [#103](https://github.com/rdkcentral/firebolt-openrpc/issues/103) [#109](https://github.com/rdkcentral/firebolt-openrpc/issues/109) [#112](https://github.com/rdkcentral/firebolt-openrpc/issues/112) [#111](https://github.com/rdkcentral/firebolt-openrpc/issues/111) [#113](https://github.com/rdkcentral/firebolt-openrpc/issues/113) [#114](https://github.com/rdkcentral/firebolt-openrpc/issues/114) [#115](https://github.com/rdkcentral/firebolt-openrpc/issues/115) [#110](https://github.com/rdkcentral/firebolt-openrpc/issues/110) [#117](https://github.com/rdkcentral/firebolt-openrpc/issues/117) [#116](https://github.com/rdkcentral/firebolt-openrpc/issues/116) [#118](https://github.com/rdkcentral/firebolt-openrpc/issues/118) [#121](https://github.com/rdkcentral/firebolt-openrpc/issues/121) [#119](https://github.com/rdkcentral/firebolt-openrpc/issues/119) [#127](https://github.com/rdkcentral/firebolt-openrpc/issues/127) [#137](https://github.com/rdkcentral/firebolt-openrpc/issues/137) [#135](https://github.com/rdkcentral/firebolt-openrpc/issues/135) [#134](https://github.com/rdkcentral/firebolt-openrpc/issues/134) [#136](https://github.com/rdkcentral/firebolt-openrpc/issues/136) [#139](https://github.com/rdkcentral/firebolt-openrpc/issues/139) [#138](https://github.com/rdkcentral/firebolt-openrpc/issues/138) [#140](https://github.com/rdkcentral/firebolt-openrpc/issues/140) [#142](https://github.com/rdkcentral/firebolt-openrpc/issues/142) [#144](https://github.com/rdkcentral/firebolt-openrpc/issues/144) [#145](https://github.com/rdkcentral/firebolt-openrpc/issues/145) [#141](https://github.com/rdkcentral/firebolt-openrpc/issues/141) [#149](https://github.com/rdkcentral/firebolt-openrpc/issues/149) [#150](https://github.com/rdkcentral/firebolt-openrpc/issues/150) [#152](https://github.com/rdkcentral/firebolt-openrpc/issues/152) [#151](https://github.com/rdkcentral/firebolt-openrpc/issues/151) [#153](https://github.com/rdkcentral/firebolt-openrpc/issues/153) [#154](https://github.com/rdkcentral/firebolt-openrpc/issues/154) [#156](https://github.com/rdkcentral/firebolt-openrpc/issues/156) [#157](https://github.com/rdkcentral/firebolt-openrpc/issues/157) [#158](https://github.com/rdkcentral/firebolt-openrpc/issues/158) [#160](https://github.com/rdkcentral/firebolt-openrpc/issues/160) [#159](https://github.com/rdkcentral/firebolt-openrpc/issues/159) [#161](https://github.com/rdkcentral/firebolt-openrpc/issues/161) [#163](https://github.com/rdkcentral/firebolt-openrpc/issues/163) [#164](https://github.com/rdkcentral/firebolt-openrpc/issues/164) [#165](https://github.com/rdkcentral/firebolt-openrpc/issues/165) [#167](https://github.com/rdkcentral/firebolt-openrpc/issues/167) [#169](https://github.com/rdkcentral/firebolt-openrpc/issues/169) [#171](https://github.com/rdkcentral/firebolt-openrpc/issues/171) [#173](https://github.com/rdkcentral/firebolt-openrpc/issues/173) [#172](https://github.com/rdkcentral/firebolt-openrpc/issues/172) [#170](https://github.com/rdkcentral/firebolt-openrpc/issues/170)


### BREAKING CHANGES

* Generalized templating engine to support both JavaScript and CPP (and other languages).

* chore: Copy JS templates to C and create language.config.json

* feat(languages): Add support for a distinct JSON-type for each schema

Also started tweaking C templates and adding a few useful macros.

* chore: Dropped debug logs

* fix: Stop passing non-schemas in to getSchemaType

* feat(accessors): New macro section for schema property accessors

# [2.3.0-next.1](https://github.com/rdkcentral/firebolt-openrpc/compare/v2.2.0...v2.3.0-next.1) (2024-01-12)


Expand Down
27 changes: 27 additions & 0 deletions languages/c-structs/language.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "C",
"langcode": "c",
"createModuleDirectories": false,
"extractSubSchemas": true,
"unwrapResultObjects": true,
"convertTuplesToArraysOrObjects": true,
"templatesPerModule": [
"/include/module.h",
"/src/module.cpp"
],
"templatesPerSchema": [
"/include/common/module.h",
"/src/module_common.cpp",
"/src/jsondata_module.h"
],
"persistPermission": true,
"primitives": {
"boolean": "bool",
"integer": "int",
"number": "float",
"string": "char*"
},
"additionalSchemaTemplates": [
"json-types"
]
}
19 changes: 19 additions & 0 deletions languages/c-structs/src/index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright 2021 Comcast Cable Communications Management, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* SPDX-License-Identifier: Apache-2.0
*/

export { default as Transport } from './shared/Transport/index.mjs'
1 change: 1 addition & 0 deletions languages/c-structs/templates/codeblocks/export.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as ${info.title} } from './${info.title}/index.mjs'
1 change: 1 addition & 0 deletions languages/c-structs/templates/codeblocks/mock-import.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import { default as _${info.title} } from './${info.title}/defaults.mjs'
1 change: 1 addition & 0 deletions languages/c-structs/templates/codeblocks/mock-parameter.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${info.title}: _${info.title},
Empty file.
9 changes: 9 additions & 0 deletions languages/c-structs/templates/codeblocks/setter.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* ${method.name} - ${method.description} */
uint32_t ${info.title}_${method.Name}( ${method.signature.params} )
{
const string method = _T("${info.title}.${method.name}");
${if.params}
${method.params.serialization}
${end.if.params}
return FireboltSDK::Properties::Set(method, jsonParameters);
}
Empty file.
5 changes: 5 additions & 0 deletions languages/c-structs/templates/declarations/default.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/*
* ${method.summary}
* ${method.params}
*/
int F${info.title}_${method.Name}(${method.signature.params}${if.result.properties}${if.params}, ${end.if.params}${end.if.result.properties}${method.result.properties});
4 changes: 4 additions & 0 deletions languages/c-structs/templates/declarations/event.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* ${method.name} - ${method.description} */
typedef void (*F${info.Title}${method.Name}Callback)( const void* userData, ${event.signature.callback.params}${if.event.params}, ${end.if.event.params}${method.result.properties} );
int F${info.title}_Register_${method.Name}( ${event.signature.params}${if.event.params}, ${end.if.event.params}F${info.Title}${method.Name}Callback userCB, const void* userData );
int F${info.title}_Unregister_${method.Name}( F${info.Title}${method.Name}Callback userCB);
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/*
* ${method.summary}
* ${method.params}
*/
int F${info.title}_${method.Name}(${method.signature.params}${if.result.properties}${if.params}, ${end.if.params}${end.if.result.properties}${method.result.properties});
5 changes: 5 additions & 0 deletions languages/c-structs/templates/declarations/property.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/*
* ${method.summary}
* ${method.params}
*/
int F${info.title}_Get${method.Name}(${method.signature.params}${if.params}, ${end.if.params}${method.result.properties});
Empty file.
Empty file.
Empty file.
Empty file.
1 change: 1 addition & 0 deletions languages/c-structs/templates/imports/default.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "jsondata_${info.title.lowercase}.h"
1 change: 1 addition & 0 deletions languages/c-structs/templates/imports/default.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "common/${info.title.lowercase}.h"
1 change: 1 addition & 0 deletions languages/c-structs/templates/imports/default.jsondata
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "jsondata_${info.title.lowercase}.h"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// need cpp code to init, get, set, clear additional properties...
1 change: 1 addition & 0 deletions languages/c-structs/templates/json-types/anyOf.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* AnyOf is not supported in C: ${title} */
4 changes: 4 additions & 0 deletions languages/c-structs/templates/json-types/array.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
uint32_t ${info.Title}_${Title}Array_Size(${type} handle);
${type} ${title}Array_Get(${type} handle, uint32_t index);
void ${info.Title}_${Title}Array_Add(${propertyType} handle, ${valueType} value);
void ${info.Title}_${Title}Array_Clear(${propertyType} handle);
1 change: 1 addition & 0 deletions languages/c-structs/templates/json-types/boolean.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
WPEFramework::Core::JSON::Boolean
Empty file.
1 change: 1 addition & 0 deletions languages/c-structs/templates/json-types/default.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${shape}
4 changes: 4 additions & 0 deletions languages/c-structs/templates/json-types/enum.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* ${title} ${description} */
ENUM_CONVERSION_BEGIN(${name})
{ ${NAME}_${key}, _T("${value}") },
ENUM_CONVERSION_END(${name})
4 changes: 4 additions & 0 deletions languages/c-structs/templates/json-types/enum.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* ${title} ${description} */
typedef enum {
${NAME}_${key},
} ${name};
1 change: 1 addition & 0 deletions languages/c-structs/templates/json-types/float.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
WPEFramework::Core::JSON::Float
1 change: 1 addition & 0 deletions languages/c-structs/templates/json-types/integer.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
WPEFramework::Core::JSON::DecSInt32
1 change: 1 addition & 0 deletions languages/c-structs/templates/json-types/namespace.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FireboltSDK::${info.Title}::
25 changes: 25 additions & 0 deletions languages/c-structs/templates/json-types/object.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
class ${title}: public WPEFramework::Core::JSON::Container {
public:
~${title}() override = default;

public:
${title}()
: WPEFramework::Core::JSON::Container()
{
${properties.register}
}

${title}(const ${title}& other)
{
${properties.assign}
}

${title}& operator=(const ${title}& other)
{
${properties.assign}
return (*this);
}

public:
${properties}
};
Empty file.
2 changes: 2 additions & 0 deletions languages/c-structs/templates/json-types/property-assign.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Add(_T("${property}"), &${Property});
${Property} = other.${Property}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add(_T("${property}"), &${Property});
1 change: 1 addition & 0 deletions languages/c-structs/templates/json-types/property.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${title} ${Property};
1 change: 1 addition & 0 deletions languages/c-structs/templates/json-types/ref.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${shape}
1 change: 1 addition & 0 deletions languages/c-structs/templates/json-types/string.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FireboltSDK::JSON::String
1 change: 1 addition & 0 deletions languages/c-structs/templates/json-types/title.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JsonData_${Title}
25 changes: 25 additions & 0 deletions languages/c-structs/templates/json-types/tuple.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
class ${title}: public WPEFramework::Core::JSON::Container {
public:
~${title}() override = default;

public:
${title}()
: WPEFramework::Core::JSON::Container()
{
${properties.register}
}

${title}(const ${title}& other)
{
${properties.assign}
}

${title}& operator=(const ${title}& other)
{
${properties.assign}
return (*this);
}

public:
${properties}
};
Empty file.
1 change: 1 addition & 0 deletions languages/c-structs/templates/json-types/x-method.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
void*
1 change: 1 addition & 0 deletions languages/c-structs/templates/language/enum-item.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${key}
3 changes: 3 additions & 0 deletions languages/c-structs/templates/language/enum.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
typedef enum {
${items}
} F${info.title}_${title};
1 change: 1 addition & 0 deletions languages/c-structs/templates/language/parameter.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${type} ${name}
1 change: 1 addition & 0 deletions languages/c-structs/templates/language/schema-item.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${type} ${property};
3 changes: 3 additions & 0 deletions languages/c-structs/templates/language/schema.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
typedef struct {
${properties}
} F${info.title}_${title};
Empty file.
24 changes: 24 additions & 0 deletions languages/c-structs/templates/methods/default.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* ${method.name} - ${method.description} */
int F${info.title}_${method.Name}(${method.signature.params}${if.result.properties}${if.params}, ${end.if.params}${end.if.result.properties}${method.result.properties}) {
int status = FireboltSDKErrorUnavailable;
FireboltSDK::Transport<WPEFramework::Core::JSON::IElement>* transport = FireboltSDK::Accessor::Instance().GetTransport();
if (transport != nullptr) {

JsonObject jsonParameters;

${if.params}
${method.params.json}
${end.if.params}

WPEFramework::Core::JSON::Boolean jsonResult;
status = transport->Invoke("${info.title}.${method.name}", jsonParameters, jsonResult);
if (status == FireboltSDKErrorNone) {
*success = jsonResult.Value();
}

} else {
FIREBOLT_LOG_ERROR(FireboltSDK::Logger::Category::OpenRPC, FireboltSDK::Logger::Module<FireboltSDK::Accessor>(), "Error in getting Transport err = %d", status);
}

return status;
}
26 changes: 26 additions & 0 deletions languages/c-structs/templates/methods/event.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* ${method.name} - ${method.description} */
static void F${info.Title}${method.Name}InnerCallback( void* userCB, const void* userData, void* response )
{
${event.callback.params.serialization}
ASSERT(jsonResponse->IsValid() == true);
if (jsonResponse->IsValid() == true) {
${event.callback.result.instantiation}
${info.Title}${method.Name}Callback callback = reinterpret_cast<${info.Title}${method.Name}Callback>(userCB);
callback(userData, ${event.callback.response.instantiation});
}
}
int F${info.title}_Register_${method.Name}( ${event.signature.params}${if.event.params}, ${end.if.event.params}${info.Title}${method.Name}Callback userCB, const void* userData )
{
const string eventName = _T("${info.title}.${method.name}");
int status = FireboltSDKErrorNone;

if (userCB != nullptr) {
${event.params.serialization}
status = FireboltSDK::Event::Instance().Subscribe<${event.result.json.type}>(eventName, jsonParameters, ${info.Title}${method.Name}InnerCallback, reinterpret_cast<void*>(userCB), userData);
}
return status;
}
int F${info.title}_Unregister_${method.Name}( ${info.Title}${method.Name}Callback userCB)
{
return FireboltSDK::Event::Instance().Unsubscribe(_T("${info.title}.${method.name}"), reinterpret_cast<void*>(userCB));
}
Empty file.
Empty file.
Empty file.
21 changes: 21 additions & 0 deletions languages/c-structs/templates/methods/polymorphic-pull.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* ${method.name} - ${method.description} */
uint32_t ${info.title}_Push${method.Name}(${method.signature.params})
{
uint32_t status = FireboltSDKErrorUnavailable;
${if.params}
${method.params.serialization}
${end.if.params}
FireboltSDK::Transport<WPEFramework::Core::JSON::IElement>* transport = FireboltSDK::Accessor::Instance().GetTransport();
if (transport != nullptr) {
WPEFramework::Core::JSON::Boolean jsonResult;
status = transport->Invoke(_T("${info.title}.${method.name}"), jsonParameters, jsonResult);
if (status == FireboltSDKErrorNone) {
FIREBOLT_LOG_INFO(FireboltSDK::Logger::Category::OpenRPC, FireboltSDK::Logger::Module<FireboltSDK::Accessor>(), "${info.title}.${method.name} is successfully pushed with status as %d", jsonResult.Value());
status = (jsonResult.Value() == true) ? FireboltSDKErrorNone : FireboltSDKErrorNotSupported;
}
} else {
FIREBOLT_LOG_ERROR(FireboltSDK::Logger::Category::OpenRPC, FireboltSDK::Logger::Module<FireboltSDK::Accessor>(), "Error in getting Transport err = %d", status);
}

return status;
}
Empty file.
15 changes: 15 additions & 0 deletions languages/c-structs/templates/methods/property.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* ${method.name} - ${method.description} */
int F${info.title}_Get${method.Name}(${method.signature.params}${if.result.properties}${if.params}, ${end.if.params}${end.if.result.properties}${method.result.properties}) {
const string method = _T("${info.title}.${method.name}");
${if.params}${method.params.serialization}${end.if.params}
${method.result.json} jsonResult;
${if.params}int status = FireboltSDK::Properties::Get(method, jsonParameters, jsonResult);${end.if.params}
${if.params.empty}int status = FireboltSDK::Properties::Get(method, jsonResult);${end.if.params.empty}
if (status == FireboltSDKErrorNone) {
if (${method.result.name} != nullptr) {
${method.result.instantiation}
}
}
return status;
}
${method.setter}
Empty file.
Empty file.
Empty file.
41 changes: 41 additions & 0 deletions languages/c-structs/templates/modules/include/Module.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright 2023 Comcast Cable Communications Management, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* SPDX-License-Identifier: Apache-2.0
*/

#ifndef _${info.TITLE}_H
#define _${info.TITLE}_H

#include "Firebolt.h"
/* ${IMPORTS} */

#ifdef __cplusplus
extern "C" {
#endif

// Enums

/* ${ENUMS} */

/* ${TYPES} */

/* ${DECLARATIONS} */

#ifdef __cplusplus
}
#endif

#endif // Header Include Guard
Loading

0 comments on commit 23bc305

Please sign in to comment.