Commit bb2b8adc authored by captainwong's avatar captainwong

add version

parent 8bf24ba2
...@@ -32,3 +32,8 @@ ...@@ -32,3 +32,8 @@
## 测试及演示工具,已编译的dll等请点击 [releases](https://github.com/captainwong/ademco_hb/releases)下载 ## 测试及演示工具,已编译的dll等请点击 [releases](https://github.com/captainwong/ademco_hb/releases)下载
## ChangeLog
|版本|发布日期|更新内容|
|----|-------|-------|
|v0.1|2021-8-10 00:29:12|启用版本号|
...@@ -2135,7 +2135,7 @@ struct WirelessAddress { ...@@ -2135,7 +2135,7 @@ struct WirelessAddress {
bool operator==(const WirelessAddress& rhs) const { return hi == rhs.hi && lo == rhs.lo; } bool operator==(const WirelessAddress& rhs) const { return hi == rhs.hi && lo == rhs.lo; }
bool operator==(uint16_t addr) const { return toUInt16() == addr; } bool operator==(uint16_t addr) const { return toUInt16() == addr; }
void fromUInt16(uint16_t addr){ hi = static_cast<Char>((addr >> 8) & 0xFF); lo = static_cast<Char>(addr & 0xFF); } void fromUInt16(uint16_t addr){ hi = static_cast<Char>((addr >> 8) & 0xFF); lo = static_cast<Char>(addr & 0xFF); }
uint16_t toUInt16() const { return static_cast<Char>(((hi << 8) | lo) & mask); } uint16_t toUInt16() const { return static_cast<uint16_t>(((hi << 8) | lo) & mask); }
bool valid() const { return toUInt16() != mask; } bool valid() const { return toUInt16() != mask; }
void reset() { hi = lo = 0xFF; } void reset() { hi = lo = 0xFF; }
...@@ -2143,6 +2143,13 @@ struct WirelessAddress { ...@@ -2143,6 +2143,13 @@ struct WirelessAddress {
WirelessAddress addr = static_cast<uint16_t>(rand() % mask); WirelessAddress addr = static_cast<uint16_t>(rand() % mask);
return addr; return addr;
} }
static WirelessAddress fromToChar(Char hi, Char lo) {
WirelessAddress addr;
addr.hi = hi;
addr.lo = lo;
return addr;
}
}; };
...@@ -2355,7 +2362,7 @@ struct WriteToMachineRequest { ...@@ -2355,7 +2362,7 @@ struct WriteToMachineRequest {
}; };
//! 从 EB B1 。。。命令[5]提取的事件码 //! 从 EB B1 。。。命令[5]提取的事件码
ademco::ADEMCO_EVENT ademcoEventFromCode(Char code) { inline ademco::ADEMCO_EVENT ademcoEventFromCode(Char code) {
switch (code) { switch (code) {
case MachineStatus::Arm: return ademco::ADEMCO_EVENT::EVENT_ARM; case MachineStatus::Arm: return ademco::ADEMCO_EVENT::EVENT_ARM;
case MachineStatus::Disarm: return ademco::ADEMCO_EVENT::EVENT_DISARM; case MachineStatus::Disarm: return ademco::ADEMCO_EVENT::EVENT_DISARM;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment