InoDrive / Connection / setTarget


InoDrive.setTarget(target)

Change InoDrive Object’s Targeted Module.
You must disconnect from the previous target before establishing the connection with the new target.

Arguments:
Target (String): A Module Name, Serial Number, or IPv4 Address.

Returns: Nothing

// Import InoDrive API Library
 import { InoDriveApiJS }  from ( "ck-inodrive-api" ) 

// Instatiate the API
let InoDriveApi = new InoDriveApiJS.InoDriveApi({ connectAppUrl: "", secure: false })

// Instantiate InoDrive Object
Drive = await InoDriveApi.InoDrive({target:'Name', autoConnect:True})

// Disconnect from Initial Target
await Drive.disconnect()

// Set new Module Target and Connect
Drive.setTarget('Name2')
await Drive.connect()