BLE device with Apple's HAP - bluetooth

I have a Raspberry Pi that acts as a BLE peripheral. I want to add Apple's HomeKit Accessory Protocol (HAP) to the Raspberry Pi's BLE code, to control the BLE device using Homekit. I would like to avoid implementing HAP over the internet.
The closest resource I found is https://gist.github.com/KhaosT/6ff09ba71d306d4c1079. However, this gist makes it seem like there are many unknowns with that process.
Does anyone know if this is possible? If so, any info or resources would be greatly appreciated. Thanks!

As mentioned at https://developer.apple.com/homekit/ under Accessory Developers, you need to first sign up for MFi and then you will get access to all the resources you need in order to implement homekit. All source code you can find publicly online is against Apple's license since they prohibit public redistribution of documentation and source code of implementations.

Related

using external bluetooth transmitter without sound card

The sound card in my desktop tower is busted. I am planning to get an external Bluetooth device so that I can connect external sound devices. I am trying to do some research on this matter to find out if it will work before I commit my resources. Please help if you have resources that can explain if this is possible and I could add to my knowledge. Please Help!

How to interact with BLE devices through Linux using C programs?

I am fairly new to the BLE world. Assuming I have a BLE device Eg: A heart rate monitor, How do I interact with that BLE device using C code.
I am able to see the Heart rate data using the command line tool 'bluetoothctl'. If I want connect to the same device through C code and see the Notified data, how do I go about it?
Though some codes on the Internet and GitHub helped me to scan for the device, I do not have any idea on how to connect to the device, read the GATT characteristics of the BLE device. I'd even appreaciate it if anyone points me to the API documentations of BlueZ, I literally have no clue what the programs are all about. Any assistance would be of great help.
The preferred API for BlueZ uses the D-Bus bindings. The documentation for those APIs are at:
https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc
There are Python examples of how to use the D-Bus API at:
https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/test
bluetoothctl is written in C and the source is available at: https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/client

Is there way to detect a certain phone from a few feet away

I am trying to build a system with a raspberry pi that allows clients access into a building depending on their membership status. Right now, it uses QR codes, but I want to know if it is possible to add a feature where it uses some technology like NFC or RFID or Bluetooth to detect their phone or RFID card from at least a foot away and confirm they have a membership.
Someone told me I could use RFID, but I am only aware of that being used in short-distance applications, like a card on a hotel door. I am not sure about Bluetooth either, because the phone would have to connect to the pi first, right? Maybe there is something I don't know about. So please offer any suggestions. Thanks
I think bluetooth does good work for tracking user. Since it's the best to handle large distances than NFC and RFID these two technologies are used for low range scenarios, check this link.
In addition, you can check distance(using Proximity and RSSI) and membership status as well. but you need to know how to handle bluetooth connectivity with raspberry pi check this link. as well create an app on that mobile phone to use Bluetooth (depending which OS you're using for Android, iOS).
Regards,

Is it possible to command the Nintendo switch's joy cons with a PC?

I want to create a TAS that can play the Nintendo Switch games that are only compatible with the joy cons.
There are turbo pro controllers in the market but there is no turbo joy cons, so my next idea is one of two:
To use the Bluetooth to connect a devise that I could control with my PC and can be connected to the Nintendo switch via Bluetooth (or USB) and trick it into thinking that it is a joy con and not a pro controller.
Use the idea above but the devise is the joy con itself, in this case, I would have to connect the joy cont to the PC and command it while it is still paired with the Nintendo Switch
Is there any way to achieve what i'm looking for? Thanks in advise.
Also, if there is a better branch in stack-overflow to post this question I will move it.
Looks like it's already been done, and you'll need a product called vJoy.
https://www.pcgamesn.com/nintendo/nintendo-switch-joy-con-pc-guide
Looks like you'd need to reverse engineer the communication protocol used by those controllers and then emulate that protocol with software. Here is a resource I have found regarding RE bluetooth. Another one I have found here. Redfang may help you in that endeavor, it is software that helps you find bluetooth addresses of devices that you you can't discover normally.
Another idea I would have is to open your controller and solder on some wires to a micro controller, such as an Arduino, Raspberry or something similar to the buttons and analogue controllers and 'input' the commands that way.
Unfortunately I can not offer you any more advice. I hope this helps in some way.
One possible way is to use JoyCon Droid app in Android to controll the Nintendo Switch. If this app can work, it should be possible to make one as PC software too.
Luckily, there are a few easy ways to control Android from PC such as using AirDroid which allows you to touch the Android screen from PC. You can refer to How to remote control Android device from a computer with AirDroid?. It can both mirror the screen and give you the touchscreen control, which you can utilize it to control the JoyCon Droid app.
I've just found another way which is to use a microcontroller as a USB controller here.

Tools for bluetooth monitoring

For my project I have an Android phone and an Arduino device that communicate via Bluetooth. I was wondering if anyone knows any software tools I could use to monitor a bluetooth communications between two devices. Something like a packet eavesdropping. Preferably for Linux.
Take a look at ubertooth one. In the linked webpage there are instructions on how to build the dongle, as well as links to shops selling assembled dongles may be bought. Ubertooth one should work well with Kismet, and thus in Linux, by using a BT plugin (disclaimer: I have no personal experience on this).
Sounds like you are after a Bluetooth sniffer.
Bad news: They are almost exclusively Windows OS based and cost mega-$.
http://www.fte.com/products/bluetooth.aspx
If you were using BlueZ for one side of the communication you could use the BlueZ HCIDUMP app and Wireshark.
I don't think anyone has made a Linuz/Bluez Sniffer - could be wrong.

Resources