1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/apfree-apfree_wifidog

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
apfree_wifidog_mqtt_protocol 2.4 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
Dengfeng Liu Отправлено 09.06.2017 06:38 1595732
apfree wifidog mqtt protocol is used to remotely control wifidog, including
1, set trusted domain&pdomain&mac&ip
2, delete trusted domain&pdomain&mac&ip
3, clear trusted domain&pdomain&mac&ip
4, show trusted domain&pdomain&mac&ip
5, save all above user defining rules
6, status of router
7, reboot router
8, reset trusted client(kick the online client)
9, set auth server to yours auth server
apfree wifidog will subscribe a topic : wifidog/gw_id/request/+
for example, it should only receive such topic:
wifidog/61ACC80118B6/request/10
in this topic, 10 is request id
when apfree wifidog receive such topic, it get its payload and process this request.
after finishing it, apfree wifidog publish a message to broker, which telling the result of this request.
its publish topic format is : wifidog/61ACC80118B6/response/10
apfree wifidog mqtt protocol details:
request:
1, set trusted domain&pdomain&mac&ip
{"op":"set_trusted", "type":"domain|pdomain|mac|ip","value":"param_list","time":"yyyymmddhhmmss"}
2, delete trusted domain&pdomain&mac&ip
{"op":"del_trusted","type":"domain|pdomain|mac|ip","value":"param_list","time":"yyyymmddhhmmss"}
3, clear trusted domain&pdomain&mac&ip
{"op":"clear_trusted","type":"domain|pdomain|mac|ip","time":"yyyymmddhhmmss"}
4, show trusted domain&pdomain&mac&ip
{"op":"show_trusted","type":"domain|pdomain|mac|ip","time":"yyyymmddhhmmss"}
5, save all above user defining rules
{"op":"save_rule","time":"yyyymmddhhmmss"}
6, get status of router
{"op":"get_status","time":"yyyymmddhhmmss"}
7, reboot device
{"op":"reboot","time":"yyyymmddhhmmss"}
8, reset trusted client
{"op":"reset","type":"ip|mac","value":"client_ip|client_mac","time":"yyyymmddhhmmss"}
9, set auth server
{"op":"set_auth_serv","value":{"hostname":"set_domain","port":"port_num","path":"path_name"},"time":"yyyymmddhhmmss"}
response:
if these request has response, its format:
{"response":"response_code","msg":"return message"}
response_code list
200 Ok
404 the request is not support
403 the request is forbidden
400 the request is bad
500 when execute the request, encounter internal error
for example, set pdomain baidu.com taobao.com qq.com for device 61ACC80118B6
topic
wifidog/61ACC80118B6/request/110
message
{"op":"set_trusted","type":"pdomain","value":"baidu.com,taobao.com,qq.com","time":"20170223113520"}
its ok response should be
topic
wifidog/61ACC80118B6/response/110
message
{"response":"200","op":"set_trusted","type":"pdomain","msg":"ok"}

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/apfree-apfree_wifidog.git
git@api.gitlife.ru:oschina-mirror/apfree-apfree_wifidog.git
oschina-mirror
apfree-apfree_wifidog
apfree-apfree_wifidog
master