2024-12-27 09:47:56 +08:00
|
|
|
#ifndef TRANSMIT_H
|
|
|
|
#define TRANSMIT_H
|
|
|
|
|
|
|
|
#include <Arduino.h>
|
2024-12-28 00:38:42 +08:00
|
|
|
#include "ble.h"
|
2024-12-27 09:47:56 +08:00
|
|
|
#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);
|
2024-12-28 00:38:42 +08:00
|
|
|
void sendStatus();
|
2024-12-27 09:47:56 +08:00
|
|
|
|
|
|
|
#endif
|