uqmi: use unmodified upstream JSON files
authorDaniel Golle <daniel@makrotopia.org>
Sat, 13 Nov 2021 23:07:49 +0000 (23:07 +0000)
committerDaniel Golle <daniel@makrotopia.org>
Wed, 17 Nov 2021 19:12:34 +0000 (19:12 +0000)
Extend code generator to handle also identifiers starting with a
numerical character.

Suggested-by: Koen Vandeputte <koen.vandeputte@citymesh.com>
Acked-by: Oskari Lemmelä <oskari@lemmela.net>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
data/gen-common.pm
data/qmi-service-nas.json
data/qmi-service-wms.json

index e951776e1ebb73f876a8fc30c85ad0e02baf47e2..278afce34408194643ca97ea9aabdf0fc0368d09 100644 (file)
@@ -32,6 +32,7 @@ sub gen_cname($) {
        my $name = shift;
 
        $name =~ s/[^a-zA-Z0-9_]/_/g;
+       $name = "_${name}" if $name =~ /^\d/;
        return lc($name);
 }
 
index fbf79c201f75b8eac864a8ff75e7b6e6d35e0f08..2602e407c5524305e26aa851013cf03f7cf17e42 100644 (file)
                      "format"        : "guint8",
                      "public-format" : "gboolean" } ],
       "output" : [ { "common-ref" : "Operation Result" },
-                   { "name"     : "EONS PLMN Name 3GPP",
+                   { "name"     : "3GPP EONS PLMN Name",
                      "id"       : "0x10",
                      "type"     : "TLV",
                      "since"    : "1.28",
                                         "format" : "gint32" },
                                       { "name"   : "SINR",
                                         "format" : "gint32" } ] },
-                    { "name"      : "Signal Strength 5G",
+                    { "name"      : "5G Signal Strength",
                       "id"        : "0x17",
                       "type"      : "TLV",
                       "since"     : "1.26.2",
                                         "format" : "gint16" },
                                       { "name"   : "SNR",
                                         "format" : "gint16" } ] },
-                    { "name"      : "Signal Strength 5G Extended",
+                    { "name"      : "5G Signal Strength Extended",
                       "id"        : "0x18",
                       "type"      : "TLV",
                       "since"     : "1.26.2",
index 7bd105a4680faed1905786d5e78ff11aaf04d0a0..ea23cf7cace0f3a95b8851443279fd84797389b1 100644 (file)
                                      { "name"          : "Success",
                                        "format"        : "guint8",
                                        "public-format" : "gboolean" } ] },
-                  { "name"      : "Failure Information 3GPP2",
+                  { "name"      : "3GPP2 Failure Information",
                      "id"        : "0x10",
                      "type"      : "TLV",
                      "since"     : "1.28",
                                      { "name"          : "Cause Code",
                                        "format"        : "guint8",
                                        "public-format" : "QmiWmsCdmaCauseCode" } ] },
-                  { "name"      : "Failure Information 3GPP",
+                  { "name"      : "3GPP Failure Information",
                      "id"        : "0x11",
                      "type"      : "TLV",
                      "since"     : "1.28",