Jump to content
C4 Forums | Control4

The Question About TCP Client Server In Control4 API


Recommended Posts

I am trying  to create a client driver to receive message from the remote server. In the control4 sdk api, there is a Lua TCP Client interface, it may be helpful. But I have one question. CreateTCPClient function could create a class worked like a socket. The class has OnRead method as a callback funciton. The question is how do we know the read data  is available? I just can not find the way how the class notifies the driver. Is there anyone can help me? Thank you!  

Link to comment
Share on other sites


Callbacks don't have notifications, they just get called when data is available.

I haven't much used CreateTCPClient, but I believe you would just put in the callback, and your defined OnRead callback would be called when data is ready.

RyanE

 

Link to comment
Share on other sites

  • 5 months later...
On 2017/6/18 at 4:15 AM, RyanE said:

Callbacks don't have notifications, they just get called when data is available.

I haven't much used CreateTCPClient, but I believe you would just put in the callback, and your defined OnRead callback would be called when data is ready.

RyanE

 

Thank you so much. Now I have a new problem.  I plan to write a driver to communicate with my phone. The driver consists of the C library code and lua code.  Everything went well in my own computer before I  run it in the HC-800. When the lua interpreter in C4 requires my C library, it always complains error "undefined symbol: lua_getfield(lua api function)" or other errors like this, which never happens in my computer. I use the same lua5.1.4 in my computer. I have checked all documents about the C4 drivers,  and there is nothing about how to use the c library in the driver. Can you give me any tips?  Thank you!

Link to comment
Share on other sites

Thank you so much. Now I have a new problem.  I plan to write a driver to communicate with my phone. The driver consists of the C library code and lua code.  Everything went well in my own computer before I  run it in the HC-800. When the lua interpreter in C4 requires my C library, it always complains error "undefined symbol: lua_getfield(lua api function)" or other errors like this, which never happens in my computer. I use the same lua5.1.4 in my computer. I have checked all documents about the C4 drivers,  and there is nothing about how to use the c library in the driver. Can you give me any tips?  Thank you!
I believe only control4 can. Not driver devs

Sent from my BBB100-1 using Tapatalk

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.