Linux network device driver register for blueooth - linux-device-driver

As I known, The register_netdevice() was used to register an new network device. such eth0
How about bluetooth? Have any function to add new BT interface (eg. hci0)
thanks
Peter

hci_register_dev() is used to register an hci(blutetooth) device.
see net/bluetooth/hci_core.c

Related

Is it possible to get the SSID & MAC Address of Currently connected WiFi Network in an App

I am looking for a way to get both the MAC Adress and the SSID of the currently connected WiFi Network in my project. I have used Tony Million's Reachability to decide when the user is on a WiFi network or not and was testing Kenial's NICInfo only to find out that it only provides the iPhone's WiFi MAC Address. Although both projects helped greatly in there own way, they do not get the job done.
I am wondering if there is a public API (for certain Apple App Approval) or some back door to achieve this.
This involves a few different things:
Getting SSID - This is independent of the MAC address issue. For this, check this SO answer: iPhone get SSID without private library. I don't know what the etiquette is regarding re-posting code from other answers so I'll just link.
Getting MAC address - since the majority of networking operates at Layer 3 (which is called, who would have guessed, the Network Layer - http://en.wikipedia.org/wiki/OSI_model) and the MAC address is at Layer 2 (the Data Link layer) you'll first need to get the IP address of the gateway of the WiFi interface. Just a side note - the question should be phrased as 'How do I get the SSID of the currently connected WiFi network and the MAC address of the WiFi router/gateway'. Anywho, to get the gateway address, see this SO answer: How to get the WIFI gateway address on the iPhone?
Once you have that, you need to convert it to a MAC address using ARP (Address Resolution Protocol, which is the protocol that all networks use to convert IP addresses to MAC addresses). Network interfaces don't communicate via IP, they communicate via MAC, so this actually happens everywhere, all the time. It's actually pretty easy to access the ARP table on a PC/Mac. For iOS, I found this SO answer to convert an IP address to a MAC address: Getting ARP table on iPhone/iPad

Create an iPad app that can send/receive data via the USB cable?

I want to create an iPad app that connects to another machine, laptop or otherwise, via USB and communicates to some other application I develop running there.
I know that this is easy to achieve via Bluetooth or WiFi but this particular set of solutions must be done via a USB cable.
Is it possible to do so without access to the Apple MFi program? (I am about 5 weeks in and the response is not looking good).
iOS App --> USB Cable --> Mac OSX --> Desktop App (without MFi access)
Thanks
To use USB communication Apple does not provide any API within IOS SDK. The only option right now is MFI. I don't think Apple will allow this in near future.
To use serial communication, you need MFI as you may have discovered. However, there is a poor man's way of achieving this. I have done so during development.
Enable "Internet sharing" on your device and connect to it. Use "ifconfig" on your Mac to find out the interface to use. You do not need to use this as the default connection, but it needs to be active. If I remember correctly, only one end can initiate connections (it was a while so I am sorry that I don't remember the details).
EDIT: I would also like to point out that I did this on an iPhone, not an iPad.
Not over USB but over RS232 (serial port)
Look here: http://www.redpark.com/c2db9.html
But:
The cable uses the old 30 pin connector, but according to them it's compatible with the Lightning adapter
The application won't be accepted on the AppStore, it's for internal use only.
There is a (small) book that explains how to use this cable to connect an iPhone directly to an Arduino, it's been published in late 2011. "iOS Sensor Apps with Arduino Wiring the iPhone and iPad into the Internet of Things" http://shop.oreilly.com/product/0636920021179.do

Serial port programming in iPhone

Which classes or functions do I have to use to open the serial port and read data from the serial port in Objective c? If anybody knows, please provide sample code, that will very helpful for me as I am new to Objective c.
You need to become a Made for iPhone member to communicate with external devices via the electrical connector or Bluetooth. See http://developer.apple.com/programs/mfi. You can then use the External Accessory framework (http://developer.apple.com/library/ios/documentation/ExternalAccessory/Reference/ExternalAccessoryFrameworkReference/_index.html).
Another option would be to try to findva means to use wifi through some adapter. This requires no mfi membership.
If this is a private project you can checkout Redpark serial cable for iOS and its SDK http://redpark.com/c2db9.html

Can I use only cellular network (3G or EDGE), even if WIFI is connected on the iPhone?

I was wondering whether I can use the cellular network (3G or 2G or whatever they may have) even if the WIFI is connected and working.
I noticed that Apple has a "Reachability" sample code, but that would only tell me if I can connect using a cellular network; instead, I would like to actually use ONLY the cellular network.
Best Regards,
Noam.
Definitely YES. You should combine Reachability notifications with network interfaces enumeration. And - this point is much important: use BSD socket's bind() call to bind to CONCRETE IP address. Don't use 0.0.0.0 and your app will be network-adaptive and awaring. My poor gist example: https://gist.github.com/avesus/fdb465b60a4f5204845c
No, I wouldn't imagine so.
My understanding is that if the device is connected to Wifi, 3G is not used for data and all data traffic travels via Wifi.
Only cellular data to another cellular device would use the phone provider's network.
I believe that the only way to accomplish this would be to detect if the user is on WiFi (example code is in the "Reachability" example you cited), and if so, prompt them to disable WiFi prior to using your app.

Detecting wifi network change in iPad

I have an iPad application which requires me to stream a video to a user only if he is connected to a particular wifi network. If his wifi network changes, I need to stop streaming.
Is there any way to know that the wifi network that the user is connected to has changed?
Are there any public APIs that can give me the SSID of the wifi network I am connected to or the VSS ID or the MAC address of the router?
Thanks and Rgrds,
Hetal
There is no supported way to do this, but it is possible.
See this question for more details:
Accessing iPhone WiFi Information via SDK