Is it possible to have my MacBook become an iBeacon?
Solution 1:
If you are a programmer I have posted instructions on how to use a MacBook with Mavericks as an iBeacon. You can find the instructions on my blog at http://www.blendedcocoa.com/blog/2013/11/02/mavericks-as-an-ibeacon/
If/When I get a chance I may create an app that you can use to advertise an iBeacon.
This is the answer I gave to a similar question on Stack Overflow
Mavericks doesn't have the iBeacon support in Core Location that was added to iOS 7. However, Mavericks does now have the ability to act as an BLE peripheral device. Given that an iBeacon is basically a peripheral it should be (and indeed is) possible to use Mavericks as an iBeacon.
In order to create an iBeacon on iOS you first create a CLBeaconRegion
object and then use the peripheralDataWithMeasuredPower:
method to get an NSDictionary
containing the necessary advertisement data to broadcast. If you take the contents of this NSDictionary
from an iOS device and use it on Mavericks then you get an iBeacon.
I have created a class to make this easier and allow you to generate the advertisement data dictionary directly on Mavericks. The source code is available at https://github.com/mttrb/BeaconOSX
The BLCBeaconAdvertisementData
class take the proximityUUID
, major
, minor
and calibrated power values and creates an NSDictionary that can be passed to the startAdvertising:
method of CBPeripheralManager
on Mavericks.
The BLCBeaconAdvertisementData
class is quite simple. The main work is done by the following method:
- (NSDictionary *)beaconAdvertisement {
NSString *beaconKey = @"kCBAdvDataAppleBeaconKey";
unsigned char advertisementBytes[21] = {0};
[self.proximityUUID getUUIDBytes:(unsigned char *)&advertisementBytes];
advertisementBytes[16] = (unsigned char)(self.major >> 8);
advertisementBytes[17] = (unsigned char)(self.major & 255);
advertisementBytes[18] = (unsigned char)(self.minor >> 8);
advertisementBytes[19] = (unsigned char)(self.minor & 255);
advertisementBytes[20] = self.measuredPower;
NSMutableData *advertisement = [NSMutableData dataWithBytes:advertisementBytes length:21];
return [NSDictionary dictionaryWithObject:advertisement forKey:beaconKey];
}
I have a more detailed blog post about this at http://www.blendedcocoa.com/blog/2013/11/02/mavericks-as-an-ibeacon/
Solution 2:
1) You would need to obtain a bluetooth 4.0 BLE (Bluetooth Low Energy) transmitter/receiver chipset to attach to/install in your MacBook.
This would allow you to transmit the beacon signal.
2) You would need to create or purchase software that could use the chipset appropriately.
This would allow you to recognize the presence of nearby beacon-enabled devices, such as the new iPhones, and interact with them appropriately.
Here's a site that explains more about iBeacons and BLE with some good example videos (actually linked to from 'iBeacon' in the original question):
Apple's iBeacons explained - What it is and why it mtters - Pocket-lint
Here is a link to a company selling BLE transmitter/receivers for use commercially (mentioned in the article above). This site also provides an overview as to how the technology works:
Estimote Beacons - real world context for your apps
This site gives details on BLE:
Low Energy | Bluetooth Technology Website
Then I'd say, put on your engineering hat and start searching for chipsets and software solutions!
Have fun!
Edit:
Another name for BLE is Bluetooth Smart. Search for hardware and/or software that is Bluetooth Smart (does BLE only) or Bluetooth Smart Ready (does both legacy bluetooth and BLE). Some lists are on the Bluetooth Technology Website (same as above), and a Google search brings up a few apps that have already been created.
Another search brings up a document for Apple developers:
Apple's Bluetooth Design Guidelines (from their developer center)
and a rapid development tool for Apple developers (from bluetooth.org):
Apple Developers | Bluetooth Development Portal
Solution 3:
I have been using a small tool called MactsAsBeacon. All you need to do is download the .app file and open it. It then allows you to set the UUID, Major, Minor and Power values.
https://github.com/timd/MactsAsBeacon