<commit_before># Blynk server
Is Netty based Java server responsible for message forwarding between mobile application and any hardware (Arduino, Raspberry Pi for now).
Please read more precise project description [here](https://www.kickstarter.com/projects/167134865/blynk-build-an-app-for-your-arduino-project-in-5-m/description).

# Requirements
Java 8 required. (OpenJDK, Oracle)

# Protocol messages

Every message consists of 2 parts.

+ Header : Protocol command (1 byte), MessageId (2 bytes), Body message length (2 bytes);

+ Body : string (could be up to 2^15 bytes).

Scheme:

	            	BEFORE DECODE (8 bytes)
	+------------------+------------+---------+------------------------+
	|       1 byte     |  2 bytes   | 2 bytes |    Variable length     |
	+------------------+------------+---------+------------------------+
	| Protocol Command |  MessageId |  Length |  Message body (String) |
	|       0x01       |   0x000A   |  0x0003 |         "1 2"          |
	+------------------+------------+---------+------------------------+
	                                          |        3 bytes         |
    	                                      +------------------------+

So message is always "1 byte + 2 bytes + 2 bytes + messageBody.length".

### Command field
Unsigned byte.
This is 1 byte field responsible for storing [command code](https://bitbucket.org/theblynk/blynk-server/src/a3861b0e9bcb9823bbb6dd2722500c55e197bbe6/common/src/main/java/cc/blynk/common/enums/Command.java?at=master) from client, like login, ping, etc...

### Message Id field
Unsigned short.
Is 2 bytes field for defining unique message identifier. Used in order to distinguish on mobile client how to manage responses from hardware. Message ID field should be generated by client side.
Any read protocol command should always have same messageId for same widget. Let's say, you have widget graph1 that configured to read some analog pin.
After you reconfigured graph1 to read another pin, load command will still look the same and messageID will be an ID of widget to draw results on.

### Length field<commit_msg>Submenu added.<commit_after># Blynk server
Is Netty based Java server responsible for message forwarding between mobile application and any hardware (Arduino, Raspberry Pi for now).
Please read more precise project description [here](https://www.kickstarter.com/projects/167134865/blynk-build-an-app-for-your-arduino-project-in-5-m/description).

# Requirements
Java 8 required. (OpenJDK, Oracle)

# Protocol messages

Every message consists of 2 parts.

+ Header :
    + Protocol command (1 byte);
    + MessageId (2 bytes);
    + Body message length (2 bytes);

+ Body : string (could be up to 2^15 bytes).

Scheme:

	            	BEFORE DECODE (8 bytes)
	+------------------+------------+---------+------------------------+
	|       1 byte     |  2 bytes   | 2 bytes |    Variable length     |
	+------------------+------------+---------+------------------------+
	| Protocol Command |  MessageId |  Length |  Message body (String) |
	|       0x01       |   0x000A   |  0x0003 |         "1 2"          |
	+------------------+------------+---------+------------------------+
	                                          |        3 bytes         |
    	                                      +------------------------+

So message is always "1 byte + 2 bytes + 2 bytes + messageBody.length".

### Command field
Unsigned byte.
This is 1 byte field responsible for storing [command code](https://bitbucket.org/theblynk/blynk-server/src/a3861b0e9bcb9823bbb6dd2722500c55e197bbe6/common/src/main/java/cc/blynk/common/enums/Command.java?at=master) from client, like login, ping, etc...

### Message Id field
Unsigned short.
Is 2 bytes field for defining unique message identifier. Used in order to distinguish on mobile client how to manage responses from hardware. Message ID field should be generated by client side.
Any read protocol command should always have same messageId for same widget. Let's say, you have widget graph1 that configured to read some analog pin.
After you reconfigured graph1 to read another pin, load command will still look the same and messageID will be an ID of widget to draw results on.

### Length field
{'fraction_non_alphanumeric': 0.17473435655253838, 'fraction_numerical': 0.032113341204250294, 'mean_word_length': 1.978902953586498, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2905593', 'n_tokens_mistral': 1172, 'n_tokens_neox': 1069, 'n_words': 428}