Skip to content

Commit

Permalink
[ts] set defice ip and port - public
Browse files Browse the repository at this point in the history
  • Loading branch information
mrhyde committed Jun 4, 2024
1 parent 782a798 commit 2bfed5f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions source/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ export type VersionInfo = {
* Represents a generic TVT Device.
*/
export class Device {
readonly #ip: string
readonly #port: number
readonly ip: string
readonly port: number

readonly #connectionTimeoutMs: number = 5 * 1000
readonly #maxRetries: number = 3
Expand All @@ -61,8 +61,8 @@ export class Device {
* @param settings - The settings for the device.
*/
constructor(ip: string, port = 9008, settings?: Settings) {
this.#ip = validateIp(ip)
this.#port = validatePort(port)
this.ip = validateIp(ip)
this.port = validatePort(port)

if (settings) {
this.#connectionTimeoutMs = settings.connectionTimeoutMs ?? this.#connectionTimeoutMs
Expand Down Expand Up @@ -167,7 +167,7 @@ export class Device {
*/
@measure
login(user: string, pass: string): boolean {
this.userId = sdk.login(this.#ip, this.#port, user, pass, this.#deviceInfo)
this.userId = sdk.login(this.ip, this.port, user, pass, this.#deviceInfo)
if (this.userId === -1) {
throw new Error(this.getLastError())
}
Expand Down

0 comments on commit 2bfed5f

Please sign in to comment.