参考程序VS2017编程

这篇博客介绍了如何在Visual Studio 2017环境下,使用C++进行LoRa通信协议的编程。内容包括了依赖库的引入、LoRa包结构的定义以及相关配置结构体的声明,为LoRa收发数据提供了基础框架。
摘要由CSDN通过智能技术生成

#define _CRT_SECURE_NO_WARNINGS
/* -------------------------------------------------------------------------- /
/
— DEPENDANCIES --------------------------------------------------------- */

#include
#include <winsock2.h>
#include <ws2tcpip.h>
#include<stdio.h>
using namespace std;
#pragma comment(lib,“Ws2_32.lib”)

/* -------------------------------------------------------------------------- /
/
— PRIVATE MACROS ------------------------------------------------------- */

#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long long uint64_t;
/* -------------------------------------------------------------------------- /
/
— PRIVATE CONSTANTS ---------------------------------------------------- */

#define PROTOCOL_VERSION 1

#define PKT_PUSH_DATA 0
#define PKT_PUSH_ACK 1
#define PKT_PULL_DATA 2
#define PKT_PULL_RESP 3
#define PKT_PULL_ACK 4
/-----------------------------------STRUCT-----------------------------------/
/----------------------------------------------------------------------------/
/*
@struct lgw_pkt_rx_s
@brief Structure containing the metadata of a packet that was received and a pointer to the payload
/
struct lgw_pkt_rx_s {
uint32_t freq_hz; /
!> central frequency of the IF chain /
uint8_t if_chain; /
!> by which IF chain was packet received /
uint8_t status; /
!> status of the received packet /
uint32_t count_us; /
!> internal concentrator counter for timestamping, 1 microsecond resolution /
uint8_t rf_chain; /
!> through which RF chain the packet was received /
uint8_t

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值