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

Commita1f64fa

Browse files
committed
Added comments to arduino api.
1 parentf674694 commita1f64fa

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

‎src/FirebaseArduino.h‎

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,96 @@
2424
#defineFIREBASE_JSONBUFFER_SIZE200
2525
#endif// FIREBASE_JSONBUFFER_SIZE
2626

27+
/**
28+
* Gateway class for Arduino clients to interact with the Firebase backend.
29+
* This implementation is designed to follow Arduino best practices and favor
30+
* simplicity over all else. For more complicated usecases and more control
31+
* see the Firebase class in Firebase.h.
32+
*/
2733
classFirebaseArduino {
2834
public:
35+
/**
36+
* Must be called first. This sets the class up for use.
37+
* \param host Your firebase db server domain name, usually X.firebaseIO.com.
38+
* \param auth Optional authentication for the db, a Secret or Token.
39+
*/
2940
voidbegin(constchar* host,constchar* auth ="");
41+
42+
/**
43+
* Adds the data in value to the list located at path. Equivilent to the
44+
* REST API's POST.
45+
* You should check success() after calling.
46+
* \param path The path inside of your db to the list you wish to update.
47+
* \param value Data that you wish to add to the list.
48+
* \return The child name where the data was written.
49+
*/
3050
Stringpush(const String& path,const JsonVariant& value);
51+
52+
/**
53+
* Writes the data in value to the node located at path Equivilent to the
54+
* REST API's PUT.
55+
* You should check success() after calling.
56+
* \param path The path inside of your db to the node you wish to update.
57+
* \param value Data that you wish to write.
58+
*/
3159
voidset(const String& path,const JsonVariant& value);
60+
61+
62+
/**
63+
* Gets the value located at path.
64+
* You should check success() after calling.
65+
* \param path The path inside of your db of the node you wish to retrieve.
66+
* \return The data located at that path. This may either be a single element
67+
* or it may be a json structure. Will only be populated if success() is true.
68+
*/
3269
FirebaseObjectget(constchar* path);
70+
71+
/**
72+
* Remove the variable, and possibly entire tree, located at path.
73+
* You should check success() after calling.
74+
* \param path The path inside of your db to the node you wish to remove,
75+
* including all of its children.
76+
*/
3377
voidremove(constchar* path);
78+
79+
/**
80+
* Starts streaming any changes made to the node located at path, including
81+
* any of its children.
82+
* You should check success() after calling.
83+
* This changes the state of this object. Once this is called you may start
84+
* monitoring available() and calling readEvent() to get new events.
85+
* \param path The path inside of your db to the node you wish to monitor.
86+
*/
3487
voidstream(constchar* path);
88+
89+
/**
90+
* Checks if there are new events available. This is only meaningful once
91+
* stream() has been called.
92+
* \return If a new event is ready.
93+
*/
3594
boolavailable();
95+
96+
/**
97+
* Reads the next event in a stream. This is only meaningful once stream() has
98+
* been called.
99+
* \return Object will have ["type"] that describes the event type, ["path"]
100+
* that describes the effected path and ["data"] that was updated.
101+
*/
36102
FirebaseObjectreadEvent();
103+
104+
/**
105+
* \return Whether the last command was successful.
106+
*/
37107
boolsuccess();
108+
109+
/**
110+
* \return Whether the last command failed.
111+
*/
38112
boolfailed();
113+
114+
/**
115+
* \return Error message from last command if failed() is true.
116+
*/
39117
const String&error();
40118
private:
41119
String host_;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp