Chromium Code Reviews| Index: components/physical_web/eddystone/eddystone_encoder.h |
| diff --git a/components/physical_web/eddystone/eddystone_encoder.h b/components/physical_web/eddystone/eddystone_encoder.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0ff6e3edb64e05b83e93cb021c959f794ebec4c8 |
| --- /dev/null |
| +++ b/components/physical_web/eddystone/eddystone_encoder.h |
| @@ -0,0 +1,27 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_PHYSICAL_WEB_EDDYSTONE_EDDYSTONE_ENCODER_H_ |
| +#define COMPONENTS_PHYSICAL_WEB_EDDYSTONE_EDDYSTONE_ENCODER_H_ |
| + |
| +#include <string> |
| +#include <vector> |
| + |
| +namespace physical_web { |
| +/* |
| + * EncodeUrl takes a URL in the form of a std::string and |
|
mattreynolds
2017/03/09 22:11:31
Would it make sense to take a GURL as the input pa
iankc
2017/03/09 23:17:50
Acknowledged.
|
| + * a pointer to a uint8_t vector to populate with the eddystone |
| + * encoding of the url. |
| + * Returns: |
| + * -1 If the Url parameter is empty. |
| + * -2 If the Url parameter is not a valid Url. |
| + * -3 If the Url parameter is not a standard Https or Http Url. |
| + * Length of encoded Url. |
| + * Eddystone spec can be found here: |
| + * https://github.com/google/eddystone/blob/master/protocol-specification.md |
|
mattreynolds
2017/03/09 22:11:31
Nice comment! A few things to clean up:
* Use all
iankc
2017/03/09 23:17:50
Done.
|
| + */ |
| +int EncodeUrl(const std::string& url, std::vector<uint8_t>* encoded_url); |
| +} |
| + |
| +#endif // COMPONENTS_PHYSICAL_WEB_EDDYSTONE_EDDYSTONE_ENCODER_H_ |