LightHub 4.6.0
Open-source smart home controller firmware
Loading...
Searching...
No Matches
owTerm.cpp File Reference
#include "owTerm.h"
#include <Arduino.h>
#include "utils.h"
#include "options.h"
#include "main.h"
#include "aJSON.h"

Functions

void owSearch ()
 Triggers a 1-Wire device search/update.
bool zero (const uint8_t *addr, uint8_t len)
char * getReadableNote (aJsonObject *owObj)
void processTemp (aJsonObject *owObj, float currentTemp)
int owUpdate ()
 Scans the 1-Wire bus and logs the devices it finds.
int owSetup ()
 Initializes the 1-Wire bus and the temperature sensors, and applies the configured resolution.
int sensors_loop (void)
void owLoop ()
 Periodic poll: reads each configured sensor and publishes its temperature to the item's /val subtopic.
void setupOwIdle (void(*ptr)())
 Registers an idle callback invoked between 1-Wire operations.

Variables

aJsonObject * owArr
aJsonObject * dev2Check = NULL
OneWire * oneWire = NULL
 1-Wire bus handle (DS2482 bridge or software pin driver).
DallasTemperature * sensors = NULL
 DallasTemperature manager on top of the 1-Wire bus.
unsigned long owTimer = 0

Function Documentation

◆ getReadableNote()

char * getReadableNote ( aJsonObject * owObj)

◆ owLoop()

void owLoop ( )

Periodic poll: reads each configured sensor and publishes its temperature to the item's /val subtopic.

◆ owSearch()

void owSearch ( )

Triggers a 1-Wire device search/update.

◆ owSetup()

int owSetup ( )

Initializes the 1-Wire bus and the temperature sensors, and applies the configured resolution.

Returns
true on success.

◆ owUpdate()

int owUpdate ( )

Scans the 1-Wire bus and logs the devices it finds.

Returns
true on success.

◆ processTemp()

void processTemp ( aJsonObject * owObj,
float currentTemp )

◆ sensors_loop()

int sensors_loop ( void )

owUpdate(); //every check circle - scan for new devices

◆ setupOwIdle()

void setupOwIdle ( void(* ptr )())

Registers an idle callback invoked between 1-Wire operations.

Parameters
ptrFunction to call while the bus is idle.

◆ zero()

bool zero ( const uint8_t * addr,
uint8_t len )

Variable Documentation

◆ dev2Check

aJsonObject* dev2Check = NULL

◆ oneWire

OneWire* oneWire = NULL

1-Wire bus handle (DS2482 bridge or software pin driver).

◆ owArr

aJsonObject* owArr
extern

◆ owTimer

unsigned long owTimer = 0

◆ sensors

DallasTemperature* sensors = NULL

DallasTemperature manager on top of the 1-Wire bus.