I hereby claim:
- I am towynlin on github.
- I am towynlin (https://keybase.io/towynlin) on keybase.
- I have a public key whose fingerprint is 6477 2407 CE3A 48C0 2D32 0DD9 585E 75DD 1E3E 7AA1
To claim this, I am signing this object:
% gem update rubysl-openssl -- --with-openssl-dir=/usr/local/Cellar/openssl/1.0.1j | |
Updating installed gems | |
Updating rubysl-openssl | |
Building native extensions with: '--with-openssl-dir=/usr/local/Cellar/openssl/1.0.1j' | |
This could take a while... | |
ERROR: Error installing rubysl-openssl: | |
ERROR: Failed to build gem native extension. | |
/Users/zac/.rbenv/versions/rbx-2.2.10/bin/rbx extconf.rb --with-openssl-dir=/usr/local/Cellar/openssl/1.0.1j | |
checking for t_open() in -lnsl... no |
I hereby claim:
To claim this, I am signing this object:
int binaryToSerial(String s) { | |
int len = s.length(); | |
for (int i=0; i < len; i++) { | |
Serial.write(s[i]); | |
Serial.write(' '); | |
Serial.println(s[i], HEX); | |
} | |
return len; | |
} |
SYSTEM_MODE(SEMI_AUTOMATIC); | |
bool wasConnecting = false; | |
int startedConnectingAt = 0; | |
void setup() { | |
Spark.connect(); | |
} | |
void checkForTimeout() { |
int last = 0; | |
char buf[256]; | |
int toSerial(String s) { | |
Serial.print("You said via REST API: "); | |
Serial.println(s); | |
memset(buf, 0, 256); | |
int charsRead = 0; | |
while (Serial.available() && charsRead < 255) { |
static char macString[18]; | |
static int t = 0; | |
static bool printed = false; | |
void setup() { | |
Spark.variable("mac", macString, STRING); | |
Serial.begin(115200); | |
byte mac[6]; | |
WiFi.macAddress(mac); |
SYSTEM_MODE(SEMI_AUTOMATIC); | |
UDP udp; | |
char binaryDeviceID[12]; | |
const char SKIP_FROM_9_TO_A = 'a' - '9' - 1; | |
int presence_announcement_coap(unsigned char *buf, const char *id) | |
{ | |
buf[0] = 0x50; // Confirmable, no token | |
buf[1] = 0x02; // Code POST |
1482c1482 | |
< 0005c90: 0b50 686f 746f 6e2d 4342 4558 ffff ffff .Photon-CBEX.... | |
--- | |
> 0005c90: 0b50 686f 746f 6e2d 4433 3235 ffff ffff .Photon-D325.... | |
1499,1537c1499,1537 | |
< 0005da0: 025f 0201 0002 8181 00c2 b20a 811d 8590 ._.............. | |
< 0005db0: e3da cdc5 3295 4159 76e2 4b56 6a49 4489 ....2.AYv.KVjID. | |
< 0005dc0: 1c70 3fb1 5690 bf14 a3be 80b8 cd2b dcfd .p?.V........+.. | |
< 0005dd0: d36d 8b65 382a baec c664 a7ea d47c 6e01 .m.e8*...d...|n. | |
< 0005de0: 205e 7816 af6b 8d3a 4ea9 59cc ca96 e932 ^x..k.:N.Y....2 |
const int multicastPort = 23232; | |
const IPAddress multicastAddress(233,252,1,64); | |
UDP udp; | |
char buf[100]; | |
void setup() { | |
udp.begin(multicastPort); | |
udp.joinMulticast(multicastAddress); | |
} |
import sys | |
import time | |
from libpebble2.communication import PebbleConnection | |
from libpebble2.communication.transports.serial import SerialTransport | |
from libpebble2.protocol.base import PebblePacket | |
from libpebble2.protocol.base.types import * | |
from libpebble2.protocol.system import * | |
pebble = PebbleConnection(SerialTransport(sys.argv[1])) # argument like /dev/cu.Pebble... | |
pebble.connect() |