V1.1.2 Update

This commit is contained in:
Mentalflow 2023-04-22 11:23:28 +08:00
parent 578f2f3264
commit b064df5fe7
Signed by: Mentalflow
GPG Key ID: 5AE68D4401A2EE71
5 changed files with 26 additions and 21 deletions

View File

@ -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.

View File

@ -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;

View File

@ -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

View File

@ -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);

View File

@ -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>
@ -163,15 +164,11 @@ 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()); };
{
load_package(buf.data(),buf.size());
};
void load_package(uint8_t* buf, uint8_t length) 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]);
@ -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