Fix: 修复Arduino ESP8266板卡下ESP NOW发送编译报错

This commit is contained in:
王立帮
2024-09-07 17:32:04 +08:00
parent 31cb31b2b2
commit f1d75df7b1
4 changed files with 3 additions and 3 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -16,7 +16,7 @@ export const esp_now_send = function (_, generator) {
const macName = macList.join('');
generator.definitions_['var_declare_PEER_' + macName] = 'uint8_t PEER_' + macName + '[] = {' + mac + '};\n';
generator.definitions_['function_sendMessage'] = 'bool sendMessage(uint8_t *macAddress, String _data) {\n'
+ ' bool ok = WifiEspNow.addPeer(macAddress, 0, nullptr, WIFI_IF_STA);\n'
+ ' bool ok = WifiEspNow.addPeer(macAddress);\n'
+ ' if (!ok) return false;\n'
+ ' uint16_t length = _data.length();\n'
+ ' char _msg[length];\n'