~aleteoryx/muditaos

9fcfb9dc42d25d09a42c1c35d365beee01ec7fcf — Lukasz Skrzypczak 4 years ago 1b843b4
[BH-653] Added Linux mock

Added Linux mock
1 files changed, 48 insertions(+), 0 deletions(-)

M module-bsp/board/linux/bell_temp_sensor/bell_temp_sensor.cpp
M module-bsp/board/linux/bell_temp_sensor/bell_temp_sensor.cpp => module-bsp/board/linux/bell_temp_sensor/bell_temp_sensor.cpp +48 -0
@@ 0,0 1,48 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "bsp/bell_temp_sensor/bell_temp_sensor.hpp"
#include <log.hpp>

namespace bsp::bell_temp_sensor
{
    bool isFahrenheit = false;

    std::int32_t init(bool Fahrenheit)
    {
        isFahrenheit = Fahrenheit;

        return 0;
    }

    void deinit()
    {
        
    }

    bool standby()
    {
        return true;
    }

    bool wakeup()
    {
        return true;
    }

    Temperature readout()
    {
        float temp = 21.0;
    
        if (isFahrenheit)
            temp = (temp * 1.8) + 32.00;

        return temp;
    }

    bool isPresent()
    {
        return true;
    }

} // namespace bsp::bell_temp_sensor