Skip to content

Instantly share code, notes, and snippets.

View aaronjamt's full-sized avatar

Aaron Tulino aaronjamt

View GitHub Profile
@aaronjamt
aaronjamt / rp2040_persistent_flash_storage.c
Last active February 29, 2024 19:20
RP2040 persistent storage using flash memory (Arduino)
#include "hardware/flash.h"
// The two primary functions that you would use are:
// bool read(uint8_t *output, uint8_t size);
// void write(uint8_t *data, uint8_t size);
// The read(...) function will either fill the *output buffer
// with size bytes (and return true), or will return false if
// there is no saved data available to be read.
@aaronjamt
aaronjamt / forward.py
Created December 8, 2023 02:23
[Python] Forward all packets between open TCP sockets
import socket, threading, select
def _forwardBetween(*sockets, endOnAnySocketClose=True, daemonize=True):
def _handler(sockets):
sockets = list(sockets)
print(sockets)
# Set all sockets to nonblocking so we don't have to wait for them
[socket.setblocking(False) for socket in sockets]
while True:
socks = select.select(sockets, [], sockets)[0]
@aaronjamt
aaronjamt / ID115 Protocol.txt
Created April 15, 2020 21:20
ID115 Watch BLE Protocol
-------------Camera fields---------------
Enable:
WRITE 06 02 00 00 00 00 => 0af6
Disable:
WRITE 06 02 01 00 00 00 => 0af6
Shutter pressed:
READ 07 01 06 00 00 00 <= 0af7