blob: 57131ef1ae38546f514d74af3dbdcadc7a57e015 [file] [log] [blame]
Zsolt Harasztidafefe12016-11-14 21:29:58 -08001#!/usr/bin/env python
2"""
3Write adapter data without any custom fields
4"""
5import sys
6
7import ext1_pb2
8from voltha.protos import adapter_pb2
9from google.protobuf import any_pb2
10
11def custom_config():
12 any = any_pb2.Any()
13 any.Pack(ext1_pb2.AdapterConfig(
14 volume=20,
15 bass=50,
16 treble=50
17 ))
18 return any
19
20
21def custom_description():
22 any = any_pb2.Any()
23 any.Pack(ext1_pb2.AdapterDescription(
24 internal_name='hulu',
25 internal_code='foo',
26 price=42
27 ))
28 return any
29
30
31adapter = adapter_pb2.Adapter(
32 id='42',
33 config=adapter_pb2.AdapterConfig(
34 additional_config=custom_config()
35 ),
36 additional_description=custom_description()
37)
38
39sys.stdout.write(adapter.SerializeToString())
40