@tempivo/sensor-beacon 0.1.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/README.md +222 -78
  2. package/android/build.gradle +38 -2
  3. package/android/src/main/AndroidManifest.xml +10 -0
  4. package/android/src/main/java/expo/modules/tempivosensorbeacon/SensorBeaconNative.java +233 -0
  5. package/android/src/main/java/expo/modules/tempivosensorbeacon/TempivoSensorBeaconModule.kt +122 -0
  6. package/android-aar/build.gradle +4 -0
  7. package/{android → android-aar}/library/build.gradle +3 -0
  8. package/android-aar/library/src/main/java/com/tempivo/sensor/beacon/PartnerBleRules.kt +279 -0
  9. package/android-aar/library/src/main/java/com/tempivo/sensor/beacon/SensorBleRuntime.kt +168 -0
  10. package/{android → android-aar}/library/src/main/java/com/tempivo/sensor/beacon/TempivoSensorBeaconDecoder.kt +6 -23
  11. package/{android → android-aar}/library/src/main/java/com/tempivo/sensor/beacon/TempivoSensorBeaconScanner.kt +0 -2
  12. package/{android → android-aar}/library/src/main/java/com/tempivo/sensor/beacon/TempivoSensorBeaconTypes.kt +2 -4
  13. package/android-aar/library/src/main/java/com/tempivo/sensor/beacon/TempivoSensorCalibration.kt +36 -0
  14. package/android-aar/library/src/main/java/com/tempivo/sensor/beacon/TempivoSensorError.kt +18 -0
  15. package/android-aar/library/src/main/java/com/tempivo/sensor/beacon/TempivoSensorProfile.kt +171 -0
  16. package/android-aar/library/src/main/java/com/tempivo/sensor/beacon/TempivoSensorQr.kt +82 -0
  17. package/android-aar/library/src/main/java/com/tempivo/sensor/beacon/TempivoSensorSession.kt +127 -0
  18. package/{android → android-aar}/settings.gradle +1 -0
  19. package/app.plugin.cjs +142 -0
  20. package/dist/calibration.d.ts +7 -0
  21. package/dist/calibration.js +42 -0
  22. package/dist/decoder.js +4 -12
  23. package/dist/errors.d.ts +6 -0
  24. package/dist/errors.js +8 -0
  25. package/dist/expo-modules-core.web-stub.d.ts +5 -0
  26. package/dist/expo-modules-core.web-stub.js +9 -0
  27. package/dist/index.d.ts +8 -1
  28. package/dist/index.js +6 -1
  29. package/dist/native-bridge.d.ts +14 -0
  30. package/dist/native-bridge.js +51 -0
  31. package/dist/native-helpers.d.ts +5 -0
  32. package/dist/native-helpers.js +33 -0
  33. package/dist/native-module.d.ts +14 -0
  34. package/dist/native-module.js +104 -0
  35. package/dist/native-types.d.ts +41 -0
  36. package/dist/native-types.js +1 -0
  37. package/dist/profile.d.ts +10 -0
  38. package/dist/profile.js +226 -0
  39. package/dist/qr.d.ts +16 -0
  40. package/dist/qr.js +90 -0
  41. package/dist/react-native.d.ts +1 -0
  42. package/dist/react-native.js +1 -0
  43. package/dist/session-types.d.ts +64 -0
  44. package/dist/session-types.js +1 -0
  45. package/dist/tempivo-sensor-beacon.aar +0 -0
  46. package/dist/types.d.ts +3 -3
  47. package/expo-module.config.json +12 -0
  48. package/ios/Frameworks/TempivoSensorBridge.xcframework/Info.plist +43 -0
  49. package/ios/Frameworks/TempivoSensorBridge.xcframework/ios-arm64/TempivoSensorBridge.framework/Headers/TempivoSensorBridge.h +159 -0
  50. package/ios/Frameworks/TempivoSensorBridge.xcframework/ios-arm64/TempivoSensorBridge.framework/Info.plist +35 -0
  51. package/ios/Frameworks/TempivoSensorBridge.xcframework/ios-arm64/TempivoSensorBridge.framework/Modules/module.modulemap +8 -0
  52. package/ios/Frameworks/TempivoSensorBridge.xcframework/ios-arm64/TempivoSensorBridge.framework/TempivoSensorBridge +0 -0
  53. package/ios/Frameworks/TempivoSensorBridge.xcframework/ios-arm64-simulator/TempivoSensorBridge.framework/Headers/TempivoSensorBridge.h +159 -0
  54. package/ios/Frameworks/TempivoSensorBridge.xcframework/ios-arm64-simulator/TempivoSensorBridge.framework/Info.plist +31 -0
  55. package/ios/Frameworks/TempivoSensorBridge.xcframework/ios-arm64-simulator/TempivoSensorBridge.framework/Modules/module.modulemap +8 -0
  56. package/ios/Frameworks/TempivoSensorBridge.xcframework/ios-arm64-simulator/TempivoSensorBridge.framework/TempivoSensorBridge +0 -0
  57. package/ios/Sources/TempivoSensorBeacon/TempivoSensorBeaconDecoder.swift +4 -8
  58. package/ios/Sources/TempivoSensorBeacon/TempivoSensorBeaconTypes.swift +3 -6
  59. package/ios/Sources/TempivoSensorBeacon/TempivoSensorCalibration.swift +22 -0
  60. package/ios/Sources/TempivoSensorBeacon/TempivoSensorError.swift +24 -0
  61. package/ios/Sources/TempivoSensorBeacon/TempivoSensorProfile.swift +123 -0
  62. package/ios/Sources/TempivoSensorBeacon/TempivoSensorQr.swift +78 -0
  63. package/ios/Sources/TempivoSensorBeacon/TempivoSensorSession.swift +161 -0
  64. package/ios/Sources/TempivoSensorBeacon/TempivoSensorSessionTypes.swift +93 -0
  65. package/ios/TempivoSensorBeacon.podspec +35 -0
  66. package/ios/TempivoSensorBeaconModule.swift +208 -0
  67. package/package.json +55 -7
  68. /package/{android → android-aar}/gradle/wrapper/gradle-wrapper.jar +0 -0
  69. /package/{android → android-aar}/gradle/wrapper/gradle-wrapper.properties +0 -0
  70. /package/{android → android-aar}/gradle.properties +0 -0
  71. /package/{android → android-aar}/gradlew +0 -0
  72. /package/{android → android-aar}/library/consumer-rules.pro +0 -0
  73. /package/{android → android-aar}/library/src/main/AndroidManifest.xml +0 -0
package/dist/qr.js ADDED
@@ -0,0 +1,90 @@
1
+ import { TempivoSensorError } from './errors.js';
2
+ export function normalizeSensorSerial(value) {
3
+ return value.trim().toUpperCase().replace(/[^A-Z0-9]/g, '');
4
+ }
5
+ /** `282C024F0012` → `28:2C:02:4F:00:12`. */
6
+ export function bluetoothMacFromSerial(serial) {
7
+ const key = normalizeSensorSerial(serial);
8
+ if (key.length !== 12 || !/^[0-9A-F]+$/.test(key)) {
9
+ throw new TempivoSensorError('invalidQr', 'Serial must be 12 hex characters.');
10
+ }
11
+ const parts = [];
12
+ for (let i = 0; i < 12; i += 2)
13
+ parts.push(key.slice(i, i + 2));
14
+ return parts.join(':');
15
+ }
16
+ /** BLE default when QR omits `model`. HC5 / FW 6.x still select legacy. */
17
+ export const DEFAULT_SENSOR_MODEL = 'HC7';
18
+ export function sessionTypeFromModel(model) {
19
+ if (model == null || model.trim() === '')
20
+ return 'modern';
21
+ const m = model.trim().toUpperCase().replace(/-/g, '');
22
+ if (m === 'HC5' || m.startsWith('6'))
23
+ return 'legacy';
24
+ return 'modern';
25
+ }
26
+ /**
27
+ * 3-byte big-endian numeric PIN for GATT command payloads that check a reset code
28
+ * (`setConfiguration`, trigger, and many other privileged writes).
29
+ */
30
+ export function encodeSensorPinPayload(pin) {
31
+ const t = pin.trim();
32
+ if (!/^\d{1,8}$/.test(t)) {
33
+ throw new TempivoSensorError('invalidPin', 'PIN must be numeric.');
34
+ }
35
+ const n = Number.parseInt(t, 10);
36
+ if (!Number.isInteger(n) || n < 0 || n > 0xffffff) {
37
+ throw new TempivoSensorError('invalidPin', 'PIN must fit in 3 bytes.');
38
+ }
39
+ return Uint8Array.of((n >> 16) & 0xff, (n >> 8) & 0xff, n & 0xff);
40
+ }
41
+ function pinFromRecord(rec) {
42
+ const raw = rec.pin ?? rec.resetCode;
43
+ if (typeof raw === 'string') {
44
+ const t = raw.trim();
45
+ return t.length > 0 ? t : undefined;
46
+ }
47
+ if (typeof raw === 'number' && Number.isFinite(raw))
48
+ return String(Math.trunc(raw));
49
+ return undefined;
50
+ }
51
+ /**
52
+ * Parse sensor label QR JSON: `{"sn":"…","pin":"…","model":"HC7"}`.
53
+ */
54
+ export function parseSensorQrJson(text) {
55
+ let rec;
56
+ try {
57
+ const o = JSON.parse(text.trim());
58
+ if (o === null || typeof o !== 'object' || Array.isArray(o)) {
59
+ throw new TempivoSensorError('invalidQr', 'QR must be a JSON object.');
60
+ }
61
+ rec = o;
62
+ }
63
+ catch (e) {
64
+ if (e instanceof TempivoSensorError)
65
+ throw e;
66
+ throw new TempivoSensorError('invalidQr', 'QR is not valid JSON.');
67
+ }
68
+ const snRaw = typeof rec.sn === 'string'
69
+ ? rec.sn
70
+ : typeof rec.sn === 'number' && Number.isFinite(rec.sn)
71
+ ? String(Math.trunc(rec.sn))
72
+ : '';
73
+ const serial = normalizeSensorSerial(snRaw);
74
+ const pin = pinFromRecord(rec);
75
+ if (!serial || serial.length < 8) {
76
+ throw new TempivoSensorError('invalidQr', 'QR is missing serial (sn).');
77
+ }
78
+ if (!pin) {
79
+ throw new TempivoSensorError('invalidQr', 'QR is missing PIN.');
80
+ }
81
+ const rawModel = typeof rec.model === 'string' ? rec.model.trim() : '';
82
+ const model = rawModel || DEFAULT_SENSOR_MODEL;
83
+ return {
84
+ serial,
85
+ pin,
86
+ model,
87
+ sessionType: sessionTypeFromModel(model),
88
+ bluetoothMac: bluetoothMacFromSerial(serial.length === 12 ? serial : serial.slice(-12)),
89
+ };
90
+ }
@@ -0,0 +1 @@
1
+ export * from './index.js';
@@ -0,0 +1 @@
1
+ export * from './index.js';
@@ -0,0 +1,64 @@
1
+ export type TempivoSensorSessionType = 'modern' | 'legacy';
2
+ export type TempivoTemperatureChannel = 'ambient' | 'probe';
3
+ export type TempivoTemperatureRangeAlert = {
4
+ type: 'range';
5
+ channel: TempivoTemperatureChannel;
6
+ lowC: number;
7
+ highC: number;
8
+ hysteresisC?: number;
9
+ transmitOnBreach?: boolean;
10
+ /** Extra uplink when temp returns inside the band. Same as Cellular API. Default `true`. */
11
+ transmitOnReturn?: boolean;
12
+ };
13
+ export type TempivoTemperatureMinAlert = {
14
+ type: 'min';
15
+ channel: TempivoTemperatureChannel;
16
+ minC: number;
17
+ hysteresisC?: number;
18
+ transmitOnBreach?: boolean;
19
+ };
20
+ export type TempivoTemperatureMaxAlert = {
21
+ type: 'max';
22
+ channel: TempivoTemperatureChannel;
23
+ maxC: number;
24
+ hysteresisC?: number;
25
+ transmitOnBreach?: boolean;
26
+ };
27
+ export type TempivoTemperatureAlert = TempivoTemperatureRangeAlert | TempivoTemperatureMinAlert | TempivoTemperatureMaxAlert;
28
+ export type TempivoScheduleAlways = {
29
+ always: true;
30
+ };
31
+ export type TempivoScheduleWeek = {
32
+ /** 0 = Monday … 6 = Sunday. */
33
+ weekdays: number[];
34
+ /** 24h `HH:MM`. */
35
+ from: string;
36
+ /** 24h `HH:MM`. */
37
+ to: string;
38
+ utcOffsetMinutes: number;
39
+ };
40
+ export type TempivoSchedule = TempivoScheduleAlways | TempivoScheduleWeek;
41
+ /**
42
+ * Same JSON as Cellular API `POST /api/v1/devices/config-profiles`
43
+ * (`temperatureAlerts` + `schedule`). Extra profile fields (`slug`, `name`, intervals) are ignored over BLE.
44
+ */
45
+ export type TempivoSensorConfiguration = {
46
+ temperatureAlerts: TempivoTemperatureAlert[];
47
+ schedule: TempivoSchedule;
48
+ };
49
+ export type TempivoSensorQr = {
50
+ serial: string;
51
+ pin: string;
52
+ /** Sticker model. Omitted QR `model` parses as HC7. */
53
+ model?: string;
54
+ sessionType: TempivoSensorSessionType;
55
+ bluetoothMac: string;
56
+ };
57
+ export type TempivoSensorCalibration = {
58
+ laboratoryCalibrationDate: string | null;
59
+ laboratoryCalibrationTimestamp: number | null;
60
+ };
61
+ export type TempivoTriggerTransmissionResult = {
62
+ ok: boolean;
63
+ supported: boolean;
64
+ };
@@ -0,0 +1 @@
1
+ export {};
Binary file
package/dist/types.d.ts CHANGED
@@ -7,6 +7,7 @@ export interface SensorBeaconMeasurement {
7
7
  humidityPct?: number;
8
8
  }
9
9
  export interface SensorBeaconReading {
10
+ /** 12 hex chars from frame 0x03 (uppercase, no colons). */
10
11
  serialMac: string;
11
12
  firmware: string;
12
13
  batteryOk: boolean;
@@ -15,9 +16,8 @@ export interface SensorBeaconReading {
15
16
  measurementCounter: number | null;
16
17
  readingTimestampUnix: number | null;
17
18
  readingTimestampIso: string | null;
18
- periodBaseSeconds: number | null;
19
- periodFactor: number | null;
20
- periodLabel: string;
19
+ /** Sample interval from the advertisement, in seconds. */
20
+ measurementIntervalSeconds: number | null;
21
21
  measurements: SensorBeaconMeasurement[];
22
22
  summary: string;
23
23
  temperatures: number[];
@@ -0,0 +1,12 @@
1
+ {
2
+ "platforms": ["apple", "android"],
3
+ "apple": {
4
+ "modules": ["TempivoSensorBeaconModule"]
5
+ },
6
+ "ios": {
7
+ "modules": ["TempivoSensorBeaconModule"]
8
+ },
9
+ "android": {
10
+ "modules": ["expo.modules.tempivosensorbeacon.TempivoSensorBeaconModule"]
11
+ }
12
+ }
@@ -0,0 +1,43 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>AvailableLibraries</key>
6
+ <array>
7
+ <dict>
8
+ <key>BinaryPath</key>
9
+ <string>TempivoSensorBridge.framework/TempivoSensorBridge</string>
10
+ <key>LibraryIdentifier</key>
11
+ <string>ios-arm64</string>
12
+ <key>LibraryPath</key>
13
+ <string>TempivoSensorBridge.framework</string>
14
+ <key>SupportedArchitectures</key>
15
+ <array>
16
+ <string>arm64</string>
17
+ </array>
18
+ <key>SupportedPlatform</key>
19
+ <string>ios</string>
20
+ </dict>
21
+ <dict>
22
+ <key>BinaryPath</key>
23
+ <string>TempivoSensorBridge.framework/TempivoSensorBridge</string>
24
+ <key>LibraryIdentifier</key>
25
+ <string>ios-arm64-simulator</string>
26
+ <key>LibraryPath</key>
27
+ <string>TempivoSensorBridge.framework</string>
28
+ <key>SupportedArchitectures</key>
29
+ <array>
30
+ <string>arm64</string>
31
+ </array>
32
+ <key>SupportedPlatform</key>
33
+ <string>ios</string>
34
+ <key>SupportedPlatformVariant</key>
35
+ <string>simulator</string>
36
+ </dict>
37
+ </array>
38
+ <key>CFBundlePackageType</key>
39
+ <string>XFWK</string>
40
+ <key>XCFrameworkFormatVersion</key>
41
+ <string>1.0</string>
42
+ </dict>
43
+ </plist>
@@ -0,0 +1,159 @@
1
+ #import <Foundation/NSArray.h>
2
+ #import <Foundation/NSDictionary.h>
3
+ #import <Foundation/NSError.h>
4
+ #import <Foundation/NSObject.h>
5
+ #import <Foundation/NSSet.h>
6
+ #import <Foundation/NSString.h>
7
+ #import <Foundation/NSValue.h>
8
+
9
+ NS_ASSUME_NONNULL_BEGIN
10
+ #pragma clang diagnostic push
11
+ #pragma clang diagnostic ignored "-Wunknown-warning-option"
12
+ #pragma clang diagnostic ignored "-Wincompatible-property-type"
13
+ #pragma clang diagnostic ignored "-Wnullability"
14
+
15
+ #pragma push_macro("_Nullable_result")
16
+ #if !__has_feature(nullability_nullable_result)
17
+ #undef _Nullable_result
18
+ #define _Nullable_result _Nullable
19
+ #endif
20
+
21
+ __attribute__((swift_name("KotlinBase")))
22
+ @interface TSBBase : NSObject
23
+ - (instancetype)init __attribute__((unavailable));
24
+ + (instancetype)new __attribute__((unavailable));
25
+ + (void)initialize __attribute__((objc_requires_super));
26
+ @end
27
+
28
+ @interface TSBBase (TSBBaseCopying) <NSCopying>
29
+ @end
30
+
31
+ __attribute__((swift_name("KotlinMutableSet")))
32
+ @interface TSBMutableSet<ObjectType> : NSMutableSet<ObjectType>
33
+ @end
34
+
35
+ __attribute__((swift_name("KotlinMutableDictionary")))
36
+ @interface TSBMutableDictionary<KeyType, ObjectType> : NSMutableDictionary<KeyType, ObjectType>
37
+ @end
38
+
39
+ @interface NSError (NSErrorTSBKotlinException)
40
+ @property (readonly) id _Nullable kotlinException;
41
+ @end
42
+
43
+ __attribute__((swift_name("KotlinNumber")))
44
+ @interface TSBNumber : NSNumber
45
+ - (instancetype)initWithChar:(char)value __attribute__((unavailable));
46
+ - (instancetype)initWithUnsignedChar:(unsigned char)value __attribute__((unavailable));
47
+ - (instancetype)initWithShort:(short)value __attribute__((unavailable));
48
+ - (instancetype)initWithUnsignedShort:(unsigned short)value __attribute__((unavailable));
49
+ - (instancetype)initWithInt:(int)value __attribute__((unavailable));
50
+ - (instancetype)initWithUnsignedInt:(unsigned int)value __attribute__((unavailable));
51
+ - (instancetype)initWithLong:(long)value __attribute__((unavailable));
52
+ - (instancetype)initWithUnsignedLong:(unsigned long)value __attribute__((unavailable));
53
+ - (instancetype)initWithLongLong:(long long)value __attribute__((unavailable));
54
+ - (instancetype)initWithUnsignedLongLong:(unsigned long long)value __attribute__((unavailable));
55
+ - (instancetype)initWithFloat:(float)value __attribute__((unavailable));
56
+ - (instancetype)initWithDouble:(double)value __attribute__((unavailable));
57
+ - (instancetype)initWithBool:(BOOL)value __attribute__((unavailable));
58
+ - (instancetype)initWithInteger:(NSInteger)value __attribute__((unavailable));
59
+ - (instancetype)initWithUnsignedInteger:(NSUInteger)value __attribute__((unavailable));
60
+ + (instancetype)numberWithChar:(char)value __attribute__((unavailable));
61
+ + (instancetype)numberWithUnsignedChar:(unsigned char)value __attribute__((unavailable));
62
+ + (instancetype)numberWithShort:(short)value __attribute__((unavailable));
63
+ + (instancetype)numberWithUnsignedShort:(unsigned short)value __attribute__((unavailable));
64
+ + (instancetype)numberWithInt:(int)value __attribute__((unavailable));
65
+ + (instancetype)numberWithUnsignedInt:(unsigned int)value __attribute__((unavailable));
66
+ + (instancetype)numberWithLong:(long)value __attribute__((unavailable));
67
+ + (instancetype)numberWithUnsignedLong:(unsigned long)value __attribute__((unavailable));
68
+ + (instancetype)numberWithLongLong:(long long)value __attribute__((unavailable));
69
+ + (instancetype)numberWithUnsignedLongLong:(unsigned long long)value __attribute__((unavailable));
70
+ + (instancetype)numberWithFloat:(float)value __attribute__((unavailable));
71
+ + (instancetype)numberWithDouble:(double)value __attribute__((unavailable));
72
+ + (instancetype)numberWithBool:(BOOL)value __attribute__((unavailable));
73
+ + (instancetype)numberWithInteger:(NSInteger)value __attribute__((unavailable));
74
+ + (instancetype)numberWithUnsignedInteger:(NSUInteger)value __attribute__((unavailable));
75
+ @end
76
+
77
+ __attribute__((swift_name("KotlinByte")))
78
+ @interface TSBByte : TSBNumber
79
+ - (instancetype)initWithChar:(char)value;
80
+ + (instancetype)numberWithChar:(char)value;
81
+ @end
82
+
83
+ __attribute__((swift_name("KotlinUByte")))
84
+ @interface TSBUByte : TSBNumber
85
+ - (instancetype)initWithUnsignedChar:(unsigned char)value;
86
+ + (instancetype)numberWithUnsignedChar:(unsigned char)value;
87
+ @end
88
+
89
+ __attribute__((swift_name("KotlinShort")))
90
+ @interface TSBShort : TSBNumber
91
+ - (instancetype)initWithShort:(short)value;
92
+ + (instancetype)numberWithShort:(short)value;
93
+ @end
94
+
95
+ __attribute__((swift_name("KotlinUShort")))
96
+ @interface TSBUShort : TSBNumber
97
+ - (instancetype)initWithUnsignedShort:(unsigned short)value;
98
+ + (instancetype)numberWithUnsignedShort:(unsigned short)value;
99
+ @end
100
+
101
+ __attribute__((swift_name("KotlinInt")))
102
+ @interface TSBInt : TSBNumber
103
+ - (instancetype)initWithInt:(int)value;
104
+ + (instancetype)numberWithInt:(int)value;
105
+ @end
106
+
107
+ __attribute__((swift_name("KotlinUInt")))
108
+ @interface TSBUInt : TSBNumber
109
+ - (instancetype)initWithUnsignedInt:(unsigned int)value;
110
+ + (instancetype)numberWithUnsignedInt:(unsigned int)value;
111
+ @end
112
+
113
+ __attribute__((swift_name("KotlinLong")))
114
+ @interface TSBLong : TSBNumber
115
+ - (instancetype)initWithLongLong:(long long)value;
116
+ + (instancetype)numberWithLongLong:(long long)value;
117
+ @end
118
+
119
+ __attribute__((swift_name("KotlinULong")))
120
+ @interface TSBULong : TSBNumber
121
+ - (instancetype)initWithUnsignedLongLong:(unsigned long long)value;
122
+ + (instancetype)numberWithUnsignedLongLong:(unsigned long long)value;
123
+ @end
124
+
125
+ __attribute__((swift_name("KotlinFloat")))
126
+ @interface TSBFloat : TSBNumber
127
+ - (instancetype)initWithFloat:(float)value;
128
+ + (instancetype)numberWithFloat:(float)value;
129
+ @end
130
+
131
+ __attribute__((swift_name("KotlinDouble")))
132
+ @interface TSBDouble : TSBNumber
133
+ - (instancetype)initWithDouble:(double)value;
134
+ + (instancetype)numberWithDouble:(double)value;
135
+ @end
136
+
137
+ __attribute__((swift_name("KotlinBoolean")))
138
+ @interface TSBBoolean : TSBNumber
139
+ - (instancetype)initWithBool:(BOOL)value;
140
+ + (instancetype)numberWithBool:(BOOL)value;
141
+ @end
142
+
143
+ __attribute__((objc_subclassing_restricted))
144
+ __attribute__((swift_name("TempivoSensorBridge")))
145
+ @interface TSBTempivoSensorBridge : TSBBase
146
+ - (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer));
147
+ + (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead")));
148
+ - (NSString *)connectPayloadJsonSerial:(NSString *)serial bluetoothMac:(NSString *)bluetoothMac pin:(int32_t)pin legacy:(BOOL)legacy __attribute__((swift_name("connectPayloadJson(serial:bluetoothMac:pin:legacy:)")));
149
+ - (void)disconnect __attribute__((swift_name("disconnect()")));
150
+ - (NSString *)getCalibrationPayloadJson __attribute__((swift_name("getCalibrationPayloadJson()")));
151
+ - (NSString *)getConfigurationPayloadJson __attribute__((swift_name("getConfigurationPayloadJson()")));
152
+ - (void)initialize __attribute__((swift_name("initialize()")));
153
+ - (NSString *)setConfigurationPayloadJsonJson:(NSString *)json __attribute__((swift_name("setConfigurationPayloadJson(json:)")));
154
+ - (NSString *)triggerTransmissionPayloadJson __attribute__((swift_name("triggerTransmissionPayloadJson()")));
155
+ @end
156
+
157
+ #pragma pop_macro("_Nullable_result")
158
+ #pragma clang diagnostic pop
159
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,35 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>CFBundleExecutable</key>
6
+ <string>TempivoSensorBridge</string>
7
+ <key>CFBundleIdentifier</key>
8
+ <string>com.tempivo.sensor.bridge.TempivoSensorBridge</string>
9
+ <key>CFBundleInfoDictionaryVersion</key>
10
+ <string>6.0</string>
11
+ <key>CFBundleName</key>
12
+ <string>TempivoSensorBridge</string>
13
+ <key>CFBundlePackageType</key>
14
+ <string>FMWK</string>
15
+ <key>CFBundleShortVersionString</key>
16
+ <string>1.0</string>
17
+ <key>CFBundleSupportedPlatforms</key>
18
+ <array>
19
+ <string>iPhoneOS</string>
20
+ </array>
21
+ <key>CFBundleVersion</key>
22
+ <string>1</string>
23
+ <key>MinimumOSVersion</key>
24
+ <string>14.0</string>
25
+ <key>UIDeviceFamily</key>
26
+ <array>
27
+ <integer>1</integer>
28
+ <integer>2</integer>
29
+ </array>
30
+ <key>UIRequiredDeviceCapabilities</key>
31
+ <array>
32
+ <string>arm64</string>
33
+ </array>
34
+ </dict>
35
+ </plist>
@@ -0,0 +1,8 @@
1
+ framework module "TempivoSensorBridge" {
2
+ umbrella header "TempivoSensorBridge.h"
3
+
4
+ export *
5
+ module * { export * }
6
+
7
+ use Foundation
8
+ }
@@ -0,0 +1,159 @@
1
+ #import <Foundation/NSArray.h>
2
+ #import <Foundation/NSDictionary.h>
3
+ #import <Foundation/NSError.h>
4
+ #import <Foundation/NSObject.h>
5
+ #import <Foundation/NSSet.h>
6
+ #import <Foundation/NSString.h>
7
+ #import <Foundation/NSValue.h>
8
+
9
+ NS_ASSUME_NONNULL_BEGIN
10
+ #pragma clang diagnostic push
11
+ #pragma clang diagnostic ignored "-Wunknown-warning-option"
12
+ #pragma clang diagnostic ignored "-Wincompatible-property-type"
13
+ #pragma clang diagnostic ignored "-Wnullability"
14
+
15
+ #pragma push_macro("_Nullable_result")
16
+ #if !__has_feature(nullability_nullable_result)
17
+ #undef _Nullable_result
18
+ #define _Nullable_result _Nullable
19
+ #endif
20
+
21
+ __attribute__((swift_name("KotlinBase")))
22
+ @interface TSBBase : NSObject
23
+ - (instancetype)init __attribute__((unavailable));
24
+ + (instancetype)new __attribute__((unavailable));
25
+ + (void)initialize __attribute__((objc_requires_super));
26
+ @end
27
+
28
+ @interface TSBBase (TSBBaseCopying) <NSCopying>
29
+ @end
30
+
31
+ __attribute__((swift_name("KotlinMutableSet")))
32
+ @interface TSBMutableSet<ObjectType> : NSMutableSet<ObjectType>
33
+ @end
34
+
35
+ __attribute__((swift_name("KotlinMutableDictionary")))
36
+ @interface TSBMutableDictionary<KeyType, ObjectType> : NSMutableDictionary<KeyType, ObjectType>
37
+ @end
38
+
39
+ @interface NSError (NSErrorTSBKotlinException)
40
+ @property (readonly) id _Nullable kotlinException;
41
+ @end
42
+
43
+ __attribute__((swift_name("KotlinNumber")))
44
+ @interface TSBNumber : NSNumber
45
+ - (instancetype)initWithChar:(char)value __attribute__((unavailable));
46
+ - (instancetype)initWithUnsignedChar:(unsigned char)value __attribute__((unavailable));
47
+ - (instancetype)initWithShort:(short)value __attribute__((unavailable));
48
+ - (instancetype)initWithUnsignedShort:(unsigned short)value __attribute__((unavailable));
49
+ - (instancetype)initWithInt:(int)value __attribute__((unavailable));
50
+ - (instancetype)initWithUnsignedInt:(unsigned int)value __attribute__((unavailable));
51
+ - (instancetype)initWithLong:(long)value __attribute__((unavailable));
52
+ - (instancetype)initWithUnsignedLong:(unsigned long)value __attribute__((unavailable));
53
+ - (instancetype)initWithLongLong:(long long)value __attribute__((unavailable));
54
+ - (instancetype)initWithUnsignedLongLong:(unsigned long long)value __attribute__((unavailable));
55
+ - (instancetype)initWithFloat:(float)value __attribute__((unavailable));
56
+ - (instancetype)initWithDouble:(double)value __attribute__((unavailable));
57
+ - (instancetype)initWithBool:(BOOL)value __attribute__((unavailable));
58
+ - (instancetype)initWithInteger:(NSInteger)value __attribute__((unavailable));
59
+ - (instancetype)initWithUnsignedInteger:(NSUInteger)value __attribute__((unavailable));
60
+ + (instancetype)numberWithChar:(char)value __attribute__((unavailable));
61
+ + (instancetype)numberWithUnsignedChar:(unsigned char)value __attribute__((unavailable));
62
+ + (instancetype)numberWithShort:(short)value __attribute__((unavailable));
63
+ + (instancetype)numberWithUnsignedShort:(unsigned short)value __attribute__((unavailable));
64
+ + (instancetype)numberWithInt:(int)value __attribute__((unavailable));
65
+ + (instancetype)numberWithUnsignedInt:(unsigned int)value __attribute__((unavailable));
66
+ + (instancetype)numberWithLong:(long)value __attribute__((unavailable));
67
+ + (instancetype)numberWithUnsignedLong:(unsigned long)value __attribute__((unavailable));
68
+ + (instancetype)numberWithLongLong:(long long)value __attribute__((unavailable));
69
+ + (instancetype)numberWithUnsignedLongLong:(unsigned long long)value __attribute__((unavailable));
70
+ + (instancetype)numberWithFloat:(float)value __attribute__((unavailable));
71
+ + (instancetype)numberWithDouble:(double)value __attribute__((unavailable));
72
+ + (instancetype)numberWithBool:(BOOL)value __attribute__((unavailable));
73
+ + (instancetype)numberWithInteger:(NSInteger)value __attribute__((unavailable));
74
+ + (instancetype)numberWithUnsignedInteger:(NSUInteger)value __attribute__((unavailable));
75
+ @end
76
+
77
+ __attribute__((swift_name("KotlinByte")))
78
+ @interface TSBByte : TSBNumber
79
+ - (instancetype)initWithChar:(char)value;
80
+ + (instancetype)numberWithChar:(char)value;
81
+ @end
82
+
83
+ __attribute__((swift_name("KotlinUByte")))
84
+ @interface TSBUByte : TSBNumber
85
+ - (instancetype)initWithUnsignedChar:(unsigned char)value;
86
+ + (instancetype)numberWithUnsignedChar:(unsigned char)value;
87
+ @end
88
+
89
+ __attribute__((swift_name("KotlinShort")))
90
+ @interface TSBShort : TSBNumber
91
+ - (instancetype)initWithShort:(short)value;
92
+ + (instancetype)numberWithShort:(short)value;
93
+ @end
94
+
95
+ __attribute__((swift_name("KotlinUShort")))
96
+ @interface TSBUShort : TSBNumber
97
+ - (instancetype)initWithUnsignedShort:(unsigned short)value;
98
+ + (instancetype)numberWithUnsignedShort:(unsigned short)value;
99
+ @end
100
+
101
+ __attribute__((swift_name("KotlinInt")))
102
+ @interface TSBInt : TSBNumber
103
+ - (instancetype)initWithInt:(int)value;
104
+ + (instancetype)numberWithInt:(int)value;
105
+ @end
106
+
107
+ __attribute__((swift_name("KotlinUInt")))
108
+ @interface TSBUInt : TSBNumber
109
+ - (instancetype)initWithUnsignedInt:(unsigned int)value;
110
+ + (instancetype)numberWithUnsignedInt:(unsigned int)value;
111
+ @end
112
+
113
+ __attribute__((swift_name("KotlinLong")))
114
+ @interface TSBLong : TSBNumber
115
+ - (instancetype)initWithLongLong:(long long)value;
116
+ + (instancetype)numberWithLongLong:(long long)value;
117
+ @end
118
+
119
+ __attribute__((swift_name("KotlinULong")))
120
+ @interface TSBULong : TSBNumber
121
+ - (instancetype)initWithUnsignedLongLong:(unsigned long long)value;
122
+ + (instancetype)numberWithUnsignedLongLong:(unsigned long long)value;
123
+ @end
124
+
125
+ __attribute__((swift_name("KotlinFloat")))
126
+ @interface TSBFloat : TSBNumber
127
+ - (instancetype)initWithFloat:(float)value;
128
+ + (instancetype)numberWithFloat:(float)value;
129
+ @end
130
+
131
+ __attribute__((swift_name("KotlinDouble")))
132
+ @interface TSBDouble : TSBNumber
133
+ - (instancetype)initWithDouble:(double)value;
134
+ + (instancetype)numberWithDouble:(double)value;
135
+ @end
136
+
137
+ __attribute__((swift_name("KotlinBoolean")))
138
+ @interface TSBBoolean : TSBNumber
139
+ - (instancetype)initWithBool:(BOOL)value;
140
+ + (instancetype)numberWithBool:(BOOL)value;
141
+ @end
142
+
143
+ __attribute__((objc_subclassing_restricted))
144
+ __attribute__((swift_name("TempivoSensorBridge")))
145
+ @interface TSBTempivoSensorBridge : TSBBase
146
+ - (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer));
147
+ + (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead")));
148
+ - (NSString *)connectPayloadJsonSerial:(NSString *)serial bluetoothMac:(NSString *)bluetoothMac pin:(int32_t)pin legacy:(BOOL)legacy __attribute__((swift_name("connectPayloadJson(serial:bluetoothMac:pin:legacy:)")));
149
+ - (void)disconnect __attribute__((swift_name("disconnect()")));
150
+ - (NSString *)getCalibrationPayloadJson __attribute__((swift_name("getCalibrationPayloadJson()")));
151
+ - (NSString *)getConfigurationPayloadJson __attribute__((swift_name("getConfigurationPayloadJson()")));
152
+ - (void)initialize __attribute__((swift_name("initialize()")));
153
+ - (NSString *)setConfigurationPayloadJsonJson:(NSString *)json __attribute__((swift_name("setConfigurationPayloadJson(json:)")));
154
+ - (NSString *)triggerTransmissionPayloadJson __attribute__((swift_name("triggerTransmissionPayloadJson()")));
155
+ @end
156
+
157
+ #pragma pop_macro("_Nullable_result")
158
+ #pragma clang diagnostic pop
159
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,31 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>CFBundleExecutable</key>
6
+ <string>TempivoSensorBridge</string>
7
+ <key>CFBundleIdentifier</key>
8
+ <string>com.tempivo.sensor.bridge.TempivoSensorBridge</string>
9
+ <key>CFBundleInfoDictionaryVersion</key>
10
+ <string>6.0</string>
11
+ <key>CFBundleName</key>
12
+ <string>TempivoSensorBridge</string>
13
+ <key>CFBundlePackageType</key>
14
+ <string>FMWK</string>
15
+ <key>CFBundleShortVersionString</key>
16
+ <string>1.0</string>
17
+ <key>CFBundleSupportedPlatforms</key>
18
+ <array>
19
+ <string>iPhoneSimulator</string>
20
+ </array>
21
+ <key>CFBundleVersion</key>
22
+ <string>1</string>
23
+ <key>MinimumOSVersion</key>
24
+ <string>14.0</string>
25
+ <key>UIDeviceFamily</key>
26
+ <array>
27
+ <integer>1</integer>
28
+ <integer>2</integer>
29
+ </array>
30
+ </dict>
31
+ </plist>
@@ -0,0 +1,8 @@
1
+ framework module "TempivoSensorBridge" {
2
+ umbrella header "TempivoSensorBridge.h"
3
+
4
+ export *
5
+ module * { export * }
6
+
7
+ use Foundation
8
+ }