V1.1.2 Update
This commit is contained in:
parent
578f2f3264
commit
b064df5fe7
|
@ -19,6 +19,10 @@ This library is now complete, the remaining work is mainly maintenance and bug f
|
||||||
|
|
||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
**V1.1.2 2023.4.22**
|
||||||
|
|
||||||
|
+ Modify header files to avoid compilation conflicts, add warnings for certain boards that do not support STL.(If your board are Arduino AVR architecture(like Arduino Uno), you have to comment 'const std::nothrow_t std::nothrow = { };' in 'ArduinoSTL/src/new_handler.cpp')
|
||||||
|
|
||||||
**V1.1.1 2023.3.18**
|
**V1.1.1 2023.3.18**
|
||||||
|
|
||||||
+ Fix the bug of incomplete copy.
|
+ Fix the bug of incomplete copy.
|
||||||
|
|
|
@ -40,7 +40,7 @@ void setup() {
|
||||||
Serial.println(temp);
|
Serial.println(temp);
|
||||||
dlln33.set_addr(0xFFFF); //test error report
|
dlln33.set_addr(0xFFFF); //test error report
|
||||||
//dlln33.get_link_quality(YOUR_ANOTHER_CHIP_ADDR); //test link quility
|
//dlln33.get_link_quality(YOUR_ANOTHER_CHIP_ADDR); //test link quility
|
||||||
dlln33.pin_control(DLLN3X::PIN::PIN4, DLLN3X::PIN_CONTROL::HIGH); //test pin, PIN4 is TTx, PIN5 is TRx
|
dlln33.pin_control(DLLN3X::PIN::DLLN3X_PIN4, DLLN3X::PIN_CONTROL::OUT_HIGH); //test pin, PIN4 is TTx, PIN5 is TRx
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t interval = 5000, pre_milli = 0;
|
uint64_t interval = 5000, pre_milli = 0;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
name= DLLN3X ZigBee Mesh Module Library
|
name= DLLN3X ZigBee Mesh Module Library
|
||||||
version= 1.1.1
|
version= 1.1.2
|
||||||
author= Dylan Liu <mentalflow@ourdocs.cn>
|
author= Dylan Liu <mentalflow@ourdocs.cn>
|
||||||
maintainer= Dylan Liu <mentalflow@ourdocs.cn>
|
maintainer= Dylan Liu <mentalflow@ourdocs.cn>
|
||||||
sentence= This library allows you to use DLLN3X ZigBee mesh module very easily.
|
sentence= This library allows you to use DLLN3X ZigBee mesh module very easily.
|
||||||
paragraph= This library currently allows basic send and receive operations, config read/modify, link quility test, pin control and more.
|
paragraph= This library currently allows basic send and receive operations, config read/modify, link quility test, pin control and more.
|
||||||
category= Communication
|
category= Communication
|
||||||
architectures= *
|
architectures= *
|
||||||
includes= DLLN3X.h zigbeeframe.h
|
includes= DLLN3X.h,zigbeeframe.h
|
||||||
license= MIT
|
license= MIT
|
||||||
url= https://github.com/mentalfl0w/DLLN3X_zigbee_mesh_module_library
|
url= https://github.com/mentalfl0w/DLLN3X_zigbee_mesh_module_library
|
||||||
|
|
|
@ -29,8 +29,8 @@ public:
|
||||||
PKG_LENGTH_ERROR = 0xF9,
|
PKG_LENGTH_ERROR = 0xF9,
|
||||||
PKG_DATA_ERROR = 0xFA
|
PKG_DATA_ERROR = 0xFA
|
||||||
};
|
};
|
||||||
enum PIN_CONTROL{ HIGH = 0x11, LOW = 0x10, READ_PIN = 0x12};
|
enum PIN_CONTROL{ OUT_HIGH = 0x11, OUT_LOW = 0x10, READ_PIN = 0x12};
|
||||||
enum PIN{ PIN4 = 0x44, PIN5 = 0x45};
|
enum PIN{ DLLN3X_PIN4 = 0x44, DLLN3X_PIN5 = 0x45};
|
||||||
DLLN3X();
|
DLLN3X();
|
||||||
~DLLN3X();
|
~DLLN3X();
|
||||||
void init(HardwareSerial* DSerial);
|
void init(HardwareSerial* DSerial);
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#ifndef _ZIGBEEFRAME_H_
|
#ifndef _ZIGBEEFRAME_H_
|
||||||
#define _ZIGBEEFRAME_H_
|
#define _ZIGBEEFRAME_H_
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
#if __has_include(<vector>)
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -70,9 +71,9 @@ public:
|
||||||
uint8_t getDesPort() { return _des_port; };
|
uint8_t getDesPort() { return _des_port; };
|
||||||
uint8_t getSrcPort() { return _src_port; };
|
uint8_t getSrcPort() { return _src_port; };
|
||||||
uint16_t getRemoteAddr() { return _remote_addr; };
|
uint16_t getRemoteAddr() { return _remote_addr; };
|
||||||
uint8_t getLength(){ return _data.size() + 4;};
|
uint8_t getLength() { return _data.size() + 4; };
|
||||||
uint8_t getDataLength(){ return _data.size();};
|
uint8_t getDataLength() { return _data.size(); };
|
||||||
std::vector<uint8_t>& getData(){ return _data; };
|
std::vector<uint8_t>& getData() { return _data; };
|
||||||
void setData(uint8_t* data, uint8_t length)
|
void setData(uint8_t* data, uint8_t length)
|
||||||
{
|
{
|
||||||
_data.clear();
|
_data.clear();
|
||||||
|
@ -163,23 +164,19 @@ public:
|
||||||
make_package(_src_port, _des_port, _remote_addr, _package, _data, _packed_data);
|
make_package(_src_port, _des_port, _remote_addr, _package, _data, _packed_data);
|
||||||
return _package;
|
return _package;
|
||||||
};
|
};
|
||||||
void load_package(std::vector <uint8_t> &buf)
|
void load_package(std::vector<uint8_t>& buf) { load_package(buf.data(), buf.size()); };
|
||||||
{
|
void load_package(uint8_t* buf, uint8_t length)
|
||||||
load_package(buf.data(),buf.size());
|
|
||||||
};
|
|
||||||
void load_package(uint8_t *buf, uint8_t length)
|
|
||||||
{
|
{
|
||||||
_packed_data.clear();
|
_packed_data.clear();
|
||||||
for (uint8_t i=0;i<length;i++)
|
for (uint8_t i = 0; i < length; i++) {
|
||||||
{
|
|
||||||
_package.push_back(buf[i]);
|
_package.push_back(buf[i]);
|
||||||
if (i>5 && i<length-1)
|
if (i > 5 && i < length - 1)
|
||||||
_packed_data.push_back(buf[i]);
|
_packed_data.push_back(buf[i]);
|
||||||
}
|
}
|
||||||
_length = _package[1];
|
_length = _package[1];
|
||||||
_src_port = _package[2];
|
_src_port = _package[2];
|
||||||
_des_port = _package[3];
|
_des_port = _package[3];
|
||||||
_remote_addr = _package[4] | (_package[5]<<8);
|
_remote_addr = _package[4] | (_package[5] << 8);
|
||||||
depack(_data, _packed_data);
|
depack(_data, _packed_data);
|
||||||
};
|
};
|
||||||
void print()
|
void print()
|
||||||
|
@ -266,4 +263,8 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#error Your Board Didn't support STL, Please install "ArduinoSTL" Library.
|
||||||
|
#error If your board are Arduino AVR architecture(like Arduino Uno), you have to comment 'const std::nothrow_t std::nothrow = { };' in 'ArduinoSTL/src/new_handler.cpp'
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
Loading…
Reference in New Issue