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

Commit 76fddf1

Browse files
committed
Updated common schema definitions
Updated the contents of src/lib/schema/common to match exactly the contents of openweave-wdlc.git:codegen/weave-device-cpp/reference/weave/common/ at commit c827473f8c762af08391667da1f99ef81bd8a22f
1 parent e0c72e7 commit 76fddf1

14 files changed

+774
-2
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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: enum.common.h
23+
* SOURCE PROTO: weave/common/time.proto
24+
*
25+
*/
26+
#ifndef _WEAVE_COMMON__DAY_OF_WEEK_ENUM_H_
27+
#define _WEAVE_COMMON__DAY_OF_WEEK_ENUM_H_
28+
29+
namespace Schema {
30+
namespace Weave {
31+
namespace Common {
32+
33+
enum DayOfWeek {
34+
DAY_OF_WEEK_SUNDAY = 1,
35+
DAY_OF_WEEK_MONDAY = 2,
36+
DAY_OF_WEEK_TUESDAY = 4,
37+
DAY_OF_WEEK_WEDNESDAY = 8,
38+
DAY_OF_WEEK_THURSDAY = 16,
39+
DAY_OF_WEEK_FRIDAY = 32,
40+
DAY_OF_WEEK_SATURDAY = 64,
41+
};
42+
43+
} // namespace Common
44+
} // namespace Weave
45+
} // namespace Schema
46+
#endif // _WEAVE_COMMON__DAY_OF_WEEK_ENUM_H_
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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: weave/common/identifiers.proto
24+
*
25+
*/
26+
27+
#include <weave/common/EventIdStructSchema.h>
28+
29+
namespace Schema {
30+
namespace Weave {
31+
namespace Common {
32+
33+
34+
const nl::FieldDescriptor EventIdFieldDescriptors[] =
35+
{
36+
{
37+
NULL, offsetof(EventId, resourceId), SET_TYPE_AND_FLAGS(nl::SerializedFieldTypeByteString, 1), 1
38+
},
39+
40+
{
41+
NULL, offsetof(EventId, importance), SET_TYPE_AND_FLAGS(nl::SerializedFieldTypeInt32, 0), 2
42+
},
43+
44+
{
45+
NULL, offsetof(EventId, id), SET_TYPE_AND_FLAGS(nl::SerializedFieldTypeUInt64, 0), 3
46+
},
47+
48+
};
49+
50+
const nl::SchemaFieldDescriptor EventId::FieldSchema =
51+
{
52+
.mNumFieldDescriptorElements = sizeof(EventIdFieldDescriptors)/sizeof(EventIdFieldDescriptors[0]),
53+
.mFields = EventIdFieldDescriptors,
54+
.mSize = sizeof(EventId)
55+
};
56+
57+
58+
59+
} // namespace Common
60+
} // namespace Weave
61+
} // namespace Schema
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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: weave/common/identifiers.proto
24+
*
25+
*/
26+
#ifndef _WEAVE_COMMON__EVENT_ID_STRUCT_SCHEMA_H_
27+
#define _WEAVE_COMMON__EVENT_ID_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 Weave {
36+
namespace Common {
37+
38+
struct EventId
39+
{
40+
nl::SerializedByteString resourceId;
41+
void SetResourceIdNull(void);
42+
void SetResourceIdPresent(void);
43+
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
44+
bool IsResourceIdPresent(void);
45+
#endif
46+
int32_t importance;
47+
uint64_t id;
48+
uint8_t __nullified_fields__[1/8 + 1];
49+
50+
static const nl::SchemaFieldDescriptor FieldSchema;
51+
52+
};
53+
54+
struct EventId_array {
55+
uint32_t num;
56+
EventId *buf;
57+
};
58+
59+
inline void EventId::SetResourceIdNull(void)
60+
{
61+
SET_FIELD_NULLIFIED_BIT(__nullified_fields__, 0);
62+
}
63+
64+
inline void EventId::SetResourceIdPresent(void)
65+
{
66+
CLEAR_FIELD_NULLIFIED_BIT(__nullified_fields__, 0);
67+
}
68+
69+
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
70+
inline bool EventId::IsResourceIdPresent(void)
71+
{
72+
return (!GET_FIELD_NULLIFIED_BIT(__nullified_fields__, 0));
73+
}
74+
#endif
75+
76+
77+
} // namespace Common
78+
} // namespace Weave
79+
} // namespace Schema
80+
#endif // _WEAVE_COMMON__EVENT_ID_STRUCT_SCHEMA_H_
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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: weave/common/identifiers.proto
24+
*
25+
*/
26+
27+
#include <weave/common/InterfaceNameStructSchema.h>
28+
29+
namespace Schema {
30+
namespace Weave {
31+
namespace Common {
32+
33+
34+
const nl::FieldDescriptor InterfaceNameFieldDescriptors[] =
35+
{
36+
{
37+
NULL, offsetof(InterfaceName, interfaceName), SET_TYPE_AND_FLAGS(nl::SerializedFieldTypeUTF8String, 0), 1
38+
},
39+
40+
};
41+
42+
const nl::SchemaFieldDescriptor InterfaceName::FieldSchema =
43+
{
44+
.mNumFieldDescriptorElements = sizeof(InterfaceNameFieldDescriptors)/sizeof(InterfaceNameFieldDescriptors[0]),
45+
.mFields = InterfaceNameFieldDescriptors,
46+
.mSize = sizeof(InterfaceName)
47+
};
48+
49+
50+
51+
} // namespace Common
52+
} // namespace Weave
53+
} // 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: weave/common/identifiers.proto
24+
*
25+
*/
26+
#ifndef _WEAVE_COMMON__INTERFACE_NAME_STRUCT_SCHEMA_H_
27+
#define _WEAVE_COMMON__INTERFACE_NAME_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 Weave {
36+
namespace Common {
37+
38+
struct InterfaceName
39+
{
40+
const char * interfaceName;
41+
42+
static const nl::SchemaFieldDescriptor FieldSchema;
43+
44+
};
45+
46+
struct InterfaceName_array {
47+
uint32_t num;
48+
InterfaceName *buf;
49+
};
50+
51+
52+
53+
} // namespace Common
54+
} // namespace Weave
55+
} // namespace Schema
56+
#endif // _WEAVE_COMMON__INTERFACE_NAME_STRUCT_SCHEMA_H_
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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: weave/common/identifiers.proto
24+
*
25+
*/
26+
27+
#include <weave/common/ProfileSpecificStatusCodeStructSchema.h>
28+
29+
namespace Schema {
30+
namespace Weave {
31+
namespace Common {
32+
33+
34+
const nl::FieldDescriptor ProfileSpecificStatusCodeFieldDescriptors[] =
35+
{
36+
{
37+
NULL, offsetof(ProfileSpecificStatusCode, profileId), SET_TYPE_AND_FLAGS(nl::SerializedFieldTypeUInt32, 0), 1
38+
},
39+
40+
{
41+
NULL, offsetof(ProfileSpecificStatusCode, statusCode), SET_TYPE_AND_FLAGS(nl::SerializedFieldTypeUInt16, 0), 2
42+
},
43+
44+
};
45+
46+
const nl::SchemaFieldDescriptor ProfileSpecificStatusCode::FieldSchema =
47+
{
48+
.mNumFieldDescriptorElements = sizeof(ProfileSpecificStatusCodeFieldDescriptors)/sizeof(ProfileSpecificStatusCodeFieldDescriptors[0]),
49+
.mFields = ProfileSpecificStatusCodeFieldDescriptors,
50+
.mSize = sizeof(ProfileSpecificStatusCode)
51+
};
52+
53+
54+
55+
} // namespace Common
56+
} // namespace Weave
57+
} // namespace Schema

0 commit comments

Comments
 (0)