Skip to content

Commit

Permalink
docs: update README.md and regenerate documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin-Stefan committed Oct 19, 2024
1 parent efebcfc commit 1b7f2d5
Show file tree
Hide file tree
Showing 13 changed files with 261 additions and 53 deletions.
157 changes: 156 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- [Default options](#default-options)
- [Finding Device Name](#-finding-device-name)
- [Examples](#-examples)
- [Supported Commands](#supported-commands)
- [Contributing](#-contributing)
- [License](#-license)

Expand Down Expand Up @@ -98,7 +99,161 @@ Typically, the device name will be something like `cdc-wdm0`.

## 🧪 Examples

Explore more examples in the [examples](/examples) folder.
Explore more examples in the [examples](./examples) folder.

## ⚙️ Supported Commands

The `UqmiClient` class provides several commands to manage network-related operations via SSH. Each command is executed through the underlying `runCommand` function, which sends the appropriate command over SSH.

### General Commands

- **Get Service Versions:**

- `getVersions()`: Retrieves the service versions.
- **SSH Command:** `uqmi --device=<device> --get-versions`

- **Set and Get Client ID:**

- `setClientId(serviceName: string, clientId: string)`: Sets the client ID for a specific service.
- **SSH Command:** `uqmi --device=<device> --set-client-id <serviceName>,<clientId>`
- `getClientId(serviceName: string)`: Retrieves the client ID for a specific service.
- **SSH Command:** `uqmi --device=<device> --get-client-id <serviceName>`

- **Synchronize Client IDs:**
- `sync()`: Synchronizes all client IDs.
- **SSH Command:** `uqmi --device=<device> --sync`

### Network Management

- **Start Network Connection:**

- `startNetwork(apn: string, authType: "pap" | "chap" | "both" | "none", username?: string, password?: string, ipFamily: "ipv4" | "ipv6" | "unspecified" = "unspecified")`: Starts a network connection using the specified parameters.
- **SSH Command:** `uqmi --device=<device> --start-network --apn=<apn> --auth-type=<authType> --ip-family=<ipFamily> [--username=<username>] [--password=<password>]`

- **Stop Network Connection:**

- `stopNetwork(pdh: string, autoconnect: boolean = false)`: Stops the network connection.
- **SSH Command:** `uqmi --device=<device> --stop-network <pdh> [--autoconnect]`

- **Get Data Status:**

- `getDataStatus()`: Retrieves the current data status.
- **SSH Command:** `uqmi --device=<device> --get-data-status`

- **Set IP Family:**

- `setIPFamily(ipFamily: "ipv4" | "ipv6" | "unspecified")`: Sets the IP family.
- **SSH Command:** `uqmi --device=<device> --set-ip-family <ipFamily>`

- **Set Autoconnect:**

- `setAutoconnect(value: "disabled" | "enabled" | "paused")`: Configures autoconnect.
- **SSH Command:** `uqmi --device=<device> --set-autoconnect <value>`

- **Get Current Network Settings:**

- `getCurrentSettings()`: Retrieves the current network settings.
- **SSH Command:** `uqmi --device=<device> --get-current-settings`

- **Set Network Modes:**

- `setNetworkModes(modes: string[])`: Sets the network configuration modes.
- **SSH Command:** `uqmi --device=<device> --set-network-modes <mode1>,<mode2>,...`

- **Network Scanning and Registration:**
- `networkScan()`: Performs a network scan.
- **SSH Command:** `uqmi --device=<device> --network-scan`
- `networkRegister()`: Registers the device on the network.
- **SSH Command:** `uqmi --device=<device> --network-register`

### SIM and PIN Management

- **Get SIM Card State:**

- `getSIMState()`: Retrieves the current SIM card state.
- **SSH Command:** `uqmi --device=<device> --uim-get-sim-state`

- **Get and Verify PIN Status:**

- `getPinStatus()`: Retrieves the current PIN status.
- **SSH Command:** `uqmi --device=<device> --get-pin-status`
- `verifyPin1(pin: string)`: Verifies PIN1.
- **SSH Command:** `uqmi --device=<device> --verify-pin1 <pin>`
- `verifyPin2(pin: string)`: Verifies PIN2.
- **SSH Command:** `uqmi --device=<device> --verify-pin2 <pin>`

- **Manage PIN Protection:**

- `setPin1Protection(state: "enabled" | "disabled", pin: string)`: Sets protection for PIN1.
- **SSH Command:** `uqmi --device=<device> --set-pin1-protection <state> --pin <pin>`
- `setPin2Protection(state: "enabled" | "disabled", pin2: string)`: Sets protection for PIN2.
- **SSH Command:** `uqmi --device=<device> --set-pin2-protection <state> --pin <pin2>`

- **Change and Unblock PIN:**
- `changePin1(oldPin: string, newPin: string)`: Changes PIN1.
- **SSH Command:** `uqmi --device=<device> --change-pin1 --pin <oldPin> --new-pin <newPin>`
- `unblockPin1(puk: string, newPin: string)`: Unblocks PIN1 using PUK.
- **SSH Command:** `uqmi --device=<device> --unblock-pin1 --puk <puk> --new-pin <newPin>`

### Device and Signal Information

- **Retrieve Device Information:**

- `getICCID()`: Retrieves the ICCID.
- **SSH Command:** `uqmi --device=<device> --get-iccid`
- `getIMSI()`: Retrieves the IMSI.
- **SSH Command:** `uqmi --device=<device> --get-imsi`
- `getIMEI()`: Retrieves the IMEI.
- **SSH Command:** `uqmi --device=<device> --get-imei`
- `getMSISDN()`: Retrieves the MSISDN.
- **SSH Command:** `uqmi --device=<device> --get-msisdn`

- **Manage Device Operating Modes:**

- `getDeviceOperatingMode()`: Retrieves the current device operating mode.
- **SSH Command:** `uqmi --device=<device> --get-device-operating-mode`
- `setDeviceOperatingMode(mode: "online" | "low_power" | "factory_test" | "offline" | "reset" | "shutting_down" | "persistent_low_power" | "mode_only_low_power")`: Sets the device operating mode.
- **SSH Command:** `uqmi --device=<device> --set-device-operating-mode <mode>`

- **Get Signal Information:**
- `getSignalInfo()`: Retrieves signal information.
- **SSH Command:** `uqmi --device=<device> --get-signal-info`
- `getServingSystem()`: Retrieves serving system information.
- **SSH Command:** `uqmi --device=<device> --get-serving-system`

### SMS Management

- **List, Retrieve, and Delete SMS Messages:**

- `listMessages(storage: "sim" | "me" = "sim")`: Lists SMS messages from the specified storage.
- **SSH Command:** `uqmi --device=<device> --list-messages --storage <storage>`
- `deleteMessage(id: number, storage: "sim" | "me" = "sim")`: Deletes an SMS message.
- **SSH Command:** `uqmi --device=<device> --delete-message <id> --storage <storage>`
- `getMessage(id: number, storage: "sim" | "me" = "sim")`: Retrieves an SMS message.
- **SSH Command:** `uqmi --device=<device> --get-message <id> --storage <storage>`

- **Send SMS:**
- `sendMessage(destinationNumber: string, message: string, flash: boolean = false, smsc?: string)`: Sends an SMS message.
- **SSH Command:** `uqmi --device=<device> --send-message <message> --send-message-target <destinationNumber> [--send-message-flash] [--send-message-smsc <smsc>]`

### Data Format

- **Set and Get Data Format:**
- `setDataFormat(type: "802.3" | "raw-ip")`: Sets the data format.
- **SSH Command:** `uqmi --device=<device> --wda-set-data-format <type>`
- `getDataFormat()`: Retrieves the current data format.
- **SSH Command:** `uqmi --device=<device> --wda-get-data-format`

### Additional Operations

- **Reset DMS Service:**

- `resetDMS()`: Resets the DMS service.
- **SSH Command:** `uqmi --device=<device> --reset-dms`

- **FCC Authorization:**
- `setFCCAuth()`: Executes FCC authorization.
- **SSH Command:** `uqmi --device=<device> --fcc-auth`

## 🤝 Contributing

Expand Down
14 changes: 14 additions & 0 deletions dist/index.d.mts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ interface SSHOptions {
privateKeyPath?: string;
passphrase?: string;
}
/**
* Options for configuring the Uqmi client, allowing for optional settings like timeout.
*
* @property {number} [timeout] - The timeout period (in milliseconds) for operations performed by the uqmi cli.
*
* @example
* const uqmiOptions: UqmiClientOptions = {
* timeout: 10000,
* };
*/
interface UqmiClientOptions {
timeout?: number;
}
Expand Down Expand Up @@ -324,6 +334,10 @@ declare class UqmiClient {
* @returns {Promise<string>} The current data format.
*/
getDataFormat(): Promise<string>;
/**
* Retrieves the serving system information.
* @returns {Promise<string>} The current serving system.
*/
getServingSystem(): Promise<string>;
}

Expand Down
14 changes: 14 additions & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ interface SSHOptions {
privateKeyPath?: string;
passphrase?: string;
}
/**
* Options for configuring the Uqmi client, allowing for optional settings like timeout.
*
* @property {number} [timeout] - The timeout period (in milliseconds) for operations performed by the uqmi cli.
*
* @example
* const uqmiOptions: UqmiClientOptions = {
* timeout: 10000,
* };
*/
interface UqmiClientOptions {
timeout?: number;
}
Expand Down Expand Up @@ -324,6 +334,10 @@ declare class UqmiClient {
* @returns {Promise<string>} The current data format.
*/
getDataFormat(): Promise<string>;
/**
* Retrieves the serving system information.
* @returns {Promise<string>} The current serving system.
*/
getServingSystem(): Promise<string>;
}

Expand Down
4 changes: 4 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,10 @@ var UqmiClient = class {
async getDataFormat() {
return this.runCommand(["--wda-get-data-format"]);
}
/**
* Retrieves the serving system information.
* @returns {Promise<string>} The current serving system.
*/
async getServingSystem() {
return this.runCommand(["--get-serving-system"]);
}
Expand Down
4 changes: 4 additions & 0 deletions dist/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,10 @@ var UqmiClient = class {
async getDataFormat() {
return this.runCommand(["--wda-get-data-format"]);
}
/**
* Retrieves the serving system information.
* @returns {Promise<string>} The current serving system.
*/
async getServingSystem() {
return this.runCommand(["--get-serving-system"]);
}
Expand Down
10 changes: 10 additions & 0 deletions dist/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ export interface SSHOptions {
* const myService: ServiceType = "sms";
*/
export type ServiceType = "wds" | "nas" | "uim" | "sms" | "voice" | "dms" | "gps";
/**
* Options for configuring the Uqmi client, allowing for optional settings like timeout.
*
* @property {number} [timeout] - The timeout period (in milliseconds) for operations performed by the uqmi cli.
*
* @example
* const uqmiOptions: UqmiClientOptions = {
* timeout: 10000,
* };
*/
export interface UqmiClientOptions {
timeout?: number;
}
Expand Down
2 changes: 1 addition & 1 deletion dist/types.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions dist/uqmiClient.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,10 @@ export declare class UqmiClient {
* @returns {Promise<string>} The current data format.
*/
getDataFormat(): Promise<string>;
/**
* Retrieves the serving system information.
* @returns {Promise<string>} The current serving system.
*/
getServingSystem(): Promise<string>;
}
//# sourceMappingURL=uqmiClient.d.ts.map
2 changes: 1 addition & 1 deletion dist/uqmiClient.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist/uqmiClient.test.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=uqmiClient.test.d.ts.map
1 change: 1 addition & 0 deletions dist/uqmiClient.test.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
**UqmiClient v1.0.2****Docs**
**UqmiClient v1.1.0****Docs**

***

# UqmiClient v1.0.2
# UqmiClient v1.1.0

## Classes

Expand Down
Loading

0 comments on commit 1b7f2d5

Please sign in to comment.