- Tutorials:
Global object to browse Samba servers.
Exists only on supported devices.
Methods
(static) findGroups(callback)
Start scanning to find all available SMB groups.
Example
stbSmb.findGroups(function ( error, data ) {
if ( !error ) {
// list of found groups:
// ['WORKGROUP']
console.log(data);
}
});
Parameters:
Name | Type | Description |
---|---|---|
callback |
stbSmb~findGroupsCallback | scan result handler |
Throws:
Will throw an error in case of bad input arguments.
(static) findServers(group, callback)
Start group scanning to find all available servers.
Example
stbSmb.findServers('WORKGROUP', function ( error, data ) {
if ( !error ) {
// list of found servers:
// ['john', 'backup', 'ALEX-PC']
console.log(data);
}
});
Parameters:
Name | Type | Description |
---|---|---|
group |
string | SMB group to scan |
callback |
stbSmb~findServersCallback | scan result handler |
Throws:
Will throw an error in case of bad input arguments.
(static) findShares(group, server, callback)
Start scanning to find all available exports on the given server.
Example
stbSmb.findShares('WORKGROUP', 'john', function ( error, data ) {
if ( !error ) {
// list of found shares:
// ['video', 'music']
console.log(data);
}
});
Parameters:
Name | Type | Description |
---|---|---|
group |
string | SMB group to scan |
server |
string | server name to scan |
callback |
stbSmb~findSharesCallback | scan result handler |
Throws:
Will throw an error in case of bad input arguments.
(static) findIp(group, server, callback)
Resolve IP for the given export name in the specific SMB group.
Example
stbSmb.findIp('WORKGROUP', 'john', function ( error, data ) {
if ( !error ) {
// resolved server IP:
// ['192.168.1.56']
console.log(data);
}
});
Parameters:
Name | Type | Description |
---|---|---|
group |
string | SMB group to scan |
server |
string | server name to resolve |
callback |
stbSmb~findIpCallback | scan result handler |
Throws:
Will throw an error in case of bad input arguments.
Type Definitions
findGroupsCallback(error, data)
Scan result handler.
Parameters:
Name | Type | Description |
---|---|---|
error |
string | null | scan error message on failure |
data |
Array.<string> | found group list |
findServersCallback(error, data)
Scan result handler.
Parameters:
Name | Type | Description |
---|---|---|
error |
string | null | scan error message on failure |
data |
Array.<string> | found server list |
findSharesCallback(error, data)
Scan result handler.
Parameters:
Name | Type | Description |
---|---|---|
error |
string | null | scan error message on failure |
data |
Array.<string> | share name list |
findIpCallback(error, data)
Scan result handler.
Parameters:
Name | Type | Description |
---|---|---|
error |
string | null | scan error message on failure |
data |
Array.<string> | share name list |