XBee modules

Dependencies:   DigiLogger

Fork of XBeeLib by Digi International Inc.

Revision:
3:8662ebe83570
Parent:
0:fcaad0dfa051
--- a/IO/IOSampleZB.cpp	Thu May 14 16:21:39 2015 +0200
+++ b/IO/IOSampleZB.cpp	Mon May 18 13:16:55 2015 +0200
@@ -1,3 +1,15 @@
+/**
+ * Copyright (c) 2015 Digi International Inc.,
+ * All rights not expressly granted are reserved.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343
+ * =======================================================================
+ */
+
 #include "XBeeLib.h"
 #include "IO/IOSampleZB.h"
 
@@ -7,6 +19,11 @@
 
 IOSampleZB::IOSampleZB(const uint8_t* const raw_data, size_t size)
 {
+    if (raw_data == NULL || size == 0) {
+        _digital_mask = 0;
+        _analog_mask = 0;
+        return;
+    }
     assert(size >= IO_SAMPLE_ZB_MIN_SIZE);
     assert(size <= sizeof _sampled_data);