Sample code for Xamarin Cross Platform bluetooth connection - xamarin.forms

I have traied meny examples to connect Zebra IMZ320 Blutooth using Iphone on Xamarin Cross-Platform
I followed CoreBluetooth Namespace
enter link description here
and also using Plugin.BLE
but I couldnt connect my device eny one has success experience in connect Bluetooth printer using Xamarin cross platform ios

CoreBluetooth.framework is for Bluetooth Low-Energy:
Communicate with Bluetooth 4.0 low-energy devices.
The Core Bluetooth framework provides the classes needed for your apps
to communicate with devices that are equipped with Bluetooth low
energy wireless technology.
According to the specifications of the Zebra IMZ320, the communication mode are:
Secure Bluetooth 2.0, 802.11a/b/g/n (optional) or USB (client)
connectivity; Wi-FiĀ®-certified connectivity
That is not Bluetooth Low-Energy (which has been introduced in Bluetooth 4.0). You won't be able to find the printer with a Bluetooth Low-Energy scan, because the behavior, logic and implementation (protocols, norms, GATT, Peripheral/Service/Characteristic) are totally different.
Also, the description page of the Zebra IMZ320 gives a link (FAQ - Creating & Registering An IOS App) to how develop apps for it.
You need to use ExternalAccessory.framework for it.
If your app communicates with a Zebra product via Bluetooth using the
External Accessory Framework, and you plan to distribute the app via
the App Store or Volume Purchase Program Store, then you must register
the app with Zebra.
This page is general (and not specific to that printer). But according to the specs, it's not Bluetooth Low-Energy compliant (while others products might be, that's why there is a paragraph talking about CoreBluetooth in it).
That's normal behavior (using ExternalAccessory vs CoreBluetooth framework), because each one of them has a specific meaning and use.
Conclusion:
Use ExternalAccessory.framework, it is also available on Xamarin.

Related

how to read RFID card from Angular

so im doing a side project, and i want to use Angular with asp.net REST api connecting to a mssql server.
the project is basically a site that could be placed in a company/school canteen, with a touch screen, and an rfid scanner for employee cards.
i've got no issues with the angular / api part. but how would i go about reading events from a rfid scanner from angular? is this even possible?
the usecase is that i want to scan the employee card, then in the angular client app, prompt if the user is correct "Welcome, are you "firstname" "Lastname"? (confirmbutton)"
then use the gathered employee informations later in this process when the employee checksout from the canteen.
Scenario 1: Server and RFID reader are on the same device
Example:
You have a Raspberry Pi 4 with Raspberry Pi OS and .NET 5 on it. You buy a RFID reader like this one, and you either find a library for it (like this one) or you start reading the datasheet and write your own library with .NET I2C or SPI APIs. Then your ASP.NET Core website on the Pi will listen for RFID events (maybe with a background worker or maybe another .NET app will notify it with gRPC or API) and notifies the client (Angular in you case) with WebSocket or polling or some other method.
Scenario 2: One server with many web clients on other locations
Example:
You have an ASP.NET Core API that doesn't know anything about RFID and just works with normal data like any Web API. You then tell your clients to buy a USB RFID (like this one) and you use Web USB API inside your Angular app to communicate with the RFID device (I don't know how) and then call necessary APIs on the ASP.NET server. (BBC micro:bit uses this method, they connect to their devices via Web USB)
Example 2 (this is probably the easiest way):
Write an Android app with Ionic that uses the NFC plugin to communicate with NFC tags and call any API you want. You can then run it under kiosk mode. All your clients need then is a cheap android device.
Note: You can combine these scenarios, for example in scenario 1 you can still call a centralized API.

Gurux on Bluetooth IGXMedia with Xamarin Forms

I'm trying to communicate with a Bluetooth Optical Probe using a SPP (serial port) that is attached to a smart meter. I have seen that using the Gurux software will be a good idea. However, they do not offer native support for Bluetooth communication (other than in the Python example) and their mobile support is only for Android-Java. Has anyone managed to create an instance of IGXMedia within Gurux for Bluetooth? The Gurux BTSerial class uses System.IO.Ports.SerialPort which is only available on Windows, where I am trying to use Cross-Platform C#.

Mobile to controller secure bluetooth ble communication

We seek your help in implementing bluetooth on our smart home controller. Our current scenarios is described below:
We want secure communication between our embedded linux controller(our smart home hub) and user's mobile phones running android/iOS.Our system is in home automation.
The hub in turn communicates with home devices that support a different protocol - we need to make communication between hub and mobile devices using bluetooth.
Currently there is not direct communication between our hub and mobile phone except through the internet.
We will use Bluetooth 4.x, not 5 for hardware support on the controller.
We are using nodejs on our controller and standard bluethooth OS libraries on android/iOS. We are open to suggestions.
Our main concern is to establish secure communication between phone and the hub. With this regard we are looking for implementation guidance on pairing and communicating securely. We have been able to establish unsecure communication - exposing characteristics and services on the hub. Our understanding of the bluetooth protocol is limited and we have only used libraries available for users.
Please provide specific pointers as to what we should do and what is possible.

Is it possible to record external HDMI device in Android TV app?

For example, if there is a gaming console (i.e PlayStation) connected to HDMI input in a TV with Android TV. Then, is it possible to record the video going through this HDMI input with a 3rd party app?
In my question I'm referring to Android's TV input framework
Thanks for the helpers.
The TV Input Framework docs mentions that it supports TV recording APIs.
DVR
For devices on Android 7.0 and above, the TV App must support the
Android framework TV recording
APIs,
to support, list, and play recorded programs.
This allows device manufacturers to plug their DVR subsystems into TIF
and dramatically reduce the integration effort it takes to enable or
integrate DVR functionality on a TV device. It also enables third
parties to provide aftermarket DVR systems that can be plugged into an
Android TV device.
In addition to recording live content, the TV App also handles
resource conflict. For example, if the device has two tuners, it can
record two programs at the same time. If the user asks to record
three, the TV App must handle the conflict and should either surface a
notification or request that the user schedules a priority for these
requests.
However I don't have code samples for you as I haven't experimented with this yet.
Another approach would be to use the MediaProjection API and record this with a MediaRecorder. Jake Wharton's app Telecine follows this approach and you can find the source code on GitHub.
The benefit is that these APIs were introduced with Lollipop, so you can use them on all Android TV devices. However I just started experimenting with Android TV, so I can not tell from personal experiences.

Does Qt support Wi-Fi Direct / P2P connections on mobile platforms?

I would like to write a cross-platform mobile app based on Qt which is able to discover other devices reachable via Wi-Fi running the same app. If such devices are found they should be able to communicate with each other in an ad-hoc mannor without requiring any user (inter-)actions.
So my question is:
Does Qt support Wi-Fi Direct communication out of the box in general (i.e. is there any API for these kind of p2p connections), and if so, is this feature also available on mobile platforms supported by Qt? If there is no out of the box solution, can it be implemented with the existing Qt Wi-Fi networking API?

Resources