File tree Expand file tree Collapse file tree
PluginSDK/Examples/IBeacon/Sources/IBeacon Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ //
2+ // Exports.swift
3+ // IBeacon
4+ //
5+ // ABI export shims. These live in the plugin's own module because `@_expose(wasm)` symbols are
6+ // dropped when they come from a dependency module (swiftlang/swift#77812). Copied unchanged from
7+ // the SDK template, with only the capability shims this plugin implements.
8+ //
9+
10+ import BLEPluginSDK
11+
12+ @_expose ( wasm, " bleplug_abi_1 " )
13+ @_cdecl ( " bleplug_abi_1 " )
14+ func bleplugABIMarker( ) { }
15+
16+ @_expose ( wasm, " bleplug_alloc " )
17+ @_cdecl ( " bleplug_alloc " )
18+ func bleplugAlloc( _ size: UInt32 ) -> UInt32 {
19+ PluginRuntime . allocate ( size)
20+ }
21+
22+ @_expose ( wasm, " bleplug_free " )
23+ @_cdecl ( " bleplug_free " )
24+ func bleplugFree( _ pointer: UInt32 , _ size: UInt32 ) {
25+ PluginRuntime . deallocate ( pointer)
26+ }
27+
28+ @_expose ( wasm, " bleplug_parse_manufacturer " )
29+ @_cdecl ( " bleplug_parse_manufacturer " )
30+ func bleplugParseManufacturer( _ pointer: UInt32 , _ length: UInt32 ) -> UInt64 {
31+ PluginRuntime . handle ( pointer: pointer, length: length, parse: parseManufacturerData)
32+ }
You can’t perform that action at this time.
0 commit comments