Skip to content

Commit 66986cd

Browse files
committed
added support for Commands
1 parent f8b4e54 commit 66986cd

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/Notecard.cpp

+15
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,21 @@ J *Notecard::newRequest(const char *request)
205205
return NoteNewRequest(request);
206206
}
207207

208+
/**************************************************************************/
209+
/*!
210+
@brief Creates a new command object for population by the host.
211+
This function accepts a command string (for example, `"note.add"`)
212+
and initializes a JSON Object to return to the host.
213+
@param request
214+
The command name, for example, `note.add`.
215+
@return A `J` JSON Object populated with the request name.
216+
*/
217+
/**************************************************************************/
218+
J *Notecard::newCommand(const char *request)
219+
{
220+
return NoteNewCommand(request);
221+
}
222+
208223
/**************************************************************************/
209224
/*!
210225
@brief Sends a request to the Notecard.

src/Notecard.h

+1
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ class Notecard
128128
void clearDebugOutputStream(void);
129129
void i2cTest(int Adjustment);
130130
J *newRequest(const char *request);
131+
J *newCommand(const char *request);
131132
bool sendRequest(J *req);
132133
J *requestAndResponse(J *req);
133134
void deleteResponse(J *rsp);

0 commit comments

Comments
 (0)