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
#include <zephyr/logging/log.h> | |
LOG_MODULE_REGISTER(golioth_memfault, LOG_LEVEL_DBG); | |
#include <golioth/stream.h> | |
#include <memfault/components.h> | |
/* Callback invoked by the Golioth SDK to read the next block of Memfault | |
data to send to Goliot */ | |
static enum golioth_status read_memfault_chunk(uint32_t block_idx, | |
uint8_t *block_buffer, |
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
//! @file | |
//! | |
//! Example code that uses libcurl to fetch the latest release for an example | |
//! device. | |
//! | |
//! Compiling: In Memfault UI, navigate to Settings->General Settings and | |
//! Copy/Paste "Project API Key" into PROJECT_KEY below: | |
//! | |
//! $ gcc get_latest.c -lcurl -lssl -lcrypto -Wall -DMEMFAULT_PROJECT_KEY=\"PROJECT_KEY\" | |
//! |
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
#include <stdint.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
// supported manifest version, in case the structure needs to change | |
#define BUNDLE_MANIFEST_VERSION 1 | |
enum bundle_manifest_entry_type { | |
BUNDLE_MANIFEST_ENTRY_TYPE_MAIN_FW, | |
BUNDLE_MANIFEST_ENTRY_TYPE_MODEM_FW, |
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 python3 | |
import base64 | |
import os | |
import sys | |
import uuid | |
import requests | |
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 python3 | |
""" | |
Example script to update the cohort for a device via the Memfault API. | |
Run with --help for usage information. | |
""" | |
import requests |
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 python3 | |
""" | |
Small python program to load json data generated by the Memfault "list Devices" | |
API: | |
https://api-docs.memfault.com/#2634f3fb-d137-42a8-b093-e05d420b8932 | |
And spit out a json object with the following format: | |
{ |
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
# require make 4.3+ for grouped targets | |
MINIMUM_MAKE_VERSION = 4.3 | |
MAKE_TEST_VERSION = $(shell printf "%s\n%s" $(MAKE_VERSION) $(MINIMUM_MAKE_VERSION) | sort --version-sort) | |
ifneq ($(MINIMUM_MAKE_VERSION),$(firstword $(MAKE_TEST_VERSION))) | |
$(error Make version is too low. Please upgrade to $(MINIMUM_MAKE_VERSION) or higher.) | |
endif |
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
# get rsync | |
❯ git clone [email protected]:WayneD/rsync.git | |
❯ git checkout v3.2.3 # recent tag | |
# get musl cross toolchain from https://musl.cc/ | |
❯ wget https://musl.cc/arm-linux-musleabihf-cross.tgz | |
❯ tar zxvf arm-linux-musleabihf-cross.tgz | |
# now add the toolchain to path and configure + make | |
❯ export PATH=$PATH:$PWD/arm-linux-musleabihf-cross/bin |
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 bash | |
# disable warning for using filter branch, we don't care lalala | |
export FILTER_BRANCH_SQUELCH_WARNING=1 | |
# rewrite all authors to = committer. | |
git filter-branch --commit-filter \ | |
'GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE" GIT_AUTHOR_EMAIL="$GIT_COMMITTER_EMAIL" git commit-tree "$@"' | |
# these are good examples: |
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
# Detect if a warning flag is supported by the $(CC) compiler | |
# | |
# HEADS UP- This should be used after including CppUTest MakefileWorker.mk, | |
# which populates the $(COMPILER_NAME) variable, but will work if you don't | |
# (it's just slower by a few ms because it will attempt to use the wrong | |
# option when testing). | |
# | |
# Example usage: | |
# ifeq ($(call WARNING_SUPPORTED,address-of-packed-member),supported) | |
# CPPUTEST_ADDITIONAL_CPPFLAGS += \ |
NewerOlder