An mbed wrapper around the helium-client to communicate with the Helium Atom
Helium for ARM mbed
This code repository exposes an mbed library for the Helium Atom module. The Helium Atom makes it easy to securely connect IoT devices and applications to back-end IoT services.
Getting Started
See a getting started guide on the Helium site.
Supported Boards
The Helium mbed client should work with any mbed board with an available serial port.
Example Setup
Example applications can be found in the mbed Helium team.
Getting Help
If you have any questions or ideas about how to use this code - or any part of Helium - head over to the Helium Community Slack. We're standing by to help.
Contributing
Want to contribute to helium-mbed? That's awesome!
Please see CONTRIBUTING.md in this repository for details.
Diff: src/Helium.cpp
- Revision:
- 14:af7682f4e610
- Parent:
- 3:475fae677f2d
- Child:
- 17:f38730193da3
--- a/src/Helium.cpp Wed Jul 05 12:58:56 2017 -0700 +++ b/src/Helium.cpp Thu Jul 06 10:18:57 2017 -0700 @@ -4,25 +4,25 @@ bool helium_serial_readable(void * param) { - Serial * serial = (Serial *)param; + BufferedSerial * serial = (BufferedSerial *)param; return serial->readable() > 0; } bool helium_serial_getc(void * param, uint8_t * ch) { - Serial * serial = (Serial *)param; - + BufferedSerial * serial = (BufferedSerial *)param; int val = serial->getc(); - *ch = val & 0xFF; + *ch = val; return val >= 0; } bool helium_serial_putc(void * param, uint8_t ch) { - Serial * serial = (Serial *)param; - return serial->putc(ch) == 1; + BufferedSerial * serial = (BufferedSerial *)param; + serial->putc(ch); + return true; } void @@ -32,13 +32,11 @@ wait_us(us); } - Helium::Helium(PinName tx, PinName rx) : serial(tx, rx, 9600) { helium_init(&_ctx, (void *)&serial); } - int Helium::baud(enum helium_baud baud) {