Prosba o dokumentacje + inne sprawy

magx2
Posts: 417
Joined: Wed May 17, 2017 1:27 pm
Has thanked: 1 time
Been thanked: 1 time

Post

Jak dostałem call_type 65 (SUPLA_DS_CALL_REGISTER_DEVICE_B) to skąd mam wiedzieć co znajduje się w polu data? Jak to odczytać?
Supla ❤️ Open HAB - https://github.com/magx2/openhab-supla
User avatar
pzygmunt
Posts: 20302
Joined: Tue Jan 19, 2016 9:26 am
Location: Paczków
Been thanked: 59 times

Post

Rzutujesz data na TDS_SuplaRegisterDevice_B
sprawdzasz data_size czy ma odpiwiednią wielkość i po rzutowaniu zabezpieczasz przed buffer overflow.

Zerknij do srpc.h
SUPLA.... Nareszcie w domu.
magx2
Posts: 417
Joined: Wed May 17, 2017 1:27 pm
Has thanked: 1 time
Been thanked: 1 time

Post

W jakim kodowaniu jest GUID https://github.com/SUPLA/supla-core/blo ... oto.h#L359?

Cały czas próbuję go sparsować i dostaję bzdury (cała reszta pół typu String parsuje się OK)
Supla ❤️ Open HAB - https://github.com/magx2/openhab-supla
User avatar
pzygmunt
Posts: 20302
Joined: Tue Jan 19, 2016 9:26 am
Location: Paczków
Been thanked: 59 times

Post

https://github.com/SUPLA/supla-core/blo ... on/tools.c

st_guid2hex


To jest random z offsetem czasowym
SUPLA.... Nareszcie w domu.
magx2
Posts: 417
Joined: Wed May 17, 2017 1:27 pm
Has thanked: 1 time
Been thanked: 1 time

Post

Nadal nie rozumiem. GUID to tablica uchar o długości 16. uchar to po prostu wartość [0-255]. Teraz jak tego chara zamienić na literę/liczbę? ASCII? Interesuje mnie to w kontekście TDS_SuplaRegisterDevice_B/C
Supla ❤️ Open HAB - https://github.com/magx2/openhab-supla
User avatar
pzygmunt
Posts: 20302
Joined: Tue Jan 19, 2016 9:26 am
Location: Paczków
Been thanked: 59 times

Post

st_guid2hex

Konwerujesz do hex-a
SUPLA.... Nareszcie w domu.
magx2
Posts: 417
Joined: Wed May 17, 2017 1:27 pm
Has thanked: 1 time
Been thanked: 1 time

Post

A już kapuję, dzięki :)
Supla ❤️ Open HAB - https://github.com/magx2/openhab-supla
magx2
Posts: 417
Joined: Wed May 17, 2017 1:27 pm
Has thanked: 1 time
Been thanked: 1 time

Post

Czy jeżeli serwer odpowiada na żądanie klienta to rrId musi być takie samo jak to, które wysłał klient?
Supla ❤️ Open HAB - https://github.com/magx2/openhab-supla
User avatar
pzygmunt
Posts: 20302
Joined: Tue Jan 19, 2016 9:26 am
Location: Paczków
Been thanked: 59 times

Post

rr_id to w tej chwili zawsze numer kolejny. rr_id zapytania nie musi być zgodne z rr_id odpowiedzi
SUPLA.... Nareszcie w domu.
magx2
Posts: 417
Joined: Wed May 17, 2017 1:27 pm
Has thanked: 1 time
Been thanked: 1 time

Post

Pierwsza wersja opisu protokołu - https://github.com/SUPLA/supla-core/pull/32

Co o tym sądzisz?
Supla ❤️ Open HAB - https://github.com/magx2/openhab-supla

Return to “Zagadnienia ogólne”