modulation of protocole wifi/bluetooth/zigbee - bluetooth

I try to learn the protole radio. I have find the trame's format but the data on their modulation i find are confusing.
I look for info on :
what modulation is used by thes protocole
if more than one is used : in with case one is used
List of potocole and data i find:
bluetooth : V1=MSK / V2=DQPSK / low energy=GFSK(not sure)
wifi : PSK(hypothesis)
RFID : BPSK
Zigbee 868MHz: BPSK(not sure in if it's the only one)
domotic 868MHz : BPSK(hypothesis)

Related

How can I enumerate supported services, or talk via GATT, once I connect to a Bluetooth device via the Bluez DBUS API on Linux?

I am looking to connect to Bluetooth devices on Linux and store information about them in a database. I have used the code from here as the starting point. It uses
prop_changed = g_dbus_connection_signal_subscribe(con,
"org.bluez",
"org.freedesktop.DBus.Properties",
"PropertiesChanged",
NULL,
"org.bluez.Adapter1",
G_DBUS_SIGNAL_FLAGS_NONE,
bluez_signal_adapter_changed,
NULL,
NULL);
to be notified when new Bluetooth devices appear. And I reuse its bluez_device_call_method() function to call the DBUS Connect() method documented in the BlueZ D-Bus Device API on every new device that appears:
bluez_device_call_method(object, "Connect");
Most devices just time out, but some devices appear to connect sucessfully. My question is, for those devices which I've connected successfully to, how do I get more information about the device I'm talking to?
The only other APIs documented in the BlueZ D-Bus Device API that seem like they'd let me retrieve more information are "void ConnectProfile(string uuid)" and "void Pair()". For ConnectProfile() how am I supposed to know the UUID? Is it just what's printed out via entries like the below?
[ /org/bluez/hci0/dev_48_57_DE_00_AA_09 ]
Address : s : 48:57:DE:00:AA:09
AddressType : s : random
Name : s : Blood Pressure
Alias : s : Blood Pressure
Paired : b : 0
Trusted : b : 0
Blocked : b : 0
LegacyPairing : b : 0
RSSI : n : -65
Connected : b : 0
UUIDs : a :
0000180a-0000-1000-8000-00805f9b34fb
00001810-0000-1000-8000-00805f9b34fb
And if it succeeds, where would I find the returned data?
And for Pair(), it says "This method will connect to the remote device, initiate pairing and then retrieve all SDP records (or GATT primary services).", but if it succeeds, where would I find the returned data?
So far I've tried:
ret = bluez_device_call_method(object, "Connect");
if(ret == -1){
bluez_device_call_method(object, "Pair");
}
else{
printf("Connect() succeeded! Now what?!\n");
}
But I don't think Pair() has ever succeeded, whereas Connect() has succeeded occasionally with some devices.

Configuring the mongodb node.js driver to use snappy compression

We've recently upgraded our MongoDB replica set to v3.4.4; I notice that this release now supports compressed network communication with snappy. I've got the set members set to enable this, so that they communicate with each other this way, and the mongo shell seems to support it natively, but I can't find any documentation on how to set up our Node.js clients to use it.
Everything still works fine, of course, since uncompressed communications are used where the client and the server can't agree on a compression protocol, but it would be good to be able to take advantage of this for obvious reasons.
Has anyone else played with this or had any luck with it?
It does appear that Mongo has an open ticket on this, but wondered if anyone else had made any progress independently of that.
You have two options to enable compression:
1) Driver option
Set the driver option when you initialize the MongoClient. Depending on the driver the syntax may differ. See docs, for example:
"options": {
"compression": [
"zstd",
"snappy",
"zlib"
]
}
2) Connection string
Add the compressors argument to your connection string, for example:
mongodb://example.com/?compressors=zstd,snappy,zlib
Note
The examples above demonstrate how to set multiple compressors to better explain the syntax and make the answer more useful. If you only want to set only one compressor, change accordingly.
You can find more examples on how to set compressors in the mongoDB Node.js driver test scripts.
You can verify that network compression is begin used and which compression algorithm is being used in the mongo logs, as each compression / decompression generates a verbose log entry. Or you can run db.serverStatus()['network'] and observe the bytesIn / bytesOut of various compressors, e.g.:
{
"bytesIn" : NumberLong("1828061251"),
"bytesOut" : NumberLong("57900955809"),
"physicalBytesIn" : NumberLong("2720120753"),
"physicalBytesOut" : NumberLong("32071382239"),
"numRequests" : NumberLong("570858"),
"compression" : {
"snappy" : {
"compressor" : {
"bytesIn" : NumberLong("2215000774"),
"bytesOut" : NumberLong("752759260")
},
"decompressor" : {
"bytesIn" : NumberLong("226402961"),
"bytesOut" : NumberLong("848171447")
}
}
},
"serviceExecutorTaskStats" : {
"executor" : "passthrough",
"threadsRunning" : 80
}
}

Non generic ZCL frame parsing

I have to decrypt frame from ZCL (Zigbee Cluster Library) and to interpretate it. So I found on NPM the "zcl-packet" module, who seems to do it well.
But, i work with sensors who use the "ZCL syntax", but who create their own cluster, so i have things like 0x8002 or 0x8003, who are not defined by ZCl, so the module doesn"t work properly, and i'm not able to decrypt as well my packet.
Example of trame :
110a800200002b00000075
Flag(+en) : 0x11 (don't know if this is generic to ZCL)
CommandID : 0x0A
ClusterID : 0x8002
AttributeID : 0x0000
AttributeType : 0x2b (Int32_type)
Data : 0x00000075
So if i try to parse it using the module, i got error, because i doesn't found the clusterID (that's seems normal)
So do i have to redevelop all (data parsing, etc), or can i just find a way to deal with and create my own cluster_id and deal with this module depending on the command ID, like by inheritance ?

Which technologies is __movsb belong to?

About this function __movsb :
link : https://msdn.microsoft.com/en-us/library/hhta9830.aspx
I wish to know which technologies it is belong to (Such as SSE , AVX)
link : https://software.intel.com/sites/landingpage/IntrinsicsGuide/
I couldn't find it (__movsb) from the website , anyone know ?

How can I calculate the signal strength of my wifi and 3g using android SDK?

I try to make an application that will calculate the signal strenth of my wifi, or 3g and let the user know about his distance from that access point.
For instance, I have here a sample of my code that will calculate the distance, in kilometers, between device and a wifi access point:
public double calculateDistance(double signalLevelInDb, double freqInMHz)
{
double exp = (27.55 - (20 * Math.log10(freqInMHz)) + Math.abs(signalLevelInDb)) / 20.0;
return Math.pow(10.0, exp);
}
but, when i call the function in android studio, I don't know how to calculate the signalLevelInDb (=dbm) and freqInMhz (=mHz) so I can send them to the function to display my distance. How can I make android studio give me these 2 values? Can I use the same function for the 3g and how?
Please find this information in the offical documentation of the Android SDK:
Android SDK API documentation, SignalStrength.
With this class you have the methods
int getCdmaDbm()
Get the CDMA RSSI value in dBm
or:
int getEvdoDbm()
Get the EVDO RSSI value in dBm
As an alternative you could have a look at the TelephonyManager class which is supported since API level 1. With this at your side you can find out in which network state (public int getNetworkType ()) your mobile device is at the moment (2G, 3G,...) and thus find out or at least translate to a corresponding "frequency".
Hope this helps you for your distance calculation.

Resources