Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Json to Tlv and Tlv to Json Converters Implementation in CPP #27635

Commits on Jul 20, 2023

  1. Json to Tlv and Tlv to Json Converters Implemented in CPP

    This implementation is equivalent to the Kotlin implementation in:
    src/controller/java/src/chip/jsontlv/
    
    Note that NOT all TLV configurations are supported by the current implementation. Here is the list of limitations:
       - TLV Structure elements are expected to be sorted in a canonical tag order
       - TLV Lists are not supported
       - Multi-Dimensional TLV Arrays are not supported
       - All elements in an array MUST be of the same type
       - The top-level TLV element MUST be a single structure with AnonymousTag
       - The following tags are supported:
           - AnonymousTag are only used with TLV Array elements or a top-level structure.
           - ContextSpecificTag are used only with TLV Structure elements.
           - CommonProfileTag are used only with TLV Structure elements.
       - Infinity Float/Double values are not supported.
    
    Added README.md file that describing the format.
    
    Added unit tests for TLV to JSON, JSON to TLV, JSON to TLV back to JSON conversion cases.
    
    NOTE about the current implementation of the Tlv-to-Json converter in:
        src/lib/support/jsontlv/TlvJson.cpp
    I kept this implementation because it is currently used in a few places in the code for testing/logging
    purposes. As a follow up work item, this implementation should be replaced with the new one presented
    in this commit.
    emargolis committed Jul 20, 2023
    Configuration menu
    Copy the full SHA
    3ef4394 View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2023

  1. Configuration menu
    Copy the full SHA
    f25def6 View commit details
    Browse the repository at this point in the history

Commits on Jul 26, 2023

  1. Update src/lib/support/jsontlv/JsonToTlv.cpp

    Co-authored-by: Robert Szewczyk <szewczyk@google.com>
    emargolis and robszewczyk authored Jul 26, 2023
    Configuration menu
    Copy the full SHA
    a9bb185 View commit details
    Browse the repository at this point in the history
  2. Update src/lib/support/jsontlv/TlvToJson.cpp

    Co-authored-by: Robert Szewczyk <szewczyk@google.com>
    emargolis and robszewczyk authored Jul 26, 2023
    Configuration menu
    Copy the full SHA
    3be7853 View commit details
    Browse the repository at this point in the history
  3. Update src/lib/support/jsontlv/TlvToJson.cpp

    Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
    emargolis and bzbarsky-apple authored Jul 26, 2023
    Configuration menu
    Copy the full SHA
    4b0cfdd View commit details
    Browse the repository at this point in the history
  4. Update src/lib/support/jsontlv/TlvToJson.cpp

    Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
    emargolis and bzbarsky-apple authored Jul 26, 2023
    Configuration menu
    Copy the full SHA
    d6c608b View commit details
    Browse the repository at this point in the history
  5. Update src/lib/support/jsontlv/JsonToTlv.h

    Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
    emargolis and bzbarsky-apple authored Jul 26, 2023
    Configuration menu
    Copy the full SHA
    f2bcd35 View commit details
    Browse the repository at this point in the history
  6. Update src/lib/support/jsontlv/JsonToTlv.h

    Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
    emargolis and bzbarsky-apple authored Jul 26, 2023
    Configuration menu
    Copy the full SHA
    6da8f04 View commit details
    Browse the repository at this point in the history

Commits on Jul 27, 2023

  1. Addressed Review Comments

    emargolis committed Jul 27, 2023
    Configuration menu
    Copy the full SHA
    d7f470c View commit details
    Browse the repository at this point in the history
  2. Restyled by clang-format

    restyled-commits authored and emargolis committed Jul 27, 2023
    Configuration menu
    Copy the full SHA
    ae43d5f View commit details
    Browse the repository at this point in the history
  3. Restyled by prettier-markdown

    restyled-commits authored and emargolis committed Jul 27, 2023
    Configuration menu
    Copy the full SHA
    13486e1 View commit details
    Browse the repository at this point in the history
  4. Removed Debug Prints

    emargolis committed Jul 27, 2023
    Configuration menu
    Copy the full SHA
    24f3202 View commit details
    Browse the repository at this point in the history

Commits on Jul 28, 2023

  1. Added Support for Float/Double Infinity Values

    Those values should be encoded as "Infinity" and "-Infinity" strings.
    emargolis committed Jul 28, 2023
    Configuration menu
    Copy the full SHA
    49a68d7 View commit details
    Browse the repository at this point in the history
  2. Restyled by clang-format

    restyled-commits authored and emargolis committed Jul 28, 2023
    Configuration menu
    Copy the full SHA
    231b1a8 View commit details
    Browse the repository at this point in the history
  3. Restyled by prettier-markdown

    restyled-commits authored and emargolis committed Jul 28, 2023
    Configuration menu
    Copy the full SHA
    bb125f8 View commit details
    Browse the repository at this point in the history
  4. Update src/lib/support/jsontlv/JsonToTlv.cpp

    Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
    emargolis and bzbarsky-apple authored Jul 28, 2023
    Configuration menu
    Copy the full SHA
    dcce2d5 View commit details
    Browse the repository at this point in the history

Commits on Jul 29, 2023

  1. Addressed Review Comments

    emargolis committed Jul 29, 2023
    Configuration menu
    Copy the full SHA
    9ebe79e View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2023

  1. Configuration menu
    Copy the full SHA
    24c2d78 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0c76ffe View commit details
    Browse the repository at this point in the history
  3. Documentation update

    andreilitvin committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    e5ee3bf View commit details
    Browse the repository at this point in the history
  4. Restyle

    andreilitvin committed Aug 2, 2023
    Configuration menu
    Copy the full SHA
    21d6e00 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    175d94b View commit details
    Browse the repository at this point in the history

Commits on Aug 4, 2023

  1. Update src/lib/support/jsontlv/README.md

    Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
    andy31415 and bzbarsky-apple authored Aug 4, 2023
    Configuration menu
    Copy the full SHA
    bb1e7ba View commit details
    Browse the repository at this point in the history
  2. Update src/lib/support/jsontlv/TlvToJson.cpp

    Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
    andy31415 and bzbarsky-apple authored Aug 4, 2023
    Configuration menu
    Copy the full SHA
    75f8f08 View commit details
    Browse the repository at this point in the history
  3. Update src/lib/support/jsontlv/TlvToJson.cpp

    Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
    andy31415 and bzbarsky-apple authored Aug 4, 2023
    Configuration menu
    Copy the full SHA
    1c06610 View commit details
    Browse the repository at this point in the history
  4. Update src/lib/support/jsontlv/TlvToJson.cpp

    Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
    andy31415 and bzbarsky-apple authored Aug 4, 2023
    Configuration menu
    Copy the full SHA
    1d07cc2 View commit details
    Browse the repository at this point in the history
  5. Update src/lib/support/jsontlv/TlvJson.cpp

    Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
    andy31415 and bzbarsky-apple authored Aug 4, 2023
    Configuration menu
    Copy the full SHA
    d5b721c View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    a99c460 View commit details
    Browse the repository at this point in the history
  7. Added more comments about kTemporaryImplicitProfileId not being actua…

    …lly used in stored values. Made the values consistent everywhere
    andreilitvin committed Aug 4, 2023
    Configuration menu
    Copy the full SHA
    92a1957 View commit details
    Browse the repository at this point in the history
  8. Revert old code updates

    andreilitvin committed Aug 4, 2023
    Configuration menu
    Copy the full SHA
    e17a3a0 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    102219e View commit details
    Browse the repository at this point in the history
  10. Make the tlv element naming a bit more consistent, including invalid …

    …JSON in case element types are NOT as expected
    andreilitvin committed Aug 4, 2023
    Configuration menu
    Copy the full SHA
    82f1cb0 View commit details
    Browse the repository at this point in the history
  11. Remove obsolete comment

    andreilitvin committed Aug 4, 2023
    Configuration menu
    Copy the full SHA
    0a86978 View commit details
    Browse the repository at this point in the history
  12. Update src/lib/support/jsontlv/TlvToJson.cpp

    Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
    andy31415 and bzbarsky-apple authored Aug 4, 2023
    Configuration menu
    Copy the full SHA
    4935d29 View commit details
    Browse the repository at this point in the history
  13. Update src/lib/support/jsontlv/TlvToJson.cpp

    Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
    yunhanw-google and bzbarsky-apple authored Aug 4, 2023
    Configuration menu
    Copy the full SHA
    a06d865 View commit details
    Browse the repository at this point in the history