Marco Zecchini
/
example-ttn-workshop
example for iot course
DummySensor.h@26:f07f5febf97f, 2018-06-28 (annotated)
- Committer:
- mbed_official
- Date:
- Thu Jun 28 12:45:20 2018 +0100
- Revision:
- 26:f07f5febf97f
- Parent:
- 0:7037ed05f54f
- Child:
- 46:a124538e2891
Using string to identify region rather than number
Using EU868 as the region identifier by default and hence giving away the
use of an identification number.
.
Commit copied from https://github.com/ARMmbed/mbed-os-example-lorawan
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 0:7037ed05f54f | 1 | /** |
mbed_official | 0:7037ed05f54f | 2 | * Copyright (c) 2017, Arm Limited and affiliates. |
mbed_official | 0:7037ed05f54f | 3 | * SPDX-License-Identifier: Apache-2.0 |
mbed_official | 0:7037ed05f54f | 4 | * |
mbed_official | 0:7037ed05f54f | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
mbed_official | 0:7037ed05f54f | 6 | * you may not use this file except in compliance with the License. |
mbed_official | 0:7037ed05f54f | 7 | * You may obtain a copy of the License at |
mbed_official | 0:7037ed05f54f | 8 | * |
mbed_official | 0:7037ed05f54f | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
mbed_official | 0:7037ed05f54f | 10 | * |
mbed_official | 0:7037ed05f54f | 11 | * Unless required by applicable law or agreed to in writing, software |
mbed_official | 0:7037ed05f54f | 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
mbed_official | 0:7037ed05f54f | 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
mbed_official | 0:7037ed05f54f | 14 | * See the License for the specific language governing permissions and |
mbed_official | 0:7037ed05f54f | 15 | * limitations under the License. |
mbed_official | 0:7037ed05f54f | 16 | */ |
mbed_official | 0:7037ed05f54f | 17 | |
mbed_official | 0:7037ed05f54f | 18 | #ifndef MBED_LORAWAN_DUMMYSENSOR_H_ |
mbed_official | 0:7037ed05f54f | 19 | #define MBED_LORAWAN_DUMMYSENSOR_H_ |
mbed_official | 0:7037ed05f54f | 20 | |
mbed_official | 0:7037ed05f54f | 21 | /* |
mbed_official | 0:7037ed05f54f | 22 | * A dummy sensor for Mbed LoRa Test Application |
mbed_official | 0:7037ed05f54f | 23 | */ |
mbed_official | 0:7037ed05f54f | 24 | class DS1820 |
mbed_official | 0:7037ed05f54f | 25 | { |
mbed_official | 0:7037ed05f54f | 26 | public: |
mbed_official | 26:f07f5febf97f | 27 | DS1820(uint32_t) { value = 1.0f; }; |
mbed_official | 0:7037ed05f54f | 28 | bool begin() { return true; }; |
mbed_official | 0:7037ed05f54f | 29 | void startConversion() {}; |
mbed_official | 0:7037ed05f54f | 30 | float read() { |
mbed_official | 26:f07f5febf97f | 31 | value += 1.1f; |
mbed_official | 0:7037ed05f54f | 32 | return value; |
mbed_official | 0:7037ed05f54f | 33 | } |
mbed_official | 0:7037ed05f54f | 34 | |
mbed_official | 0:7037ed05f54f | 35 | private: |
mbed_official | 0:7037ed05f54f | 36 | float value; |
mbed_official | 0:7037ed05f54f | 37 | }; |
mbed_official | 0:7037ed05f54f | 38 | |
mbed_official | 0:7037ed05f54f | 39 | |
mbed_official | 0:7037ed05f54f | 40 | |
mbed_official | 0:7037ed05f54f | 41 | #endif /* MBED_LORAWAN_DUMMYSENSOR_H_ */ |