github.com/primecitizens/pcz/std@v0.2.1/plat/js/webext/bluetoothlowenergy/bindings/ffi_bindings.ts (about)

     1  import { importModule, Application, heap, Pointer } from "@ffi";
     2  
     3  importModule("plat/js/webext/bluetoothlowenergy", (A: Application) => {
     4    const WEBEXT = typeof globalThis.browser === "undefined" ? globalThis.chrome : globalThis.browser;
     5  
     6    return {
     7      "constof_AdvertisementType": (ref: heap.Ref<string>): number => {
     8        const idx = ["broadcast", "peripheral"].indexOf(A.H.get(ref));
     9        return idx < 0 ? 0 : idx + 1;
    10      },
    11  
    12      "store_ManufacturerData": (ptr: Pointer, ref: heap.Ref<any>) => {
    13        const x = A.H.get<any>(ref);
    14  
    15        if (typeof x === "undefined") {
    16          A.store.Bool(ptr + 9, false);
    17          A.store.Bool(ptr + 8, false);
    18          A.store.Int32(ptr + 0, 0);
    19          A.store.Ref(ptr + 4, undefined);
    20        } else {
    21          A.store.Bool(ptr + 9, true);
    22          A.store.Bool(ptr + 8, "id" in x ? true : false);
    23          A.store.Int32(ptr + 0, x["id"] === undefined ? 0 : (x["id"] as number));
    24          A.store.Ref(ptr + 4, x["data"]);
    25        }
    26      },
    27      "load_ManufacturerData": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
    28        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
    29  
    30        if (A.load.Bool(ptr + 8)) {
    31          x["id"] = A.load.Int32(ptr + 0);
    32        } else {
    33          delete x["id"];
    34        }
    35        x["data"] = A.load.Ref(ptr + 4, undefined);
    36        return create === A.H.TRUE ? A.H.push(x) : ref;
    37      },
    38  
    39      "store_ServiceData": (ptr: Pointer, ref: heap.Ref<any>) => {
    40        const x = A.H.get<any>(ref);
    41  
    42        if (typeof x === "undefined") {
    43          A.store.Bool(ptr + 8, false);
    44          A.store.Ref(ptr + 0, undefined);
    45          A.store.Ref(ptr + 4, undefined);
    46        } else {
    47          A.store.Bool(ptr + 8, true);
    48          A.store.Ref(ptr + 0, x["uuid"]);
    49          A.store.Ref(ptr + 4, x["data"]);
    50        }
    51      },
    52      "load_ServiceData": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
    53        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
    54  
    55        x["uuid"] = A.load.Ref(ptr + 0, undefined);
    56        x["data"] = A.load.Ref(ptr + 4, undefined);
    57        return create === A.H.TRUE ? A.H.push(x) : ref;
    58      },
    59  
    60      "store_Advertisement": (ptr: Pointer, ref: heap.Ref<any>) => {
    61        const x = A.H.get<any>(ref);
    62  
    63        if (typeof x === "undefined") {
    64          A.store.Bool(ptr + 20, false);
    65          A.store.Enum(ptr + 0, -1);
    66          A.store.Ref(ptr + 4, undefined);
    67          A.store.Ref(ptr + 8, undefined);
    68          A.store.Ref(ptr + 12, undefined);
    69          A.store.Ref(ptr + 16, undefined);
    70        } else {
    71          A.store.Bool(ptr + 20, true);
    72          A.store.Enum(ptr + 0, ["broadcast", "peripheral"].indexOf(x["type"] as string));
    73          A.store.Ref(ptr + 4, x["serviceUuids"]);
    74          A.store.Ref(ptr + 8, x["manufacturerData"]);
    75          A.store.Ref(ptr + 12, x["solicitUuids"]);
    76          A.store.Ref(ptr + 16, x["serviceData"]);
    77        }
    78      },
    79      "load_Advertisement": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
    80        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
    81  
    82        x["type"] = A.load.Enum(ptr + 0, ["broadcast", "peripheral"]);
    83        x["serviceUuids"] = A.load.Ref(ptr + 4, undefined);
    84        x["manufacturerData"] = A.load.Ref(ptr + 8, undefined);
    85        x["solicitUuids"] = A.load.Ref(ptr + 12, undefined);
    86        x["serviceData"] = A.load.Ref(ptr + 16, undefined);
    87        return create === A.H.TRUE ? A.H.push(x) : ref;
    88      },
    89  
    90      "store_Service": (ptr: Pointer, ref: heap.Ref<any>) => {
    91        const x = A.H.get<any>(ref);
    92  
    93        if (typeof x === "undefined") {
    94          A.store.Bool(ptr + 17, false);
    95          A.store.Ref(ptr + 0, undefined);
    96          A.store.Bool(ptr + 16, false);
    97          A.store.Bool(ptr + 4, false);
    98          A.store.Ref(ptr + 8, undefined);
    99          A.store.Ref(ptr + 12, undefined);
   100        } else {
   101          A.store.Bool(ptr + 17, true);
   102          A.store.Ref(ptr + 0, x["uuid"]);
   103          A.store.Bool(ptr + 16, "isPrimary" in x ? true : false);
   104          A.store.Bool(ptr + 4, x["isPrimary"] ? true : false);
   105          A.store.Ref(ptr + 8, x["instanceId"]);
   106          A.store.Ref(ptr + 12, x["deviceAddress"]);
   107        }
   108      },
   109      "load_Service": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   110        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   111  
   112        x["uuid"] = A.load.Ref(ptr + 0, undefined);
   113        if (A.load.Bool(ptr + 16)) {
   114          x["isPrimary"] = A.load.Bool(ptr + 4);
   115        } else {
   116          delete x["isPrimary"];
   117        }
   118        x["instanceId"] = A.load.Ref(ptr + 8, undefined);
   119        x["deviceAddress"] = A.load.Ref(ptr + 12, undefined);
   120        return create === A.H.TRUE ? A.H.push(x) : ref;
   121      },
   122      "constof_CharacteristicProperty": (ref: heap.Ref<string>): number => {
   123        const idx = [
   124          "broadcast",
   125          "read",
   126          "writeWithoutResponse",
   127          "write",
   128          "notify",
   129          "indicate",
   130          "authenticatedSignedWrites",
   131          "extendedProperties",
   132          "reliableWrite",
   133          "writableAuxiliaries",
   134          "encryptRead",
   135          "encryptWrite",
   136          "encryptAuthenticatedRead",
   137          "encryptAuthenticatedWrite",
   138        ].indexOf(A.H.get(ref));
   139        return idx < 0 ? 0 : idx + 1;
   140      },
   141  
   142      "store_Characteristic": (ptr: Pointer, ref: heap.Ref<any>) => {
   143        const x = A.H.get<any>(ref);
   144  
   145        if (typeof x === "undefined") {
   146          A.store.Bool(ptr + 36, false);
   147          A.store.Ref(ptr + 0, undefined);
   148  
   149          A.store.Bool(ptr + 4 + 17, false);
   150          A.store.Ref(ptr + 4 + 0, undefined);
   151          A.store.Bool(ptr + 4 + 16, false);
   152          A.store.Bool(ptr + 4 + 4, false);
   153          A.store.Ref(ptr + 4 + 8, undefined);
   154          A.store.Ref(ptr + 4 + 12, undefined);
   155          A.store.Ref(ptr + 24, undefined);
   156          A.store.Ref(ptr + 28, undefined);
   157          A.store.Ref(ptr + 32, undefined);
   158        } else {
   159          A.store.Bool(ptr + 36, true);
   160          A.store.Ref(ptr + 0, x["uuid"]);
   161  
   162          if (typeof x["service"] === "undefined") {
   163            A.store.Bool(ptr + 4 + 17, false);
   164            A.store.Ref(ptr + 4 + 0, undefined);
   165            A.store.Bool(ptr + 4 + 16, false);
   166            A.store.Bool(ptr + 4 + 4, false);
   167            A.store.Ref(ptr + 4 + 8, undefined);
   168            A.store.Ref(ptr + 4 + 12, undefined);
   169          } else {
   170            A.store.Bool(ptr + 4 + 17, true);
   171            A.store.Ref(ptr + 4 + 0, x["service"]["uuid"]);
   172            A.store.Bool(ptr + 4 + 16, "isPrimary" in x["service"] ? true : false);
   173            A.store.Bool(ptr + 4 + 4, x["service"]["isPrimary"] ? true : false);
   174            A.store.Ref(ptr + 4 + 8, x["service"]["instanceId"]);
   175            A.store.Ref(ptr + 4 + 12, x["service"]["deviceAddress"]);
   176          }
   177          A.store.Ref(ptr + 24, x["properties"]);
   178          A.store.Ref(ptr + 28, x["instanceId"]);
   179          A.store.Ref(ptr + 32, x["value"]);
   180        }
   181      },
   182      "load_Characteristic": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   183        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   184  
   185        x["uuid"] = A.load.Ref(ptr + 0, undefined);
   186        if (A.load.Bool(ptr + 4 + 17)) {
   187          x["service"] = {};
   188          x["service"]["uuid"] = A.load.Ref(ptr + 4 + 0, undefined);
   189          if (A.load.Bool(ptr + 4 + 16)) {
   190            x["service"]["isPrimary"] = A.load.Bool(ptr + 4 + 4);
   191          } else {
   192            delete x["service"]["isPrimary"];
   193          }
   194          x["service"]["instanceId"] = A.load.Ref(ptr + 4 + 8, undefined);
   195          x["service"]["deviceAddress"] = A.load.Ref(ptr + 4 + 12, undefined);
   196        } else {
   197          delete x["service"];
   198        }
   199        x["properties"] = A.load.Ref(ptr + 24, undefined);
   200        x["instanceId"] = A.load.Ref(ptr + 28, undefined);
   201        x["value"] = A.load.Ref(ptr + 32, undefined);
   202        return create === A.H.TRUE ? A.H.push(x) : ref;
   203      },
   204  
   205      "store_ConnectProperties": (ptr: Pointer, ref: heap.Ref<any>) => {
   206        const x = A.H.get<any>(ref);
   207  
   208        if (typeof x === "undefined") {
   209          A.store.Bool(ptr + 2, false);
   210          A.store.Bool(ptr + 1, false);
   211          A.store.Bool(ptr + 0, false);
   212        } else {
   213          A.store.Bool(ptr + 2, true);
   214          A.store.Bool(ptr + 1, "persistent" in x ? true : false);
   215          A.store.Bool(ptr + 0, x["persistent"] ? true : false);
   216        }
   217      },
   218      "load_ConnectProperties": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   219        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   220  
   221        if (A.load.Bool(ptr + 1)) {
   222          x["persistent"] = A.load.Bool(ptr + 0);
   223        } else {
   224          delete x["persistent"];
   225        }
   226        return create === A.H.TRUE ? A.H.push(x) : ref;
   227      },
   228      "constof_DescriptorPermission": (ref: heap.Ref<string>): number => {
   229        const idx = [
   230          "read",
   231          "write",
   232          "encryptedRead",
   233          "encryptedWrite",
   234          "encryptedAuthenticatedRead",
   235          "encryptedAuthenticatedWrite",
   236        ].indexOf(A.H.get(ref));
   237        return idx < 0 ? 0 : idx + 1;
   238      },
   239  
   240      "store_Descriptor": (ptr: Pointer, ref: heap.Ref<any>) => {
   241        const x = A.H.get<any>(ref);
   242  
   243        if (typeof x === "undefined") {
   244          A.store.Bool(ptr + 56, false);
   245          A.store.Ref(ptr + 0, undefined);
   246  
   247          A.store.Bool(ptr + 4 + 36, false);
   248          A.store.Ref(ptr + 4 + 0, undefined);
   249  
   250          A.store.Bool(ptr + 4 + 4 + 17, false);
   251          A.store.Ref(ptr + 4 + 4 + 0, undefined);
   252          A.store.Bool(ptr + 4 + 4 + 16, false);
   253          A.store.Bool(ptr + 4 + 4 + 4, false);
   254          A.store.Ref(ptr + 4 + 4 + 8, undefined);
   255          A.store.Ref(ptr + 4 + 4 + 12, undefined);
   256          A.store.Ref(ptr + 4 + 24, undefined);
   257          A.store.Ref(ptr + 4 + 28, undefined);
   258          A.store.Ref(ptr + 4 + 32, undefined);
   259          A.store.Ref(ptr + 44, undefined);
   260          A.store.Ref(ptr + 48, undefined);
   261          A.store.Ref(ptr + 52, undefined);
   262        } else {
   263          A.store.Bool(ptr + 56, true);
   264          A.store.Ref(ptr + 0, x["uuid"]);
   265  
   266          if (typeof x["characteristic"] === "undefined") {
   267            A.store.Bool(ptr + 4 + 36, false);
   268            A.store.Ref(ptr + 4 + 0, undefined);
   269  
   270            A.store.Bool(ptr + 4 + 4 + 17, false);
   271            A.store.Ref(ptr + 4 + 4 + 0, undefined);
   272            A.store.Bool(ptr + 4 + 4 + 16, false);
   273            A.store.Bool(ptr + 4 + 4 + 4, false);
   274            A.store.Ref(ptr + 4 + 4 + 8, undefined);
   275            A.store.Ref(ptr + 4 + 4 + 12, undefined);
   276            A.store.Ref(ptr + 4 + 24, undefined);
   277            A.store.Ref(ptr + 4 + 28, undefined);
   278            A.store.Ref(ptr + 4 + 32, undefined);
   279          } else {
   280            A.store.Bool(ptr + 4 + 36, true);
   281            A.store.Ref(ptr + 4 + 0, x["characteristic"]["uuid"]);
   282  
   283            if (typeof x["characteristic"]["service"] === "undefined") {
   284              A.store.Bool(ptr + 4 + 4 + 17, false);
   285              A.store.Ref(ptr + 4 + 4 + 0, undefined);
   286              A.store.Bool(ptr + 4 + 4 + 16, false);
   287              A.store.Bool(ptr + 4 + 4 + 4, false);
   288              A.store.Ref(ptr + 4 + 4 + 8, undefined);
   289              A.store.Ref(ptr + 4 + 4 + 12, undefined);
   290            } else {
   291              A.store.Bool(ptr + 4 + 4 + 17, true);
   292              A.store.Ref(ptr + 4 + 4 + 0, x["characteristic"]["service"]["uuid"]);
   293              A.store.Bool(ptr + 4 + 4 + 16, "isPrimary" in x["characteristic"]["service"] ? true : false);
   294              A.store.Bool(ptr + 4 + 4 + 4, x["characteristic"]["service"]["isPrimary"] ? true : false);
   295              A.store.Ref(ptr + 4 + 4 + 8, x["characteristic"]["service"]["instanceId"]);
   296              A.store.Ref(ptr + 4 + 4 + 12, x["characteristic"]["service"]["deviceAddress"]);
   297            }
   298            A.store.Ref(ptr + 4 + 24, x["characteristic"]["properties"]);
   299            A.store.Ref(ptr + 4 + 28, x["characteristic"]["instanceId"]);
   300            A.store.Ref(ptr + 4 + 32, x["characteristic"]["value"]);
   301          }
   302          A.store.Ref(ptr + 44, x["permissions"]);
   303          A.store.Ref(ptr + 48, x["instanceId"]);
   304          A.store.Ref(ptr + 52, x["value"]);
   305        }
   306      },
   307      "load_Descriptor": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   308        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   309  
   310        x["uuid"] = A.load.Ref(ptr + 0, undefined);
   311        if (A.load.Bool(ptr + 4 + 36)) {
   312          x["characteristic"] = {};
   313          x["characteristic"]["uuid"] = A.load.Ref(ptr + 4 + 0, undefined);
   314          if (A.load.Bool(ptr + 4 + 4 + 17)) {
   315            x["characteristic"]["service"] = {};
   316            x["characteristic"]["service"]["uuid"] = A.load.Ref(ptr + 4 + 4 + 0, undefined);
   317            if (A.load.Bool(ptr + 4 + 4 + 16)) {
   318              x["characteristic"]["service"]["isPrimary"] = A.load.Bool(ptr + 4 + 4 + 4);
   319            } else {
   320              delete x["characteristic"]["service"]["isPrimary"];
   321            }
   322            x["characteristic"]["service"]["instanceId"] = A.load.Ref(ptr + 4 + 4 + 8, undefined);
   323            x["characteristic"]["service"]["deviceAddress"] = A.load.Ref(ptr + 4 + 4 + 12, undefined);
   324          } else {
   325            delete x["characteristic"]["service"];
   326          }
   327          x["characteristic"]["properties"] = A.load.Ref(ptr + 4 + 24, undefined);
   328          x["characteristic"]["instanceId"] = A.load.Ref(ptr + 4 + 28, undefined);
   329          x["characteristic"]["value"] = A.load.Ref(ptr + 4 + 32, undefined);
   330        } else {
   331          delete x["characteristic"];
   332        }
   333        x["permissions"] = A.load.Ref(ptr + 44, undefined);
   334        x["instanceId"] = A.load.Ref(ptr + 48, undefined);
   335        x["value"] = A.load.Ref(ptr + 52, undefined);
   336        return create === A.H.TRUE ? A.H.push(x) : ref;
   337      },
   338  
   339      "store_Device": (ptr: Pointer, ref: heap.Ref<any>) => {
   340        const x = A.H.get<any>(ref);
   341  
   342        if (typeof x === "undefined") {
   343          A.store.Bool(ptr + 13, false);
   344          A.store.Ref(ptr + 0, undefined);
   345          A.store.Ref(ptr + 4, undefined);
   346          A.store.Bool(ptr + 12, false);
   347          A.store.Int32(ptr + 8, 0);
   348        } else {
   349          A.store.Bool(ptr + 13, true);
   350          A.store.Ref(ptr + 0, x["address"]);
   351          A.store.Ref(ptr + 4, x["name"]);
   352          A.store.Bool(ptr + 12, "deviceClass" in x ? true : false);
   353          A.store.Int32(ptr + 8, x["deviceClass"] === undefined ? 0 : (x["deviceClass"] as number));
   354        }
   355      },
   356      "load_Device": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   357        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   358  
   359        x["address"] = A.load.Ref(ptr + 0, undefined);
   360        x["name"] = A.load.Ref(ptr + 4, undefined);
   361        if (A.load.Bool(ptr + 12)) {
   362          x["deviceClass"] = A.load.Int32(ptr + 8);
   363        } else {
   364          delete x["deviceClass"];
   365        }
   366        return create === A.H.TRUE ? A.H.push(x) : ref;
   367      },
   368  
   369      "store_Notification": (ptr: Pointer, ref: heap.Ref<any>) => {
   370        const x = A.H.get<any>(ref);
   371  
   372        if (typeof x === "undefined") {
   373          A.store.Bool(ptr + 6, false);
   374          A.store.Ref(ptr + 0, undefined);
   375          A.store.Bool(ptr + 5, false);
   376          A.store.Bool(ptr + 4, false);
   377        } else {
   378          A.store.Bool(ptr + 6, true);
   379          A.store.Ref(ptr + 0, x["value"]);
   380          A.store.Bool(ptr + 5, "shouldIndicate" in x ? true : false);
   381          A.store.Bool(ptr + 4, x["shouldIndicate"] ? true : false);
   382        }
   383      },
   384      "load_Notification": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   385        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   386  
   387        x["value"] = A.load.Ref(ptr + 0, undefined);
   388        if (A.load.Bool(ptr + 5)) {
   389          x["shouldIndicate"] = A.load.Bool(ptr + 4);
   390        } else {
   391          delete x["shouldIndicate"];
   392        }
   393        return create === A.H.TRUE ? A.H.push(x) : ref;
   394      },
   395  
   396      "store_NotificationProperties": (ptr: Pointer, ref: heap.Ref<any>) => {
   397        const x = A.H.get<any>(ref);
   398  
   399        if (typeof x === "undefined") {
   400          A.store.Bool(ptr + 2, false);
   401          A.store.Bool(ptr + 1, false);
   402          A.store.Bool(ptr + 0, false);
   403        } else {
   404          A.store.Bool(ptr + 2, true);
   405          A.store.Bool(ptr + 1, "persistent" in x ? true : false);
   406          A.store.Bool(ptr + 0, x["persistent"] ? true : false);
   407        }
   408      },
   409      "load_NotificationProperties": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   410        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   411  
   412        if (A.load.Bool(ptr + 1)) {
   413          x["persistent"] = A.load.Bool(ptr + 0);
   414        } else {
   415          delete x["persistent"];
   416        }
   417        return create === A.H.TRUE ? A.H.push(x) : ref;
   418      },
   419  
   420      "store_Request": (ptr: Pointer, ref: heap.Ref<any>) => {
   421        const x = A.H.get<any>(ref);
   422  
   423        if (typeof x === "undefined") {
   424          A.store.Bool(ptr + 25, false);
   425          A.store.Bool(ptr + 24, false);
   426          A.store.Int32(ptr + 0, 0);
   427  
   428          A.store.Bool(ptr + 4 + 13, false);
   429          A.store.Ref(ptr + 4 + 0, undefined);
   430          A.store.Ref(ptr + 4 + 4, undefined);
   431          A.store.Bool(ptr + 4 + 12, false);
   432          A.store.Int32(ptr + 4 + 8, 0);
   433          A.store.Ref(ptr + 20, undefined);
   434        } else {
   435          A.store.Bool(ptr + 25, true);
   436          A.store.Bool(ptr + 24, "requestId" in x ? true : false);
   437          A.store.Int32(ptr + 0, x["requestId"] === undefined ? 0 : (x["requestId"] as number));
   438  
   439          if (typeof x["device"] === "undefined") {
   440            A.store.Bool(ptr + 4 + 13, false);
   441            A.store.Ref(ptr + 4 + 0, undefined);
   442            A.store.Ref(ptr + 4 + 4, undefined);
   443            A.store.Bool(ptr + 4 + 12, false);
   444            A.store.Int32(ptr + 4 + 8, 0);
   445          } else {
   446            A.store.Bool(ptr + 4 + 13, true);
   447            A.store.Ref(ptr + 4 + 0, x["device"]["address"]);
   448            A.store.Ref(ptr + 4 + 4, x["device"]["name"]);
   449            A.store.Bool(ptr + 4 + 12, "deviceClass" in x["device"] ? true : false);
   450            A.store.Int32(
   451              ptr + 4 + 8,
   452              x["device"]["deviceClass"] === undefined ? 0 : (x["device"]["deviceClass"] as number)
   453            );
   454          }
   455          A.store.Ref(ptr + 20, x["value"]);
   456        }
   457      },
   458      "load_Request": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   459        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   460  
   461        if (A.load.Bool(ptr + 24)) {
   462          x["requestId"] = A.load.Int32(ptr + 0);
   463        } else {
   464          delete x["requestId"];
   465        }
   466        if (A.load.Bool(ptr + 4 + 13)) {
   467          x["device"] = {};
   468          x["device"]["address"] = A.load.Ref(ptr + 4 + 0, undefined);
   469          x["device"]["name"] = A.load.Ref(ptr + 4 + 4, undefined);
   470          if (A.load.Bool(ptr + 4 + 12)) {
   471            x["device"]["deviceClass"] = A.load.Int32(ptr + 4 + 8);
   472          } else {
   473            delete x["device"]["deviceClass"];
   474          }
   475        } else {
   476          delete x["device"];
   477        }
   478        x["value"] = A.load.Ref(ptr + 20, undefined);
   479        return create === A.H.TRUE ? A.H.push(x) : ref;
   480      },
   481  
   482      "store_Response": (ptr: Pointer, ref: heap.Ref<any>) => {
   483        const x = A.H.get<any>(ref);
   484  
   485        if (typeof x === "undefined") {
   486          A.store.Bool(ptr + 14, false);
   487          A.store.Bool(ptr + 12, false);
   488          A.store.Int32(ptr + 0, 0);
   489          A.store.Bool(ptr + 13, false);
   490          A.store.Bool(ptr + 4, false);
   491          A.store.Ref(ptr + 8, undefined);
   492        } else {
   493          A.store.Bool(ptr + 14, true);
   494          A.store.Bool(ptr + 12, "requestId" in x ? true : false);
   495          A.store.Int32(ptr + 0, x["requestId"] === undefined ? 0 : (x["requestId"] as number));
   496          A.store.Bool(ptr + 13, "isError" in x ? true : false);
   497          A.store.Bool(ptr + 4, x["isError"] ? true : false);
   498          A.store.Ref(ptr + 8, x["value"]);
   499        }
   500      },
   501      "load_Response": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   502        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   503  
   504        if (A.load.Bool(ptr + 12)) {
   505          x["requestId"] = A.load.Int32(ptr + 0);
   506        } else {
   507          delete x["requestId"];
   508        }
   509        if (A.load.Bool(ptr + 13)) {
   510          x["isError"] = A.load.Bool(ptr + 4);
   511        } else {
   512          delete x["isError"];
   513        }
   514        x["value"] = A.load.Ref(ptr + 8, undefined);
   515        return create === A.H.TRUE ? A.H.push(x) : ref;
   516      },
   517      "has_Connect": (): heap.Ref<boolean> => {
   518        if (WEBEXT?.bluetoothLowEnergy && "connect" in WEBEXT?.bluetoothLowEnergy) {
   519          return A.H.TRUE;
   520        }
   521        return A.H.FALSE;
   522      },
   523      "func_Connect": (fn: Pointer): void => {
   524        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.connect);
   525      },
   526      "call_Connect": (retPtr: Pointer, deviceAddress: heap.Ref<object>, properties: Pointer): void => {
   527        const properties_ffi = {};
   528  
   529        if (A.load.Bool(properties + 1)) {
   530          properties_ffi["persistent"] = A.load.Bool(properties + 0);
   531        }
   532  
   533        const _ret = WEBEXT.bluetoothLowEnergy.connect(A.H.get<object>(deviceAddress), properties_ffi);
   534        A.store.Ref(retPtr, _ret);
   535      },
   536      "try_Connect": (
   537        retPtr: Pointer,
   538        errPtr: Pointer,
   539        deviceAddress: heap.Ref<object>,
   540        properties: Pointer
   541      ): heap.Ref<boolean> => {
   542        try {
   543          const properties_ffi = {};
   544  
   545          if (A.load.Bool(properties + 1)) {
   546            properties_ffi["persistent"] = A.load.Bool(properties + 0);
   547          }
   548  
   549          const _ret = WEBEXT.bluetoothLowEnergy.connect(A.H.get<object>(deviceAddress), properties_ffi);
   550          A.store.Ref(retPtr, _ret);
   551          return A.H.TRUE;
   552        } catch (err: any) {
   553          A.store.Ref(errPtr, err);
   554          return A.H.FALSE;
   555        }
   556      },
   557      "has_CreateCharacteristic": (): heap.Ref<boolean> => {
   558        if (WEBEXT?.bluetoothLowEnergy && "createCharacteristic" in WEBEXT?.bluetoothLowEnergy) {
   559          return A.H.TRUE;
   560        }
   561        return A.H.FALSE;
   562      },
   563      "func_CreateCharacteristic": (fn: Pointer): void => {
   564        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.createCharacteristic);
   565      },
   566      "call_CreateCharacteristic": (retPtr: Pointer, characteristic: Pointer, serviceId: heap.Ref<object>): void => {
   567        const characteristic_ffi = {};
   568  
   569        characteristic_ffi["uuid"] = A.load.Ref(characteristic + 0, undefined);
   570        if (A.load.Bool(characteristic + 4 + 17)) {
   571          characteristic_ffi["service"] = {};
   572          characteristic_ffi["service"]["uuid"] = A.load.Ref(characteristic + 4 + 0, undefined);
   573          if (A.load.Bool(characteristic + 4 + 16)) {
   574            characteristic_ffi["service"]["isPrimary"] = A.load.Bool(characteristic + 4 + 4);
   575          }
   576          characteristic_ffi["service"]["instanceId"] = A.load.Ref(characteristic + 4 + 8, undefined);
   577          characteristic_ffi["service"]["deviceAddress"] = A.load.Ref(characteristic + 4 + 12, undefined);
   578        }
   579        characteristic_ffi["properties"] = A.load.Ref(characteristic + 24, undefined);
   580        characteristic_ffi["instanceId"] = A.load.Ref(characteristic + 28, undefined);
   581        characteristic_ffi["value"] = A.load.Ref(characteristic + 32, undefined);
   582  
   583        const _ret = WEBEXT.bluetoothLowEnergy.createCharacteristic(characteristic_ffi, A.H.get<object>(serviceId));
   584        A.store.Ref(retPtr, _ret);
   585      },
   586      "try_CreateCharacteristic": (
   587        retPtr: Pointer,
   588        errPtr: Pointer,
   589        characteristic: Pointer,
   590        serviceId: heap.Ref<object>
   591      ): heap.Ref<boolean> => {
   592        try {
   593          const characteristic_ffi = {};
   594  
   595          characteristic_ffi["uuid"] = A.load.Ref(characteristic + 0, undefined);
   596          if (A.load.Bool(characteristic + 4 + 17)) {
   597            characteristic_ffi["service"] = {};
   598            characteristic_ffi["service"]["uuid"] = A.load.Ref(characteristic + 4 + 0, undefined);
   599            if (A.load.Bool(characteristic + 4 + 16)) {
   600              characteristic_ffi["service"]["isPrimary"] = A.load.Bool(characteristic + 4 + 4);
   601            }
   602            characteristic_ffi["service"]["instanceId"] = A.load.Ref(characteristic + 4 + 8, undefined);
   603            characteristic_ffi["service"]["deviceAddress"] = A.load.Ref(characteristic + 4 + 12, undefined);
   604          }
   605          characteristic_ffi["properties"] = A.load.Ref(characteristic + 24, undefined);
   606          characteristic_ffi["instanceId"] = A.load.Ref(characteristic + 28, undefined);
   607          characteristic_ffi["value"] = A.load.Ref(characteristic + 32, undefined);
   608  
   609          const _ret = WEBEXT.bluetoothLowEnergy.createCharacteristic(characteristic_ffi, A.H.get<object>(serviceId));
   610          A.store.Ref(retPtr, _ret);
   611          return A.H.TRUE;
   612        } catch (err: any) {
   613          A.store.Ref(errPtr, err);
   614          return A.H.FALSE;
   615        }
   616      },
   617      "has_CreateDescriptor": (): heap.Ref<boolean> => {
   618        if (WEBEXT?.bluetoothLowEnergy && "createDescriptor" in WEBEXT?.bluetoothLowEnergy) {
   619          return A.H.TRUE;
   620        }
   621        return A.H.FALSE;
   622      },
   623      "func_CreateDescriptor": (fn: Pointer): void => {
   624        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.createDescriptor);
   625      },
   626      "call_CreateDescriptor": (retPtr: Pointer, descriptor: Pointer, characteristicId: heap.Ref<object>): void => {
   627        const descriptor_ffi = {};
   628  
   629        descriptor_ffi["uuid"] = A.load.Ref(descriptor + 0, undefined);
   630        if (A.load.Bool(descriptor + 4 + 36)) {
   631          descriptor_ffi["characteristic"] = {};
   632          descriptor_ffi["characteristic"]["uuid"] = A.load.Ref(descriptor + 4 + 0, undefined);
   633          if (A.load.Bool(descriptor + 4 + 4 + 17)) {
   634            descriptor_ffi["characteristic"]["service"] = {};
   635            descriptor_ffi["characteristic"]["service"]["uuid"] = A.load.Ref(descriptor + 4 + 4 + 0, undefined);
   636            if (A.load.Bool(descriptor + 4 + 4 + 16)) {
   637              descriptor_ffi["characteristic"]["service"]["isPrimary"] = A.load.Bool(descriptor + 4 + 4 + 4);
   638            }
   639            descriptor_ffi["characteristic"]["service"]["instanceId"] = A.load.Ref(descriptor + 4 + 4 + 8, undefined);
   640            descriptor_ffi["characteristic"]["service"]["deviceAddress"] = A.load.Ref(descriptor + 4 + 4 + 12, undefined);
   641          }
   642          descriptor_ffi["characteristic"]["properties"] = A.load.Ref(descriptor + 4 + 24, undefined);
   643          descriptor_ffi["characteristic"]["instanceId"] = A.load.Ref(descriptor + 4 + 28, undefined);
   644          descriptor_ffi["characteristic"]["value"] = A.load.Ref(descriptor + 4 + 32, undefined);
   645        }
   646        descriptor_ffi["permissions"] = A.load.Ref(descriptor + 44, undefined);
   647        descriptor_ffi["instanceId"] = A.load.Ref(descriptor + 48, undefined);
   648        descriptor_ffi["value"] = A.load.Ref(descriptor + 52, undefined);
   649  
   650        const _ret = WEBEXT.bluetoothLowEnergy.createDescriptor(descriptor_ffi, A.H.get<object>(characteristicId));
   651        A.store.Ref(retPtr, _ret);
   652      },
   653      "try_CreateDescriptor": (
   654        retPtr: Pointer,
   655        errPtr: Pointer,
   656        descriptor: Pointer,
   657        characteristicId: heap.Ref<object>
   658      ): heap.Ref<boolean> => {
   659        try {
   660          const descriptor_ffi = {};
   661  
   662          descriptor_ffi["uuid"] = A.load.Ref(descriptor + 0, undefined);
   663          if (A.load.Bool(descriptor + 4 + 36)) {
   664            descriptor_ffi["characteristic"] = {};
   665            descriptor_ffi["characteristic"]["uuid"] = A.load.Ref(descriptor + 4 + 0, undefined);
   666            if (A.load.Bool(descriptor + 4 + 4 + 17)) {
   667              descriptor_ffi["characteristic"]["service"] = {};
   668              descriptor_ffi["characteristic"]["service"]["uuid"] = A.load.Ref(descriptor + 4 + 4 + 0, undefined);
   669              if (A.load.Bool(descriptor + 4 + 4 + 16)) {
   670                descriptor_ffi["characteristic"]["service"]["isPrimary"] = A.load.Bool(descriptor + 4 + 4 + 4);
   671              }
   672              descriptor_ffi["characteristic"]["service"]["instanceId"] = A.load.Ref(descriptor + 4 + 4 + 8, undefined);
   673              descriptor_ffi["characteristic"]["service"]["deviceAddress"] = A.load.Ref(
   674                descriptor + 4 + 4 + 12,
   675                undefined
   676              );
   677            }
   678            descriptor_ffi["characteristic"]["properties"] = A.load.Ref(descriptor + 4 + 24, undefined);
   679            descriptor_ffi["characteristic"]["instanceId"] = A.load.Ref(descriptor + 4 + 28, undefined);
   680            descriptor_ffi["characteristic"]["value"] = A.load.Ref(descriptor + 4 + 32, undefined);
   681          }
   682          descriptor_ffi["permissions"] = A.load.Ref(descriptor + 44, undefined);
   683          descriptor_ffi["instanceId"] = A.load.Ref(descriptor + 48, undefined);
   684          descriptor_ffi["value"] = A.load.Ref(descriptor + 52, undefined);
   685  
   686          const _ret = WEBEXT.bluetoothLowEnergy.createDescriptor(descriptor_ffi, A.H.get<object>(characteristicId));
   687          A.store.Ref(retPtr, _ret);
   688          return A.H.TRUE;
   689        } catch (err: any) {
   690          A.store.Ref(errPtr, err);
   691          return A.H.FALSE;
   692        }
   693      },
   694      "has_CreateService": (): heap.Ref<boolean> => {
   695        if (WEBEXT?.bluetoothLowEnergy && "createService" in WEBEXT?.bluetoothLowEnergy) {
   696          return A.H.TRUE;
   697        }
   698        return A.H.FALSE;
   699      },
   700      "func_CreateService": (fn: Pointer): void => {
   701        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.createService);
   702      },
   703      "call_CreateService": (retPtr: Pointer, service: Pointer): void => {
   704        const service_ffi = {};
   705  
   706        service_ffi["uuid"] = A.load.Ref(service + 0, undefined);
   707        if (A.load.Bool(service + 16)) {
   708          service_ffi["isPrimary"] = A.load.Bool(service + 4);
   709        }
   710        service_ffi["instanceId"] = A.load.Ref(service + 8, undefined);
   711        service_ffi["deviceAddress"] = A.load.Ref(service + 12, undefined);
   712  
   713        const _ret = WEBEXT.bluetoothLowEnergy.createService(service_ffi);
   714        A.store.Ref(retPtr, _ret);
   715      },
   716      "try_CreateService": (retPtr: Pointer, errPtr: Pointer, service: Pointer): heap.Ref<boolean> => {
   717        try {
   718          const service_ffi = {};
   719  
   720          service_ffi["uuid"] = A.load.Ref(service + 0, undefined);
   721          if (A.load.Bool(service + 16)) {
   722            service_ffi["isPrimary"] = A.load.Bool(service + 4);
   723          }
   724          service_ffi["instanceId"] = A.load.Ref(service + 8, undefined);
   725          service_ffi["deviceAddress"] = A.load.Ref(service + 12, undefined);
   726  
   727          const _ret = WEBEXT.bluetoothLowEnergy.createService(service_ffi);
   728          A.store.Ref(retPtr, _ret);
   729          return A.H.TRUE;
   730        } catch (err: any) {
   731          A.store.Ref(errPtr, err);
   732          return A.H.FALSE;
   733        }
   734      },
   735      "has_Disconnect": (): heap.Ref<boolean> => {
   736        if (WEBEXT?.bluetoothLowEnergy && "disconnect" in WEBEXT?.bluetoothLowEnergy) {
   737          return A.H.TRUE;
   738        }
   739        return A.H.FALSE;
   740      },
   741      "func_Disconnect": (fn: Pointer): void => {
   742        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.disconnect);
   743      },
   744      "call_Disconnect": (retPtr: Pointer, deviceAddress: heap.Ref<object>): void => {
   745        const _ret = WEBEXT.bluetoothLowEnergy.disconnect(A.H.get<object>(deviceAddress));
   746        A.store.Ref(retPtr, _ret);
   747      },
   748      "try_Disconnect": (retPtr: Pointer, errPtr: Pointer, deviceAddress: heap.Ref<object>): heap.Ref<boolean> => {
   749        try {
   750          const _ret = WEBEXT.bluetoothLowEnergy.disconnect(A.H.get<object>(deviceAddress));
   751          A.store.Ref(retPtr, _ret);
   752          return A.H.TRUE;
   753        } catch (err: any) {
   754          A.store.Ref(errPtr, err);
   755          return A.H.FALSE;
   756        }
   757      },
   758      "has_GetCharacteristic": (): heap.Ref<boolean> => {
   759        if (WEBEXT?.bluetoothLowEnergy && "getCharacteristic" in WEBEXT?.bluetoothLowEnergy) {
   760          return A.H.TRUE;
   761        }
   762        return A.H.FALSE;
   763      },
   764      "func_GetCharacteristic": (fn: Pointer): void => {
   765        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.getCharacteristic);
   766      },
   767      "call_GetCharacteristic": (retPtr: Pointer, characteristicId: heap.Ref<object>): void => {
   768        const _ret = WEBEXT.bluetoothLowEnergy.getCharacteristic(A.H.get<object>(characteristicId));
   769        A.store.Ref(retPtr, _ret);
   770      },
   771      "try_GetCharacteristic": (
   772        retPtr: Pointer,
   773        errPtr: Pointer,
   774        characteristicId: heap.Ref<object>
   775      ): heap.Ref<boolean> => {
   776        try {
   777          const _ret = WEBEXT.bluetoothLowEnergy.getCharacteristic(A.H.get<object>(characteristicId));
   778          A.store.Ref(retPtr, _ret);
   779          return A.H.TRUE;
   780        } catch (err: any) {
   781          A.store.Ref(errPtr, err);
   782          return A.H.FALSE;
   783        }
   784      },
   785      "has_GetCharacteristics": (): heap.Ref<boolean> => {
   786        if (WEBEXT?.bluetoothLowEnergy && "getCharacteristics" in WEBEXT?.bluetoothLowEnergy) {
   787          return A.H.TRUE;
   788        }
   789        return A.H.FALSE;
   790      },
   791      "func_GetCharacteristics": (fn: Pointer): void => {
   792        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.getCharacteristics);
   793      },
   794      "call_GetCharacteristics": (retPtr: Pointer, serviceId: heap.Ref<object>): void => {
   795        const _ret = WEBEXT.bluetoothLowEnergy.getCharacteristics(A.H.get<object>(serviceId));
   796        A.store.Ref(retPtr, _ret);
   797      },
   798      "try_GetCharacteristics": (retPtr: Pointer, errPtr: Pointer, serviceId: heap.Ref<object>): heap.Ref<boolean> => {
   799        try {
   800          const _ret = WEBEXT.bluetoothLowEnergy.getCharacteristics(A.H.get<object>(serviceId));
   801          A.store.Ref(retPtr, _ret);
   802          return A.H.TRUE;
   803        } catch (err: any) {
   804          A.store.Ref(errPtr, err);
   805          return A.H.FALSE;
   806        }
   807      },
   808      "has_GetDescriptor": (): heap.Ref<boolean> => {
   809        if (WEBEXT?.bluetoothLowEnergy && "getDescriptor" in WEBEXT?.bluetoothLowEnergy) {
   810          return A.H.TRUE;
   811        }
   812        return A.H.FALSE;
   813      },
   814      "func_GetDescriptor": (fn: Pointer): void => {
   815        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.getDescriptor);
   816      },
   817      "call_GetDescriptor": (retPtr: Pointer, descriptorId: heap.Ref<object>): void => {
   818        const _ret = WEBEXT.bluetoothLowEnergy.getDescriptor(A.H.get<object>(descriptorId));
   819        A.store.Ref(retPtr, _ret);
   820      },
   821      "try_GetDescriptor": (retPtr: Pointer, errPtr: Pointer, descriptorId: heap.Ref<object>): heap.Ref<boolean> => {
   822        try {
   823          const _ret = WEBEXT.bluetoothLowEnergy.getDescriptor(A.H.get<object>(descriptorId));
   824          A.store.Ref(retPtr, _ret);
   825          return A.H.TRUE;
   826        } catch (err: any) {
   827          A.store.Ref(errPtr, err);
   828          return A.H.FALSE;
   829        }
   830      },
   831      "has_GetDescriptors": (): heap.Ref<boolean> => {
   832        if (WEBEXT?.bluetoothLowEnergy && "getDescriptors" in WEBEXT?.bluetoothLowEnergy) {
   833          return A.H.TRUE;
   834        }
   835        return A.H.FALSE;
   836      },
   837      "func_GetDescriptors": (fn: Pointer): void => {
   838        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.getDescriptors);
   839      },
   840      "call_GetDescriptors": (retPtr: Pointer, characteristicId: heap.Ref<object>): void => {
   841        const _ret = WEBEXT.bluetoothLowEnergy.getDescriptors(A.H.get<object>(characteristicId));
   842        A.store.Ref(retPtr, _ret);
   843      },
   844      "try_GetDescriptors": (retPtr: Pointer, errPtr: Pointer, characteristicId: heap.Ref<object>): heap.Ref<boolean> => {
   845        try {
   846          const _ret = WEBEXT.bluetoothLowEnergy.getDescriptors(A.H.get<object>(characteristicId));
   847          A.store.Ref(retPtr, _ret);
   848          return A.H.TRUE;
   849        } catch (err: any) {
   850          A.store.Ref(errPtr, err);
   851          return A.H.FALSE;
   852        }
   853      },
   854      "has_GetIncludedServices": (): heap.Ref<boolean> => {
   855        if (WEBEXT?.bluetoothLowEnergy && "getIncludedServices" in WEBEXT?.bluetoothLowEnergy) {
   856          return A.H.TRUE;
   857        }
   858        return A.H.FALSE;
   859      },
   860      "func_GetIncludedServices": (fn: Pointer): void => {
   861        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.getIncludedServices);
   862      },
   863      "call_GetIncludedServices": (retPtr: Pointer, serviceId: heap.Ref<object>): void => {
   864        const _ret = WEBEXT.bluetoothLowEnergy.getIncludedServices(A.H.get<object>(serviceId));
   865        A.store.Ref(retPtr, _ret);
   866      },
   867      "try_GetIncludedServices": (retPtr: Pointer, errPtr: Pointer, serviceId: heap.Ref<object>): heap.Ref<boolean> => {
   868        try {
   869          const _ret = WEBEXT.bluetoothLowEnergy.getIncludedServices(A.H.get<object>(serviceId));
   870          A.store.Ref(retPtr, _ret);
   871          return A.H.TRUE;
   872        } catch (err: any) {
   873          A.store.Ref(errPtr, err);
   874          return A.H.FALSE;
   875        }
   876      },
   877      "has_GetService": (): heap.Ref<boolean> => {
   878        if (WEBEXT?.bluetoothLowEnergy && "getService" in WEBEXT?.bluetoothLowEnergy) {
   879          return A.H.TRUE;
   880        }
   881        return A.H.FALSE;
   882      },
   883      "func_GetService": (fn: Pointer): void => {
   884        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.getService);
   885      },
   886      "call_GetService": (retPtr: Pointer, serviceId: heap.Ref<object>): void => {
   887        const _ret = WEBEXT.bluetoothLowEnergy.getService(A.H.get<object>(serviceId));
   888        A.store.Ref(retPtr, _ret);
   889      },
   890      "try_GetService": (retPtr: Pointer, errPtr: Pointer, serviceId: heap.Ref<object>): heap.Ref<boolean> => {
   891        try {
   892          const _ret = WEBEXT.bluetoothLowEnergy.getService(A.H.get<object>(serviceId));
   893          A.store.Ref(retPtr, _ret);
   894          return A.H.TRUE;
   895        } catch (err: any) {
   896          A.store.Ref(errPtr, err);
   897          return A.H.FALSE;
   898        }
   899      },
   900      "has_GetServices": (): heap.Ref<boolean> => {
   901        if (WEBEXT?.bluetoothLowEnergy && "getServices" in WEBEXT?.bluetoothLowEnergy) {
   902          return A.H.TRUE;
   903        }
   904        return A.H.FALSE;
   905      },
   906      "func_GetServices": (fn: Pointer): void => {
   907        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.getServices);
   908      },
   909      "call_GetServices": (retPtr: Pointer, deviceAddress: heap.Ref<object>): void => {
   910        const _ret = WEBEXT.bluetoothLowEnergy.getServices(A.H.get<object>(deviceAddress));
   911        A.store.Ref(retPtr, _ret);
   912      },
   913      "try_GetServices": (retPtr: Pointer, errPtr: Pointer, deviceAddress: heap.Ref<object>): heap.Ref<boolean> => {
   914        try {
   915          const _ret = WEBEXT.bluetoothLowEnergy.getServices(A.H.get<object>(deviceAddress));
   916          A.store.Ref(retPtr, _ret);
   917          return A.H.TRUE;
   918        } catch (err: any) {
   919          A.store.Ref(errPtr, err);
   920          return A.H.FALSE;
   921        }
   922      },
   923      "has_NotifyCharacteristicValueChanged": (): heap.Ref<boolean> => {
   924        if (WEBEXT?.bluetoothLowEnergy && "notifyCharacteristicValueChanged" in WEBEXT?.bluetoothLowEnergy) {
   925          return A.H.TRUE;
   926        }
   927        return A.H.FALSE;
   928      },
   929      "func_NotifyCharacteristicValueChanged": (fn: Pointer): void => {
   930        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.notifyCharacteristicValueChanged);
   931      },
   932      "call_NotifyCharacteristicValueChanged": (
   933        retPtr: Pointer,
   934        characteristicId: heap.Ref<object>,
   935        notification: Pointer
   936      ): void => {
   937        const notification_ffi = {};
   938  
   939        notification_ffi["value"] = A.load.Ref(notification + 0, undefined);
   940        if (A.load.Bool(notification + 5)) {
   941          notification_ffi["shouldIndicate"] = A.load.Bool(notification + 4);
   942        }
   943  
   944        const _ret = WEBEXT.bluetoothLowEnergy.notifyCharacteristicValueChanged(
   945          A.H.get<object>(characteristicId),
   946          notification_ffi
   947        );
   948        A.store.Ref(retPtr, _ret);
   949      },
   950      "try_NotifyCharacteristicValueChanged": (
   951        retPtr: Pointer,
   952        errPtr: Pointer,
   953        characteristicId: heap.Ref<object>,
   954        notification: Pointer
   955      ): heap.Ref<boolean> => {
   956        try {
   957          const notification_ffi = {};
   958  
   959          notification_ffi["value"] = A.load.Ref(notification + 0, undefined);
   960          if (A.load.Bool(notification + 5)) {
   961            notification_ffi["shouldIndicate"] = A.load.Bool(notification + 4);
   962          }
   963  
   964          const _ret = WEBEXT.bluetoothLowEnergy.notifyCharacteristicValueChanged(
   965            A.H.get<object>(characteristicId),
   966            notification_ffi
   967          );
   968          A.store.Ref(retPtr, _ret);
   969          return A.H.TRUE;
   970        } catch (err: any) {
   971          A.store.Ref(errPtr, err);
   972          return A.H.FALSE;
   973        }
   974      },
   975      "has_OnCharacteristicReadRequest": (): heap.Ref<boolean> => {
   976        if (
   977          WEBEXT?.bluetoothLowEnergy?.onCharacteristicReadRequest &&
   978          "addListener" in WEBEXT?.bluetoothLowEnergy?.onCharacteristicReadRequest
   979        ) {
   980          return A.H.TRUE;
   981        }
   982        return A.H.FALSE;
   983      },
   984      "func_OnCharacteristicReadRequest": (fn: Pointer): void => {
   985        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.onCharacteristicReadRequest.addListener);
   986      },
   987      "call_OnCharacteristicReadRequest": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   988        const _ret = WEBEXT.bluetoothLowEnergy.onCharacteristicReadRequest.addListener(A.H.get<object>(callback));
   989      },
   990      "try_OnCharacteristicReadRequest": (
   991        retPtr: Pointer,
   992        errPtr: Pointer,
   993        callback: heap.Ref<object>
   994      ): heap.Ref<boolean> => {
   995        try {
   996          const _ret = WEBEXT.bluetoothLowEnergy.onCharacteristicReadRequest.addListener(A.H.get<object>(callback));
   997          return A.H.TRUE;
   998        } catch (err: any) {
   999          A.store.Ref(errPtr, err);
  1000          return A.H.FALSE;
  1001        }
  1002      },
  1003      "has_OffCharacteristicReadRequest": (): heap.Ref<boolean> => {
  1004        if (
  1005          WEBEXT?.bluetoothLowEnergy?.onCharacteristicReadRequest &&
  1006          "removeListener" in WEBEXT?.bluetoothLowEnergy?.onCharacteristicReadRequest
  1007        ) {
  1008          return A.H.TRUE;
  1009        }
  1010        return A.H.FALSE;
  1011      },
  1012      "func_OffCharacteristicReadRequest": (fn: Pointer): void => {
  1013        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.onCharacteristicReadRequest.removeListener);
  1014      },
  1015      "call_OffCharacteristicReadRequest": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1016        const _ret = WEBEXT.bluetoothLowEnergy.onCharacteristicReadRequest.removeListener(A.H.get<object>(callback));
  1017      },
  1018      "try_OffCharacteristicReadRequest": (
  1019        retPtr: Pointer,
  1020        errPtr: Pointer,
  1021        callback: heap.Ref<object>
  1022      ): heap.Ref<boolean> => {
  1023        try {
  1024          const _ret = WEBEXT.bluetoothLowEnergy.onCharacteristicReadRequest.removeListener(A.H.get<object>(callback));
  1025          return A.H.TRUE;
  1026        } catch (err: any) {
  1027          A.store.Ref(errPtr, err);
  1028          return A.H.FALSE;
  1029        }
  1030      },
  1031      "has_HasOnCharacteristicReadRequest": (): heap.Ref<boolean> => {
  1032        if (
  1033          WEBEXT?.bluetoothLowEnergy?.onCharacteristicReadRequest &&
  1034          "hasListener" in WEBEXT?.bluetoothLowEnergy?.onCharacteristicReadRequest
  1035        ) {
  1036          return A.H.TRUE;
  1037        }
  1038        return A.H.FALSE;
  1039      },
  1040      "func_HasOnCharacteristicReadRequest": (fn: Pointer): void => {
  1041        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.onCharacteristicReadRequest.hasListener);
  1042      },
  1043      "call_HasOnCharacteristicReadRequest": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1044        const _ret = WEBEXT.bluetoothLowEnergy.onCharacteristicReadRequest.hasListener(A.H.get<object>(callback));
  1045        A.store.Bool(retPtr, _ret);
  1046      },
  1047      "try_HasOnCharacteristicReadRequest": (
  1048        retPtr: Pointer,
  1049        errPtr: Pointer,
  1050        callback: heap.Ref<object>
  1051      ): heap.Ref<boolean> => {
  1052        try {
  1053          const _ret = WEBEXT.bluetoothLowEnergy.onCharacteristicReadRequest.hasListener(A.H.get<object>(callback));
  1054          A.store.Bool(retPtr, _ret);
  1055          return A.H.TRUE;
  1056        } catch (err: any) {
  1057          A.store.Ref(errPtr, err);
  1058          return A.H.FALSE;
  1059        }
  1060      },
  1061      "has_OnCharacteristicValueChanged": (): heap.Ref<boolean> => {
  1062        if (
  1063          WEBEXT?.bluetoothLowEnergy?.onCharacteristicValueChanged &&
  1064          "addListener" in WEBEXT?.bluetoothLowEnergy?.onCharacteristicValueChanged
  1065        ) {
  1066          return A.H.TRUE;
  1067        }
  1068        return A.H.FALSE;
  1069      },
  1070      "func_OnCharacteristicValueChanged": (fn: Pointer): void => {
  1071        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.onCharacteristicValueChanged.addListener);
  1072      },
  1073      "call_OnCharacteristicValueChanged": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1074        const _ret = WEBEXT.bluetoothLowEnergy.onCharacteristicValueChanged.addListener(A.H.get<object>(callback));
  1075      },
  1076      "try_OnCharacteristicValueChanged": (
  1077        retPtr: Pointer,
  1078        errPtr: Pointer,
  1079        callback: heap.Ref<object>
  1080      ): heap.Ref<boolean> => {
  1081        try {
  1082          const _ret = WEBEXT.bluetoothLowEnergy.onCharacteristicValueChanged.addListener(A.H.get<object>(callback));
  1083          return A.H.TRUE;
  1084        } catch (err: any) {
  1085          A.store.Ref(errPtr, err);
  1086          return A.H.FALSE;
  1087        }
  1088      },
  1089      "has_OffCharacteristicValueChanged": (): heap.Ref<boolean> => {
  1090        if (
  1091          WEBEXT?.bluetoothLowEnergy?.onCharacteristicValueChanged &&
  1092          "removeListener" in WEBEXT?.bluetoothLowEnergy?.onCharacteristicValueChanged
  1093        ) {
  1094          return A.H.TRUE;
  1095        }
  1096        return A.H.FALSE;
  1097      },
  1098      "func_OffCharacteristicValueChanged": (fn: Pointer): void => {
  1099        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.onCharacteristicValueChanged.removeListener);
  1100      },
  1101      "call_OffCharacteristicValueChanged": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1102        const _ret = WEBEXT.bluetoothLowEnergy.onCharacteristicValueChanged.removeListener(A.H.get<object>(callback));
  1103      },
  1104      "try_OffCharacteristicValueChanged": (
  1105        retPtr: Pointer,
  1106        errPtr: Pointer,
  1107        callback: heap.Ref<object>
  1108      ): heap.Ref<boolean> => {
  1109        try {
  1110          const _ret = WEBEXT.bluetoothLowEnergy.onCharacteristicValueChanged.removeListener(A.H.get<object>(callback));
  1111          return A.H.TRUE;
  1112        } catch (err: any) {
  1113          A.store.Ref(errPtr, err);
  1114          return A.H.FALSE;
  1115        }
  1116      },
  1117      "has_HasOnCharacteristicValueChanged": (): heap.Ref<boolean> => {
  1118        if (
  1119          WEBEXT?.bluetoothLowEnergy?.onCharacteristicValueChanged &&
  1120          "hasListener" in WEBEXT?.bluetoothLowEnergy?.onCharacteristicValueChanged
  1121        ) {
  1122          return A.H.TRUE;
  1123        }
  1124        return A.H.FALSE;
  1125      },
  1126      "func_HasOnCharacteristicValueChanged": (fn: Pointer): void => {
  1127        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.onCharacteristicValueChanged.hasListener);
  1128      },
  1129      "call_HasOnCharacteristicValueChanged": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1130        const _ret = WEBEXT.bluetoothLowEnergy.onCharacteristicValueChanged.hasListener(A.H.get<object>(callback));
  1131        A.store.Bool(retPtr, _ret);
  1132      },
  1133      "try_HasOnCharacteristicValueChanged": (
  1134        retPtr: Pointer,
  1135        errPtr: Pointer,
  1136        callback: heap.Ref<object>
  1137      ): heap.Ref<boolean> => {
  1138        try {
  1139          const _ret = WEBEXT.bluetoothLowEnergy.onCharacteristicValueChanged.hasListener(A.H.get<object>(callback));
  1140          A.store.Bool(retPtr, _ret);
  1141          return A.H.TRUE;
  1142        } catch (err: any) {
  1143          A.store.Ref(errPtr, err);
  1144          return A.H.FALSE;
  1145        }
  1146      },
  1147      "has_OnCharacteristicWriteRequest": (): heap.Ref<boolean> => {
  1148        if (
  1149          WEBEXT?.bluetoothLowEnergy?.onCharacteristicWriteRequest &&
  1150          "addListener" in WEBEXT?.bluetoothLowEnergy?.onCharacteristicWriteRequest
  1151        ) {
  1152          return A.H.TRUE;
  1153        }
  1154        return A.H.FALSE;
  1155      },
  1156      "func_OnCharacteristicWriteRequest": (fn: Pointer): void => {
  1157        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.onCharacteristicWriteRequest.addListener);
  1158      },
  1159      "call_OnCharacteristicWriteRequest": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1160        const _ret = WEBEXT.bluetoothLowEnergy.onCharacteristicWriteRequest.addListener(A.H.get<object>(callback));
  1161      },
  1162      "try_OnCharacteristicWriteRequest": (
  1163        retPtr: Pointer,
  1164        errPtr: Pointer,
  1165        callback: heap.Ref<object>
  1166      ): heap.Ref<boolean> => {
  1167        try {
  1168          const _ret = WEBEXT.bluetoothLowEnergy.onCharacteristicWriteRequest.addListener(A.H.get<object>(callback));
  1169          return A.H.TRUE;
  1170        } catch (err: any) {
  1171          A.store.Ref(errPtr, err);
  1172          return A.H.FALSE;
  1173        }
  1174      },
  1175      "has_OffCharacteristicWriteRequest": (): heap.Ref<boolean> => {
  1176        if (
  1177          WEBEXT?.bluetoothLowEnergy?.onCharacteristicWriteRequest &&
  1178          "removeListener" in WEBEXT?.bluetoothLowEnergy?.onCharacteristicWriteRequest
  1179        ) {
  1180          return A.H.TRUE;
  1181        }
  1182        return A.H.FALSE;
  1183      },
  1184      "func_OffCharacteristicWriteRequest": (fn: Pointer): void => {
  1185        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.onCharacteristicWriteRequest.removeListener);
  1186      },
  1187      "call_OffCharacteristicWriteRequest": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1188        const _ret = WEBEXT.bluetoothLowEnergy.onCharacteristicWriteRequest.removeListener(A.H.get<object>(callback));
  1189      },
  1190      "try_OffCharacteristicWriteRequest": (
  1191        retPtr: Pointer,
  1192        errPtr: Pointer,
  1193        callback: heap.Ref<object>
  1194      ): heap.Ref<boolean> => {
  1195        try {
  1196          const _ret = WEBEXT.bluetoothLowEnergy.onCharacteristicWriteRequest.removeListener(A.H.get<object>(callback));
  1197          return A.H.TRUE;
  1198        } catch (err: any) {
  1199          A.store.Ref(errPtr, err);
  1200          return A.H.FALSE;
  1201        }
  1202      },
  1203      "has_HasOnCharacteristicWriteRequest": (): heap.Ref<boolean> => {
  1204        if (
  1205          WEBEXT?.bluetoothLowEnergy?.onCharacteristicWriteRequest &&
  1206          "hasListener" in WEBEXT?.bluetoothLowEnergy?.onCharacteristicWriteRequest
  1207        ) {
  1208          return A.H.TRUE;
  1209        }
  1210        return A.H.FALSE;
  1211      },
  1212      "func_HasOnCharacteristicWriteRequest": (fn: Pointer): void => {
  1213        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.onCharacteristicWriteRequest.hasListener);
  1214      },
  1215      "call_HasOnCharacteristicWriteRequest": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1216        const _ret = WEBEXT.bluetoothLowEnergy.onCharacteristicWriteRequest.hasListener(A.H.get<object>(callback));
  1217        A.store.Bool(retPtr, _ret);
  1218      },
  1219      "try_HasOnCharacteristicWriteRequest": (
  1220        retPtr: Pointer,
  1221        errPtr: Pointer,
  1222        callback: heap.Ref<object>
  1223      ): heap.Ref<boolean> => {
  1224        try {
  1225          const _ret = WEBEXT.bluetoothLowEnergy.onCharacteristicWriteRequest.hasListener(A.H.get<object>(callback));
  1226          A.store.Bool(retPtr, _ret);
  1227          return A.H.TRUE;
  1228        } catch (err: any) {
  1229          A.store.Ref(errPtr, err);
  1230          return A.H.FALSE;
  1231        }
  1232      },
  1233      "has_OnDescriptorReadRequest": (): heap.Ref<boolean> => {
  1234        if (
  1235          WEBEXT?.bluetoothLowEnergy?.onDescriptorReadRequest &&
  1236          "addListener" in WEBEXT?.bluetoothLowEnergy?.onDescriptorReadRequest
  1237        ) {
  1238          return A.H.TRUE;
  1239        }
  1240        return A.H.FALSE;
  1241      },
  1242      "func_OnDescriptorReadRequest": (fn: Pointer): void => {
  1243        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.onDescriptorReadRequest.addListener);
  1244      },
  1245      "call_OnDescriptorReadRequest": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1246        const _ret = WEBEXT.bluetoothLowEnergy.onDescriptorReadRequest.addListener(A.H.get<object>(callback));
  1247      },
  1248      "try_OnDescriptorReadRequest": (
  1249        retPtr: Pointer,
  1250        errPtr: Pointer,
  1251        callback: heap.Ref<object>
  1252      ): heap.Ref<boolean> => {
  1253        try {
  1254          const _ret = WEBEXT.bluetoothLowEnergy.onDescriptorReadRequest.addListener(A.H.get<object>(callback));
  1255          return A.H.TRUE;
  1256        } catch (err: any) {
  1257          A.store.Ref(errPtr, err);
  1258          return A.H.FALSE;
  1259        }
  1260      },
  1261      "has_OffDescriptorReadRequest": (): heap.Ref<boolean> => {
  1262        if (
  1263          WEBEXT?.bluetoothLowEnergy?.onDescriptorReadRequest &&
  1264          "removeListener" in WEBEXT?.bluetoothLowEnergy?.onDescriptorReadRequest
  1265        ) {
  1266          return A.H.TRUE;
  1267        }
  1268        return A.H.FALSE;
  1269      },
  1270      "func_OffDescriptorReadRequest": (fn: Pointer): void => {
  1271        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.onDescriptorReadRequest.removeListener);
  1272      },
  1273      "call_OffDescriptorReadRequest": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1274        const _ret = WEBEXT.bluetoothLowEnergy.onDescriptorReadRequest.removeListener(A.H.get<object>(callback));
  1275      },
  1276      "try_OffDescriptorReadRequest": (
  1277        retPtr: Pointer,
  1278        errPtr: Pointer,
  1279        callback: heap.Ref<object>
  1280      ): heap.Ref<boolean> => {
  1281        try {
  1282          const _ret = WEBEXT.bluetoothLowEnergy.onDescriptorReadRequest.removeListener(A.H.get<object>(callback));
  1283          return A.H.TRUE;
  1284        } catch (err: any) {
  1285          A.store.Ref(errPtr, err);
  1286          return A.H.FALSE;
  1287        }
  1288      },
  1289      "has_HasOnDescriptorReadRequest": (): heap.Ref<boolean> => {
  1290        if (
  1291          WEBEXT?.bluetoothLowEnergy?.onDescriptorReadRequest &&
  1292          "hasListener" in WEBEXT?.bluetoothLowEnergy?.onDescriptorReadRequest
  1293        ) {
  1294          return A.H.TRUE;
  1295        }
  1296        return A.H.FALSE;
  1297      },
  1298      "func_HasOnDescriptorReadRequest": (fn: Pointer): void => {
  1299        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.onDescriptorReadRequest.hasListener);
  1300      },
  1301      "call_HasOnDescriptorReadRequest": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1302        const _ret = WEBEXT.bluetoothLowEnergy.onDescriptorReadRequest.hasListener(A.H.get<object>(callback));
  1303        A.store.Bool(retPtr, _ret);
  1304      },
  1305      "try_HasOnDescriptorReadRequest": (
  1306        retPtr: Pointer,
  1307        errPtr: Pointer,
  1308        callback: heap.Ref<object>
  1309      ): heap.Ref<boolean> => {
  1310        try {
  1311          const _ret = WEBEXT.bluetoothLowEnergy.onDescriptorReadRequest.hasListener(A.H.get<object>(callback));
  1312          A.store.Bool(retPtr, _ret);
  1313          return A.H.TRUE;
  1314        } catch (err: any) {
  1315          A.store.Ref(errPtr, err);
  1316          return A.H.FALSE;
  1317        }
  1318      },
  1319      "has_OnDescriptorValueChanged": (): heap.Ref<boolean> => {
  1320        if (
  1321          WEBEXT?.bluetoothLowEnergy?.onDescriptorValueChanged &&
  1322          "addListener" in WEBEXT?.bluetoothLowEnergy?.onDescriptorValueChanged
  1323        ) {
  1324          return A.H.TRUE;
  1325        }
  1326        return A.H.FALSE;
  1327      },
  1328      "func_OnDescriptorValueChanged": (fn: Pointer): void => {
  1329        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.onDescriptorValueChanged.addListener);
  1330      },
  1331      "call_OnDescriptorValueChanged": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1332        const _ret = WEBEXT.bluetoothLowEnergy.onDescriptorValueChanged.addListener(A.H.get<object>(callback));
  1333      },
  1334      "try_OnDescriptorValueChanged": (
  1335        retPtr: Pointer,
  1336        errPtr: Pointer,
  1337        callback: heap.Ref<object>
  1338      ): heap.Ref<boolean> => {
  1339        try {
  1340          const _ret = WEBEXT.bluetoothLowEnergy.onDescriptorValueChanged.addListener(A.H.get<object>(callback));
  1341          return A.H.TRUE;
  1342        } catch (err: any) {
  1343          A.store.Ref(errPtr, err);
  1344          return A.H.FALSE;
  1345        }
  1346      },
  1347      "has_OffDescriptorValueChanged": (): heap.Ref<boolean> => {
  1348        if (
  1349          WEBEXT?.bluetoothLowEnergy?.onDescriptorValueChanged &&
  1350          "removeListener" in WEBEXT?.bluetoothLowEnergy?.onDescriptorValueChanged
  1351        ) {
  1352          return A.H.TRUE;
  1353        }
  1354        return A.H.FALSE;
  1355      },
  1356      "func_OffDescriptorValueChanged": (fn: Pointer): void => {
  1357        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.onDescriptorValueChanged.removeListener);
  1358      },
  1359      "call_OffDescriptorValueChanged": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1360        const _ret = WEBEXT.bluetoothLowEnergy.onDescriptorValueChanged.removeListener(A.H.get<object>(callback));
  1361      },
  1362      "try_OffDescriptorValueChanged": (
  1363        retPtr: Pointer,
  1364        errPtr: Pointer,
  1365        callback: heap.Ref<object>
  1366      ): heap.Ref<boolean> => {
  1367        try {
  1368          const _ret = WEBEXT.bluetoothLowEnergy.onDescriptorValueChanged.removeListener(A.H.get<object>(callback));
  1369          return A.H.TRUE;
  1370        } catch (err: any) {
  1371          A.store.Ref(errPtr, err);
  1372          return A.H.FALSE;
  1373        }
  1374      },
  1375      "has_HasOnDescriptorValueChanged": (): heap.Ref<boolean> => {
  1376        if (
  1377          WEBEXT?.bluetoothLowEnergy?.onDescriptorValueChanged &&
  1378          "hasListener" in WEBEXT?.bluetoothLowEnergy?.onDescriptorValueChanged
  1379        ) {
  1380          return A.H.TRUE;
  1381        }
  1382        return A.H.FALSE;
  1383      },
  1384      "func_HasOnDescriptorValueChanged": (fn: Pointer): void => {
  1385        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.onDescriptorValueChanged.hasListener);
  1386      },
  1387      "call_HasOnDescriptorValueChanged": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1388        const _ret = WEBEXT.bluetoothLowEnergy.onDescriptorValueChanged.hasListener(A.H.get<object>(callback));
  1389        A.store.Bool(retPtr, _ret);
  1390      },
  1391      "try_HasOnDescriptorValueChanged": (
  1392        retPtr: Pointer,
  1393        errPtr: Pointer,
  1394        callback: heap.Ref<object>
  1395      ): heap.Ref<boolean> => {
  1396        try {
  1397          const _ret = WEBEXT.bluetoothLowEnergy.onDescriptorValueChanged.hasListener(A.H.get<object>(callback));
  1398          A.store.Bool(retPtr, _ret);
  1399          return A.H.TRUE;
  1400        } catch (err: any) {
  1401          A.store.Ref(errPtr, err);
  1402          return A.H.FALSE;
  1403        }
  1404      },
  1405      "has_OnDescriptorWriteRequest": (): heap.Ref<boolean> => {
  1406        if (
  1407          WEBEXT?.bluetoothLowEnergy?.onDescriptorWriteRequest &&
  1408          "addListener" in WEBEXT?.bluetoothLowEnergy?.onDescriptorWriteRequest
  1409        ) {
  1410          return A.H.TRUE;
  1411        }
  1412        return A.H.FALSE;
  1413      },
  1414      "func_OnDescriptorWriteRequest": (fn: Pointer): void => {
  1415        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.onDescriptorWriteRequest.addListener);
  1416      },
  1417      "call_OnDescriptorWriteRequest": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1418        const _ret = WEBEXT.bluetoothLowEnergy.onDescriptorWriteRequest.addListener(A.H.get<object>(callback));
  1419      },
  1420      "try_OnDescriptorWriteRequest": (
  1421        retPtr: Pointer,
  1422        errPtr: Pointer,
  1423        callback: heap.Ref<object>
  1424      ): heap.Ref<boolean> => {
  1425        try {
  1426          const _ret = WEBEXT.bluetoothLowEnergy.onDescriptorWriteRequest.addListener(A.H.get<object>(callback));
  1427          return A.H.TRUE;
  1428        } catch (err: any) {
  1429          A.store.Ref(errPtr, err);
  1430          return A.H.FALSE;
  1431        }
  1432      },
  1433      "has_OffDescriptorWriteRequest": (): heap.Ref<boolean> => {
  1434        if (
  1435          WEBEXT?.bluetoothLowEnergy?.onDescriptorWriteRequest &&
  1436          "removeListener" in WEBEXT?.bluetoothLowEnergy?.onDescriptorWriteRequest
  1437        ) {
  1438          return A.H.TRUE;
  1439        }
  1440        return A.H.FALSE;
  1441      },
  1442      "func_OffDescriptorWriteRequest": (fn: Pointer): void => {
  1443        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.onDescriptorWriteRequest.removeListener);
  1444      },
  1445      "call_OffDescriptorWriteRequest": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1446        const _ret = WEBEXT.bluetoothLowEnergy.onDescriptorWriteRequest.removeListener(A.H.get<object>(callback));
  1447      },
  1448      "try_OffDescriptorWriteRequest": (
  1449        retPtr: Pointer,
  1450        errPtr: Pointer,
  1451        callback: heap.Ref<object>
  1452      ): heap.Ref<boolean> => {
  1453        try {
  1454          const _ret = WEBEXT.bluetoothLowEnergy.onDescriptorWriteRequest.removeListener(A.H.get<object>(callback));
  1455          return A.H.TRUE;
  1456        } catch (err: any) {
  1457          A.store.Ref(errPtr, err);
  1458          return A.H.FALSE;
  1459        }
  1460      },
  1461      "has_HasOnDescriptorWriteRequest": (): heap.Ref<boolean> => {
  1462        if (
  1463          WEBEXT?.bluetoothLowEnergy?.onDescriptorWriteRequest &&
  1464          "hasListener" in WEBEXT?.bluetoothLowEnergy?.onDescriptorWriteRequest
  1465        ) {
  1466          return A.H.TRUE;
  1467        }
  1468        return A.H.FALSE;
  1469      },
  1470      "func_HasOnDescriptorWriteRequest": (fn: Pointer): void => {
  1471        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.onDescriptorWriteRequest.hasListener);
  1472      },
  1473      "call_HasOnDescriptorWriteRequest": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1474        const _ret = WEBEXT.bluetoothLowEnergy.onDescriptorWriteRequest.hasListener(A.H.get<object>(callback));
  1475        A.store.Bool(retPtr, _ret);
  1476      },
  1477      "try_HasOnDescriptorWriteRequest": (
  1478        retPtr: Pointer,
  1479        errPtr: Pointer,
  1480        callback: heap.Ref<object>
  1481      ): heap.Ref<boolean> => {
  1482        try {
  1483          const _ret = WEBEXT.bluetoothLowEnergy.onDescriptorWriteRequest.hasListener(A.H.get<object>(callback));
  1484          A.store.Bool(retPtr, _ret);
  1485          return A.H.TRUE;
  1486        } catch (err: any) {
  1487          A.store.Ref(errPtr, err);
  1488          return A.H.FALSE;
  1489        }
  1490      },
  1491      "has_OnServiceAdded": (): heap.Ref<boolean> => {
  1492        if (WEBEXT?.bluetoothLowEnergy?.onServiceAdded && "addListener" in WEBEXT?.bluetoothLowEnergy?.onServiceAdded) {
  1493          return A.H.TRUE;
  1494        }
  1495        return A.H.FALSE;
  1496      },
  1497      "func_OnServiceAdded": (fn: Pointer): void => {
  1498        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.onServiceAdded.addListener);
  1499      },
  1500      "call_OnServiceAdded": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1501        const _ret = WEBEXT.bluetoothLowEnergy.onServiceAdded.addListener(A.H.get<object>(callback));
  1502      },
  1503      "try_OnServiceAdded": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
  1504        try {
  1505          const _ret = WEBEXT.bluetoothLowEnergy.onServiceAdded.addListener(A.H.get<object>(callback));
  1506          return A.H.TRUE;
  1507        } catch (err: any) {
  1508          A.store.Ref(errPtr, err);
  1509          return A.H.FALSE;
  1510        }
  1511      },
  1512      "has_OffServiceAdded": (): heap.Ref<boolean> => {
  1513        if (
  1514          WEBEXT?.bluetoothLowEnergy?.onServiceAdded &&
  1515          "removeListener" in WEBEXT?.bluetoothLowEnergy?.onServiceAdded
  1516        ) {
  1517          return A.H.TRUE;
  1518        }
  1519        return A.H.FALSE;
  1520      },
  1521      "func_OffServiceAdded": (fn: Pointer): void => {
  1522        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.onServiceAdded.removeListener);
  1523      },
  1524      "call_OffServiceAdded": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1525        const _ret = WEBEXT.bluetoothLowEnergy.onServiceAdded.removeListener(A.H.get<object>(callback));
  1526      },
  1527      "try_OffServiceAdded": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
  1528        try {
  1529          const _ret = WEBEXT.bluetoothLowEnergy.onServiceAdded.removeListener(A.H.get<object>(callback));
  1530          return A.H.TRUE;
  1531        } catch (err: any) {
  1532          A.store.Ref(errPtr, err);
  1533          return A.H.FALSE;
  1534        }
  1535      },
  1536      "has_HasOnServiceAdded": (): heap.Ref<boolean> => {
  1537        if (WEBEXT?.bluetoothLowEnergy?.onServiceAdded && "hasListener" in WEBEXT?.bluetoothLowEnergy?.onServiceAdded) {
  1538          return A.H.TRUE;
  1539        }
  1540        return A.H.FALSE;
  1541      },
  1542      "func_HasOnServiceAdded": (fn: Pointer): void => {
  1543        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.onServiceAdded.hasListener);
  1544      },
  1545      "call_HasOnServiceAdded": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1546        const _ret = WEBEXT.bluetoothLowEnergy.onServiceAdded.hasListener(A.H.get<object>(callback));
  1547        A.store.Bool(retPtr, _ret);
  1548      },
  1549      "try_HasOnServiceAdded": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
  1550        try {
  1551          const _ret = WEBEXT.bluetoothLowEnergy.onServiceAdded.hasListener(A.H.get<object>(callback));
  1552          A.store.Bool(retPtr, _ret);
  1553          return A.H.TRUE;
  1554        } catch (err: any) {
  1555          A.store.Ref(errPtr, err);
  1556          return A.H.FALSE;
  1557        }
  1558      },
  1559      "has_OnServiceChanged": (): heap.Ref<boolean> => {
  1560        if (
  1561          WEBEXT?.bluetoothLowEnergy?.onServiceChanged &&
  1562          "addListener" in WEBEXT?.bluetoothLowEnergy?.onServiceChanged
  1563        ) {
  1564          return A.H.TRUE;
  1565        }
  1566        return A.H.FALSE;
  1567      },
  1568      "func_OnServiceChanged": (fn: Pointer): void => {
  1569        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.onServiceChanged.addListener);
  1570      },
  1571      "call_OnServiceChanged": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1572        const _ret = WEBEXT.bluetoothLowEnergy.onServiceChanged.addListener(A.H.get<object>(callback));
  1573      },
  1574      "try_OnServiceChanged": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
  1575        try {
  1576          const _ret = WEBEXT.bluetoothLowEnergy.onServiceChanged.addListener(A.H.get<object>(callback));
  1577          return A.H.TRUE;
  1578        } catch (err: any) {
  1579          A.store.Ref(errPtr, err);
  1580          return A.H.FALSE;
  1581        }
  1582      },
  1583      "has_OffServiceChanged": (): heap.Ref<boolean> => {
  1584        if (
  1585          WEBEXT?.bluetoothLowEnergy?.onServiceChanged &&
  1586          "removeListener" in WEBEXT?.bluetoothLowEnergy?.onServiceChanged
  1587        ) {
  1588          return A.H.TRUE;
  1589        }
  1590        return A.H.FALSE;
  1591      },
  1592      "func_OffServiceChanged": (fn: Pointer): void => {
  1593        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.onServiceChanged.removeListener);
  1594      },
  1595      "call_OffServiceChanged": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1596        const _ret = WEBEXT.bluetoothLowEnergy.onServiceChanged.removeListener(A.H.get<object>(callback));
  1597      },
  1598      "try_OffServiceChanged": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
  1599        try {
  1600          const _ret = WEBEXT.bluetoothLowEnergy.onServiceChanged.removeListener(A.H.get<object>(callback));
  1601          return A.H.TRUE;
  1602        } catch (err: any) {
  1603          A.store.Ref(errPtr, err);
  1604          return A.H.FALSE;
  1605        }
  1606      },
  1607      "has_HasOnServiceChanged": (): heap.Ref<boolean> => {
  1608        if (
  1609          WEBEXT?.bluetoothLowEnergy?.onServiceChanged &&
  1610          "hasListener" in WEBEXT?.bluetoothLowEnergy?.onServiceChanged
  1611        ) {
  1612          return A.H.TRUE;
  1613        }
  1614        return A.H.FALSE;
  1615      },
  1616      "func_HasOnServiceChanged": (fn: Pointer): void => {
  1617        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.onServiceChanged.hasListener);
  1618      },
  1619      "call_HasOnServiceChanged": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1620        const _ret = WEBEXT.bluetoothLowEnergy.onServiceChanged.hasListener(A.H.get<object>(callback));
  1621        A.store.Bool(retPtr, _ret);
  1622      },
  1623      "try_HasOnServiceChanged": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
  1624        try {
  1625          const _ret = WEBEXT.bluetoothLowEnergy.onServiceChanged.hasListener(A.H.get<object>(callback));
  1626          A.store.Bool(retPtr, _ret);
  1627          return A.H.TRUE;
  1628        } catch (err: any) {
  1629          A.store.Ref(errPtr, err);
  1630          return A.H.FALSE;
  1631        }
  1632      },
  1633      "has_OnServiceRemoved": (): heap.Ref<boolean> => {
  1634        if (
  1635          WEBEXT?.bluetoothLowEnergy?.onServiceRemoved &&
  1636          "addListener" in WEBEXT?.bluetoothLowEnergy?.onServiceRemoved
  1637        ) {
  1638          return A.H.TRUE;
  1639        }
  1640        return A.H.FALSE;
  1641      },
  1642      "func_OnServiceRemoved": (fn: Pointer): void => {
  1643        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.onServiceRemoved.addListener);
  1644      },
  1645      "call_OnServiceRemoved": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1646        const _ret = WEBEXT.bluetoothLowEnergy.onServiceRemoved.addListener(A.H.get<object>(callback));
  1647      },
  1648      "try_OnServiceRemoved": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
  1649        try {
  1650          const _ret = WEBEXT.bluetoothLowEnergy.onServiceRemoved.addListener(A.H.get<object>(callback));
  1651          return A.H.TRUE;
  1652        } catch (err: any) {
  1653          A.store.Ref(errPtr, err);
  1654          return A.H.FALSE;
  1655        }
  1656      },
  1657      "has_OffServiceRemoved": (): heap.Ref<boolean> => {
  1658        if (
  1659          WEBEXT?.bluetoothLowEnergy?.onServiceRemoved &&
  1660          "removeListener" in WEBEXT?.bluetoothLowEnergy?.onServiceRemoved
  1661        ) {
  1662          return A.H.TRUE;
  1663        }
  1664        return A.H.FALSE;
  1665      },
  1666      "func_OffServiceRemoved": (fn: Pointer): void => {
  1667        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.onServiceRemoved.removeListener);
  1668      },
  1669      "call_OffServiceRemoved": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1670        const _ret = WEBEXT.bluetoothLowEnergy.onServiceRemoved.removeListener(A.H.get<object>(callback));
  1671      },
  1672      "try_OffServiceRemoved": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
  1673        try {
  1674          const _ret = WEBEXT.bluetoothLowEnergy.onServiceRemoved.removeListener(A.H.get<object>(callback));
  1675          return A.H.TRUE;
  1676        } catch (err: any) {
  1677          A.store.Ref(errPtr, err);
  1678          return A.H.FALSE;
  1679        }
  1680      },
  1681      "has_HasOnServiceRemoved": (): heap.Ref<boolean> => {
  1682        if (
  1683          WEBEXT?.bluetoothLowEnergy?.onServiceRemoved &&
  1684          "hasListener" in WEBEXT?.bluetoothLowEnergy?.onServiceRemoved
  1685        ) {
  1686          return A.H.TRUE;
  1687        }
  1688        return A.H.FALSE;
  1689      },
  1690      "func_HasOnServiceRemoved": (fn: Pointer): void => {
  1691        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.onServiceRemoved.hasListener);
  1692      },
  1693      "call_HasOnServiceRemoved": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1694        const _ret = WEBEXT.bluetoothLowEnergy.onServiceRemoved.hasListener(A.H.get<object>(callback));
  1695        A.store.Bool(retPtr, _ret);
  1696      },
  1697      "try_HasOnServiceRemoved": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
  1698        try {
  1699          const _ret = WEBEXT.bluetoothLowEnergy.onServiceRemoved.hasListener(A.H.get<object>(callback));
  1700          A.store.Bool(retPtr, _ret);
  1701          return A.H.TRUE;
  1702        } catch (err: any) {
  1703          A.store.Ref(errPtr, err);
  1704          return A.H.FALSE;
  1705        }
  1706      },
  1707      "has_ReadCharacteristicValue": (): heap.Ref<boolean> => {
  1708        if (WEBEXT?.bluetoothLowEnergy && "readCharacteristicValue" in WEBEXT?.bluetoothLowEnergy) {
  1709          return A.H.TRUE;
  1710        }
  1711        return A.H.FALSE;
  1712      },
  1713      "func_ReadCharacteristicValue": (fn: Pointer): void => {
  1714        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.readCharacteristicValue);
  1715      },
  1716      "call_ReadCharacteristicValue": (retPtr: Pointer, characteristicId: heap.Ref<object>): void => {
  1717        const _ret = WEBEXT.bluetoothLowEnergy.readCharacteristicValue(A.H.get<object>(characteristicId));
  1718        A.store.Ref(retPtr, _ret);
  1719      },
  1720      "try_ReadCharacteristicValue": (
  1721        retPtr: Pointer,
  1722        errPtr: Pointer,
  1723        characteristicId: heap.Ref<object>
  1724      ): heap.Ref<boolean> => {
  1725        try {
  1726          const _ret = WEBEXT.bluetoothLowEnergy.readCharacteristicValue(A.H.get<object>(characteristicId));
  1727          A.store.Ref(retPtr, _ret);
  1728          return A.H.TRUE;
  1729        } catch (err: any) {
  1730          A.store.Ref(errPtr, err);
  1731          return A.H.FALSE;
  1732        }
  1733      },
  1734      "has_ReadDescriptorValue": (): heap.Ref<boolean> => {
  1735        if (WEBEXT?.bluetoothLowEnergy && "readDescriptorValue" in WEBEXT?.bluetoothLowEnergy) {
  1736          return A.H.TRUE;
  1737        }
  1738        return A.H.FALSE;
  1739      },
  1740      "func_ReadDescriptorValue": (fn: Pointer): void => {
  1741        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.readDescriptorValue);
  1742      },
  1743      "call_ReadDescriptorValue": (retPtr: Pointer, descriptorId: heap.Ref<object>): void => {
  1744        const _ret = WEBEXT.bluetoothLowEnergy.readDescriptorValue(A.H.get<object>(descriptorId));
  1745        A.store.Ref(retPtr, _ret);
  1746      },
  1747      "try_ReadDescriptorValue": (
  1748        retPtr: Pointer,
  1749        errPtr: Pointer,
  1750        descriptorId: heap.Ref<object>
  1751      ): heap.Ref<boolean> => {
  1752        try {
  1753          const _ret = WEBEXT.bluetoothLowEnergy.readDescriptorValue(A.H.get<object>(descriptorId));
  1754          A.store.Ref(retPtr, _ret);
  1755          return A.H.TRUE;
  1756        } catch (err: any) {
  1757          A.store.Ref(errPtr, err);
  1758          return A.H.FALSE;
  1759        }
  1760      },
  1761      "has_RegisterAdvertisement": (): heap.Ref<boolean> => {
  1762        if (WEBEXT?.bluetoothLowEnergy && "registerAdvertisement" in WEBEXT?.bluetoothLowEnergy) {
  1763          return A.H.TRUE;
  1764        }
  1765        return A.H.FALSE;
  1766      },
  1767      "func_RegisterAdvertisement": (fn: Pointer): void => {
  1768        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.registerAdvertisement);
  1769      },
  1770      "call_RegisterAdvertisement": (retPtr: Pointer, advertisement: Pointer): void => {
  1771        const advertisement_ffi = {};
  1772  
  1773        advertisement_ffi["type"] = A.load.Enum(advertisement + 0, ["broadcast", "peripheral"]);
  1774        advertisement_ffi["serviceUuids"] = A.load.Ref(advertisement + 4, undefined);
  1775        advertisement_ffi["manufacturerData"] = A.load.Ref(advertisement + 8, undefined);
  1776        advertisement_ffi["solicitUuids"] = A.load.Ref(advertisement + 12, undefined);
  1777        advertisement_ffi["serviceData"] = A.load.Ref(advertisement + 16, undefined);
  1778  
  1779        const _ret = WEBEXT.bluetoothLowEnergy.registerAdvertisement(advertisement_ffi);
  1780        A.store.Ref(retPtr, _ret);
  1781      },
  1782      "try_RegisterAdvertisement": (retPtr: Pointer, errPtr: Pointer, advertisement: Pointer): heap.Ref<boolean> => {
  1783        try {
  1784          const advertisement_ffi = {};
  1785  
  1786          advertisement_ffi["type"] = A.load.Enum(advertisement + 0, ["broadcast", "peripheral"]);
  1787          advertisement_ffi["serviceUuids"] = A.load.Ref(advertisement + 4, undefined);
  1788          advertisement_ffi["manufacturerData"] = A.load.Ref(advertisement + 8, undefined);
  1789          advertisement_ffi["solicitUuids"] = A.load.Ref(advertisement + 12, undefined);
  1790          advertisement_ffi["serviceData"] = A.load.Ref(advertisement + 16, undefined);
  1791  
  1792          const _ret = WEBEXT.bluetoothLowEnergy.registerAdvertisement(advertisement_ffi);
  1793          A.store.Ref(retPtr, _ret);
  1794          return A.H.TRUE;
  1795        } catch (err: any) {
  1796          A.store.Ref(errPtr, err);
  1797          return A.H.FALSE;
  1798        }
  1799      },
  1800      "has_RegisterService": (): heap.Ref<boolean> => {
  1801        if (WEBEXT?.bluetoothLowEnergy && "registerService" in WEBEXT?.bluetoothLowEnergy) {
  1802          return A.H.TRUE;
  1803        }
  1804        return A.H.FALSE;
  1805      },
  1806      "func_RegisterService": (fn: Pointer): void => {
  1807        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.registerService);
  1808      },
  1809      "call_RegisterService": (retPtr: Pointer, serviceId: heap.Ref<object>): void => {
  1810        const _ret = WEBEXT.bluetoothLowEnergy.registerService(A.H.get<object>(serviceId));
  1811        A.store.Ref(retPtr, _ret);
  1812      },
  1813      "try_RegisterService": (retPtr: Pointer, errPtr: Pointer, serviceId: heap.Ref<object>): heap.Ref<boolean> => {
  1814        try {
  1815          const _ret = WEBEXT.bluetoothLowEnergy.registerService(A.H.get<object>(serviceId));
  1816          A.store.Ref(retPtr, _ret);
  1817          return A.H.TRUE;
  1818        } catch (err: any) {
  1819          A.store.Ref(errPtr, err);
  1820          return A.H.FALSE;
  1821        }
  1822      },
  1823      "has_RemoveService": (): heap.Ref<boolean> => {
  1824        if (WEBEXT?.bluetoothLowEnergy && "removeService" in WEBEXT?.bluetoothLowEnergy) {
  1825          return A.H.TRUE;
  1826        }
  1827        return A.H.FALSE;
  1828      },
  1829      "func_RemoveService": (fn: Pointer): void => {
  1830        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.removeService);
  1831      },
  1832      "call_RemoveService": (retPtr: Pointer, serviceId: heap.Ref<object>): void => {
  1833        const _ret = WEBEXT.bluetoothLowEnergy.removeService(A.H.get<object>(serviceId));
  1834        A.store.Ref(retPtr, _ret);
  1835      },
  1836      "try_RemoveService": (retPtr: Pointer, errPtr: Pointer, serviceId: heap.Ref<object>): heap.Ref<boolean> => {
  1837        try {
  1838          const _ret = WEBEXT.bluetoothLowEnergy.removeService(A.H.get<object>(serviceId));
  1839          A.store.Ref(retPtr, _ret);
  1840          return A.H.TRUE;
  1841        } catch (err: any) {
  1842          A.store.Ref(errPtr, err);
  1843          return A.H.FALSE;
  1844        }
  1845      },
  1846      "has_ResetAdvertising": (): heap.Ref<boolean> => {
  1847        if (WEBEXT?.bluetoothLowEnergy && "resetAdvertising" in WEBEXT?.bluetoothLowEnergy) {
  1848          return A.H.TRUE;
  1849        }
  1850        return A.H.FALSE;
  1851      },
  1852      "func_ResetAdvertising": (fn: Pointer): void => {
  1853        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.resetAdvertising);
  1854      },
  1855      "call_ResetAdvertising": (retPtr: Pointer): void => {
  1856        const _ret = WEBEXT.bluetoothLowEnergy.resetAdvertising();
  1857        A.store.Ref(retPtr, _ret);
  1858      },
  1859      "try_ResetAdvertising": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => {
  1860        try {
  1861          const _ret = WEBEXT.bluetoothLowEnergy.resetAdvertising();
  1862          A.store.Ref(retPtr, _ret);
  1863          return A.H.TRUE;
  1864        } catch (err: any) {
  1865          A.store.Ref(errPtr, err);
  1866          return A.H.FALSE;
  1867        }
  1868      },
  1869      "has_SendRequestResponse": (): heap.Ref<boolean> => {
  1870        if (WEBEXT?.bluetoothLowEnergy && "sendRequestResponse" in WEBEXT?.bluetoothLowEnergy) {
  1871          return A.H.TRUE;
  1872        }
  1873        return A.H.FALSE;
  1874      },
  1875      "func_SendRequestResponse": (fn: Pointer): void => {
  1876        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.sendRequestResponse);
  1877      },
  1878      "call_SendRequestResponse": (retPtr: Pointer, response: Pointer): void => {
  1879        const response_ffi = {};
  1880  
  1881        if (A.load.Bool(response + 12)) {
  1882          response_ffi["requestId"] = A.load.Int32(response + 0);
  1883        }
  1884        if (A.load.Bool(response + 13)) {
  1885          response_ffi["isError"] = A.load.Bool(response + 4);
  1886        }
  1887        response_ffi["value"] = A.load.Ref(response + 8, undefined);
  1888  
  1889        const _ret = WEBEXT.bluetoothLowEnergy.sendRequestResponse(response_ffi);
  1890      },
  1891      "try_SendRequestResponse": (retPtr: Pointer, errPtr: Pointer, response: Pointer): heap.Ref<boolean> => {
  1892        try {
  1893          const response_ffi = {};
  1894  
  1895          if (A.load.Bool(response + 12)) {
  1896            response_ffi["requestId"] = A.load.Int32(response + 0);
  1897          }
  1898          if (A.load.Bool(response + 13)) {
  1899            response_ffi["isError"] = A.load.Bool(response + 4);
  1900          }
  1901          response_ffi["value"] = A.load.Ref(response + 8, undefined);
  1902  
  1903          const _ret = WEBEXT.bluetoothLowEnergy.sendRequestResponse(response_ffi);
  1904          return A.H.TRUE;
  1905        } catch (err: any) {
  1906          A.store.Ref(errPtr, err);
  1907          return A.H.FALSE;
  1908        }
  1909      },
  1910      "has_SetAdvertisingInterval": (): heap.Ref<boolean> => {
  1911        if (WEBEXT?.bluetoothLowEnergy && "setAdvertisingInterval" in WEBEXT?.bluetoothLowEnergy) {
  1912          return A.H.TRUE;
  1913        }
  1914        return A.H.FALSE;
  1915      },
  1916      "func_SetAdvertisingInterval": (fn: Pointer): void => {
  1917        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.setAdvertisingInterval);
  1918      },
  1919      "call_SetAdvertisingInterval": (retPtr: Pointer, minInterval: number, maxInterval: number): void => {
  1920        const _ret = WEBEXT.bluetoothLowEnergy.setAdvertisingInterval(minInterval, maxInterval);
  1921        A.store.Ref(retPtr, _ret);
  1922      },
  1923      "try_SetAdvertisingInterval": (
  1924        retPtr: Pointer,
  1925        errPtr: Pointer,
  1926        minInterval: number,
  1927        maxInterval: number
  1928      ): heap.Ref<boolean> => {
  1929        try {
  1930          const _ret = WEBEXT.bluetoothLowEnergy.setAdvertisingInterval(minInterval, maxInterval);
  1931          A.store.Ref(retPtr, _ret);
  1932          return A.H.TRUE;
  1933        } catch (err: any) {
  1934          A.store.Ref(errPtr, err);
  1935          return A.H.FALSE;
  1936        }
  1937      },
  1938      "has_StartCharacteristicNotifications": (): heap.Ref<boolean> => {
  1939        if (WEBEXT?.bluetoothLowEnergy && "startCharacteristicNotifications" in WEBEXT?.bluetoothLowEnergy) {
  1940          return A.H.TRUE;
  1941        }
  1942        return A.H.FALSE;
  1943      },
  1944      "func_StartCharacteristicNotifications": (fn: Pointer): void => {
  1945        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.startCharacteristicNotifications);
  1946      },
  1947      "call_StartCharacteristicNotifications": (
  1948        retPtr: Pointer,
  1949        characteristicId: heap.Ref<object>,
  1950        properties: Pointer
  1951      ): void => {
  1952        const properties_ffi = {};
  1953  
  1954        if (A.load.Bool(properties + 1)) {
  1955          properties_ffi["persistent"] = A.load.Bool(properties + 0);
  1956        }
  1957  
  1958        const _ret = WEBEXT.bluetoothLowEnergy.startCharacteristicNotifications(
  1959          A.H.get<object>(characteristicId),
  1960          properties_ffi
  1961        );
  1962        A.store.Ref(retPtr, _ret);
  1963      },
  1964      "try_StartCharacteristicNotifications": (
  1965        retPtr: Pointer,
  1966        errPtr: Pointer,
  1967        characteristicId: heap.Ref<object>,
  1968        properties: Pointer
  1969      ): heap.Ref<boolean> => {
  1970        try {
  1971          const properties_ffi = {};
  1972  
  1973          if (A.load.Bool(properties + 1)) {
  1974            properties_ffi["persistent"] = A.load.Bool(properties + 0);
  1975          }
  1976  
  1977          const _ret = WEBEXT.bluetoothLowEnergy.startCharacteristicNotifications(
  1978            A.H.get<object>(characteristicId),
  1979            properties_ffi
  1980          );
  1981          A.store.Ref(retPtr, _ret);
  1982          return A.H.TRUE;
  1983        } catch (err: any) {
  1984          A.store.Ref(errPtr, err);
  1985          return A.H.FALSE;
  1986        }
  1987      },
  1988      "has_StopCharacteristicNotifications": (): heap.Ref<boolean> => {
  1989        if (WEBEXT?.bluetoothLowEnergy && "stopCharacteristicNotifications" in WEBEXT?.bluetoothLowEnergy) {
  1990          return A.H.TRUE;
  1991        }
  1992        return A.H.FALSE;
  1993      },
  1994      "func_StopCharacteristicNotifications": (fn: Pointer): void => {
  1995        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.stopCharacteristicNotifications);
  1996      },
  1997      "call_StopCharacteristicNotifications": (retPtr: Pointer, characteristicId: heap.Ref<object>): void => {
  1998        const _ret = WEBEXT.bluetoothLowEnergy.stopCharacteristicNotifications(A.H.get<object>(characteristicId));
  1999        A.store.Ref(retPtr, _ret);
  2000      },
  2001      "try_StopCharacteristicNotifications": (
  2002        retPtr: Pointer,
  2003        errPtr: Pointer,
  2004        characteristicId: heap.Ref<object>
  2005      ): heap.Ref<boolean> => {
  2006        try {
  2007          const _ret = WEBEXT.bluetoothLowEnergy.stopCharacteristicNotifications(A.H.get<object>(characteristicId));
  2008          A.store.Ref(retPtr, _ret);
  2009          return A.H.TRUE;
  2010        } catch (err: any) {
  2011          A.store.Ref(errPtr, err);
  2012          return A.H.FALSE;
  2013        }
  2014      },
  2015      "has_UnregisterAdvertisement": (): heap.Ref<boolean> => {
  2016        if (WEBEXT?.bluetoothLowEnergy && "unregisterAdvertisement" in WEBEXT?.bluetoothLowEnergy) {
  2017          return A.H.TRUE;
  2018        }
  2019        return A.H.FALSE;
  2020      },
  2021      "func_UnregisterAdvertisement": (fn: Pointer): void => {
  2022        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.unregisterAdvertisement);
  2023      },
  2024      "call_UnregisterAdvertisement": (retPtr: Pointer, advertisementId: number): void => {
  2025        const _ret = WEBEXT.bluetoothLowEnergy.unregisterAdvertisement(advertisementId);
  2026        A.store.Ref(retPtr, _ret);
  2027      },
  2028      "try_UnregisterAdvertisement": (retPtr: Pointer, errPtr: Pointer, advertisementId: number): heap.Ref<boolean> => {
  2029        try {
  2030          const _ret = WEBEXT.bluetoothLowEnergy.unregisterAdvertisement(advertisementId);
  2031          A.store.Ref(retPtr, _ret);
  2032          return A.H.TRUE;
  2033        } catch (err: any) {
  2034          A.store.Ref(errPtr, err);
  2035          return A.H.FALSE;
  2036        }
  2037      },
  2038      "has_UnregisterService": (): heap.Ref<boolean> => {
  2039        if (WEBEXT?.bluetoothLowEnergy && "unregisterService" in WEBEXT?.bluetoothLowEnergy) {
  2040          return A.H.TRUE;
  2041        }
  2042        return A.H.FALSE;
  2043      },
  2044      "func_UnregisterService": (fn: Pointer): void => {
  2045        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.unregisterService);
  2046      },
  2047      "call_UnregisterService": (retPtr: Pointer, serviceId: heap.Ref<object>): void => {
  2048        const _ret = WEBEXT.bluetoothLowEnergy.unregisterService(A.H.get<object>(serviceId));
  2049        A.store.Ref(retPtr, _ret);
  2050      },
  2051      "try_UnregisterService": (retPtr: Pointer, errPtr: Pointer, serviceId: heap.Ref<object>): heap.Ref<boolean> => {
  2052        try {
  2053          const _ret = WEBEXT.bluetoothLowEnergy.unregisterService(A.H.get<object>(serviceId));
  2054          A.store.Ref(retPtr, _ret);
  2055          return A.H.TRUE;
  2056        } catch (err: any) {
  2057          A.store.Ref(errPtr, err);
  2058          return A.H.FALSE;
  2059        }
  2060      },
  2061      "has_WriteCharacteristicValue": (): heap.Ref<boolean> => {
  2062        if (WEBEXT?.bluetoothLowEnergy && "writeCharacteristicValue" in WEBEXT?.bluetoothLowEnergy) {
  2063          return A.H.TRUE;
  2064        }
  2065        return A.H.FALSE;
  2066      },
  2067      "func_WriteCharacteristicValue": (fn: Pointer): void => {
  2068        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.writeCharacteristicValue);
  2069      },
  2070      "call_WriteCharacteristicValue": (
  2071        retPtr: Pointer,
  2072        characteristicId: heap.Ref<object>,
  2073        value: heap.Ref<object>
  2074      ): void => {
  2075        const _ret = WEBEXT.bluetoothLowEnergy.writeCharacteristicValue(
  2076          A.H.get<object>(characteristicId),
  2077          A.H.get<object>(value)
  2078        );
  2079        A.store.Ref(retPtr, _ret);
  2080      },
  2081      "try_WriteCharacteristicValue": (
  2082        retPtr: Pointer,
  2083        errPtr: Pointer,
  2084        characteristicId: heap.Ref<object>,
  2085        value: heap.Ref<object>
  2086      ): heap.Ref<boolean> => {
  2087        try {
  2088          const _ret = WEBEXT.bluetoothLowEnergy.writeCharacteristicValue(
  2089            A.H.get<object>(characteristicId),
  2090            A.H.get<object>(value)
  2091          );
  2092          A.store.Ref(retPtr, _ret);
  2093          return A.H.TRUE;
  2094        } catch (err: any) {
  2095          A.store.Ref(errPtr, err);
  2096          return A.H.FALSE;
  2097        }
  2098      },
  2099      "has_WriteDescriptorValue": (): heap.Ref<boolean> => {
  2100        if (WEBEXT?.bluetoothLowEnergy && "writeDescriptorValue" in WEBEXT?.bluetoothLowEnergy) {
  2101          return A.H.TRUE;
  2102        }
  2103        return A.H.FALSE;
  2104      },
  2105      "func_WriteDescriptorValue": (fn: Pointer): void => {
  2106        A.store.Ref(fn, WEBEXT.bluetoothLowEnergy.writeDescriptorValue);
  2107      },
  2108      "call_WriteDescriptorValue": (retPtr: Pointer, descriptorId: heap.Ref<object>, value: heap.Ref<object>): void => {
  2109        const _ret = WEBEXT.bluetoothLowEnergy.writeDescriptorValue(
  2110          A.H.get<object>(descriptorId),
  2111          A.H.get<object>(value)
  2112        );
  2113        A.store.Ref(retPtr, _ret);
  2114      },
  2115      "try_WriteDescriptorValue": (
  2116        retPtr: Pointer,
  2117        errPtr: Pointer,
  2118        descriptorId: heap.Ref<object>,
  2119        value: heap.Ref<object>
  2120      ): heap.Ref<boolean> => {
  2121        try {
  2122          const _ret = WEBEXT.bluetoothLowEnergy.writeDescriptorValue(
  2123            A.H.get<object>(descriptorId),
  2124            A.H.get<object>(value)
  2125          );
  2126          A.store.Ref(retPtr, _ret);
  2127          return A.H.TRUE;
  2128        } catch (err: any) {
  2129          A.store.Ref(errPtr, err);
  2130          return A.H.FALSE;
  2131        }
  2132      },
  2133    };
  2134  });