iphone tcp/ip via accessory port? - iphone

I'd love to be able to mod the iPhone tcp/ip stack to route packets over the accessory port either serial or better yet USB or Firewire...
The applications I'm researching wouldn't be able to use WiFi, 3G or bluetooth...
Custom apps could be written to use the serial port available via the accessory port, but it would be nice to support generic apps that need network access.
I haven't tracked down much info relating to this, anyone have thoughts??

About the only way this could work would be to Jailbreak the device, and do some quite low level hacking. OS X supports NKEs (Network Kernel Extensions) that would allow you to introduce a new network interface. I don't know if the iPhone OS has these (as there's obviously not much information on it - it's supposed to be a black box). Even if it did, you'd have to make your KE lie and claim to be e.g. the Wifi device, as many applications will probe for network availability by searching for the Wifi interface.
Basically, I think this is an untenable idea. You can use the External Accessory APIs to allow your custom apps to use your dongle as a network service provider, but you can't use it to provide a new network interface. If you want this kind of open, extensible platform, then the iPhone is not really the right platform.

Related

Authenticate users using client MAC address?

This question is not language-aware.
I wanna know how can I recognize a returning user on my website (Java, PHP, Coldfusion...) if he's using a dynamic IP.
Why? A lot of users of my web application use iPhone (with 3G networking) for accessing. IP changes each time, so I always see them as "new" users.
I know it's unlikely to track MAC address in web pages but.... what solutions are there for such a common problem?
Maybe a suitable iPhone app? ;-)
It's not quite possible to find original requesting machine's MAC address. You should use Cookies to track users.
You can find more info about MAC Addresses here.
A Media Access Control address (MAC address) is a unique identifier
assigned to network interfaces for communications on the physical
network segment. MAC addresses are used for numerous network
technologies and most IEEE 802 network technologies, including
Ethernet. Logically, MAC addresses are used in the Media Access
Control protocol sub-layer of the OSI reference model.
Why not do what everybody else does and use cookies?
As other said, you could easier get what you want with cookies...
and, reading your question and purpose, i'm not really sure that if a user uses it's iPhone via wifi and browse to your website and than it come back again via 3G the MAC address doesn't change... i thought that MAC address is unique not for a device, but for a single hardware component in it: this mean that an iPhone could have a MAC for wifi hardware and a MAC for 3g hardware... if it works as on my powerMac... i can see my computer has a mac address for my ethernet and one other for my wifi...
but i'm not an hardware expert, so (all readers), please consider this answer as a question too, and if there is any net expert on line...

Establish communication link between a device and iOS

I'm developing an iPhone/iPad app that requires it communicate with another device. I'm actually more interested in receiving input from another device that the iPhone is connected to through USB. The solution needs to work with any iOS device and cannot require it to be jailbroken.
I've heard of apps that communicate with a piece of hardware that can be plugged to the iOS' serial connection, which is similar to what I'm going to develop except that the other device I'll be connecting to is a standalone music keyboard.
best regards,
fbr
If you are developing accessories that need to connect to iOS devices and want to use your own communication mechanism then you need to join the Apple MFi program.
Several options:
Forget MFi unless you have 1000s of $ backing up your product development. Apple won't even talk to you. I've tried.
Take a look at the Serial Cable from Redpark (http://redpark.com/c2db9.html)
I've got one of those and it's ideal for apps that you can deliver on your own, but you might also be able to get them into the App Store.
Another option is to use Wifi with a Wifi-to-Serial adapter on the other end. I've used the RN-174 and RN-134 from Roving Networks successfully.
However, these solutions only get you Serial connections, but can be quite fast, especially with the RN modules. There are also Serial-to-USB converters you can use on the device's end, but that would require the device to work as a USB host, usually. If you have a USB device that wants to act as a client, these common adapters won't do the trick.
So, unless you can actually afford the MFi program, and if you really need USB connectivity, you'll have to let someone create a small box containing a USB host adapter with a Wifi chip. I don't know of a ready-made solution for this yet, although I've seen quite a few area where people would like to have such a unit.

How can I send simple data from an iPhone to another iPhone, or an Android?

I'm just getting started with mobile development, and after considerable searching I'm still confused about sending a message from my iPhone to another or an Android. For instance, in building a simple Tic-Tac-Toe game, if I want to notify the other phone of a move, what is the best way to do so? Wifi, bluetooth, 3G? And how?
Many methods seem to point to communicating through a web server, but I'd rather send them directly from phone to phone if possible. (this is for native apps of course)
If you don't want to have a server (or even if you do! It depends!) it sounds like you will want to use TCP sockets. Apple doesn't have a generic bluetooth API to use with iPhone-to-android communication and you'll have TCP access anyway with 3G. A 3G network connection is very similar to wifi and you should be able to check for the difference as needed with little change to your overall networking code. I'm not sure if bonjour is supported on android, but I bet someone has ported it for similar reasons already, and it is supported in iOS. Apple has a networking section for iOS that you may find informative.
Additionally if you want to stay within the iOS device only realm you could use GameKit to communicate via bluetooth.
Hope that helps some.
The easiest way is to create a web server with an API and the clients poll the server for new moves (or the server pushes the client an update). This is the only way you're going to be able to do it over 3G unless you can figure out the IP addresses of both phones (do phones even keep the same IP address for a long period of time?) and open up sockets between them and let one phone be the server and the other be the client (could cause potential cheating).
WiFi is not always there - by limiting your users' options to areas with access points, you'll lose sales. Not sure about Bluetooth - how prevalent is it on handsets, how much of the API is exposed. Your best bet, IMHO, is 3G. With some kind of a central presence server (Web or otherwise), with optional proxying. Read up on peer-to-peer networking.
As far as i know does the iphone only support incoming messages over push notifications.
This means, that you have to update the information, by requesting it from web services etc.
The bluetooth API of the iphone doesn't support this either.

How does iPhone app communicate with other devices?

We bought a Grace wifi radio. Grace has a cool iPhone app that connects to the radio and lets you control it.
My question is.. how the heck does this work? How can the iPhone connect to the radio and then control it??
I can't find detailed technical information on Grace's side, but, if I were asked to design something like this, I'd have the radio advertise a service on its wifi LAN via zeroconf (also known by Apple's trademarked name, bonjour -- an app on the iphone (or any other node on that wifi LAN) can then easily find the radios on the same LAN and chat with them through whatever protocol Grace has defined for the purpose.
Edit: from the scarce crumbs of docs on Grace's site it seem they may have chosen UPnP instead of Zeroconf -- ah well, see here for a (possibly biased, but solid) analysis of why they should have chosen Zeroconf instead!-)
Are you asking coding specifics or just an overall concept of what's going on? The actual networking stack behind these operations can be quite complex.
Your Grace wifi radio will have created a server which the iPhone has connected to on your wifi network, from this point onwards it's a simple client-server relationship, with the iPhone sending data to the radio each time it sends a command. Because of this, if your iPhone is not on the same wifi network it will not be able to control/find the radio.
Most likely, the WiFi radio listens over a fixed UDP port. The iPhone in turn sets up a UDP connection by broadcasting the network (on IP 255.255.255.255) on that port. The radio will respond and a connection will be established.
This is complete speculation; I have no idea how it actually works. No doubt there is plenty of documentation on this.

Is it possible to do streaming WiFi Communications on the iPhone?

I am looking to develop an iPhone application that will require point-to-point WiFi communications on an iPhone. I would like to use the WiFi interface and have the application stream between the phone and a WiFi device. Does anyone have some experience with this? Is it even possible? I know there is a discovery application but I am looking for something a little more robust.
As far as I know (as the SDK stands now), the only thing available is communication over the existing network connection. The SDK doesn't allow for setting up wireless network connections, or creating ad-hoc networks. I believe the only way to join or create wifi networks is through the settings app.