commit b12b424c037d81233aee5a0d247d49195639217f
parent 7f4f03070e25110381aef6a4d882c851fda59074
Author: Bharatvaj H <bharatvaj@yahoo.com>
Date: Fri, 15 Mar 2019 12:06:40 +0000
parent 7f4f03070e25110381aef6a4d882c851fda59074
Author: Bharatvaj H <bharatvaj@yahoo.com>
Date: Fri, 15 Mar 2019 12:06:40 +0000
Updated zb init
4 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/3rdparty/xbee_CMakeLists.txt b/3rdparty/xbee_CMakeLists.txt @@ -3,11 +3,13 @@ cmake_minimum_required(VERSION 3.0) project(xbee LANGUAGES C) file(GLOB_RECURSE xbee_HDRS "include/*.h") -file(GLOB_RECURSE xbee_SRCS "src/posix/*.c" "src/common/*.c" "src/wpan/*.c" "src/xbee/*.c" "src/zigbee/*.c") +file(GLOB_RECURSE xbee_SRCS "src/util/*.c" "src/posix/*.c" "src/wpan/*.c" "src/xbee/*.c" "src/zigbee/*.c") add_definitions(-DPOSIX) add_library(xbee ${xbee_HDRS} ${xbee_SRCS}) target_include_directories(xbee PRIVATE include) -install(DIRECTORY include DESTINATION include) +install(DIRECTORY include/wpan DESTINATION include) +install(DIRECTORY include/xbee DESTINATION include) +install(DIRECTORY include/zigbee DESTINATION include) install(TARGETS xbee PUBLIC_HEADER DESTINATION include ARCHIVE DESTINATION lib
diff --git a/CMakeLists.txt b/CMakeLists.txt @@ -5,6 +5,7 @@ find_package(comm) find_package(Threads) add_subdirectory(deps/xbee_ansic_library) +add_definitions(-DPOSIX) add_executable(forwarder forwarder.cpp) target_include_directories(forwarder PRIVATE ${COMM_INCLUDE_LIBS})
diff --git a/depinstall.sh b/depinstall.sh @@ -34,7 +34,7 @@ downloadAndInstallXBee() { } if [ -f /etc/arch-release ]; then - pacman -Sy base-devel bluez bluez-libs libmnl + pacman -Syu --needed base-devel bluez bluez-libs libmnl else apt install bluez bluez-tools bluez-hcidump build-essential libmnl0 libmnl-dev libbluetooth-dev fi
diff --git a/include/ZigBee.hpp b/include/ZigBee.hpp @@ -9,6 +9,10 @@ #include <sys/socket.h> #include <net/if.h> +#include "xbee/device.h" +#include "xbee/atcmd.h" +#include "xbee/wpan.h" + #include <Network.hpp> #include <model/NetworkInfo.hpp> #include <comm.h> @@ -27,6 +31,12 @@ namespace wa { } bool init() override { + xbee_serial_t XBEE_SERPORT; + xbee_dev_t my_xbee; + if (xbee_dev_init( &my_xbee, &XBEE_SERPORT, NULL, NULL)) + { + return false; + } return true; }
: bharatvaj/forwarder