tencent cloud

All product documents
Control data transfer
Last updated: 2025-02-11 16:46:49
Control data transfer
Last updated: 2025-02-11 16:46:49
Note:
Control data transfer, used for binary data communication between the field device and the remote device. The SDK provides a data sending interface and a data receiving callback interface for both types of devices.
Note:
Field device SDK, the data sending interface will send data in a broadcast manner to all remote devices that are in a session connection with the field device.
Remote Device SDK, the data sending interface can send data to the specified field device within the session connection. Only when the remote device has master permission of the field device, the message can be successfully sent.

Field Device

Send data to remote devices

Note:
This interface will send data messages to all remote devices that are in session connection with the field device. The single message length limit is 700 bytes, and the sending frequency is limited to 100Hz.
extern "C" TRRO_EXPORT int TRRO_sendControlData(const char* msg, int len, int qos = 0);
Parameter
Meaning
msg
Message content
len
Message length
qos
Send qos type.
0: ultra-low latency transmission, data lost is allowed
1: Reliable Transmission
Returned values
Success: 1
Failed: <= 0

Register control message callback

extern "C" TRRO_EXPORT int TRRO_registerReportDataCallback(void* context, TRRO_onReportData * callback);
Parameter
Meaning
context
Callback Context
TRRO_onControlData
Callback Function

typedef void TRRO_onReportData(void* context, const char* gwid, const char* msg, int len, int qos)
Parameter
Meaning
context
Callback Context
gwid
Field Device ID
msg
pointer to the data buffer
len
String Length
qos
Message qos type:
0: ultra-low latency transmission, data lost is allowed
1: Reliable Transmission

Remote Device

Send data to field device

This interface will send data messages to the specified field device in the session connection. Sending will succeed only if the remote device has the master permission of the field device. The single message length limit is 700 bytes, and the sending frequency is limited to 100Hz.
extern "C" TRRO_EXPORT int TRRO_sendControlData(const char* gwid, const char* msg, int len, int qos = 0);
Parameter
Meaning
gwid
On-site Equipment ID
msg
Send binary data
len
Message length
qos
Send qos:
0: ultra-low latency transmission, data lost is allowed
1: Reliable Transmission
Returned values
Success: 1
Failed: <= 0

Register control message callback

This interface is used to register the report data callback function to receive the data sent by the field device.
extern "C" TRRO_EXPORT int TRRO_registerReportDataCallback(void* context, TRRO_onReportData * callback);
Parameter
Meaning
context
Context Pointer
callback
Callback Function

typedef void TRRO_onReportData(void* context, const char* gwid, const char* msg, int len, int qos)
Parameter
Meaning
context
Callback Context
gwid
Field Device ID
msg
pointer to the data buffer
len
String Length
qos
Message qos type.
0: ultra-low latency transmission, data lost is allowed
1: Reliable Transmission

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon