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

Commitd3bd07d

Browse files
authored
Add argument comment to BEGIN_MSG and add usage info to MSG
1 parentae26fa4 commitd3bd07d

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

‎serial_protocol.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,14 +196,17 @@ Used to stop listening to events at a given path. This must be the same path pro
196196
#Messaging Protocol
197197

198198
##BEGIN_MSG
199-
Called to start communicating with Firebase Cloud Messaging, it requires a server key.
199+
Called to start communicating with Firebase Cloud Messaging, it requires a server key. You can also optionally supply any of the arguments listed on the MSG command to make them the defaults for this session. If you set them as defaults you don't need to specify them when calling MSG.
200+
200201
###Usage
201-
BEGIN_MSG %Server_Key%
202+
BEGIN_MSG %Server_Key% %Argument% %Argument% ...
202203
###Response
203204
+OK - Accepted initialization parameters
204205
###Examples
205206
>> BEGIN_MSG AIzaSyCk4GtbBa-XMQbc5TyT5oe1KnH71M-2lAZ
206207
<< +OK
208+
>> BEGIN_MSG AIzaSyCk4GtbBa-XMQbc5TyT5oe1KnH71M-2lAZ topic=iot_updates high_priority=true time_to_live=3600
209+
<< +OK
207210

208211
##MSG
209212
Called to start composing a message. It is followed by a list of named arguments, all of these arguments may be listed on BEGIN_MSG as well to set them as defaults for the session. Even if they are listed on BEGIN_MSG they can be overriden when calling MSG.
@@ -249,6 +252,22 @@ The message will expire after this amount of time in seconds. The default (and m
249252
#####Examples
250253
time_to_live=500
251254

255+
##Usage
256+
MSG %Argument% %Argument% ...
257+
###Response
258+
+OK - Ready to specify rest of message.
259+
-ERROR_MISSING_TARGET - You didn't specify either registration_ids or topic.
260+
-ERROR_PARSING_ARGUMENTS - There was a syntax error in your arguments.
261+
###Examples
262+
>> MSG
263+
<< +OK // Only works if you specified a default registration_ids or topic on BEGIN_MSG.
264+
>> MSG
265+
<< +ERROR_MISSING_TARGET // If you didn't specify a default registration_ids or topic on BEGIN_MSG.
266+
>> MSG registration_ids=fQCLfBOGdh0...9k0,fQCLfBOGdh0...5j1 delay_while_idle=true
267+
<< +OK
268+
>> MSG registration_ids=fQCLfBOGdh0...9k0, fQCLfBOGdh0...5j1 delay_while_idle=true
269+
<< +ERROR_PARSING_ARGUMENTS // There is a space in the list of registration ids.
270+
252271
##NOTIFICATION
253272
Notification to display to the user, is made up of a title and a body. The title is specified on the first line and the first line ends with a count of bytes in the body. We will then read the next %Body_Byte_Count% bytes (after the line break) and interpret them as the body. If there is no body specify 0 for the byte count.
254273
##Usage

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp