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.
Fork of XBeeLib by
Diff: IO/IOSample802.cpp
- Revision:
- 3:8662ebe83570
- Parent:
- 0:fcaad0dfa051
- Child:
- 4:629712865107
--- a/IO/IOSample802.cpp Thu May 14 16:21:39 2015 +0200 +++ b/IO/IOSample802.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/IOSample802.h" #include "Utils/Debug.h" @@ -10,6 +22,10 @@ IOSample802::IOSample802(const uint8_t* const raw_data, size_t size) { + if (raw_data == NULL || size == 0) { + _channel_mask = 0; + return; + } assert(size >= IO_SAMPLE_802_MIN_SIZE); assert(size <= sizeof _sampled_data);