Nuvoton
/
NuMaker-mbed-OS-6-lorawan
NuMaker mbed OS v6.x LoRaWAN
DummySensor.h@0:a160d512fe55, 2020-09-01 (annotated)
- Committer:
- cyliang
- Date:
- Tue Sep 01 20:28:04 2020 +0800
- Revision:
- 0:a160d512fe55
Mbed OS v6.x LoRaWAN example for NuMaker platforms
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
cyliang | 0:a160d512fe55 | 1 | /** |
cyliang | 0:a160d512fe55 | 2 | * Copyright (c) 2017, Arm Limited and affiliates. |
cyliang | 0:a160d512fe55 | 3 | * SPDX-License-Identifier: Apache-2.0 |
cyliang | 0:a160d512fe55 | 4 | * |
cyliang | 0:a160d512fe55 | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
cyliang | 0:a160d512fe55 | 6 | * you may not use this file except in compliance with the License. |
cyliang | 0:a160d512fe55 | 7 | * You may obtain a copy of the License at |
cyliang | 0:a160d512fe55 | 8 | * |
cyliang | 0:a160d512fe55 | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
cyliang | 0:a160d512fe55 | 10 | * |
cyliang | 0:a160d512fe55 | 11 | * Unless required by applicable law or agreed to in writing, software |
cyliang | 0:a160d512fe55 | 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
cyliang | 0:a160d512fe55 | 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
cyliang | 0:a160d512fe55 | 14 | * See the License for the specific language governing permissions and |
cyliang | 0:a160d512fe55 | 15 | * limitations under the License. |
cyliang | 0:a160d512fe55 | 16 | */ |
cyliang | 0:a160d512fe55 | 17 | |
cyliang | 0:a160d512fe55 | 18 | #ifndef MBED_LORAWAN_DUMMYSENSOR_H_ |
cyliang | 0:a160d512fe55 | 19 | #define MBED_LORAWAN_DUMMYSENSOR_H_ |
cyliang | 0:a160d512fe55 | 20 | |
cyliang | 0:a160d512fe55 | 21 | /* |
cyliang | 0:a160d512fe55 | 22 | * A dummy sensor for Mbed LoRa Test Application |
cyliang | 0:a160d512fe55 | 23 | */ |
cyliang | 0:a160d512fe55 | 24 | class DS1820 { |
cyliang | 0:a160d512fe55 | 25 | public: |
cyliang | 0:a160d512fe55 | 26 | DS1820(uint32_t) |
cyliang | 0:a160d512fe55 | 27 | { |
cyliang | 0:a160d512fe55 | 28 | value = 1; |
cyliang | 0:a160d512fe55 | 29 | }; |
cyliang | 0:a160d512fe55 | 30 | bool begin() |
cyliang | 0:a160d512fe55 | 31 | { |
cyliang | 0:a160d512fe55 | 32 | return true; |
cyliang | 0:a160d512fe55 | 33 | }; |
cyliang | 0:a160d512fe55 | 34 | void startConversion() {}; |
cyliang | 0:a160d512fe55 | 35 | int32_t read() |
cyliang | 0:a160d512fe55 | 36 | { |
cyliang | 0:a160d512fe55 | 37 | value += 2; |
cyliang | 0:a160d512fe55 | 38 | return value; |
cyliang | 0:a160d512fe55 | 39 | } |
cyliang | 0:a160d512fe55 | 40 | |
cyliang | 0:a160d512fe55 | 41 | private: |
cyliang | 0:a160d512fe55 | 42 | int32_t value; |
cyliang | 0:a160d512fe55 | 43 | }; |
cyliang | 0:a160d512fe55 | 44 | |
cyliang | 0:a160d512fe55 | 45 | |
cyliang | 0:a160d512fe55 | 46 | |
cyliang | 0:a160d512fe55 | 47 | #endif /* MBED_LORAWAN_DUMMYSENSOR_H_ */ |