Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 3:bfc4928cd279, committed 2016-04-06
- Comitter:
- bhepp
- Date:
- Wed Apr 06 08:27:25 2016 +0000
- Parent:
- 2:502d1a5f79a0
- Commit message:
- Updated license
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LICENSE.txt Wed Apr 06 08:27:25 2016 +0000 @@ -0,0 +1,143 @@ +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. + + +License applies to work derived from Arduhdlc library: +============================================================================= +Arduhdlc is Arduino HDLC library, which can be used over any interface. +Copyright (C) 2015 Jarkko Hautakorpi + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + + + +Licese applies to work derived from Dust SmartMeshSDK C Library: +============================================================================= +Copyright (c) 2012, Dust Networks +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Dust Networks nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL DUST NETWORKS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + + +Licese applies to work derived from Piconomic FW Library: +============================================================================= +Copyright (c) 2006 Pieter Conradie [www.piconomic.co.za] +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +* Neither the name of the copyright holders nor the names of + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +Title: HDLC encapsulation layer +Author(s): Pieter Conradie +Creation Date: 2007-03-31 +Revision Info: $Id: hdlc.h 117 2010-06-24 20:21:28Z pieterconradie $ + + + + +Licese applies to work derived from HDLC byte stuffing package: +============================================================================= +/***************************************************** +* HDLC byte stuffing package * +* * +* Created on: Dec 2013 * +* Author: jdn * +* * +****************************************************** +* * +* * +* (C) 2012,2013 * +* * +* Jens Dalsgaard Nielsen <jdn@es.aau.dk> * +* http://www.control.aau.dk/~jdn * +* Studentspace/Satlab * +* Section of Automation & Control * +* Aalborg University, * +* Denmark * +* * +* "THE BEER-WARE LICENSE" (frit efter PHK) * +* <jdn@es.aau.dk> wrote this file. As long as you * +* retain this notice you can do whatever you want * +* with this stuff. If we meet some day, and you think* +* this stuff is worth it ... * +* you can buy me a beer in return :-) * +* or if you are real happy then ... * +* single malt will be well received :-) * +* * +* Use it at your own risk - no warranty * +*****************************************************/
--- a/ait_link.cpp Wed Apr 06 08:11:43 2016 +0000
+++ b/ait_link.cpp Wed Apr 06 08:27:25 2016 +0000
@@ -1,158 +1,145 @@
-// Adapted by Benjamin Hepp from ArduHDLC library
-
-/*
-Arduhdlc is Arduino HDLC library, which can be used over any interface.
-Copyright (C) 2015 Jarkko Hautakorpi et al. see LICENSE.txt
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-
-
-#include "ait_link/ait_link.h"
-
-using namespace ait;
-
-/* 16bit low and high bytes copier */
-#define low(x) ((x) & 0xFF)
-#define high(x) (((x)>>8) & 0xFF)
-
-AITLink::AITLink(size_t max_frame_length)
-{
- frame_checksum = CRC16_CCITT_INIT_VAL;
- escape_character = false;
- frame_position = 0;
- this->max_frame_length = max_frame_length;
- receive_frame_buffer = new uint8_t[max_frame_length+1]; // char* ab = (char*)malloc(12);
- handle_frame_callback = NULL;
- callback_user_data = NULL;
-}
-
-AITLink::~AITLink()
-{
- delete[] receive_frame_buffer;
-}
-
-/* Wrap given data in HDLC frame and send it out byte at a time*/
-bool AITLink::sendFrame(const uint8_t* frame_buffer, size_t frame_length)
-{
- if (frame_length > max_frame_length) {
- return false;
- }
-
- uint8_t data;
- uint16_t fcs = CRC16_CCITT_INIT_VAL;
-
- sendChar(FRAME_BOUNDARY_OCTET);
-
- while (frame_length)
- {
- data = *frame_buffer++;
- fcs = crcCcittUpdate(fcs, data);
- if ((data == CONTROL_ESCAPE_OCTET) || (data == FRAME_BOUNDARY_OCTET))
- {
- sendChar(CONTROL_ESCAPE_OCTET);
- data ^= INVERT_OCTET;
- }
- sendChar(data);
- --frame_length;
- }
- data = low(fcs);
- if ((data == CONTROL_ESCAPE_OCTET) || (data == FRAME_BOUNDARY_OCTET))
- {
- sendChar(CONTROL_ESCAPE_OCTET);
- data ^= INVERT_OCTET;
- }
- sendChar(data);
- data = high(fcs);
- if ((data == CONTROL_ESCAPE_OCTET) || (data == FRAME_BOUNDARY_OCTET))
- {
- sendChar(CONTROL_ESCAPE_OCTET);
- data ^= INVERT_OCTET;
- }
- sendChar(data);
- sendChar(FRAME_BOUNDARY_OCTET);
-
- return true;
-}
-
-/* Function to find valid HDLC frame from incoming data */
-void AITLink::inputReceivedChar(uint8_t data)
-{
- /* FRAME FLAG */
- if (data == FRAME_BOUNDARY_OCTET)
- {
- if (this->escape_character == true)
- {
- this->escape_character = false;
- }
- /* If a valid frame is detected */
- else if ( (this->frame_position >= 2) &&
- ( this->frame_checksum == ((this->receive_frame_buffer[this->frame_position-1] << 8 ) | (this->receive_frame_buffer[this->frame_position-2] & 0xff)) ) ) // (msb << 8 ) | (lsb & 0xff)
- {
- /* Call the user defined function and pass frame to it */
- handleFrame(receive_frame_buffer, this->frame_position - 2);
- }
- this->frame_position = 0;
- this->frame_checksum = CRC16_CCITT_INIT_VAL;
- return;
- }
-
- if (this->escape_character)
- {
- this->escape_character = false;
- data ^= INVERT_OCTET;
- }
- else if (data == CONTROL_ESCAPE_OCTET)
- {
- this->escape_character = true;
- return;
- }
-
- receive_frame_buffer[this->frame_position] = data;
-
- if (this->frame_position >= 2) {
- this->frame_checksum = crcCcittUpdate(this->frame_checksum, receive_frame_buffer[this->frame_position - 2]);
- }
-
- this->frame_position++;
-
- if (this->frame_position >= this->max_frame_length)
- {
- this->frame_position = 0;
- this->frame_checksum = CRC16_CCITT_INIT_VAL;
- }
-}
-
-void AITLink::registerFrameHandler(void (*callback)(void* user_data, const uint8_t* frame_buffer, size_t frame_length), void* user_data)
-{
- handle_frame_callback = callback;
- callback_user_data = user_data;
-}
-
-void AITLink::handleFrame(const uint8_t* frame_buffer, size_t frame_length)
-{
- if (handle_frame_callback != NULL) {
- (*handle_frame_callback)(callback_user_data, frame_buffer, frame_length);
- }
-
-}
-
-uint16_t AITLink::crcCcittUpdate(uint16_t crc, uint8_t data)
-{
- data ^= low(crc);
- data ^= data << 4;
-
- return (
- ( ((uint16_t)data << 8) | high(crc) ) ^ ((uint8_t)data >> 4) ^ ((uint16_t)data << 3)
- );
-}
+//
+// HDLC based serial communication class.
+//
+// Adapted by Benjamin Hepp from ArduHDLC library (see LICENSE.txt)
+// Original work Copyright (c) 2015 Jarkko Hautakorpi et al.
+// Modified work Copyright (c) 2016 Benjamin Hepp.
+
+#include "ait_link/ait_link.h"
+
+using namespace ait;
+
+/* 16bit low and high bytes copier */
+#define low(x) ((x) & 0xFF)
+#define high(x) (((x)>>8) & 0xFF)
+
+AITLink::AITLink(size_t max_frame_length)
+{
+ frame_checksum = CRC16_CCITT_INIT_VAL;
+ escape_character = false;
+ frame_position = 0;
+ this->max_frame_length = max_frame_length;
+ receive_frame_buffer = new uint8_t[max_frame_length+1]; // char* ab = (char*)malloc(12);
+ handle_frame_callback = NULL;
+ callback_user_data = NULL;
+}
+
+AITLink::~AITLink()
+{
+ delete[] receive_frame_buffer;
+}
+
+/* Wrap given data in HDLC frame and send it out byte at a time*/
+bool AITLink::sendFrame(const uint8_t* frame_buffer, size_t frame_length)
+{
+ if (frame_length > max_frame_length) {
+ return false;
+ }
+
+ uint8_t data;
+ uint16_t fcs = CRC16_CCITT_INIT_VAL;
+
+ sendChar(FRAME_BOUNDARY_OCTET);
+
+ while (frame_length)
+ {
+ data = *frame_buffer++;
+ fcs = crcCcittUpdate(fcs, data);
+ if ((data == CONTROL_ESCAPE_OCTET) || (data == FRAME_BOUNDARY_OCTET))
+ {
+ sendChar(CONTROL_ESCAPE_OCTET);
+ data ^= INVERT_OCTET;
+ }
+ sendChar(data);
+ --frame_length;
+ }
+ data = low(fcs);
+ if ((data == CONTROL_ESCAPE_OCTET) || (data == FRAME_BOUNDARY_OCTET))
+ {
+ sendChar(CONTROL_ESCAPE_OCTET);
+ data ^= INVERT_OCTET;
+ }
+ sendChar(data);
+ data = high(fcs);
+ if ((data == CONTROL_ESCAPE_OCTET) || (data == FRAME_BOUNDARY_OCTET))
+ {
+ sendChar(CONTROL_ESCAPE_OCTET);
+ data ^= INVERT_OCTET;
+ }
+ sendChar(data);
+ sendChar(FRAME_BOUNDARY_OCTET);
+ return true;
+}
+
+/* Function to find valid HDLC frame from incoming data */
+void AITLink::inputReceivedChar(uint8_t data)
+{
+ /* FRAME FLAG */
+ if (data == FRAME_BOUNDARY_OCTET)
+ {
+ if (this->escape_character == true)
+ {
+ this->escape_character = false;
+ }
+ /* If a valid frame is detected */
+ else if ( (this->frame_position >= 2) &&
+ ( this->frame_checksum == ((this->receive_frame_buffer[this->frame_position-1] << 8 ) | (this->receive_frame_buffer[this->frame_position-2] & 0xff)) ) ) // (msb << 8 ) | (lsb & 0xff)
+ {
+ /* Call the user defined function and pass frame to it */
+ handleFrame(receive_frame_buffer, this->frame_position - 2);
+ }
+ this->frame_position = 0;
+ this->frame_checksum = CRC16_CCITT_INIT_VAL;
+ return;
+ }
+
+ if (this->escape_character)
+ {
+ this->escape_character = false;
+ data ^= INVERT_OCTET;
+ }
+ else if (data == CONTROL_ESCAPE_OCTET)
+ {
+ this->escape_character = true;
+ return;
+ }
+
+ receive_frame_buffer[this->frame_position] = data;
+
+ if (this->frame_position >= 2) {
+ this->frame_checksum = crcCcittUpdate(this->frame_checksum, receive_frame_buffer[this->frame_position - 2]);
+ }
+
+ this->frame_position++;
+
+ if (this->frame_position >= this->max_frame_length)
+ {
+ this->frame_position = 0;
+ this->frame_checksum = CRC16_CCITT_INIT_VAL;
+ }
+}
+
+void AITLink::registerFrameHandler(void (*callback)(void* user_data, const uint8_t* frame_buffer, size_t frame_length), void* user_data)
+{
+ handle_frame_callback = callback;
+ callback_user_data = user_data;
+}
+
+void AITLink::handleFrame(const uint8_t* frame_buffer, size_t frame_length)
+{
+ if (handle_frame_callback != NULL) {
+ (*handle_frame_callback)(callback_user_data, frame_buffer, frame_length);
+ }
+
+}
+
+uint16_t AITLink::crcCcittUpdate(uint16_t crc, uint8_t data)
+{
+ data ^= low(crc);
+ data ^= data << 4;
+
+ return (
+ ( ((uint16_t)data << 8) | high(crc) ) ^ ((uint8_t)data >> 4) ^ ((uint16_t)data << 3)
+ );
+}
--- a/ait_link.h Wed Apr 06 08:11:43 2016 +0000
+++ b/ait_link.h Wed Apr 06 08:27:25 2016 +0000
@@ -1,75 +1,62 @@
-// Adapted by Benjamin Hepp from ArduHDLC library
-
-/*
-Arduhdlc is Arduino HDLC library, which can be used over any interface.
-Copyright (C) 2015 Jarkko Hautakorpi et al. see LICENSE.txt
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-
-
-#pragma once
-
-#include <stdint.h>
-#include <stdbool.h>
-#include <stddef.h>
-
-namespace ait {
-
- class AITLink {
- public:
- /* HDLC Asynchronous framing */
- /* The frame boundary octet is 01111110, (7E in hexadecimal notation) */
- const static uint8_t FRAME_BOUNDARY_OCTET = 0x7E;
-
- /* A "control escape octet", has the bit sequence '01111101', (7D hexadecimal) */
- const static uint8_t CONTROL_ESCAPE_OCTET = 0x7D;
-
- /* If either of these two octets appears in the transmitted data, an escape octet is sent, */
- /* followed by the original data octet with bit 5 inverted */
- const static uint8_t INVERT_OCTET = 0x20;
-
- /* The frame check sequence (FCS) is a 16-bit CRC-CCITT */
- /* AVR Libc CRC function is _crc_ccitt_update() */
- /* Corresponding CRC function in Qt (www.qt.io) is qChecksum() */
- const static uint16_t CRC16_CCITT_INIT_VAL = 0xFFFF;
-
- AITLink(size_t max_frame_length = 1024);
- virtual ~AITLink();
-
- bool sendFrame(const uint8_t* frame_buffer, size_t frame_length);
- void inputReceivedChar(uint8_t data);
-
- /* User must define a function, that will process the valid received frame */
- /* This function can act like a command router/dispatcher */
- void registerFrameHandler(void (*callback)(void* user_data, const uint8_t* frame_buffer, size_t frame_length), void* user_data);
-
- protected:
- virtual void handleFrame(const uint8_t* frame_buffer, size_t frame_length);
- /* User must define a function to send a byte throug USART, I2C, SPI etc.*/
- virtual void sendChar(uint8_t data) = 0;
-
- private:
- uint16_t crcCcittUpdate(uint16_t crc, uint8_t data);
-
- bool escape_character;
- size_t frame_position;
- // 16bit CRC sum for crcCcittUpdate
- uint16_t frame_checksum;
- size_t max_frame_length;
- uint8_t* receive_frame_buffer;
- void (*handle_frame_callback)(void* user_data, const uint8_t* frame_buffer, size_t frame_length);
- void* callback_user_data;
- };
-
-}
+//
+// HDLC based serial communication class.
+//
+// Adapted by Benjamin Hepp from ArduHDLC library (see LICENSE.txt)
+// Original work Copyright (c) 2015 Jarkko Hautakorpi et al.
+// Modified work Copyright (c) 2016 Benjamin Hepp.
+
+#pragma once
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <stddef.h>
+
+namespace ait {
+
+ class AITLink {
+ public:
+ /* HDLC Asynchronous framing */
+ /* The frame boundary octet is 01111110, (7E in hexadecimal notation) */
+ const static uint8_t FRAME_BOUNDARY_OCTET = 0x7E;
+
+ /* A "control escape octet", has the bit sequence '01111101', (7D hexadecimal) */
+ const static uint8_t CONTROL_ESCAPE_OCTET = 0x7D;
+
+ /* If either of these two octets appears in the transmitted data, an escape octet is sent, */
+ /* followed by the original data octet with bit 5 inverted */
+ const static uint8_t INVERT_OCTET = 0x20;
+ /* The frame check sequence (FCS) is a 16-bit CRC-CCITT */
+ /* AVR Libc CRC function is _crc_ccitt_update() */
+ /* Corresponding CRC function in Qt (www.qt.io) is qChecksum() */
+ const static uint16_t CRC16_CCITT_INIT_VAL = 0xFFFF;
+
+ AITLink(size_t max_frame_length = 1024);
+ virtual ~AITLink();
+
+ bool sendFrame(const uint8_t* frame_buffer, size_t frame_length);
+ void inputReceivedChar(uint8_t data);
+
+ /* User must define a function, that will process the valid received frame */
+ /* This function can act like a command router/dispatcher */
+ void registerFrameHandler(void (*callback)(void* user_data, const uint8_t* frame_buffer, size_t frame_length), void* user_data);
+
+ protected:
+ virtual void handleFrame(const uint8_t* frame_buffer, size_t frame_length);
+ /* User must define a function to send a byte throug USART, I2C, SPI etc.*/
+ virtual void sendChar(uint8_t data) = 0;
+
+ private:
+ uint16_t crcCcittUpdate(uint16_t crc, uint8_t data);
+
+ bool escape_character;
+ size_t frame_position;
+ // 16bit CRC sum for crcCcittUpdate
+ uint16_t frame_checksum;
+ size_t max_frame_length;
+ uint8_t* receive_frame_buffer;
+ void (*handle_frame_callback)(void* user_data, const uint8_t* frame_buffer, size_t frame_length);
+ void* callback_user_data;
+ };
+
+}
--- a/ait_link_impl.h Wed Apr 06 08:11:43 2016 +0000 +++ b/ait_link_impl.h Wed Apr 06 08:27:25 2016 +0000 @@ -1,3 +1,10 @@ +// +// HDLC based serial communication class. +// +// Created by Benjamin Hepp on 02.04.16. +// Copyright (c) 2016 Benjamin Hepp. All rights reserved. +// + #pragma once #include "ait_link.h"
--- a/ait_link_mbed.h Wed Apr 06 08:11:43 2016 +0000 +++ b/ait_link_mbed.h Wed Apr 06 08:27:25 2016 +0000 @@ -1,3 +1,10 @@ +// +// HDLC based serial communication class. +// +// Created by Benjamin Hepp on 02.04.16. +// Copyright (c) 2016 Benjamin Hepp. All rights reserved. +// + #pragma once #include <BufferedSerial/BufferedSerial.h>
--- a/uwb_link/uwb_link.h Wed Apr 06 08:11:43 2016 +0000
+++ b/uwb_link/uwb_link.h Wed Apr 06 08:27:25 2016 +0000
@@ -1,3 +1,10 @@
+//
+// Simple message protocol for UWB.
+//
+// Created by Benjamin Hepp on 02.04.16.
+// Copyright (c) 2016 Benjamin Hepp. All rights reserved.
+//
+
#pragma once
#include <string.h>
@@ -194,24 +201,24 @@
}
uint8_t getType() const {
- return type_;
+ return type_;
}
const UWBMessageBody* getMessageBody() const {
- return body_;
+ return body_;
}
void setMessageBody(const UWBMessageBody* body) {
- clearMessageBody();
- body_ = body;
+ clearMessageBody();
+ body_ = body;
}
int getSize() const {
- int size = sizeof(type_);
- if (body_ != NULL) {
- size += body_->getSize();
- }
- return size;
+ int size = sizeof(type_);
+ if (body_ != NULL) {
+ size += body_->getSize();
+ }
+ return size;
}
void buildMessage(uint8_t* buffer) const {
@@ -338,4 +345,3 @@
};
}
-
--- a/uwb_link/uwb_link_impl.h Wed Apr 06 08:11:43 2016 +0000 +++ b/uwb_link/uwb_link_impl.h Wed Apr 06 08:27:25 2016 +0000 @@ -1,3 +1,10 @@ +// +// Simple message protocol for UWB. +// +// Created by Benjamin Hepp on 02.04.16. +// Copyright (c) 2016 Benjamin Hepp. All rights reserved. +// + #pragma once #include <ait_link/ait_link_impl.h>
--- a/uwb_link/uwb_link_mbed.h Wed Apr 06 08:11:43 2016 +0000 +++ b/uwb_link/uwb_link_mbed.h Wed Apr 06 08:27:25 2016 +0000 @@ -1,3 +1,10 @@ +// +// Simple message protocol for UWB. +// +// Created by Benjamin Hepp on 02.04.16. +// Copyright (c) 2016 Benjamin Hepp. All rights reserved. +// + #pragma once #include <ait_link/ait_link_mbed.h>