PietteTech_Phant (community library)

Summary

Name Value
Name PietteTech_Phant
Version 0.0.3
Installs 164
License GPL v3 (http://www.gnu.org/licenses/gpl.html)
Author Scott Piette, Piette Technologies LTD (scott.piette@gmail.com)
URL https://github.com/piettetech/piettetech_phant
Repository https://github.com/piettetech/piettetech_phant.git
Download .tar.gz
All Versions 0.0.3, 0.0.2

Phant database library for Spark

Example Build Testing

Device OS Version:

This table is generated from an automated build. Success only indicates that the code compiled successfully.

Library Read Me

This content is provided by the library maintainer and has not been validated or approved.

Phant database library for Spark

Supports clearing and writing data to Phant data streams

Scott Piette, Piette Technologies, LTD - scott.piette@gmail.com
Copyright 2014 Piette Technologies, LTD

Project supported by Open Source Beehives Project http://www.opensourcebeehives.net

Oct 16, 2014  - Initial release for Spark Core

VERSION: 0.3
PURPOSE: Phant database communication library for Spark
LICENSE: GPL v3 (http://www.gnu.org/licenses/gpl.html)

BASED ON:
Phant Arduino Library https://github.com/sparkfun/phant-arduino

PHANT GITHUB:       https://github.com/sparkfun/phant

METHODS:
sendData(method)
sends data to Phant server using the method passed, defaults to POST
addData(name, value)
adds a data=value pair to the stream, returns the number of bytes added or '0' on error.  After you have added all data send the stream using sendData
getError()
returns the human readable text from the Phant server resulting from the last sendData

NOTES:
1 Does not use dynamic Strings as that can cause memory fragmentation
2 HTTP Header is consolidated into one 256 byte data buffer to improve performance
3 POST and CLEAR use the same header buffer - modified before sending
4 All POST data gets added to a 512 byte internal content buffer
5 HTTP and Phant responses from server are read using block reads into the remaining space from internal content buffer, or if space < 128 bytes we read using single byte reads from stream
6 sendData returns 1=success from Phant server or 0=failure if connect fails, no HTTP response, or Phant server returns status = 0
7 Currently only supports CLEAR STREAM,  and POST methods
8 There is a 64 byte buffer for the Phant response message. Use getError() to get the Phant response text.
9 The response buffer is used as a temporary buffer for addData so it's only valid after the sendData call and before any addData calls


Browse Library Files