@leonardojc/capacitor-ioboard 1.2.7 → 2.0.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.
- package/README.md +257 -209
- package/android/build.gradle +0 -1
- package/android/src/main/java/com/leonardojc/capacitor/ioboard/CapacitorIoboardPlugin.java +926 -381
- package/android/src/main/java/com/leonardojc/capacitor/ioboard/CapacitorIoboardPlugin.java.backup +777 -0
- package/android/src/main/java/com/leonardojc/capacitor/ioboard/SerialConnectionManager.java +446 -0
- package/dist/esm/definitions-v2.d.ts +228 -0
- package/dist/esm/definitions-v2.js +11 -0
- package/dist/esm/definitions.d.ts +28 -0
- package/dist/esm/index-v2.d.ts +266 -0
- package/dist/esm/index-v2.js +295 -0
- package/dist/esm/web.d.ts +13 -16
- package/dist/esm/web.js +51 -135
- package/dist/plugin.cjs.js +50 -134
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +50 -134
- package/dist/plugin.js.map +1 -1
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -1,292 +1,340 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 🚀 IOBoard Plugin v2.0 - Integrated Serial + Protocol
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**@leonardojc/capacitor-ioboard v2.0.0** - Complete IOBoard control with integrated serial communication
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## ✨ What's New in v2.0
|
|
6
|
+
|
|
7
|
+
- **🔗 Integrated Serial Communication** - No need for separate serial plugin
|
|
8
|
+
- **🎯 Simplified API** - Single plugin handles everything
|
|
9
|
+
- **⚡ Real-time Events** - Connection state, data received, error handling
|
|
10
|
+
- **🎨 Enhanced Color Control** - Predefined colors and custom RGB support
|
|
11
|
+
- **🚀 Complete OTA Support** - Firmware updates with progress tracking
|
|
12
|
+
- **🌐 Web Compatible** - Works in browser with simulation mode
|
|
13
|
+
|
|
14
|
+
## 📦 Installation
|
|
6
15
|
|
|
7
16
|
```bash
|
|
8
|
-
npm install @leonardojc/capacitor-ioboard
|
|
17
|
+
npm install @leonardojc/capacitor-ioboard@2.0.0
|
|
9
18
|
npx cap sync
|
|
10
19
|
```
|
|
11
20
|
|
|
12
|
-
##
|
|
13
|
-
|
|
14
|
-
This plugin requires the [@leonardojc/capacitor-serial-port](https://www.npmjs.com/package/@leonardojc/capacitor-serial-port) plugin for serial communication.
|
|
21
|
+
## 🚀 Quick Start
|
|
15
22
|
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
```
|
|
23
|
+
```typescript
|
|
24
|
+
import { ioboard } from '@leonardojc/capacitor-ioboard';
|
|
19
25
|
|
|
20
|
-
|
|
26
|
+
// Connect to device
|
|
27
|
+
const result = await ioboard.connect('/dev/ttyS2', 115200);
|
|
21
28
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
29
|
+
// Unlock pallet with green color
|
|
30
|
+
await ioboard.unlockPallet(1, 3, 'GREEN', {
|
|
31
|
+
intensity: 100,
|
|
32
|
+
blinkTimes: 3,
|
|
33
|
+
blinkSpeed: 2
|
|
34
|
+
});
|
|
25
35
|
|
|
26
|
-
|
|
36
|
+
// Set all pallets to red
|
|
37
|
+
await ioboard.setAllPalletsColor(1, 'RED');
|
|
27
38
|
|
|
28
|
-
|
|
39
|
+
// Get device status
|
|
40
|
+
const status = await ioboard.getStatus(1);
|
|
41
|
+
console.log(\`Firmware: \${status.status.firmwareVersion}\`);
|
|
42
|
+
```
|
|
29
43
|
|
|
30
|
-
|
|
44
|
+
## 📚 Complete API Reference
|
|
31
45
|
|
|
32
|
-
|
|
46
|
+
### 🔌 Connection Methods
|
|
33
47
|
|
|
48
|
+
#### `connect(portPath?, baudRate?)`
|
|
49
|
+
Connect to IOBoard device
|
|
34
50
|
```typescript
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const result = await CapacitorIoboard.openConnection({
|
|
38
|
-
baudRate: 115200,
|
|
39
|
-
dataBits: 8,
|
|
40
|
-
stopBits: 1,
|
|
41
|
-
parity: 'none',
|
|
42
|
-
timeout: 5000
|
|
43
|
-
});
|
|
51
|
+
await ioboard.connect('/dev/ttyS2', 115200);
|
|
44
52
|
```
|
|
45
53
|
|
|
46
|
-
|
|
54
|
+
#### `disconnect()`
|
|
55
|
+
Disconnect from device
|
|
56
|
+
```typescript
|
|
57
|
+
await ioboard.disconnect();
|
|
58
|
+
```
|
|
47
59
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
| flowControl | 'none' \| 'hardware' \| 'software' | 'none' | Flow control method |
|
|
55
|
-
| timeout | number | 5000 | Response timeout (ms) |
|
|
60
|
+
#### `isDeviceConnected()`
|
|
61
|
+
Check connection status
|
|
62
|
+
```typescript
|
|
63
|
+
const status = await ioboard.isDeviceConnected();
|
|
64
|
+
console.log(status.connected); // true/false
|
|
65
|
+
```
|
|
56
66
|
|
|
57
|
-
#### `
|
|
67
|
+
#### `listPorts()`
|
|
68
|
+
List available serial ports
|
|
69
|
+
```typescript
|
|
70
|
+
const result = await ioboard.listPorts();
|
|
71
|
+
console.log(result.ports); // ['/dev/ttyS0', '/dev/ttyS1', ...]
|
|
72
|
+
```
|
|
58
73
|
|
|
59
|
-
|
|
74
|
+
### 🎮 IOBoard Device Methods
|
|
60
75
|
|
|
76
|
+
#### `getStatus(address)`
|
|
77
|
+
Get device status and information
|
|
61
78
|
```typescript
|
|
62
|
-
const result = await
|
|
79
|
+
const result = await ioboard.getStatus(1);
|
|
80
|
+
console.log(result.status);
|
|
81
|
+
// {
|
|
82
|
+
// address: 1,
|
|
83
|
+
// connected: true,
|
|
84
|
+
// firmwareVersion: "2.1.0",
|
|
85
|
+
// palletStates: [false, false, ...], // 8 pallets
|
|
86
|
+
// temperature: 25.5,
|
|
87
|
+
// voltage: 12.0,
|
|
88
|
+
// uptime: 86400
|
|
89
|
+
// }
|
|
63
90
|
```
|
|
64
91
|
|
|
65
|
-
#### `
|
|
92
|
+
#### `unlockPallet(address, palletNumber, color, options?)`
|
|
93
|
+
Unlock specific pallet with color and effects
|
|
94
|
+
```typescript
|
|
95
|
+
await ioboard.unlockPallet(1, 3, 'GREEN', {
|
|
96
|
+
intensity: 100, // 0-100
|
|
97
|
+
blinkTimes: 3, // Number of blinks (0 = solid)
|
|
98
|
+
blinkSpeed: 2 // Blink speed (1-5)
|
|
99
|
+
});
|
|
66
100
|
|
|
67
|
-
|
|
101
|
+
// Using custom RGB color
|
|
102
|
+
await ioboard.unlockPallet(1, 5, { red: 255, green: 128, blue: 0 });
|
|
103
|
+
```
|
|
68
104
|
|
|
105
|
+
#### `setAllPalletsColor(address, color, options?)`
|
|
106
|
+
Set color for all 8 pallets
|
|
69
107
|
```typescript
|
|
70
|
-
|
|
71
|
-
|
|
108
|
+
await ioboard.setAllPalletsColor(1, 'BLUE', {
|
|
109
|
+
intensity: 80,
|
|
110
|
+
blinkTimes: 0 // Solid color
|
|
111
|
+
});
|
|
72
112
|
```
|
|
73
113
|
|
|
74
|
-
|
|
114
|
+
#### `controlMultipleLEDs(address, ledConfigs)`
|
|
115
|
+
Control each pallet individually
|
|
116
|
+
```typescript
|
|
117
|
+
const configs = [
|
|
118
|
+
{ color: 'RED', intensity: 100 },
|
|
119
|
+
{ color: 'GREEN', intensity: 90 },
|
|
120
|
+
{ color: 'BLUE', intensity: 80 },
|
|
121
|
+
{ color: { red: 255, green: 128, blue: 0 }, intensity: 70 },
|
|
122
|
+
// ... up to 8 configurations
|
|
123
|
+
];
|
|
124
|
+
|
|
125
|
+
await ioboard.controlMultipleLEDs(1, configs);
|
|
126
|
+
```
|
|
75
127
|
|
|
76
|
-
|
|
128
|
+
### 🎨 Predefined Colors
|
|
77
129
|
|
|
78
|
-
|
|
130
|
+
Available color presets:
|
|
131
|
+
- `RED`, `GREEN`, `BLUE`
|
|
132
|
+
- `YELLOW`, `MAGENTA`, `CYAN`
|
|
133
|
+
- `WHITE`, `OFF`
|
|
134
|
+
- `ORANGE`, `PURPLE`, `PINK`, `LIME`
|
|
79
135
|
|
|
80
136
|
```typescript
|
|
81
|
-
|
|
137
|
+
// Using predefined colors
|
|
138
|
+
await ioboard.unlockPallet(1, 0, 'PURPLE');
|
|
82
139
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
console.log('Software Version:', response.data.softwareVersion);
|
|
86
|
-
}
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
**Parameters:**
|
|
140
|
+
// Using custom RGB
|
|
141
|
+
await ioboard.unlockPallet(1, 1, { red: 128, green: 64, blue: 192 });
|
|
90
142
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
143
|
+
// Get available colors
|
|
144
|
+
const colors = ioboard.getColorPresets();
|
|
145
|
+
```
|
|
94
146
|
|
|
95
|
-
|
|
147
|
+
### 🚀 OTA Firmware Update
|
|
96
148
|
|
|
149
|
+
#### `startOTAUpdate(address, fileName, fileSize)`
|
|
150
|
+
Initialize OTA update process
|
|
97
151
|
```typescript
|
|
98
|
-
|
|
99
|
-
success: boolean;
|
|
100
|
-
message?: string;
|
|
101
|
-
data?: {
|
|
102
|
-
doorLockStatus: number; // 8-bit status (each bit represents a lock)
|
|
103
|
-
softwareVersion: {
|
|
104
|
-
major: number;
|
|
105
|
-
minor: number;
|
|
106
|
-
patch: number;
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
}
|
|
152
|
+
await ioboard.startOTAUpdate(1, 'firmware.bin', 32768);
|
|
110
153
|
```
|
|
111
154
|
|
|
112
|
-
#### `
|
|
113
|
-
|
|
114
|
-
Controls a single pallet on the IOBOARD.
|
|
115
|
-
|
|
155
|
+
#### `sendOTAData(address, packetNumber, data)`
|
|
156
|
+
Send OTA data packet
|
|
116
157
|
```typescript
|
|
117
|
-
|
|
118
|
-
address: 1,
|
|
119
|
-
palletNumber: 0,
|
|
120
|
-
doorLock: true, // true = unlock, false = no action
|
|
121
|
-
ledControl: {
|
|
122
|
-
red: 255,
|
|
123
|
-
green: 0,
|
|
124
|
-
blue: 0,
|
|
125
|
-
intensity: 100,
|
|
126
|
-
blinkTimes: 5,
|
|
127
|
-
blinkSpeed: 2
|
|
128
|
-
}
|
|
129
|
-
});
|
|
158
|
+
await ioboard.sendOTAData(1, 0, [0x48, 0x65, 0x6C, 0x6C, 0x6F]); // "Hello"
|
|
130
159
|
```
|
|
131
160
|
|
|
132
|
-
|
|
161
|
+
#### `performOTAUpdate(address, file, onProgress?)`
|
|
162
|
+
Complete OTA update with progress callback
|
|
163
|
+
```typescript
|
|
164
|
+
const file = new File([firmwareData], 'firmware.bin');
|
|
133
165
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
| doorLock | boolean | true = unlock, false = no action |
|
|
139
|
-
| ledControl | LEDControlOptions | LED control parameters |
|
|
166
|
+
await ioboard.performOTAUpdate(1, file, (progress, packet, total) => {
|
|
167
|
+
console.log(\`Progress: \${progress.toFixed(1)}% (\${packet}/\${total})\`);
|
|
168
|
+
});
|
|
169
|
+
```
|
|
140
170
|
|
|
141
|
-
|
|
171
|
+
### 📡 Event Handling
|
|
142
172
|
|
|
143
|
-
|
|
173
|
+
#### `addDataReceivedListener(callback)`
|
|
174
|
+
Listen for data received from device
|
|
175
|
+
```typescript
|
|
176
|
+
await ioboard.addDataReceivedListener((event) => {
|
|
177
|
+
console.log('Data received:', event);
|
|
178
|
+
});
|
|
179
|
+
```
|
|
144
180
|
|
|
181
|
+
#### `addConnectionStateListener(callback)`
|
|
182
|
+
Listen for connection state changes
|
|
145
183
|
```typescript
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
intensity: 50, blinkTimes: 0, blinkSpeed: 0
|
|
184
|
+
await ioboard.addConnectionStateListener((event) => {
|
|
185
|
+
console.log(\`Connection: \${event.connected}\`);
|
|
149
186
|
});
|
|
187
|
+
```
|
|
150
188
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
189
|
+
#### `addSerialErrorListener(callback)`
|
|
190
|
+
Listen for serial communication errors
|
|
191
|
+
```typescript
|
|
192
|
+
await ioboard.addSerialErrorListener((event) => {
|
|
193
|
+
console.error('Serial error:', event.error);
|
|
156
194
|
});
|
|
157
195
|
```
|
|
158
196
|
|
|
159
|
-
|
|
197
|
+
#### `removeAllListeners()`
|
|
198
|
+
Remove all event listeners
|
|
199
|
+
```typescript
|
|
200
|
+
await ioboard.removeAllListeners();
|
|
201
|
+
```
|
|
160
202
|
|
|
161
|
-
|
|
162
|
-
|-----------------|---------------------|--------------------------------|
|
|
163
|
-
| address | number | IOBOARD address (1-63) |
|
|
164
|
-
| doorLockControl | number | 8-bit mask for door control |
|
|
165
|
-
| extendedControl | number | Extended control byte |
|
|
166
|
-
| ledControls | LEDControlOptions[] | Array of 8 LED control configs |
|
|
203
|
+
## 🛠️ Utility Methods
|
|
167
204
|
|
|
168
|
-
|
|
205
|
+
#### `getConnectionInfo()`
|
|
206
|
+
Get current connection information
|
|
207
|
+
```typescript
|
|
208
|
+
const info = ioboard.getConnectionInfo();
|
|
209
|
+
console.log(info.isConnected, info.currentPort);
|
|
210
|
+
```
|
|
169
211
|
|
|
212
|
+
#### `createColor(red, green, blue)`
|
|
213
|
+
Create RGB color object
|
|
170
214
|
```typescript
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
green: number; // 0-255
|
|
174
|
-
blue: number; // 0-255
|
|
175
|
-
intensity: number; // 0-255 (0=off, 1-100=percentage, 101-255=max)
|
|
176
|
-
blinkTimes: number; // 0-255 (0=no blink, 255=infinite)
|
|
177
|
-
blinkSpeed: number; // 1-30 seconds interval
|
|
178
|
-
}
|
|
215
|
+
const orange = ioboard.createColor(255, 165, 0);
|
|
216
|
+
await ioboard.unlockPallet(1, 0, orange);
|
|
179
217
|
```
|
|
180
218
|
|
|
181
|
-
|
|
219
|
+
## 🌟 React Component Example
|
|
182
220
|
|
|
183
|
-
|
|
221
|
+
```jsx
|
|
222
|
+
import React, { useState, useEffect } from 'react';
|
|
223
|
+
import { ioboard } from '@leonardojc/capacitor-ioboard';
|
|
184
224
|
|
|
185
|
-
|
|
225
|
+
const IOBoardController = () => {
|
|
226
|
+
const [isConnected, setIsConnected] = useState(false);
|
|
186
227
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
patchVersion: 0,
|
|
193
|
-
firmwareSize: 65536 // Size in bytes
|
|
194
|
-
});
|
|
195
|
-
```
|
|
228
|
+
useEffect(() => {
|
|
229
|
+
// Setup event listeners
|
|
230
|
+
ioboard.addConnectionStateListener((event) => {
|
|
231
|
+
setIsConnected(event.connected);
|
|
232
|
+
});
|
|
196
233
|
|
|
197
|
-
|
|
234
|
+
return () => {
|
|
235
|
+
ioboard.removeAllListeners();
|
|
236
|
+
};
|
|
237
|
+
}, []);
|
|
198
238
|
|
|
199
|
-
|
|
239
|
+
const handleConnect = async () => {
|
|
240
|
+
const result = await ioboard.connect('/dev/ttyS2');
|
|
241
|
+
if (result.success) {
|
|
242
|
+
console.log('Connected successfully!');
|
|
243
|
+
}
|
|
244
|
+
};
|
|
200
245
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
246
|
+
const handleUnlockPallet = async (pallet) => {
|
|
247
|
+
await ioboard.unlockPallet(1, pallet, 'GREEN', {
|
|
248
|
+
intensity: 100,
|
|
249
|
+
blinkTimes: 3
|
|
250
|
+
});
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
return (
|
|
254
|
+
<div>
|
|
255
|
+
<button onClick={handleConnect} disabled={isConnected}>
|
|
256
|
+
{isConnected ? 'Connected' : 'Connect'}
|
|
257
|
+
</button>
|
|
258
|
+
|
|
259
|
+
{isConnected && (
|
|
260
|
+
<div>
|
|
261
|
+
{[0,1,2,3,4,5,6,7].map(pallet => (
|
|
262
|
+
<button
|
|
263
|
+
key={pallet}
|
|
264
|
+
onClick={() => handleUnlockPallet(pallet)}
|
|
265
|
+
>
|
|
266
|
+
Unlock Pallet {pallet}
|
|
267
|
+
</button>
|
|
268
|
+
))}
|
|
269
|
+
</div>
|
|
270
|
+
)}
|
|
271
|
+
</div>
|
|
272
|
+
);
|
|
273
|
+
};
|
|
207
274
|
```
|
|
208
275
|
|
|
209
|
-
## Protocol
|
|
276
|
+
## 📋 MTC3P08L Protocol
|
|
210
277
|
|
|
211
|
-
The plugin implements the
|
|
278
|
+
The plugin implements the complete MTC3P08L protocol:
|
|
212
279
|
|
|
213
|
-
- **
|
|
214
|
-
- **
|
|
215
|
-
- **
|
|
216
|
-
- **
|
|
217
|
-
- **
|
|
218
|
-
- **Response Timeout:** Configurable (default 5000ms)
|
|
280
|
+
- **Device Status** - Get firmware version, temperature, voltage
|
|
281
|
+
- **Pallet Control** - Individual pallet unlock with RGB LEDs
|
|
282
|
+
- **Multiple Control** - Control all 8 pallets simultaneously
|
|
283
|
+
- **OTA Updates** - Complete firmware update support
|
|
284
|
+
- **Error Handling** - Comprehensive error reporting
|
|
219
285
|
|
|
220
|
-
##
|
|
286
|
+
## 🔧 Configuration
|
|
221
287
|
|
|
222
|
-
|
|
288
|
+
Default connection settings:
|
|
289
|
+
- **Baud Rate**: 115200
|
|
290
|
+
- **Data Bits**: 8
|
|
291
|
+
- **Stop Bits**: 1
|
|
292
|
+
- **Parity**: None
|
|
293
|
+
- **Default Port**: '/dev/ttyS2'
|
|
223
294
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
// Use response.data if available
|
|
230
|
-
} else {
|
|
231
|
-
console.error('Operation failed:', response.message);
|
|
232
|
-
}
|
|
233
|
-
```
|
|
295
|
+
## 🌐 Platform Support
|
|
296
|
+
|
|
297
|
+
- ✅ **Android** - Full native support
|
|
298
|
+
- ✅ **iOS** - Full native support
|
|
299
|
+
- ✅ **Web** - Simulation mode for testing
|
|
234
300
|
|
|
235
|
-
##
|
|
301
|
+
## 🆚 Migration from v1.x
|
|
236
302
|
|
|
303
|
+
Version 2.0 is a complete rewrite with breaking changes:
|
|
304
|
+
|
|
305
|
+
### Before (v1.x - Two plugins)
|
|
237
306
|
```typescript
|
|
307
|
+
// Required two separate plugins
|
|
308
|
+
import { CapacitorSerialPort } from '@leonardojc/capacitor-serial-port';
|
|
238
309
|
import { CapacitorIoboard } from '@leonardojc/capacitor-ioboard';
|
|
239
310
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
async unlockPallet(address: number, palletNumber: number) {
|
|
256
|
-
const response = await CapacitorIoboard.controlSinglePallet({
|
|
257
|
-
address,
|
|
258
|
-
palletNumber,
|
|
259
|
-
doorLock: true,
|
|
260
|
-
ledControl: {
|
|
261
|
-
red: 0, green: 255, blue: 0, // Green light
|
|
262
|
-
intensity: 100,
|
|
263
|
-
blinkTimes: 3,
|
|
264
|
-
blinkSpeed: 1
|
|
265
|
-
}
|
|
266
|
-
});
|
|
267
|
-
|
|
268
|
-
return response.success;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
async getDeviceStatus(address: number) {
|
|
272
|
-
const response = await CapacitorIoboard.queryStatus({ address });
|
|
273
|
-
|
|
274
|
-
if (response.success && response.data) {
|
|
275
|
-
return {
|
|
276
|
-
doorStatus: response.data.doorLockStatus,
|
|
277
|
-
version: response.data.softwareVersion
|
|
278
|
-
};
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
return null;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
311
|
+
// Complex coordination required
|
|
312
|
+
await CapacitorSerialPort.connect({...});
|
|
313
|
+
await CapacitorIoboard.unlockPallet({...});
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
### After (v2.0 - Single plugin)
|
|
317
|
+
```typescript
|
|
318
|
+
// Single integrated plugin
|
|
319
|
+
import { ioboard } from '@leonardojc/capacitor-ioboard';
|
|
320
|
+
|
|
321
|
+
// Simple, unified API
|
|
322
|
+
await ioboard.connect('/dev/ttyS2');
|
|
323
|
+
await ioboard.unlockPallet(1, 3, 'GREEN');
|
|
284
324
|
```
|
|
285
325
|
|
|
286
|
-
##
|
|
326
|
+
## 🔗 Links
|
|
327
|
+
|
|
328
|
+
- **NPM Package**: [@leonardojc/capacitor-ioboard](https://www.npmjs.com/package/@leonardojc/capacitor-ioboard)
|
|
329
|
+
- **GitHub**: [IOBoard Plugin Repository](#)
|
|
330
|
+
- **Documentation**: [Complete API Docs](#)
|
|
331
|
+
|
|
332
|
+
## 📄 License
|
|
333
|
+
|
|
334
|
+
MIT License - see LICENSE file for details.
|
|
287
335
|
|
|
288
|
-
|
|
336
|
+
---
|
|
289
337
|
|
|
290
|
-
|
|
338
|
+
### 🎉 IOBoard v2.0 - Simplified, Powerful, Complete!
|
|
291
339
|
|
|
292
|
-
|
|
340
|
+
Single plugin, comprehensive control, zero hassle. Everything you need for IOBoard device integration.
|
package/android/build.gradle
CHANGED
|
@@ -33,7 +33,6 @@ repositories {
|
|
|
33
33
|
dependencies {
|
|
34
34
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
35
35
|
implementation project(':capacitor-android')
|
|
36
|
-
implementation project(':leonardojc-capacitor-serial-port') // SerialPort plugin dependency
|
|
37
36
|
testImplementation 'junit:junit:4.13.2'
|
|
38
37
|
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
|
39
38
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|