ESPHome  2024.11.1
Public Member Functions | Protected Member Functions | Protected Attributes
esphome::one_wire::OneWireDevice Class Reference

#include <one_wire.h>

Inheritance diagram for esphome::one_wire::OneWireDevice:
esphome::dallas_temp::DallasTemperatureSensor

Public Member Functions

void set_address (uint64_t address)
 store the address of the device More...
 
void set_one_wire_bus (OneWireBus *bus)
 store the pointer to the OneWireBus to use More...
 
const std::string & get_address_name ()
 Helper to create (and cache) the name for this sensor. For example "0xfe0000031f1eaf29". More...
 
std::string unique_id ()
 

Protected Member Functions

bool check_address_ ()
 find an address if necessary should be called from setup More...
 
bool send_command_ (uint8_t cmd)
 send command on the bus More...
 

Protected Attributes

uint64_t address_ {0}
 
OneWireBusbus_ {nullptr}
 pointer to OneWireBus instance More...
 
std::string address_name_
 

Detailed Description

Definition at line 14 of file one_wire.h.

Member Function Documentation

◆ check_address_()

bool esphome::one_wire::OneWireDevice::check_address_ ( )
protected

find an address if necessary should be called from setup

Definition at line 23 of file one_wire.cpp.

◆ get_address_name()

const std::string & esphome::one_wire::OneWireDevice::get_address_name ( )

Helper to create (and cache) the name for this sensor. For example "0xfe0000031f1eaf29".

Definition at line 8 of file one_wire.cpp.

◆ send_command_()

bool esphome::one_wire::OneWireDevice::send_command_ ( uint8_t  cmd)
protected

send command on the bus

Parameters
cmdcommand to send

Definition at line 16 of file one_wire.cpp.

◆ set_address()

void esphome::one_wire::OneWireDevice::set_address ( uint64_t  address)
inline

store the address of the device

Parameters
addressof the device

Definition at line 18 of file one_wire.h.

◆ set_one_wire_bus()

void esphome::one_wire::OneWireDevice::set_one_wire_bus ( OneWireBus bus)
inline

store the pointer to the OneWireBus to use

Parameters
buspointer to the OneWireBus object

Definition at line 22 of file one_wire.h.

◆ unique_id()

std::string esphome::one_wire::OneWireDevice::unique_id ( )

Definition at line 14 of file one_wire.cpp.

Field Documentation

◆ address_

uint64_t esphome::one_wire::OneWireDevice::address_ {0}
protected

Definition at line 30 of file one_wire.h.

◆ address_name_

std::string esphome::one_wire::OneWireDevice::address_name_
protected

Definition at line 32 of file one_wire.h.

◆ bus_

OneWireBus* esphome::one_wire::OneWireDevice::bus_ {nullptr}
protected

pointer to OneWireBus instance

Definition at line 31 of file one_wire.h.


The documentation for this class was generated from the following files: