This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Linumiz <parthiban@linumiz.com> | |
* mqtt_loop: subscribe to topic and loopbacks the message to publish topic | |
* | |
* gcc -I./lib -L./lib -DMQTT_TLS -o ./mqtt_loop ./mqtt_loop.c -lmosquitto | |
*/ | |
#include <errno.h> | |
#include <stdio.h> | |
#include <stdlib.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* hci_list.c : Find the list of bluetooth controller present as | |
* - If more the one controller found, prints the UP-RUNNING | |
* - If none is enabled, it prints the first found controller | |
* - If none found, prints nothing | |
* Compile: gcc -o ./hci_list ./hci_list.c -lbluetooth | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# We have a conf and classes directory, add to BBPATH | |
BBPATH .= ":${LAYERDIR}" | |
# We have a recipes-* directories, add to BBFILES | |
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ | |
${LAYERDIR}/recipes-*/*/*.bbappend" | |
BBFILE_COLLECTIONS += "babelouest" | |
BBFILE_PATTERN_babelouest = "^${LAYERDIR}/" | |
BBFILE_PRIORITY_babelouest = "6" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* bluez_adapter_connect.c - Connect with device without StartDiscovery | |
* - This example registers an agen with NoInputOutput capability for the purpose of | |
* auto pairing | |
* - Use ConnectDevice method to connect with device using provided MAC address | |
* - Usual signal subscription to get the details of the connected device | |
* - Introduced new signal handler to exit the program gracefully | |
* | |
* Note: As "ConnectDevice" is new API and in experimental state (but mostly stable) | |
* one need to use "-E" option when starting "bluetoothd". Systems running systemd can |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* bluez_adapter_scan.c - Scan for bluetooth devices | |
* - This example scans for new devices after powering the adapter, if any devices | |
* appeared in /org/hciX/dev_XX_YY_ZZ_AA_BB_CC, it is monitered using "InterfaceAdded" | |
* signal and all the properties of the device is printed | |
* - Scanning continues to run until any device is disappered, this happens after 180 seconds | |
* automatically if the device is not used. | |
* gcc `pkg-config --cflags glib-2.0 gio-2.0` -Wall -Wextra -o ./bin/bluez_adapter_scan ./bluez_adapter_scan.c `pkg-config --libs glib-2.0 gio-2.0` | |
*/ | |
#include <glib.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* bluez_adapter_filter.c - Set discovery filter, Scan for bluetooth devices | |
* - Control three discovery filter parameter from command line, | |
* - auto/bredr/le | |
* - RSSI (0:very close range to -100:far away) | |
* - UUID (only one as of now) | |
* Example run: ./bin/bluez_adapter_filter bredr 100 00001105-0000-1000-8000-00805f9b34fb | |
* - This example scans for new devices after powering the adapter, if any devices | |
* appeared in /org/hciX/dev_XX_YY_ZZ_AA_BB_CC, it is monitered using "InterfaceAdded" | |
* signal and all the properties of the device is printed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* gcc `pkg-config --cflags glib-2.0 gio-2.0` -Wall -Wextra -o ./bin/agent ./agent.c `pkg-config --libs glib-2.0 gio-2.0` | |
*/ | |
#include <glib.h> | |
#include <gio/gio.h> | |
#include <stdio.h> | |
#include "agent.h" | |
GMainLoop *loop; | |
GDBusConnection *con; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* bluez_list_devices.c - Find the Bluetooth devices | |
* - The example uses GDBUS to get the list of bluetooth devices using DBUS | |
* interfaces provided by bluez. This lists only the devices which are already or | |
* currently enumerated by the Adapter. | |
* - The device may be appeared in followind conditions, | |
* - Previously paired with Adapter | |
* - Previously paired and connected with Adapter | |
* - Appeared after StartDiscovery session (but not yet used/removed) | |
* gcc `pkg-config --cflags glib-2.0 gio-2.0` -Wall -Wextra -o ./bin/bluez_list_devices ./bluez_list_devices.c `pkg-config --libs glib-2.0 gio-2.0` |
OlderNewer