Skip to content
This repository was archived by the owner on Dec 20, 2023. It is now read-only.

Commit 3022787

Browse files
committed
Add extra files from openweave-wdlc reference to simplify management
This commit simplifies the management of the contents of `src/test-apps/schema` directory -- following any substantive change in OpenWeave WDLC or its reference code or test traits, the contents of `openweave/openweave-wdlc.git:/codegen/weave-device-cpp/reference/` shall be copied directly to `src/test-apps/schema`, and subject to a one-line edit outlined in the parent. This commit brings the content of `src/test-apps/schema` up to date with commir c827473f8c762af08391667da1f99ef81bd8a22f in openweave-wdlc
1 parent d3e9a5d commit 3022787

28 files changed

+1494
-15
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
* Copyright (c) 2019 Google LLC.
3+
* Copyright (c) 2016-2018 Nest Labs, Inc.
4+
* All rights reserved.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
/*
20+
* THIS FILE IS GENERATED. DO NOT MODIFY.
21+
*
22+
* SOURCE TEMPLATE: struct.cpp
23+
* SOURCE PROTO: google/protobuf/field_mask.proto
24+
*
25+
*/
26+
27+
#include <google/protobuf/FieldMaskStructSchema.h>
28+
29+
namespace Schema {
30+
namespace Google {
31+
namespace Protobuf {
32+
33+
34+
const nl::FieldDescriptor FieldMaskFieldDescriptors[] =
35+
{
36+
{
37+
NULL, offsetof(FieldMask, paths) + offsetof(nl::SerializedFieldTypeUTF8String_array, num), SET_TYPE_AND_FLAGS(nl::SerializedFieldTypeArray, 0), 1
38+
},
39+
{
40+
NULL, offsetof(FieldMask, paths) + offsetof(nl::SerializedFieldTypeUTF8String_array, buf), SET_TYPE_AND_FLAGS(nl::SerializedFieldTypeUTF8String, 0), 1
41+
},
42+
43+
};
44+
45+
const nl::SchemaFieldDescriptor FieldMask::FieldSchema =
46+
{
47+
.mNumFieldDescriptorElements = sizeof(FieldMaskFieldDescriptors)/sizeof(FieldMaskFieldDescriptors[0]),
48+
.mFields = FieldMaskFieldDescriptors,
49+
.mSize = sizeof(FieldMask)
50+
};
51+
52+
53+
54+
} // namespace Protobuf
55+
} // namespace Google
56+
} // namespace Schema
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
* Copyright (c) 2019 Google LLC.
3+
* Copyright (c) 2016-2018 Nest Labs, Inc.
4+
* All rights reserved.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
/*
20+
* THIS FILE IS GENERATED. DO NOT MODIFY.
21+
*
22+
* SOURCE TEMPLATE: struct.cpp.h
23+
* SOURCE PROTO: google/protobuf/field_mask.proto
24+
*
25+
*/
26+
#ifndef _GOOGLE_PROTOBUF__FIELD_MASK_STRUCT_SCHEMA_H_
27+
#define _GOOGLE_PROTOBUF__FIELD_MASK_STRUCT_SCHEMA_H_
28+
29+
#include <Weave/Support/SerializationUtils.h>
30+
#include <Weave/Profiles/data-management/DataManagement.h>
31+
32+
33+
34+
namespace Schema {
35+
namespace Google {
36+
namespace Protobuf {
37+
38+
struct FieldMask
39+
{
40+
nl::SerializedFieldTypeUTF8String_array paths;
41+
42+
static const nl::SchemaFieldDescriptor FieldSchema;
43+
44+
};
45+
46+
struct FieldMask_array {
47+
uint32_t num;
48+
FieldMask *buf;
49+
};
50+
51+
52+
53+
} // namespace Protobuf
54+
} // namespace Google
55+
} // namespace Schema
56+
#endif // _GOOGLE_PROTOBUF__FIELD_MASK_STRUCT_SCHEMA_H_
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
2+
/*
3+
* Copyright (c) 2019 Google LLC.
4+
* Copyright (c) 2016-2018 Nest Labs, Inc.
5+
* All rights reserved.
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
20+
/*
21+
* THIS FILE IS GENERATED. DO NOT MODIFY.
22+
*
23+
* SOURCE TEMPLATE: resource.cpp.h
24+
* SOURCE PROTO: nest/test/resource/trait_test_resource.proto
25+
*
26+
*/
27+
28+
#ifndef _NEST_TEST_RESOURCE__TRAIT_TEST_RESOURCE_H_
29+
#define _NEST_TEST_RESOURCE__TRAIT_TEST_RESOURCE_H_
30+
31+
namespace Schema {
32+
namespace Nest {
33+
namespace Test {
34+
namespace Resource {
35+
namespace TraitTestResource {
36+
37+
38+
enum {
39+
ServiceA = 0,
40+
ServiceB = 0,
41+
ServiceC = 0,
42+
ServiceD = 0,
43+
DeviceA = 1,
44+
DeviceB = 1,
45+
DeviceC = 1,
46+
DeviceD = 1,
47+
DeviceA2 = 2,
48+
DeviceA3 = 3,
49+
};
50+
} // namespace TraitTestResource
51+
52+
} // namespace Resource
53+
} // namespace Test
54+
} // namespace Nest
55+
} // namespace Schema
56+
#endif // _NEST_TEST_RESOURCE__TRAIT_TEST_RESOURCE_H_
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
2+
/*
3+
* Copyright (c) 2019 Google LLC.
4+
* Copyright (c) 2016-2018 Nest Labs, Inc.
5+
* All rights reserved.
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
20+
/*
21+
* THIS FILE IS GENERATED. DO NOT MODIFY.
22+
*
23+
* SOURCE TEMPLATE: trait.c.h
24+
* SOURCE PROTO: nest/test/trait/test_a_trait.proto
25+
*
26+
*/
27+
#ifndef _NEST_TEST_TRAIT__TEST_A_TRAIT_C_H_
28+
#define _NEST_TEST_TRAIT__TEST_A_TRAIT_C_H_
29+
30+
31+
32+
//
33+
// Commands
34+
//
35+
36+
typedef enum
37+
{
38+
kCommandARequestId = 0x1,
39+
kCommandBRequestId = 0x2,
40+
} schema_nest_test_test_a_trait_command_id_t;
41+
42+
43+
// CommandARequest Parameters
44+
typedef enum
45+
{
46+
kCommandARequestParameter_A = 1,
47+
kCommandARequestParameter_B = 2,
48+
} schema_nest_test_test_a_trait_command_a_request_param_t;
49+
// CommandBRequest Parameters
50+
typedef enum
51+
{
52+
kCommandBRequestParameter_A = 1,
53+
kCommandBRequestParameter_B = 2,
54+
} schema_nest_test_test_a_trait_command_b_request_param_t;
55+
56+
57+
// CommandBResponse Parameters
58+
typedef enum
59+
{
60+
kCommandBResponseParameter_A = 1,
61+
kCommandBResponseParameter_B = 2,
62+
} schema_nest_test_test_a_trait_command_b_response_param_t;
63+
64+
//
65+
// Enums
66+
//
67+
68+
// EnumA
69+
typedef enum
70+
{
71+
ENUM_A_VALUE_1 = 1,
72+
ENUM_A_VALUE_2 = 2,
73+
ENUM_A_VALUE_3 = 3,
74+
} schema_nest_test_test_a_trait_enum_a_t;
75+
// EnumAA
76+
typedef enum
77+
{
78+
ENUM_AA_VALUE_1 = 1,
79+
ENUM_AA_VALUE_2 = 2,
80+
ENUM_AA_VALUE_3 = 3,
81+
} schema_nest_test_test_a_trait_enum_aa_t;
82+
83+
84+
//
85+
// Constants
86+
//
87+
88+
#define SCHEMA_NEST_TEST_TEST_A_TRAIT_CONSTANT_A_VALUE_1 {0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
89+
#define SCHEMA_NEST_TEST_TEST_A_TRAIT_CONSTANT_A_VALUE_2 {0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}
90+
#define SCHEMA_NEST_TEST_TEST_A_TRAIT_CONSTANT_A_VALUE_3 {0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02}
91+
#define SCHEMA_NEST_TEST_TEST_A_TRAIT_CONSTANT_A_VALUE_4 {0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03}
92+
#define SCHEMA_NEST_TEST_TEST_A_TRAIT_CONSTANT_A_VALUE_5 {0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04}
93+
#define SCHEMA_NEST_TEST_TEST_A_TRAIT_CONSTANT_A_VALUE_6 {0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05}
94+
#define SCHEMA_NEST_TEST_TEST_A_TRAIT_CONSTANT_A_VALUE_7 {0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06}
95+
#define SCHEMA_NEST_TEST_TEST_A_TRAIT_CONSTANT_A_VALUE_8 {0x00, 0x08, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88}
96+
97+
#define SCHEMA_NEST_TEST_TEST_A_TRAIT_CONSTANT_A_VALUE_1_IMP (0x0000000000000000ULL) // DEVICE_00000000
98+
#define SCHEMA_NEST_TEST_TEST_A_TRAIT_CONSTANT_A_VALUE_2_IMP (0x0000000000000001ULL) // USER_00000001
99+
#define SCHEMA_NEST_TEST_TEST_A_TRAIT_CONSTANT_A_VALUE_3_IMP (0x0000000000000002ULL) // ACCOUNT_00000002
100+
#define SCHEMA_NEST_TEST_TEST_A_TRAIT_CONSTANT_A_VALUE_4_IMP (0x0000000000000003ULL) // AREA_00000003
101+
#define SCHEMA_NEST_TEST_TEST_A_TRAIT_CONSTANT_A_VALUE_5_IMP (0x0000000000000004ULL) // FIXTURE_00000004
102+
#define SCHEMA_NEST_TEST_TEST_A_TRAIT_CONSTANT_A_VALUE_6_IMP (0x0000000000000005ULL) // GROUP_00000005
103+
#define SCHEMA_NEST_TEST_TEST_A_TRAIT_CONSTANT_A_VALUE_7_IMP (0x0000000000000006ULL) // ANNOTATION_00000006
104+
#define SCHEMA_NEST_TEST_TEST_A_TRAIT_CONSTANT_A_VALUE_8_IMP (0x1122334455667788ULL) // STRUCTURE_1122334455667788
105+
106+
107+
108+
#endif // _NEST_TEST_TRAIT__TEST_A_TRAIT_C_H_
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
/*
3+
* Copyright (c) 2019 Google LLC.
4+
* Copyright (c) 2016-2018 Nest Labs, Inc.
5+
* All rights reserved.
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
20+
/*
21+
* THIS FILE IS GENERATED. DO NOT MODIFY.
22+
*
23+
* SOURCE TEMPLATE: trait.c.h
24+
* SOURCE PROTO: nest/test/trait/test_b_trait.proto
25+
*
26+
*/
27+
#ifndef _NEST_TEST_TRAIT__TEST_B_TRAIT_C_H_
28+
#define _NEST_TEST_TRAIT__TEST_B_TRAIT_C_H_
29+
30+
31+
32+
33+
34+
35+
36+
#endif // _NEST_TEST_TRAIT__TEST_B_TRAIT_C_H_
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
2+
/*
3+
* Copyright (c) 2019 Google LLC.
4+
* Copyright (c) 2016-2018 Nest Labs, Inc.
5+
* All rights reserved.
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
20+
/*
21+
* THIS FILE IS GENERATED. DO NOT MODIFY.
22+
*
23+
* SOURCE TEMPLATE: trait.c.h
24+
* SOURCE PROTO: nest/test/trait/test_c_trait.proto
25+
*
26+
*/
27+
#ifndef _NEST_TEST_TRAIT__TEST_C_TRAIT_C_H_
28+
#define _NEST_TEST_TRAIT__TEST_C_TRAIT_C_H_
29+
30+
31+
32+
33+
//
34+
// Enums
35+
//
36+
37+
// EnumC
38+
typedef enum
39+
{
40+
ENUM_C_VALUE_1 = 1,
41+
ENUM_C_VALUE_2 = 2,
42+
ENUM_C_VALUE_3 = 3,
43+
} schema_nest_test_test_c_trait_enum_c_t;
44+
45+
46+
47+
48+
#endif // _NEST_TEST_TRAIT__TEST_C_TRAIT_C_H_

0 commit comments

Comments
 (0)