How to get list of devices thst are connected to router using program - router

Using c programing i need to display mac address of the devices which are connected to router on terminal.I tried with so many things bt still i am not getting the exact output.Else any command is there to get that details please share.i am doing project based on this so please if anyone know means share the answers.

Not sure about doing it with C, but I have a look at ettercap you could use some command line script to to easily get info about all connected devices a local network.

What you are looking for is to write your your arp-scan.
To do this basically you'll need to write or use existing C based ping code. Apple has a nice simple ping.
Here is the link to apple's simple ping -
simplePing
Then you will want to open your devices arp-table. This will vary based on device but there should be some way to make C code compatible across a narrow range of devices.
Here is an interesting code review involving what you are looking for.
Post is here

Related

Share text between iPhone and other phones using wifi

Is it possible to send and receive data between iPhone and other phones such as blackberry or android over wifi. I am on the move it to create an iPhone app with the above functionality. Can any one has previous experience in this, or any sample codes to do this. I have searched a lot but couldn't find anything relevant.
you can do this by using a server application. So the iphone pushes the data to the server and the other devices are either getting push notifications or something similar or simply poll for the data.
Without a server, you have the trouble of finding the other devices. If its safe to assume they are all on the same subnet, then you could use a UDP broadcast to do this.
There's many ways of doing this, every one with its own pitfalls. So there's no generic answer to this question without knowing in more detail what's the purpose of it.

UDPEcho or C Code?

Im making an iPhone application that sends commands and retrieves data through an UDP connection.
I have a question, since my previous question did not get answered and I was not able to fix it by now I am looking for two other ways to implement an UDP connection.
UDPEcho
C code
Which one is better [advantages/disadvantages] and which one is easier or recommended to implement it into an iphone application?
UDPEcho already set up the iOS project for you, so unless you need to port your app to other platforms afterwards, that would give you a headstart compared to C code.

How do we detect if wifi becomes unavailable in iPhone SDK

Is there any way that we can programatically identify when the wifi of a user becomes available/unavailable?
My application requires exchanging messages between two different devices. It is working good in stable wifi setups. But if the wifi is unstable, I am having trouble in detecting if the other device is available or not.
I am not sure if this is expected, but my bonjour based NSNetService discoverer is not updating the available devices list automatically. This leaves me with a list of services that are not available for the exchange.
My line of thinking was to remove all the available services from the list and start a fresh search.
Please let me know if I am thinking in the right direction to solve the right problem.
Thanks in advance.
-Murali
Perhaps the Reachability sample code provided by Apple will help you in this regard. Although there have been people who say it hasn't been updated in a while, in which case, here is an actively maintained fork.
It seems like you can register for notifications so you can get frequent information on the state of the network.

Sending print request from with-in an iPhone application

Is there a way to send a print request to a printer using wifi or some other means?
Edit:
There must be, because there are some applications which lets you do that. But how do they do it? For example,
HP iPrint Photo
Air Photo
EuroSmartzPrint
and maybe others as well.
There's no native way to print in Apple's SDK. Air Photo prints using a helper app installed on a computer, so it sends the request to the desktop app which actually sends the print request. HP's app can connect to HP printers that it can find on the network, presumably using Bonjour. The difficulty with printing directly is getting the right drivers, fortunately for HP, they make the printers too. EuroSmartz I believe does both previous methods, but they make no claim as to how good the quality will actually be printing directly to the printer, probably because they can't include vendor supplied drivers.
So, if you want to print your options are:
Connect to the printer via Bonjour and attempt to print without vendor supplied drivers (maybe you can find open source ones).
Write a desktop app to assist in printing. (Better quality, but requires a middle man.)
Update:
With iOS 4.2, Apple is including a new technology called "AirPrint". Apple is essentially doing both #1, by printing directly to HP printers that support ePrint (my understanding is that this doesn't use drivers in the traditional sense), and #2 by printing via a Mac with OS X 10.6.5.
Yes, you can certainly find printers nearby using Bonjour and the NSNetServiceBrowser class. Specifically you'd want to send its searchForServicesOfType: message, with a type of #"_ipp._tcp" (nearby printers). Check out the Browsing for Services article in the developer documentation. How the actual spooling to print works is beyond me. I'm just learning GameKit/Bonjour right now.
As far as I know it is only possible if the devices are Bonjour-enabled as part of the Made For iPod program. Then you can use EAAccessoryManager and related classes to make a connection and send data to the device. This is one of the harder things you can attempt on an iPhone...
Here's another (perhaps) useful question on the subject.

How mobile printer that work alone and with WIFI for POS app?

I'm hunting for a mobile POS printer for use in a mobile point-of-sale application (BestSeller). The requeriments is that must work independent of anything except the mobile device. So the solution is only: Printer + iPhone.
I have a early question on this, here but with not answers.
The idea is that the printer work as their own server and I can send print commands to make tickets and that stuff.
The salesman work outside the company,and have not ascces to internet or other facilities.
I found this:
http://www.barcodegiant.com/epson/mobilink.htm
and
http://www.barcodegiant.com/zebra/mz220.htm
but is not clear to me if will work as I imagine. And also, I don't find any how to in how make the programing...
You should probably just send your salesmen with laptops and printers as that solution is easy and well supported. I don't know of any solutions currently that would allow you to connect an iPhone directly to a printer or to print to a printer with wifi. Printing solutions currently available require some sort of desktop or server app counterpart to facilitate the actual printing.