changes to communication
Fork of XBeeLib by
Diff: IO/IOSample802.h
- Revision:
- 3:8662ebe83570
- Parent:
- 0:fcaad0dfa051
- Child:
- 4:629712865107
diff -r 2ee1b6d51df2 -r 8662ebe83570 IO/IOSample802.h --- a/IO/IOSample802.h Thu May 14 16:21:39 2015 +0200 +++ b/IO/IOSample802.h Mon May 18 13:16:55 2015 +0200 @@ -1,6 +1,4 @@ /** - * Digi XBee library for mbed. This is the only header you have to include from your application to use the library. - * * Copyright (c) 2015 Digi International Inc., * All rights not expressly granted are reserved. * @@ -8,7 +6,8 @@ * 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. + * Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343 + * ======================================================================= */ #ifndef _IO_IOSAMPLE802_H_ @@ -25,7 +24,7 @@ * @param raw_data The IO Sample data, as returned by an "IS" command response or in the Io16Bit (0x83) or Io64Bit (0x82) frames * @param size size (in bytes) of raw_data */ - IOSample802(const uint8_t* const raw_data, size_t size); + IOSample802(const uint8_t* const raw_data = NULL, size_t size = 0); /** Class destructor */ ~IOSample802(); @@ -50,6 +49,14 @@ */ RadioStatus get_adc(XBee802::IoLine line, uint16_t* const val) const; + /** is_valid - checks if the IOSample802 object has at least one DIO or ADC sample. + * @returns true if valid, false otherwise + */ + inline bool is_valid() + { + return _channel_mask == 0; + } + protected: uint16_t _channel_mask; uint8_t _sampled_data[MAX_IO_SAMPLE_802_LEN];