I'm using BTool, together with a TI Launchpad and the nRF Connect mobile app on my Samsung S21. I am curious, what type of services nRF Connect can be used, that send notifications to my TI Launchpad whenever their value is changed. Not periodically. Only after their value is changed.
I tried using a Battery Level service, but I'm not sure on how to "subscribe" to that service (how to enable notifications) from BTool.
Any advice?
According to this BTool User Guide I found the process of enabling notifications is as follows:
In order to enable notifications, the client device must write a value of 0x0001 to the client characteristic configuration descriptor (CCCD) for the particular characteristic. The handle for the CCCD immediately follows the characteristic value’s handle. Therefore, a value of 0x0001 must be written to the “handle + 1”.
The Battery Service you created has the UUID 0x180F and you have to get the handle for this characteristic. One way is described in the part about reading a characteristic by UUID.
To do this, you will first need to click the “Read/Write” tab in BTool. Select the option “Read Using Characteristic UUID” under the”sub-procedure” option in the “Characteristic Read” section at the top of the screen. Enter the UUID (note that the LSB is entered first, and the MSB is entered last) in the “Characteristic UUID” box, and click the “Read” button.
You can now access the CCCD using "handle + 1" as described earlier. To enable the notifications just write 0x0001 to that handle.
Related
I try to understand the BLE pairing procedure via checking the HCI log and reading the Core profile .
now I know something as blow :
1.SMP use the channel 0x0006 in L2CAP.
2.L2CAP has the connectionless\Connection-oriented channel , 0x0006 belongs to the Connection-oriented channel.
3.L2CAP create connection should have the "L2CAP Connection Request/respon".
what I confused is there is no "L2CAP Connection Request/respon" in my HCI logs(more than 10 files).
Is this channel create via the BLE STACK in Bluetooth init step ? so When the SMP wanna use this 0x0006 Channel ,it is already exist ,no need to create .Am i rigtht?
I try to reboot the smart phone \the SDK board ,try to get the HCI log about init step ,but nothing more .
The SMP channel 0x0006 is a "fixed channel".
Per Bluetooth Core specification v5.3, Vol 3 (Host), Part A (L2CAP):
Fixed channels are available as soon as the ACL-U or LE-U logical link is set up. All initialization that is normally performed when a channel is created shall be performed for each of the supported fixed channels when the ACL-U or LE-U logical link is set up. Fixed channels shall only run over ACL-U, APB-U, or LE-U logical links.
So, there is no need to (and not allowed to) send request/response packets that create the channel, since it's already established when the BLE connection is created. The SMP channel 0x0006 uses the "basic mode", so you are therefore not even allowed to use L2CAP_LE_CREDIT_BASED_CONNECTION_REQ for that channel, since that request can only be used for channels in LE Credit Based Flow Control mode. And L2CAP_CONNECTION_REQ can only be used for Bluetooth Classic.
I made an app that advertises an iBeacon. The UUID changes every 30 seconds. Within the UUID is the androidID of the phone and a timestamp. Both are encrypted. My smarthome system decrypts the UUID and gets the timestamp and the androidID.If both are valid the front door opens.
The app creates an UUID and starts advertising, stops after 30 seconds an creates a new one and restarts the advertising. This goes on for ever until the app (running in backround) doesn't get closed.
I wonder if it is possible to change the advertising data (UUID) without stopping and restarting the advertising??
Thanks!
Is starting with AdvertisingSet a solution??
The way to do this is via the setAdvertisingData() method. Calling this in the middle of advertising shouldn't be an issue (as long as you are on API 26 or later). From the Android developer website:-
Set/update data being Advertised. Make sure that data doesn't exceed
the size limit for specified AdvertisingSetParameters. This method
returns immediately, the operation status is delivered through
callback.onAdvertisingDataSet().
Advertising data must be empty if non-legacy scannable advertising is
used. For apps targeting Build.VERSION_CODES#R or lower, this requires
the Manifest.permission#BLUETOOTH_ADMIN permission which can be gained
with a simple manifest tag. For apps targeting
Build.VERSION_CODES#S or or higher, this requires the
Manifest.permission#BLUETOOTH_ADVERTISE permission which can be gained
with Activity.requestPermissions(String[], int). Requires
Manifest.permission.BLUETOOTH_ADVERTISE
Have a look at the links below for more information:-
How do you update the Android BLE advertising data at runtime
Dynamically changing BLE data in Android
BLE advertisements changing in Android
What i have:
I am running a freeradius server fully configured of how i need it to be. Everything works just fine right now.
What i need:
I need the radius to put the devices in a seperate vlan before authentication and to run a vulnerability scan (nessus / openvas etc) on the devices in this vlan to check for software status ( antivirus etc. )
if the device passes the test the authentication should be done normaly.
if it fails it should be put into a third ( fourth if you count the unauth-vid ) vlan.
can someone tell me if this is doable in freeradius ?
thanks in advance for your answers
Yes. But this is a very broad question and is dependent on the networking equipment being used. I'll give you an overview of how I'd design such a system.
In general, you'll have an easier time if you can use the same DHCP server/IP range for your NAC and full access VLAN. That means you don't have to signal the higher networking layers in the client that there's been a state change, you can swap out VLANs behind the scenes to change what they can access.
You'd set up a database with an entry for each client. This doesn't have to be pre-populated, it could be populated during the first auth attempt. Part of each client entry would be a status field detailing when they last completed NAC.
You'd also need an accounting database, to store information about where each client is connected to the network.
If the client had never completed NAC checks before, you'd assign the client to the NAC VLAN, and signal your NAC processes to start interrogating it.
FreeRADIUS can act as both a RADIUS and DHCPv4 server, so you'd probably do signal the NAC process from the DHCPv4 side because then you'd know what IP the client received.
Binding the RADIUS and DHCPv4 sides can be done in a couple of ways. The most obvious is MAC, another common way is NAS/Port ID using the accounting table.
Once the NAC checks had completed, you'd have the NAC process write out a receipt in detail file format, and have that read back in by a detail file listener (there are examples of this in sites-available/ in the 'decoupled-accounting' virtual server files). When reading those entries back in, you'd change the state in the database, and send a CoA packet to the switch using information from the accounting database to identify the client. This would flip the VLAN and allow them to the standard set of networking resources.
I know this is very high level, documenting it properly would probably exceed StackOverflow's character limit. If you need more help with this, I suggest you research what I've described above and then start asking the RADIUS related questions on the FreeRADIUS user's mailing list https://freeradius.org/support/.
Is it possible to send some notification messages to the nearby Bluetooth devices without pairing.I have found some protocol for these - OBEX Oject Push. But am not clear whether is is feasible without pairing request .Any demo apps for reference?
Yes and no.
If you are actually talking about connecting but not pairing, then, yes.
If you are talking about no connection at all, then no.
When creating a Bluetooth connection between two or more devices the following steps are taken.
Inquiry – If two Bluetooth devices know absolutely nothing about each other, one must run an inquiry to try to discover the other. One device sends out the inquiry request, and any device listening for such a request will respond with its address, and possibly its name and other information. The closest located device is not necessarily the fastest to respond and any device that hears the call will try to respond.
Paging – Paging is the process of forming a connection between two Bluetooth devices. Before this connection can be initiated, each device needs to know the address of the other (found in the inquiry process).
Connection – After a device has completed the paging process, it enters the connection state. While connected, a device can either be actively participating or it can be put into a low power sleep mode.
• Active Mode – This is the regular connected mode, where the device is actively transmitting or receiving data.
• Sniff Mode – This is a power-saving mode, where the device is less active. It’ll sleep and only listen for transmissions at a set interval (e.g. every 100ms).
• Hold Mode – Hold mode is a temporary, power-saving mode where a device sleeps for a defined period and then returns back to active mode when that interval has passed. The master can command a slave device to hold.
• Park Mode – Park is the deepest of sleep modes. A master can command a slave to “park”, and that slave will become inactive until the master tells it to wake back up.
Two devices can be bonded together through a one-time process called pairing. When two devices are paired, they store each other’s addresses, names and profiles in memory, allowing them to automatically establish a connection as soon as they are in range of each other.
It is not possible to send OPP (or other) communication between two devices before connecting.
It is possible to send communication between two devices after connection but before pairing.
I'm trying to read some data from the secure element in the SIM of a global platform 2.2 card.
My SELECT command of the applet is successful 90,00 with some PDOL data in the response. However when I send Get Processing Options it returns 6D00. It seems the Security Domain is still in charge and does not understand the GPO command.
My investigation says applet specific commands needs to go over a secure channel, while the CRS runs on the basic channel. Is this requirement true even if the card is not being accessed over the contactless interface?
First of all verify that your applet must be selected on same I/O interface and the same logical channel on which you are sending the command.
The status word '6D00' shows that the command sent over another applet or SD that does not understand it instead of secure channel initiation requirement.
And yes if you are communicating with secured card like and Secure element then you need to initiate scp session.
SELECT APDU should be sent first with correct AID.
If AID belongs to the EMV card, response should come with status SW 90 00 with data area. Processing Options Data Object List in data area should be properly parsed and GET PROCESSING OPTIONS should be constructed with required parameters (Terminal
Transaction Qualifiers,Amount, Authorized , Unpredictable Number etc.)
Try this TLV utilities and see the options list:
9F38 Processing Options Data Object List (PDOL)
9F66049F02069F37045F2A029A03