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
//Extracted 1/10/2022 from my COVID-CO2-tracker project, in case they're useful to anybody. I'm gonna file an issue/suggesting a few places, and it seems polite to dump it here rather than a long preformatted bit in an issue. | |
export const GENERIC_GATT_SERVICE_SHORT_ID_DESCRIPTIONS = new Map([ | |
//these are hex strings, without the 0x. Chrome zero extends the devices... so 0x1800 becomes 0x00001800. | |
// This is a hack to make things easy. | |
['1800', "generic_access"], | |
['1801', "generic_attribute"], | |
['1802', "immediate_alert"], | |
['1803', "link_loss"], |
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
cmake_minimum_required(VERSION 3.8.0) | |
# Project info | |
project(sdhr) | |
set(${PROJECT_NAME}_MAJOR "0") | |
set(${PROJECT_NAME}_MINOR "0") | |
set(${PROJECT_NAME}_PATCH "1") | |
set(VERSION "${${PROJECT_NAME}_MAJOR}.${${PROJECT_NAME}_MINOR}.${${PROJECT_NAME}_PATCH}") | |
set(CMAKE_CXX_STANDARD 11) |
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
package com.sam016.vsflatomation.service.ble; | |
import java.util.HashMap; | |
import java.util.UUID; | |
public class AllGattCharacteristics { | |
private static HashMap<String, String> attributes = new HashMap(); | |
static { | |
attributes.put("00002a00-0000-1000-8000-00805f9b34fb", "Device Name"); |
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
# Uses Bluez for Linux | |
# | |
# sudo apt-get install bluez python-bluez | |
# | |
# Taken from: https://people.csail.mit.edu/albert/bluez-intro/x232.html | |
# Taken from: https://people.csail.mit.edu/albert/bluez-intro/c212.html | |
import bluetooth | |
def receiveMessages(): |
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
#!/usr/bin/env python | |
""" | |
Copyright 2011 Domen Kozar. All rights reserved. | |
Redistribution and use in source and binary forms, with or without modification, are | |
permitted provided that the following conditions are met: | |
1. Redistributions of source code must retain the above copyright notice, this list of | |
conditions and the following disclaimer. |