Sigfox Communication library, allowing you to use any kind of UART able Sigfox Transmitter
Fork of Sigfox_Com by
Revision 2:975b82a3cde0, committed 2016-03-12
- Comitter:
- RB62680
- Date:
- Sat Mar 12 16:00:57 2016 +0000
- Parent:
- 1:39a0558a3a3a
- Commit message:
- Added Sigfox_n Sigfox;;
Changed in this revision
sigfox.cpp | Show annotated file Show diff for this revision Revisions of this file |
sigfox.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/sigfox.cpp Fri Mar 11 08:38:19 2016 +0000 +++ b/sigfox.cpp Sat Mar 12 16:00:57 2016 +0000 @@ -2,46 +2,13 @@ #include "millis.h" #include "sigfox.h" -/* sigfox library - * - * Copyright (c) Adrien Chapelet for IoTech.fr - * Apache 2 license - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ - - /* - This library allows you to use any kind of Sigfox Transmitter, all you have to do is configure pins and baudrate, and check syntax is conform to your datasheet. - */ - -//---------------------------------------------------------------------------------------------// -//Constructors +Sigfox_ Sigfox; + Sigfox_::Sigfox_() { Serial device(PIN_RX, PIN_TX); _lastSend=-1; } -/*Sigfox_::Sigfox_(PinMode TX, PinMode RX) { - Serial device(p8, p7); -}*/ -//Functions uint8_t Sigfox_::_nextReturn() { Serial device(PIN_RX, PIN_TX); char fstChar = device.getc(); @@ -77,23 +44,6 @@ //return _nextReturn() == OK; return true; -/* - device.putc((uint8_t)'A'); - device.putc((uint8_t)'T'); - - uint8_t response[8] = {0}; - uint8_t i = 0; - //while(!device.available()); - while(device.peek() != ';') { - response[i] = device.read(); - while(!device.available()); - ++i; - } - response[0]=device.getc(); //'K' - response[1]=device.getc(); //'O' - response[2]=device.getc(); //';' - if ((response[0]=='O') && (response[1]=='K')) - return OK;*/ } bool Sigfox_::send(const void* data, uint8_t len) {
--- a/sigfox.h Fri Mar 11 08:38:19 2016 +0000 +++ b/sigfox.h Sat Mar 12 16:00:57 2016 +0000 @@ -4,9 +4,9 @@ #include "mbed.h" //Define your baudrate and pins here -#define BAUDRATE 9600 -#define PIN_RX p7 -#define PIN_TX p8 +#define BAUDRATE 9600 +#define PIN_RX p19 +#define PIN_TX p18 class Sigfox_ {