2
Detector.cpp:アクセス
#include "Detector.h"
void detectorSniffer(uint8_t *buf, uint16_t len) {
if(buf[12] == 0xA0 || buf[12] == 0xC0) {
c++; //Failing to read C long in the detector class
}
};
void Detector::start() {
Serial.print("start");
}
Detector.h
#include <ESP8266WiFi.h>
#include "Mac.h"
class Detector {
public:
void start();
unsigned long c = 0; // Variable
};
私はdetectorSniffer()
からDetector
クラスにunsigned long型の変数にアクセスしようとしています関数。私はDetector d
とd.c
を試しました。私は間違って何をしていますか?
のインスタンスへの参照を渡すかdetectorSnifferを検出クラスのメンバメソッドを作る – Sil
厥なぜか*または* ... –
おっと、私はあなたの答えを誤解しました。申し訳ありません:P – Sil