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

Commitf42d1cf

Browse files
authored
Update serial_protocol.md
Added errors for BEGIN_MSG.
1 parentd3bd07d commitf42d1cf

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

‎serial_protocol.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,17 @@ Called to start communicating with Firebase Cloud Messaging, it requires a serve
202202
BEGIN_MSG %Server_Key% %Argument% %Argument% ...
203203
###Response
204204
+OK - Accepted initialization parameters
205+
-ERROR_MISSING_SERVER_KEY
206+
-ERROR_PARSING_ARGUMENTS
205207
###Examples
206208
>> BEGIN_MSG AIzaSyCk4GtbBa-XMQbc5TyT5oe1KnH71M-2lAZ
207209
<< +OK
208210
>> BEGIN_MSG AIzaSyCk4GtbBa-XMQbc5TyT5oe1KnH71M-2lAZ topic=iot_updates high_priority=true time_to_live=3600
209211
<< +OK
212+
>> BEGIN_MSG
213+
<< +ERROR_MISSING_SERVER_KEY
214+
>> BEGIN_MSG AIzaSyCk4GtbBa-XMQbc5TyT5oe1KnH71M-2lAZ topic = iot_updates
215+
<< +ERROR_PARSING_ARGUMENTS // Can't have spaces in arguments.
210216

211217
##MSG
212218
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.
@@ -258,6 +264,7 @@ time_to_live=500
258264
+OK - Ready to specify rest of message.
259265
-ERROR_MISSING_TARGET - You didn't specify either registration_ids or topic.
260266
-ERROR_PARSING_ARGUMENTS - There was a syntax error in your arguments.
267+
-ERROR_INVALID_ARGUMENT - You specified an argument we don't support.
261268
###Examples
262269
>> MSG
263270
<< +OK // Only works if you specified a default registration_ids or topic on BEGIN_MSG.
@@ -267,6 +274,8 @@ time_to_live=500
267274
<< +OK
268275
>> MSG registration_ids=fQCLfBOGdh0...9k0, fQCLfBOGdh0...5j1 delay_while_idle=true
269276
<< +ERROR_PARSING_ARGUMENTS // There is a space in the list of registration ids.
277+
>> MSG some_random_thing=true
278+
<< +ERROR_INVALID_ARGUMENT // some_random_thing is not a valid argument.
270279

271280
##NOTIFICATION
272281
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.
@@ -286,7 +295,7 @@ Notification to display to the user, is made up of a title and a body. The title
286295
<< +OK
287296

288297
##ADD_DATA
289-
Data todelivery to client application. This is comprised of Key->Value pairs. The Key is specified on the first line and the first line ends with a count of bytes in the value. We will then read the next %Value_Byte_Count% bytes (after the line break) and interpret them as the value. If there is no value specify 0 forthe byte count.
298+
Data todeliver to client application. This is comprised of Key->Value pairs. The Key is specified on the first line and the first line ends with a count of bytes in the value. We will then read the next %Value_Byte_Count% bytes (after the line break) and interpret them as the value. If there is no value specify 0 forthe byte count.
290299
##Usage
291300
ADD_DATA %KEY% %VALUE_BYTE_COUNT%
292301
%VALUE%

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp