Access device information with gluon - javafx

I was looking for accessing device information like current device WLAN MAC address, IMEI, OS type etc. using Gluon mobile. How can I do it?

Currently the Charm Down Device service provides some of the features you are requesting.
Model: device's model or product
Uuid: device's universally unique identifier
Platform: the platform string that the operating system uses to identify itself
Version: the version number of the device platform
Serial: the device hardware serial number.
Wearable: true if the device is a wearable
In your view, you can call the service like:
Services.get(DeviceService.class).ifPresent(service -> {
System.out.printf("Device Model Name: %s", service.getModel());
});
Also, you can find implementation details for android here and for iOS here.
If there is any other feature you require, and you want to implement it, you can either clone and modify the service (see this question on how to do it), or create a new one (see this sample).

Related

Is a BLE advertisement required to provide a non-empty local name?

I am porting some code from MacOS to Windows. MacOS always returns a non-empty local name in advertisement packets while Windows seems to always return an empty local name in an advertisement packet.
No, having a local name is not a requirement as part of sending out adverts. The requirements for BLE adverts depend on the type of advert, but for the simplest and most common advert type (ADV_IND, a.k.a scannable & connectable advert) the only requirement is the device's public or random address. None of the advert types require the local name to be part of the address. You can read more about this in the Bluetooth Specification v5.2, Vol 6, Part B, Section 2.3.1 (Advertising PDUs) [1].
You can also do a scan with nRF Connect on an Android/iOS device and you'll see that many devices don't have the name as part of advert, instead you get N/A as the device's name:-

IOKit: Creating a MacOS device instance to provide coordinate input for a USB-OTG device

I'm working on a project that involves connecting a single-board computer (either a BeagleBone Black, or a BeagleBoard X15) to a Mac via USB OTG, and then delivering basic mouse/touch input (pointer coordinates and left/right-click events).
This process should be technically very similar to connecting a mouse (or, more accurately, a touchscreen-style device that receives precise mouse coordinates) and passing some ordinary HID input to MacOS. So I don't need most of the complexity of IOKit - I don't think I need to create a kernel extension; I should just be able to create an instance of a HID for which MacOS already has generic kernel extensions.
So I'm delving into IOKit to figure out how to create the device instance and provide input. However, nearly everything I'm reading about IOKit involves creating and registering new kernel extensions, services, etc. - none of which is germane to my project.
So far, the only relevant leads I've got are the I/O Registry Explorer and the contents of /System/Library/Extensions. Several items in there look promising, such as AppleDHIDMouse.kext. However, I cannot find any examples of code to bridge the gap: how my USB-connected device can connect with the kernel extension, create an instance for itself, and send commands.
Any help? Thanks in advance.
Either your device is fully USB HID compliant, in which case you shouldn't need any code at all on the Mac side, or you'll need to create a kernel extension.
How far have you got? What does your device look like in ioreg/IORegistryExplorer? (The latter is from the "Additional Tools for Xcode", downloadable from https://developer.apple.com/download/more/ )
Does your USB device's interface report as HID? (bInterfaceClass 3) The device itself normally reports as a composite device (bDeviceType 0). bInterfaceProtocol and bInterfacSubClass also have defined meanings in the context of HID, and should probably both be 0 for a "tablet" style device. With that in place, macOS should pick up your device as a HID device and try to drive it with one of its built in HID device drivers.
The way HID devices work is through "reports" - event data structures with a flexible format/layout, which is defined via the device's "report descriptor". What buttons, input axes, etc. your device has is defined there.
For an example of a USB "tablet" device (absolute coordinate pointing device) that works with macOS, check out the code for the USB Tablet device that Qemu emulates. That might be a good starting point for the report descriptor of your own device.
If your device doesn't conform to general USB HID conventions and uses some custom protocol, you'll need a custom kext (up to macOS 10.14) or dext (from macOS 10.15 onwards) which will most likely implement a IOHIDDevice subclass. An example of such a driver is the open source Mac driver for the Xbox 360's game controller, which doesn't behave like a standard USB HID device.

Can I connect two private addressed BLE devices together?

Hello,
The context: I'm currently working on a BLE device that is connected with Just Works connection type to its Master (android tablet).
Since :
Android devices with recent versions of Android do not use the public address when connecting. Rather, they use a random address. This is part of the BLE spec. For the purpose of privacy, in addition to the public device address there are random device addresses. New versions of Android uses a random address when connecting to peripherals. (source of that quote)
I understood that my Android tablet is using a random address. For that, i made a programme to verify this information and it actually works (fortunately).
So my BLE public addressed device can connect to the master by receiving its pairing ask.
The question: First of all, what exactly are BLE addresses (random, static, public(mac) it's a bit confusing from the docs) ?
The MAIN question: Can my master (android tablet) connect to my device when those two are private addressed ?
My specifications:
Using VisualStudio
Using VisualGDB and openOCD
BLE_lib.h and BlueNRG
Ask for more information
The answer: Public BLE address is given by Bluetooth SIG and is guaranteed to unique. Random BLE address does not have this property. In addition random address can be either static or public. Static address cannot be changed while the BT chip is on. Public is divided into resolvable and non-resolvable, both can change whenever and the basic difference is the amount of bytes that change.
The main answer: Yes but you will need a way to identify the device. You could broadcasting specific data (e.g. manufacturer data or a 128b service UUID) and have your tablet scan for it. Then you can connect to whatever address you find provided the device advertises correct data.
And recommendation: You can find a lot of stuff at Nordic semiconductor-related sites. Even if you do not use their stack, their tutorials and explanations are easy to understand and cover pretty much everything.
Edit: I could probably provide better answer if I knew what exactly you intend to do.

Is there a way to test SocketMobile integration without actual scanner?

I have Android and iOS React Native app that requires user to scan barcodes. I am now working on integration with SocketMobile scanner.
Is there a way to test integration without actual scanner device? Maybe there's some kind of emulator?
Using the SDK you can enable a "SoftScan" device, which uses the built-in camera. The SoftScan device behaves just like a physical device and can be configured using the same APIs.
Enabling SoftScan
After ScanAPI is initialized; most likely inside ScanApiHelperNotification.onScanApiInitializeComplete()
mScanApiHelper.postSetSoftScanStatus(kSktScanEnableSoftScan, callback)
Once SoftScan is enabled, you will immediately receive a device arrival notification - in the same way you receive a device arrival notification when a physical device is connected via Bluetooth.
The SoftScan device does not support all the properties of a physical device and will return an unsupported error if you try to get/set one of the properties it does not support.
SoftScan uses the Barcode Scanner app, so make sure it is installed on your device

API to access GSM signal on computer

Hope this is the right place to ask - assuming so as it is related to programming.
I am looking for some hardware (say a dongle) that would open up an API for my computer to a SIM card. Does that exist anywhere?
The idea would be that I can then use my existing SIM card on its existing network/contract and with a bit of code, send/receive calls and texts. I figured that if a phone can be programmed to do it why can't a computer? I just need the hardware.
Any suggestions if this kind of thing is possible? Even by maybe integrating a phone?
You can use AT commands with any modem or phone, whose driver exposes a modem port when you connect it to a computer. Plug in the phone or modem, and go to Windows Device Manager, and look under "Modems" and see what you've got. From "properties" of the Modem, you can see which COM port it is on.
AT commands are an older method of communicating with a modem. There is a standard set of commands for GSM/GPRS/3G/4G devices available from 3GPP.org, here. Manufacturers add their own proprietary commands for more obscure functions. Many but not all of these are in the public domain.
Some newer plug-in modems may appear as a network adapter (you can see this in Windows), due to their drivers. In this case, you can use the following interfaces:
on Vista: NDIS, proprietary interfaces
on Windows 7 and 8.x Desktop apps: Windows Mobile Broadband API
on Windows 8.x, in the Metro/app area: Windows.Networking and MobileBroadband APIs.
on Windows 10, UWP, there are UWP APIs here. But they do not give as much functionality as the Desktop APIs.
On Windows 8.1 and Windows 10, if the appropriate drives are present it is possible to use the new MBIM interface via the desktop Mobile Broadband DeviceServices API. Mobile Broadband Interface Model spec available here.
On Linux, use AT commands via the serial port.
I'm a bit puzzled by your requirement to make (voice?) calls via a phone connected to a computer. Do you mean Skype? In this case, of course, you wouldn't need any interface for making calls, you would just open an IP connection over a data session - which can be done via any of the above interfaces.
(added this comment as an answer, as there was more information)
I use this GSM device: http://www.mikroe.com/click/gsm2/ connected to a basic UART like: https://www.sparkfun.com/products/718?gclid=CIj1xOzbur4CFUVbfgodCpQASQ
Then use AT COMMANDS.
I also use a piece of software called QNavigator to inspect the modem/gsm: http://www.soselectronic.com/?str=1329

Resources