mirror of
https://github.com/Dominocs/Project_Cymple.git
synced 2025-09-26 23:49:11 +08:00
update
This commit is contained in:
parent
8aecfc3a2c
commit
aeed90f8dd
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
1
eyeTracker/software/.pio/build/esp32-cam/tmp43vjp99e.tmp
Normal file
1
eyeTracker/software/.pio/build/esp32-cam/tmp43vjp99e.tmp
Normal file
File diff suppressed because one or more lines are too long
1
eyeTracker/software/.pio/build/esp32-cam/tmp4_p2ewh8.tmp
Normal file
1
eyeTracker/software/.pio/build/esp32-cam/tmp4_p2ewh8.tmp
Normal file
File diff suppressed because one or more lines are too long
1
eyeTracker/software/.pio/build/esp32-cam/tmp54urrsai.tmp
Normal file
1
eyeTracker/software/.pio/build/esp32-cam/tmp54urrsai.tmp
Normal file
File diff suppressed because one or more lines are too long
1
eyeTracker/software/.pio/build/esp32-cam/tmpv_nu3x5l.tmp
Normal file
1
eyeTracker/software/.pio/build/esp32-cam/tmpv_nu3x5l.tmp
Normal file
File diff suppressed because one or more lines are too long
@ -1,6 +1,9 @@
|
||||
#include <WiFi.h>
|
||||
#include "serialMsg.h"
|
||||
#include "wlanMsg.h"
|
||||
#include "drv/eeprom.h"
|
||||
#include "esp32cam.h"
|
||||
|
||||
#define SERIAL_TIMEOUT 200
|
||||
serialClass *pserialObj = NULL;
|
||||
#define LOG_BUFF_SIZE 256
|
||||
@ -66,7 +69,7 @@ bool serialClass::getSerialMsgHead()
|
||||
void serialClass::serialMsgCallback(uint16_t type, uint16_t len){
|
||||
switch(type){
|
||||
case SERIAL_MSG_REQ_DEVICEINFO_E:
|
||||
serial_writelog("\n\nProject cympleEye\nContributor: Dominocs\nGithub & BiliBili & Vrc: Dominocs\nEmail: 1030487127@qq.com Version:DIY_1_0_0\n");
|
||||
serial_writelog("\n\nProject cympleEye\nContributor: Dominocs\nGithub & BiliBili & Vrc: Dominocs\nEmail: 1030487127@qq.com Version:DIY_1_1_0\n");
|
||||
if(WiFi.isConnected()){
|
||||
serial_writelog("Ip address:%s\n", WiFi.localIP().toString().c_str());
|
||||
}
|
||||
@ -79,6 +82,15 @@ void serialClass::serialMsgCallback(uint16_t type, uint16_t len){
|
||||
pwlanMsgObj->connect(tmp->acSSID, tmp->acPassword);
|
||||
}
|
||||
break;
|
||||
case SERIAL_MSG_POSITION_CFG_E:
|
||||
if(len == sizeof(SERIAL_MSG_POSITION_CFG_S)){
|
||||
SERIAL_MSG_POSITION_CFG_S *pstMsg = (SERIAL_MSG_POSITION_CFG_S *)(acSerialRxBuffer + usSerialRxDataOffset);
|
||||
eepromApi::write(&pstMsg->ucPosition, OFFSET(EEPROM_DATA_S, ucFlags), sizeof(pstMsg->ucPosition));
|
||||
pCamera->ucFlags = pstMsg->ucPosition;
|
||||
}else{
|
||||
serial_writelog("Mismatch: sizeof(MSG_WLAN_PARACONFIG_S):%u, msg len:%d\n", sizeof(SERIAL_MSG_POSITION_CFG_S), len);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
serial_writelog("Unrecgnized serial msg type: %u\n", type);
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ typedef enum {
|
||||
SERIAL_MSG_REPLY_DEVICEINFO_E,
|
||||
SERIAL_MSG_WIFI_CONFIG_E,
|
||||
SERIAL_MSG_IMAGE_E = 5,
|
||||
SERIAL_MSG_POSITION_CFG_E,
|
||||
SERIAL_MSG_MAX_E
|
||||
} SERIAL_MSG_TYPE_E;
|
||||
|
||||
@ -36,6 +37,12 @@ typedef struct {
|
||||
char acPassword[64];
|
||||
} SERIAL_MSG_WIFICONFIG_S;
|
||||
|
||||
typedef struct {
|
||||
STREAM_TLV_S tlv;
|
||||
uint8_t ucPosition;
|
||||
int8_t reserved[3];
|
||||
}SERIAL_MSG_POSITION_CFG_S;
|
||||
|
||||
class serialClass{
|
||||
public:
|
||||
serialClass();
|
||||
|
@ -32,28 +32,6 @@ static void onPacketCallBack(AsyncUDPPacket packet){
|
||||
bHeartbeatTimeout = false;
|
||||
unicastAddr = packet.remoteIP();
|
||||
break;
|
||||
case MSG_POSITION_CFG_E:{
|
||||
if(msgLen == sizeof(MSG_WLAN_POSIOTN_CONFIG_S)){
|
||||
MSG_WLAN_POSIOTN_CONFIG_S *pstMsg = (MSG_WLAN_POSIOTN_CONFIG_S *)packet.data();
|
||||
eepromApi::write(&pstMsg->ucPosition, OFFSET(EEPROM_DATA_S, ucFlags), sizeof(pstMsg->ucPosition));
|
||||
pCamera->ucFlags = pstMsg->ucPosition;
|
||||
}else{
|
||||
serial_writelog("Mismatch: sizeof(MSG_WLAN_PARACONFIG_S):%u, msg len:%d\n", sizeof(MSG_WLAN_POSIOTN_CONFIG_S), msgLen);
|
||||
}
|
||||
break;
|
||||
// case MSG_REFRESH_RATE_CFT_E:
|
||||
// uint8_t flag;
|
||||
// eepromApi::read(&flag, OFFSET(EEPROM_DATA_S, ucFlags2), sizeof(flag));
|
||||
// if((flag & FLAG2_FAST_MODE) == 0){
|
||||
// flag |= FLAG2_FAST_MODE;
|
||||
// }else{
|
||||
// flag &= (~FLAG2_FAST_MODE);
|
||||
// }
|
||||
// ucFlag2 = flag;
|
||||
// eepromApi::write(&flag, OFFSET(EEPROM_DATA_S, ucFlags2), sizeof(flag));
|
||||
// serial_writelog("Switch fresh rate: flag2:%d\n", ucFlag2);
|
||||
// break;
|
||||
}
|
||||
case MSG_CONFIG_WIFI_E:{
|
||||
if(msgLen != sizeof(MSG_WLAN_WIFI_CONFIG_S)){
|
||||
serial_writelog("Sizeof MSG_WLAN_WIFI_CONFIG_S dismatch: rcv: %u, local %u\r\n", msgLen, sizeof(MSG_WLAN_WIFI_CONFIG_S));
|
||||
@ -66,6 +44,7 @@ static void onPacketCallBack(AsyncUDPPacket packet){
|
||||
pwlanMsgObj->tryConCount = 0;
|
||||
pwlanMsgObj->connect(tmp->SSID, tmp->password);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
|
@ -25,11 +25,6 @@ typedef struct {
|
||||
uint8_t aucData[0];
|
||||
}MSG_WLAN_IMAGE_S;
|
||||
|
||||
typedef struct{
|
||||
TLV_S tlv;
|
||||
uint8_t ucPosition;
|
||||
}MSG_WLAN_POSIOTN_CONFIG_S;
|
||||
|
||||
typedef struct{
|
||||
TLV_S tlv;
|
||||
char SSID[SSID_LENGTH];
|
||||
|
Loading…
Reference in New Issue
Block a user