Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit217d58f

Browse files
committed
Added comments for clarify
1 parentd805dc6 commit217d58f

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

‎Firebase.h

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,36 @@
2525
#include<WiFiClientSecure.h>
2626
#include<ESP8266HTTPClient.h>
2727

28+
//TODO(edcoyne) split these into multiple files.
29+
30+
// Result from call to Firebase backend. ALWAYS check isError() before
31+
// expecting any data.
2832
classFirebaseResult {
2933
public:
3034
FirebaseResult(int status);
3135
FirebaseResult(int status,const String& response);
3236
FirebaseResult(const FirebaseResult& result);
3337

38+
// True if there was an error completeing call.
3439
boolisError()const;
35-
boolisOk()const;
3640
StringerrorMessage()const;
41+
42+
// True if http status code is 200(OK).
43+
boolisOk()const;
44+
// Message sent back from Firebase backend.
3745
const String&response()const;
3846

3947
inthttpStatus()const {
4048
return status_;
4149
}
4250

43-
protected:
51+
private:
4452
int status_;
4553
String response_;
4654
};
4755

56+
// Low level connection to Firebase backend, you probably want the
57+
// Firebase class below.
4858
classFirebaseConnection {
4959
public:
5060
FirebaseConnection(const String& host);
@@ -72,7 +82,7 @@ class FirebaseConnection {
7282
String auth_;
7383
};
7484

75-
//Firebase istheconnection to firebase.
85+
//Primary client totheFirebase backend.
7686
classFirebase {
7787
public:
7888
Firebase(const String& host);
@@ -104,14 +114,19 @@ class FirebaseEventStream {
104114
FirebaseEventStream(const String& host);
105115
FirebaseEventStream&auth(const String& auth);
106116

117+
// Connect to backend and start receiving events.
107118
FirebaseResultconnect(const String& path);
119+
// Read next event in stream.
108120
Eventread(String& event);
109121

122+
// True if connected to backend.
110123
boolconnected();
124+
125+
// True if there is an event available.
111126
boolavailable();
127+
112128
private:
113129
FirebaseConnection connection_;
114130
};
115131

116-
117132
#endif// firebase_h

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp