Files
GyverLamp2/docs/Протокол/GyverLamp2_UDP.txt
2021-03-01 17:00:10 +03:00

12 lines
610 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Отправляем на адрес x.x.x.255, первые 3 октета - адрес сети, к которой подключен смартфон
Порт UDP формируется из имени сети:
GLkey = "ключ"
portNum = 17; // uint16_t (или % 65536)
for (byte i = 0; i < длина ключа; i++) portNum *= GLkey[i];
portNum %= 15000;
portNum += 50000;
portNum += номер группы
Таким образом порт лежит в диапазоне 50 001... 65 010
UDP пакет вида <GL>,<тип>,<дата1>,<дата2>... разделитель - запятая