You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
773 B
C++
42 lines
773 B
C++
4 weeks ago
|
/*
|
||
|
* WeinbusBuffer.cpp
|
||
|
*
|
||
|
* Author: Aleksey Gerasimenko
|
||
|
* gerasimenko.aleksey.n@gmail.com
|
||
|
*/
|
||
|
|
||
|
#include "WEINBUS/WeinbusBuffer.h"
|
||
|
|
||
|
namespace WEINBUS
|
||
|
{
|
||
|
//CONSTRUCTOR
|
||
|
WeinbusBuffer::WeinbusBuffer():
|
||
|
m_type(WEINBUS::OUTPUTCOILS),
|
||
|
m_length (0),
|
||
|
m_start_addr(0),
|
||
|
m_end_addr(0),
|
||
|
m_addr(0),
|
||
|
m_counter(0),
|
||
|
m_quantity(0),
|
||
|
m_size(0)
|
||
|
//
|
||
|
{}//CONSTRUCTOR
|
||
|
//
|
||
|
|
||
|
void WeinbusBuffer::set(WEINBUS::buffer_type_t type, uint16_t startAddr)
|
||
|
{
|
||
|
m_type = type;
|
||
|
m_start_addr = startAddr;
|
||
|
m_end_addr = startAddr;
|
||
|
//
|
||
|
}//
|
||
|
//
|
||
|
bool WeinbusBuffer::address_range(uint16_t address)
|
||
|
{
|
||
|
|
||
|
return ((address >= m_start_addr)&&(address <= m_end_addr) ? true : false);
|
||
|
//
|
||
|
}//
|
||
|
//
|
||
|
} /* namespace WEINBUS */
|