This is an example of BLE GATT Client, which receives broadcast data from BLE_Server_BME280 ( a GATT server) , then transfers values up to mbed Device Connector (cloud).

Please refer details about BLEClient_mbedDevConn below. https://github.com/soramame21/BLEClient_mbedDevConn

The location of required BLE GATT server, BLE_Server_BME280, is at here. https://developer.mbed.org/users/edamame22/code/BLE_Server_BME280/

Committer:
Ren Boting
Date:
Tue Sep 05 11:56:13 2017 +0900
Revision:
2:b894b3508057
Parent:
0:29983394c6b6
Update all libraries and reform main.cpp

Who changed what in which revision?

UserRevisionLine numberNew contents of line
edamame22 0:29983394c6b6 1 /* Unity Configuration
edamame22 0:29983394c6b6 2 * As of May 11th, 2016 at ThrowTheSwitch/Unity commit 837c529
edamame22 0:29983394c6b6 3 * See Also: Unity/docs/UnityConfigurationGuide.pdf
edamame22 0:29983394c6b6 4 *
edamame22 0:29983394c6b6 5 * Unity is designed to run on almost anything that is targeted by a C compiler.
edamame22 0:29983394c6b6 6 * It would be awesome if this could be done with zero configuration. While
edamame22 0:29983394c6b6 7 * there are some targets that come close to this dream, it is sadly not
edamame22 0:29983394c6b6 8 * universal. It is likely that you are going to need at least a couple of the
edamame22 0:29983394c6b6 9 * configuration options described in this document.
edamame22 0:29983394c6b6 10 *
edamame22 0:29983394c6b6 11 * All of Unity's configuration options are `#defines`. Most of these are simple
edamame22 0:29983394c6b6 12 * definitions. A couple are macros with arguments. They live inside the
edamame22 0:29983394c6b6 13 * unity_internals.h header file. We don't necessarily recommend opening that
edamame22 0:29983394c6b6 14 * file unless you really need to. That file is proof that a cross-platform
edamame22 0:29983394c6b6 15 * library is challenging to build. From a more positive perspective, it is also
edamame22 0:29983394c6b6 16 * proof that a great deal of complexity can be centralized primarily to one
edamame22 0:29983394c6b6 17 * place in order to provide a more consistent and simple experience elsewhere.
edamame22 0:29983394c6b6 18 *
edamame22 0:29983394c6b6 19 * Using These Options
edamame22 0:29983394c6b6 20 * It doesn't matter if you're using a target-specific compiler and a simulator
edamame22 0:29983394c6b6 21 * or a native compiler. In either case, you've got a couple choices for
edamame22 0:29983394c6b6 22 * configuring these options:
edamame22 0:29983394c6b6 23 *
edamame22 0:29983394c6b6 24 * 1. Because these options are specified via C defines, you can pass most of
edamame22 0:29983394c6b6 25 * these options to your compiler through command line compiler flags. Even
edamame22 0:29983394c6b6 26 * if you're using an embedded target that forces you to use their
edamame22 0:29983394c6b6 27 * overbearing IDE for all configuration, there will be a place somewhere in
edamame22 0:29983394c6b6 28 * your project to configure defines for your compiler.
edamame22 0:29983394c6b6 29 * 2. You can create a custom `unity_config.h` configuration file (present in
edamame22 0:29983394c6b6 30 * your toolchain's search paths). In this file, you will list definitions
edamame22 0:29983394c6b6 31 * and macros specific to your target. All you must do is define
edamame22 0:29983394c6b6 32 * `UNITY_INCLUDE_CONFIG_H` and Unity will rely on `unity_config.h` for any
edamame22 0:29983394c6b6 33 * further definitions it may need.
edamame22 0:29983394c6b6 34 */
edamame22 0:29983394c6b6 35
edamame22 0:29983394c6b6 36 #ifndef UNITY_CONFIG_H
edamame22 0:29983394c6b6 37 #define UNITY_CONFIG_H
edamame22 0:29983394c6b6 38
edamame22 0:29983394c6b6 39 #ifdef __cplusplus
edamame22 0:29983394c6b6 40 extern "C"
edamame22 0:29983394c6b6 41 {
edamame22 0:29983394c6b6 42 #endif
edamame22 0:29983394c6b6 43
edamame22 0:29983394c6b6 44 /* ************************* AUTOMATIC INTEGER TYPES ***************************
edamame22 0:29983394c6b6 45 * C's concept of an integer varies from target to target. The C Standard has
edamame22 0:29983394c6b6 46 * rules about the `int` matching the register size of the target
edamame22 0:29983394c6b6 47 * microprocessor. It has rules about the `int` and how its size relates to
edamame22 0:29983394c6b6 48 * other integer types. An `int` on one target might be 16 bits while on another
edamame22 0:29983394c6b6 49 * target it might be 64. There are more specific types in compilers compliant
edamame22 0:29983394c6b6 50 * with C99 or later, but that's certainly not every compiler you are likely to
edamame22 0:29983394c6b6 51 * encounter. Therefore, Unity has a number of features for helping to adjust
edamame22 0:29983394c6b6 52 * itself to match your required integer sizes. It starts off by trying to do it
edamame22 0:29983394c6b6 53 * automatically.
edamame22 0:29983394c6b6 54 **************************************************************************** */
edamame22 0:29983394c6b6 55
edamame22 0:29983394c6b6 56 /* The first thing that Unity does to guess your types is check `stdint.h`. This
edamame22 0:29983394c6b6 57 * file includes defines like `UINT_MAX` that Unity can make use of to learn a
edamame22 0:29983394c6b6 58 * lot about your system. It's possible you don't want it to do this or it's
edamame22 0:29983394c6b6 59 * possible that your system doesn't support `stdint.h`. If that's the case,
edamame22 0:29983394c6b6 60 * you're going to want to define this. That way, Unity will know to skip the
edamame22 0:29983394c6b6 61 * inclusion of this file and you won't be left with a compiler error.
edamame22 0:29983394c6b6 62 */
edamame22 0:29983394c6b6 63 /* #define UNITY_EXCLUDE_STDINT_H */
edamame22 0:29983394c6b6 64
edamame22 0:29983394c6b6 65 /* The second attempt to guess your types is to check `limits.h`. Some compilers
edamame22 0:29983394c6b6 66 * that don't support `stdint.h` could include `limits.h` instead. If you don't
edamame22 0:29983394c6b6 67 * want Unity to check this file either, define this to make it skip the
edamame22 0:29983394c6b6 68 * inclusion.
edamame22 0:29983394c6b6 69 */
edamame22 0:29983394c6b6 70 /* #define UNITY_EXCLUDE_LIMITS_H */
edamame22 0:29983394c6b6 71
edamame22 0:29983394c6b6 72 /* The third and final attempt to guess your types is to use the `sizeof()`
edamame22 0:29983394c6b6 73 * operator. Even if the first two options don't work, this one covers most
edamame22 0:29983394c6b6 74 * cases. There _is_ a rare compiler or two out there that doesn't support
edamame22 0:29983394c6b6 75 * `sizeof()` in the preprocessing stage, though. For these, you have the
edamame22 0:29983394c6b6 76 * ability to disable this feature as well.
edamame22 0:29983394c6b6 77 */
edamame22 0:29983394c6b6 78 /* #define UNITY_EXCLUDE_SIZEOF */
edamame22 0:29983394c6b6 79
edamame22 0:29983394c6b6 80
edamame22 0:29983394c6b6 81 /* ********************** MANUAL INTEGER TYPE DEFINITION ***********************
edamame22 0:29983394c6b6 82 * If you've disabled all of the automatic options above, you're going to have
edamame22 0:29983394c6b6 83 * to do the configuration yourself. There are just a handful of defines that
edamame22 0:29983394c6b6 84 * you are going to specify if you don't like the defaults.
edamame22 0:29983394c6b6 85 **************************************************************************** */
edamame22 0:29983394c6b6 86
edamame22 0:29983394c6b6 87 /* Define this to be the number of bits an `int` takes up on your system. The
edamame22 0:29983394c6b6 88 * default, if not auto-detected, is 32 bits.
edamame22 0:29983394c6b6 89 *
edamame22 0:29983394c6b6 90 * Example:
edamame22 0:29983394c6b6 91 */
edamame22 0:29983394c6b6 92 /* #define UNITY_INT_WIDTH 16 */
edamame22 0:29983394c6b6 93
edamame22 0:29983394c6b6 94 /* Define this to be the number of bits a `long` takes up on your system. The
edamame22 0:29983394c6b6 95 * default, if not autodetected, is 32 bits. This is used to figure out what
edamame22 0:29983394c6b6 96 * kind of 64-bit support your system can handle. Does it need to specify a
edamame22 0:29983394c6b6 97 * `long` or a `long long` to get a 64-bit value. On 16-bit systems, this option
edamame22 0:29983394c6b6 98 * is going to be ignored.
edamame22 0:29983394c6b6 99 *
edamame22 0:29983394c6b6 100 * Example:
edamame22 0:29983394c6b6 101 */
edamame22 0:29983394c6b6 102 /* #define UNITY_LONG_WIDTH 16 */
edamame22 0:29983394c6b6 103
edamame22 0:29983394c6b6 104 /* Define this to be the number of bits a pointer takes up on your system. The
edamame22 0:29983394c6b6 105 * default, if not autodetected, is 32-bits. If you're getting ugly compiler
edamame22 0:29983394c6b6 106 * warnings about casting from pointers, this is the one to look at.
edamame22 0:29983394c6b6 107 *
edamame22 0:29983394c6b6 108 * Example:
edamame22 0:29983394c6b6 109 */
edamame22 0:29983394c6b6 110 /* #define UNITY_POINTER_WIDTH 64 */
edamame22 0:29983394c6b6 111
edamame22 0:29983394c6b6 112 /* Unity will automatically include 64-bit support if it auto-detects it, or if
edamame22 0:29983394c6b6 113 * your `int`, `long`, or pointer widths are greater than 32-bits. Define this
edamame22 0:29983394c6b6 114 * to enable 64-bit support if none of the other options already did it for you.
edamame22 0:29983394c6b6 115 * There can be a significant size and speed impact to enabling 64-bit support
edamame22 0:29983394c6b6 116 * on small targets, so don't define it if you don't need it.
edamame22 0:29983394c6b6 117 */
edamame22 0:29983394c6b6 118 /* #define UNITY_INCLUDE_64 */
edamame22 0:29983394c6b6 119
edamame22 0:29983394c6b6 120
edamame22 0:29983394c6b6 121 /* *************************** FLOATING POINT TYPES ****************************
edamame22 0:29983394c6b6 122 * In the embedded world, it's not uncommon for targets to have no support for
edamame22 0:29983394c6b6 123 * floating point operations at all or to have support that is limited to only
edamame22 0:29983394c6b6 124 * single precision. We are able to guess integer sizes on the fly because
edamame22 0:29983394c6b6 125 * integers are always available in at least one size. Floating point, on the
edamame22 0:29983394c6b6 126 * other hand, is sometimes not available at all. Trying to include `float.h` on
edamame22 0:29983394c6b6 127 * these platforms would result in an error. This leaves manual configuration as
edamame22 0:29983394c6b6 128 * the only option.
edamame22 0:29983394c6b6 129 **************************************************************************** */
edamame22 0:29983394c6b6 130
edamame22 0:29983394c6b6 131 /* By default, Unity guesses that you will want single precision floating point
edamame22 0:29983394c6b6 132 * support, but not double precision. It's easy to change either of these using
edamame22 0:29983394c6b6 133 * the include and exclude options here. You may include neither, either, or
edamame22 0:29983394c6b6 134 * both, as suits your needs.
edamame22 0:29983394c6b6 135 */
edamame22 0:29983394c6b6 136 /* #define UNITY_INCLUDE_FLOAT */
edamame22 0:29983394c6b6 137 /* #define UNITY_EXCLUDE_FLOAT */
edamame22 0:29983394c6b6 138 /* #define UNITY_INCLUDE_DOUBLE */
edamame22 0:29983394c6b6 139 /* #define UNITY_EXCLUDE_DOUBLE */
edamame22 0:29983394c6b6 140
edamame22 0:29983394c6b6 141 /* For features that are enabled, the following floating point options also
edamame22 0:29983394c6b6 142 * become available.
edamame22 0:29983394c6b6 143 */
edamame22 0:29983394c6b6 144
edamame22 0:29983394c6b6 145 /* Unity aims for as small of a footprint as possible and avoids most standard
edamame22 0:29983394c6b6 146 * library calls (some embedded platforms don't have a standard library!).
edamame22 0:29983394c6b6 147 * Because of this, its routines for printing integer values are minimalist and
edamame22 0:29983394c6b6 148 * hand-coded. To keep Unity universal, though, we chose to _not_ develop our
edamame22 0:29983394c6b6 149 * own floating point print routines. Instead, the display of floating point
edamame22 0:29983394c6b6 150 * values during a failure are optional. By default, Unity will not print the
edamame22 0:29983394c6b6 151 * actual results of floating point assertion failure. So a failed assertion
edamame22 0:29983394c6b6 152 * will produce a message like `"Values Not Within Delta"`. If you would like
edamame22 0:29983394c6b6 153 * verbose failure messages for floating point assertions, use these options to
edamame22 0:29983394c6b6 154 * give more explicit failure messages (e.g. `"Expected 4.56 Was 4.68"`). Note
edamame22 0:29983394c6b6 155 * that this feature requires the use of `sprintf` so might not be desirable in
edamame22 0:29983394c6b6 156 * all cases.
edamame22 0:29983394c6b6 157 */
edamame22 0:29983394c6b6 158 /* #define UNITY_FLOAT_VERBOSE */
edamame22 0:29983394c6b6 159 /* #define UNITY_DOUBLE_VERBOSE */
edamame22 0:29983394c6b6 160
edamame22 0:29983394c6b6 161 /* If enabled, Unity assumes you want your `FLOAT` asserts to compare standard C
edamame22 0:29983394c6b6 162 * floats. If your compiler supports a specialty floating point type, you can
edamame22 0:29983394c6b6 163 * always override this behavior by using this definition.
edamame22 0:29983394c6b6 164 *
edamame22 0:29983394c6b6 165 * Example:
edamame22 0:29983394c6b6 166 */
edamame22 0:29983394c6b6 167 /* #define UNITY_FLOAT_TYPE float16_t */
edamame22 0:29983394c6b6 168
edamame22 0:29983394c6b6 169 /* If enabled, Unity assumes you want your `DOUBLE` asserts to compare standard
edamame22 0:29983394c6b6 170 * C doubles. If you would like to change this, you can specify something else
edamame22 0:29983394c6b6 171 * by using this option. For example, defining `UNITY_DOUBLE_TYPE` to `long
edamame22 0:29983394c6b6 172 * double` could enable gargantuan floating point types on your 64-bit processor
edamame22 0:29983394c6b6 173 * instead of the standard `double`.
edamame22 0:29983394c6b6 174 *
edamame22 0:29983394c6b6 175 * Example:
edamame22 0:29983394c6b6 176 */
edamame22 0:29983394c6b6 177 /* #define UNITY_DOUBLE_TYPE long double */
edamame22 0:29983394c6b6 178
edamame22 0:29983394c6b6 179 /* If you look up `UNITY_ASSERT_EQUAL_FLOAT` and `UNITY_ASSERT_EQUAL_DOUBLE` as
edamame22 0:29983394c6b6 180 * documented in the Unity Assertion Guide, you will learn that they are not
edamame22 0:29983394c6b6 181 * really asserting that two values are equal but rather that two values are
edamame22 0:29983394c6b6 182 * "close enough" to equal. "Close enough" is controlled by these precision
edamame22 0:29983394c6b6 183 * configuration options. If you are working with 32-bit floats and/or 64-bit
edamame22 0:29983394c6b6 184 * doubles (the normal on most processors), you should have no need to change
edamame22 0:29983394c6b6 185 * these options. They are both set to give you approximately 1 significant bit
edamame22 0:29983394c6b6 186 * in either direction. The float precision is 0.00001 while the double is
edamame22 0:29983394c6b6 187 * 10^-12. For further details on how this works, see the appendix of the Unity
edamame22 0:29983394c6b6 188 * Assertion Guide.
edamame22 0:29983394c6b6 189 *
edamame22 0:29983394c6b6 190 * Example:
edamame22 0:29983394c6b6 191 */
edamame22 0:29983394c6b6 192 /* #define UNITY_FLOAT_PRECISION 0.001f */
edamame22 0:29983394c6b6 193 /* #define UNITY_DOUBLE_PRECISION 0.001f */
edamame22 0:29983394c6b6 194
edamame22 0:29983394c6b6 195
edamame22 0:29983394c6b6 196 /* *************************** TOOLSET CUSTOMIZATION ***************************
edamame22 0:29983394c6b6 197 * In addition to the options listed above, there are a number of other options
edamame22 0:29983394c6b6 198 * which will come in handy to customize Unity's behavior for your specific
edamame22 0:29983394c6b6 199 * toolchain. It is possible that you may not need to touch any of these but
edamame22 0:29983394c6b6 200 * certain platforms, particularly those running in simulators, may need to jump
edamame22 0:29983394c6b6 201 * through extra hoops to operate properly. These macros will help in those
edamame22 0:29983394c6b6 202 * situations.
edamame22 0:29983394c6b6 203 **************************************************************************** */
edamame22 0:29983394c6b6 204
edamame22 0:29983394c6b6 205 /* By default, Unity prints its results to `stdout` as it runs. This works
edamame22 0:29983394c6b6 206 * perfectly fine in most situations where you are using a native compiler for
edamame22 0:29983394c6b6 207 * testing. It works on some simulators as well so long as they have `stdout`
edamame22 0:29983394c6b6 208 * routed back to the command line. There are times, however, where the
edamame22 0:29983394c6b6 209 * simulator will lack support for dumping results or you will want to route
edamame22 0:29983394c6b6 210 * results elsewhere for other reasons. In these cases, you should define the
edamame22 0:29983394c6b6 211 * `UNITY_OUTPUT_CHAR` macro. This macro accepts a single character at a time
edamame22 0:29983394c6b6 212 * (as an `int`, since this is the parameter type of the standard C `putchar`
edamame22 0:29983394c6b6 213 * function most commonly used). You may replace this with whatever function
edamame22 0:29983394c6b6 214 * call you like.
edamame22 0:29983394c6b6 215 *
edamame22 0:29983394c6b6 216 * Example:
edamame22 0:29983394c6b6 217 * Say you are forced to run your test suite on an embedded processor with no
edamame22 0:29983394c6b6 218 * `stdout` option. You decide to route your test result output to a custom
edamame22 0:29983394c6b6 219 * serial `RS232_putc()` function you wrote like thus:
edamame22 0:29983394c6b6 220 */
edamame22 0:29983394c6b6 221 /* #define UNITY_OUTPUT_CHAR(a) RS232_putc(a) */
edamame22 0:29983394c6b6 222 /* #define UNITY_OUTPUT_FLUSH() RS232_config(115200,1,8,0) */
edamame22 0:29983394c6b6 223 /* #define UNITY_OUTPUT_START() RS232_flush() */
edamame22 0:29983394c6b6 224 /* #define UNITY_OUTPUT_COMPLETE() RS232_close() */
edamame22 0:29983394c6b6 225
edamame22 0:29983394c6b6 226 /* For some targets, Unity can make the otherwise required `setUp()` and
edamame22 0:29983394c6b6 227 * `tearDown()` functions optional. This is a nice convenience for test writers
edamame22 0:29983394c6b6 228 * since `setUp` and `tearDown` don't often actually _do_ anything. If you're
edamame22 0:29983394c6b6 229 * using gcc or clang, this option is automatically defined for you. Other
edamame22 0:29983394c6b6 230 * compilers can also support this behavior, if they support a C feature called
edamame22 0:29983394c6b6 231 * weak functions. A weak function is a function that is compiled into your
edamame22 0:29983394c6b6 232 * executable _unless_ a non-weak version of the same function is defined
edamame22 0:29983394c6b6 233 * elsewhere. If a non-weak version is found, the weak version is ignored as if
edamame22 0:29983394c6b6 234 * it never existed. If your compiler supports this feature, you can let Unity
edamame22 0:29983394c6b6 235 * know by defining `UNITY_SUPPORT_WEAK` as the function attributes that would
edamame22 0:29983394c6b6 236 * need to be applied to identify a function as weak. If your compiler lacks
edamame22 0:29983394c6b6 237 * support for weak functions, you will always need to define `setUp` and
edamame22 0:29983394c6b6 238 * `tearDown` functions (though they can be and often will be just empty). The
edamame22 0:29983394c6b6 239 * most common options for this feature are:
edamame22 0:29983394c6b6 240 */
edamame22 0:29983394c6b6 241 /* #define UNITY_SUPPORT_WEAK weak */
edamame22 0:29983394c6b6 242 /* #define UNITY_SUPPORT_WEAK __attribute__((weak)) */
edamame22 0:29983394c6b6 243
edamame22 0:29983394c6b6 244 /* Some compilers require a custom attribute to be assigned to pointers, like
edamame22 0:29983394c6b6 245 * `near` or `far`. In these cases, you can give Unity a safe default for these
edamame22 0:29983394c6b6 246 * by defining this option with the attribute you would like.
edamame22 0:29983394c6b6 247 *
edamame22 0:29983394c6b6 248 * Example:
edamame22 0:29983394c6b6 249 */
edamame22 0:29983394c6b6 250 /* #define UNITY_PTR_ATTRIBUTE __attribute__((far)) */
edamame22 0:29983394c6b6 251 /* #define UNITY_PTR_ATTRIBUTE near */
edamame22 0:29983394c6b6 252
edamame22 0:29983394c6b6 253 #ifdef __cplusplus
edamame22 0:29983394c6b6 254 }
edamame22 0:29983394c6b6 255 #endif /* extern "C" */
edamame22 0:29983394c6b6 256
edamame22 0:29983394c6b6 257 #endif /* UNITY_CONFIG_H */