1

How to get NetBios Name for other ip address from iOS wifi scan sample app in Local network where my device is connected and I am getting all connected device ip address?

Mac-OS i am using this code.

-(NSString *) runCommand: (NSString *) commandToRun {

NSTask *task;
task = [[NSTask alloc] init];
[task setLaunchPath: @"/bin/sh"];

NSArray *arguments = [NSArray arrayWithObjects:
                      @"-c" ,
                      [NSString stringWithFormat:@"%@", commandToRun],
                      nil];
NSLog(@"run command: %@",commandToRun);
[task setArguments: arguments];

NSPipe *pipe;
pipe = [NSPipe pipe];
[task setStandardOutput: pipe];

NSFileHandle *file;
file = [pipe fileHandleForReading];

[task launch];

NSData *data;
data = [file readDataToEndOfFile];

NSString *output;
output = [[NSString alloc] initWithData: data encoding: NSUTF8StringEncoding];

return output; }

command is Mac-Mini:~ Test$ smbutil status 10.0.0.19

output : Using IP address of 10.0.0.19: 10.0.0.19

Workgroup: A Server: TestLAP_004

like Fing App

0 Answers0