esp32-car/include/transmit.h

19 lines
537 B
C
Raw Normal View History

2024-12-27 09:47:56 +08:00
#ifndef TRANSMIT_H
#define TRANSMIT_H
#include <Arduino.h>
#include <BLEDevice.h>
#include <BLECharacteristic.h>
#include "handlers.h"
#define PACKET_R_HEAD 0x00
#define PACKET_R_TAIL 0xFF
#define PACKET_T_HEAD 0x01
#define PACKET_T_TAIL 0xFE
#define PACKET_MAX_LENGTH 32 // 数据包最大长度
void handleSerialPacket(uint8_t *packet, int length, BLECharacteristic &characteristic);
void processSerialIncomingByte(uint8_t incomingByte, BLECharacteristic &characteristic);
void sendStatus(BLECharacteristic &characteristic);
#endif