https://github.com/nicolasroehm/capacitormodbus
Modbus client for Capacitor 4.x
https://github.com/nicolasroehm/capacitormodbus
Last synced: 3 months ago
JSON representation
Modbus client for Capacitor 4.x
- Host: GitHub
- URL: https://github.com/nicolasroehm/capacitormodbus
- Owner: NicolasRoehm
- Created: 2022-11-30T10:53:32.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-14T14:26:09.000Z (almost 2 years ago)
- Last Synced: 2025-02-16T15:30:31.770Z (3 months ago)
- Language: Java
- Homepage:
- Size: 201 KB
- Stars: 0
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# Capacitor Modbus
Modbus client for Android with Capacitor 4.x
## Install
```bash
npm install capacitor-modbus
npx cap sync
```## API
* [`setIpAddress(...)`](#setipaddress)
* [`setPort(...)`](#setport)
* [`connect()`](#connect)
* [`connectTo(...)`](#connectto)
* [`disconnect()`](#disconnect)
* [`isConnected()`](#isconnected)
* [`readHoldingRegisters(...)`](#readholdingregisters)
* [`convertRegistersToFloat(...)`](#convertregisterstofloat)### setIpAddress(...)
```typescript
setIpAddress(options: { ip: string; }) => Promise
```| Param | Type |
| ------------- | ---------------------------- |
| **`options`** |{ ip: string; }
|--------------------
### setPort(...)
```typescript
setPort(options: { port: number; }) => Promise
```| Param | Type |
| ------------- | ------------------------------ |
| **`options`** |{ port: number; }
|--------------------
### connect()
```typescript
connect() => Promise
```--------------------
### connectTo(...)
```typescript
connectTo(options: { ip: string; port: number; }) => Promise
```| Param | Type |
| ------------- | ------------------------------------------ |
| **`options`** |{ ip: string; port: number; }
|--------------------
### disconnect()
```typescript
disconnect() => Promise
```--------------------
### isConnected()
```typescript
isConnected() => Promise<{ result: boolean; }>
```**Returns:**
Promise<{ result: boolean; }>
--------------------
### readHoldingRegisters(...)
```typescript
readHoldingRegisters(options: { start: number; count: number; }) => Promise<{ result: number[]; }>
```| Param | Type |
| ------------- | ---------------------------------------------- |
| **`options`** |{ start: number; count: number; }
|**Returns:**
Promise<{ result: number[]; }>
--------------------
### convertRegistersToFloat(...)
```typescript
convertRegistersToFloat(options: { registers: number[]; order: 0 | 1; }) => Promise<{ result: number; }>
```| Param | Type |
| ------------- | ---------------------------------------------------- |
| **`options`** |{ registers: number[]; order: 0 \| 1; }
|**Returns:**
Promise<{ result: number; }>
--------------------
## Sources
- https://github.com/dhakerShiv/cordova-plugin-modbus-tcp
- https://capacitorjs.com/docs/plugins/workflow