Skip to content

Instantly share code, notes, and snippets.

View amcjen's full-sized avatar

Allison Clift-Jennings amcjen

View GitHub Profile
char leadAnnounceSig[256];
static void leadAnnouncementSend(uint16_t group, uint16_t from, char *message) {
// reports are expected to be json objects
if (group == 0xBEEF) {
sprintf(leadAnnounceSig, "{\"type\":\"report\",\"from\":%d,\"report\":%s}\n", from, report2json(message));
}
if (group == 0) {
sprintf(leadAnnounceSig, "{\"type\":\"announce\",\"from\":%d,\"announce\":%s}\n", from, message);
// called whenever another scout sends an answer back to us
bool leadAnswers(NWK_DataInd_t *ind) {
bool end = false;
int at;
if (ind->options & NWK_IND_OPT_MULTICAST) {
if (hqVerboseOutput) {
speol("MULTICAST on wrong endpoint");
}
announcing to 48879 [36,[36,37],[[0,0,0],[255,128,0]]]
HQ signalling
{"type":"report","from":1,"report":{"type":"led","led":[0,0,0],"torch":[255,128,0]}}
looking for packet in: {"type":"command","to":1,"id":1,"command":"if(!scout.isleadscout) report"}
command
1
HQ signalling
/**
* \file Ping.c
*
* \brief Peer2Peer application implementation
*
* Copyright (C) 2012 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* Redistribution and use in source and binary forms, with or without
CREATE TABLE `party`
(
`party_id` INTEGER NOT NULL AUTO_INCREMENT COMMENT 'Party ID',
`first_name` VARCHAR(128) COMMENT 'First Name',
`middle_name` VARCHAR(128) COMMENT 'Middle Name',
`last_name` VARCHAR(128) COMMENT 'Last Name',
`prefix` VARCHAR(64) COMMENT 'Prefix',
`suffix` VARCHAR(64) COMMENT 'Suffix',
`birthday` DATETIME COMMENT 'Birthday',
`gender` VARCHAR(32),
> wifi.command("AT&V")
ACTIVE PROFILE
C0 &Y0 E0 V0 &K1 CPL0 CPH0
+NDHCP=1 +NSET=192.168.1.99,255.255.255.0,192.168.1.1
+DNS1=0.0.0.0, +DNS2=0.0.0.0
+WM=0 +WAUTO=0,"Pinoccio",,
+WRETRY=5 +WP=0 +WRXPS=1 +WRXACTIVE=0
+NAUTO=0,1,173.255.220.185,22757
+WAUTH=0 +WWPA="s3cr3t1v3"+PSK-valid=1 +SSID=Pinoccio
+WWEP1=1234567890 +WWEP2=
# power
## power.ischarging
#### Description
`int power.ischarging()`
Determines if the Scout is charging its battery via USB. This will also mirror the orange charging LED next to the USB port, which also shines when charging, and turns off when either fully-charged, or the Scout is not plugged in.
```
> print pin.read("a0")
1
> print a0
0
> pin.setmode("a0", INPUT)
Hello from Pinoccio!
(Shell based on Bitlash v2.0 (c) 2014 Bill Roy)
14719 bytes free
Build 2014021701
allocating
0000 32164 32161 : used/free/large
0642 31522 31519 : used/free/large
1284 30880 30877 : used/free/large
1926 30238 30235 : used/free/large
2568 29596 29593 : used/free/large
3210 28954 28951 : used/free/large
3852 28312 28309 : used/free/large
4494 27670 27667 : used/free/large
5136 27028 27025 : used/free/large
@amcjen
amcjen / gist:9537054
Created March 13, 2014 21:10
malloc/free test
#include <Arduino.h>
#include "memdebug.h"
void shuffle(void **array, int n);
void showmem();
void dotest(bool shuffle);
// Compatibility stub for undefined pure virtual