Skip to content

Commit

Permalink
Add a dumb gen_tokens.zapt file to src/app/zap-templates
Browse files Browse the repository at this point in the history
 #### Proble

`gen_tokens.h` is one of the file required by `src/app` but that it still missing a template. If someone tries to create a new app from scratch using `ZAP` it will complains that `gen_tokens.h` is missing.

This PR introduce a dumb template based on the content of `gen_tokens.h` from what is in the tree. The tokens list is empty because the tokens code has not yet been fixed in `src/app` and so nobody uses it at the moment.
  • Loading branch information
vivien-apple committed Feb 1, 2021
1 parent 5623ab9 commit d68a138
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 84 deletions.
23 changes: 3 additions & 20 deletions examples/all-clusters-app/all-clusters-common/gen/gen_tokens.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
*
* Copyright (c) 2020 Project CHIP Authors
*
Expand All @@ -15,25 +15,8 @@
* limitations under the License.
*/

/**
*
* Copyright (c) 2020 Silicon Labs
*
* 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.
*/
// This file is generated by Simplicity Studio. Please do not edit manually.
//
//
// Prevent multiple inclusion
#pragma once

// This file contains the tokens for attributes stored in flash

Expand Down
23 changes: 3 additions & 20 deletions examples/bridge-app/bridge-common/gen/gen_tokens.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
*
* Copyright (c) 2020 Project CHIP Authors
*
Expand All @@ -15,25 +15,8 @@
* limitations under the License.
*/

/**
*
* Copyright (c) 2020 Silicon Labs
*
* 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.
*/
// This file is generated by Simplicity Studio. Please do not edit manually.
//
//
// Prevent multiple inclusion
#pragma once

// This file contains the tokens for attributes stored in flash

Expand Down
23 changes: 3 additions & 20 deletions examples/lighting-app/lighting-common/gen/gen_tokens.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
*
* Copyright (c) 2020 Project CHIP Authors
*
Expand All @@ -15,25 +15,8 @@
* limitations under the License.
*/

/**
*
* Copyright (c) 2020 Silicon Labs
*
* 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.
*/
// This file is generated by Simplicity Studio. Please do not edit manually.
//
//
// Prevent multiple inclusion
#pragma once

// This file contains the tokens for attributes stored in flash

Expand Down
23 changes: 3 additions & 20 deletions examples/lock-app/lock-common/gen/gen_tokens.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
*
* Copyright (c) 2020 Project CHIP Authors
*
Expand All @@ -15,25 +15,8 @@
* limitations under the License.
*/

/**
*
* Copyright (c) 2020 Silicon Labs
*
* 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.
*/
// This file is generated by Simplicity Studio. Please do not edit manually.
//
//
// Prevent multiple inclusion
#pragma once

// This file contains the tokens for attributes stored in flash

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
*
* Copyright (c) 2020 Project CHIP Authors
*
Expand All @@ -14,9 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// This file is generated by Simplicity Studio. Please do not edit manually.
//
//

// Prevent multiple inclusion
#pragma once

// This file contains the tokens for attributes stored in flash

Expand Down
5 changes: 5 additions & 0 deletions src/app/zap-templates/app-templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@
"name": "ZCL gen_config header",
"output": "gen_config.h"
},
{
"path": "templates/app/gen_tokens.zapt",
"name": "ZCL gen_tokens header",
"output": "gen_tokens.h"
},
{
"path": "templates/app/print-cluster.zapt",
"name": "ZCL print-cluster header",
Expand Down
28 changes: 28 additions & 0 deletions src/app/zap-templates/templates/app/gen_tokens.zapt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{> header}}

// Prevent multiple inclusion
#pragma once

// This file contains the tokens for attributes stored in flash

// Identifier tags for tokens

// Types for the tokens
#ifdef DEFINETYPES
#endif // DEFINETYPES

// Actual token definitions
#ifdef DEFINETOKENS
#endif // DEFINETOKENS

// Macro snippet that loads all the attributes from tokens
#define GENERATED_TOKEN_LOADER(endpoint) \
do \
{ \
} while (false)

// Macro snippet that saves the attribute to token
#define GENERATED_TOKEN_SAVER \
do \
{ \
} while (false)

0 comments on commit d68a138

Please sign in to comment.