Response from command

Prugala 25 days ago

Hi,

I am looking for a solution but cannot find one. Is there a way to get a response from a command? It could be handled as an event.

What I want to achieve:
My device has a command SHMAC# which returns a list of Wi-Fi networks, for example:

WIFI1:YFEC:60:73:0F:78:02;
WIFI2:HYS,62:77:3B:B4:16:C8;
WIFI3:HYS_5,62:77:3B:B4:16:BA;
WIFI4:TP-LINK_A1AD,88:25:93:95:A1:AD;
WIFI5:lynkworld888,74:05:A5:F2:50:18;
WIFI6:JTF-1000M888,22:9B:79:B8:A2:C6;
WIFI7:JTF-1000M,22:9B:79:B8:A2:D4;
WIFI8:Wi-Fi5,9C:9D:7E:F4:F7:D2;
WIFI9:test123,98:97:CC:3F:94:AC;
WIFI10:PDA_CPL,65:55:82:42:41

When I send the command, I want to receive this response. Since I am using Kafka, receiving it as an event would be ideal.

Anton Tananaev 24 days ago

You need to add support to the decoder.

Prugala 24 days ago

Yes I know that out of the box my response will not be supported and I have to add support. But how to get response in event later? Should I create custom event adding support in decoder directly?

Anton Tananaev 24 days ago

You just decode it as the "result" attribute and the rest will be handled automatically. See existing usage.

Prugala 23 days ago

I've added support to the decoder and works well. Thank you.