CMSV6Help Center
/
839 DOCS · 213 VIDEOS中文

Device LAN search and web parameter configuration

Author 谢周轩Updated 2025-10-14 16:36:26Doc ID 2365372 words · 2 min readView original ↗

1. function description

Device LAN search and web parameter configuration

2. Docking instructions

2.1 bool bInitListen during initialization, unsigned short usListenPort

bInitListen fill in as true
Please fill in the usListenPort as 6688

/**
* @ Description: Start the network module, call this interface, and maintain the communication link with the server
* @ param: szIDNO: device number, if 13510907654, it is recommended that the terminal serial number use the mobile phone number corresponding to the SIM card, with a maximum of 16 digits.
szServerIP server address
usPort Server Port
bInitListen: Real- time monitoring.
usListenPort: Local listening port
bInitLogin: Whether to communicate with server recommendations
bOnlyMedia: whether to run only streaming media, 808 protocol to use
bAuthentication: Indicates whether the authentication mode is enabled. If true, the server will issue an authentication code.
A, after the device DoAuthentication checks the authentication code, if the authentication code does not meet the rules, the server is wrong, and the sdk will interrupt the link.
B, when the test passes, encrypt the authkey and return the data to the server
* @ return: 0 indicates success
* @Author: afu
*/
LIBDVRNET_API int TTXNET_StartWork(const char* szIDNO, const char* szServerIP, unsigned short usPort
, bool bInitListen, unsigned short usListenPort, bool bInitLogin = true, bool bOnlyMedia = false
, bool bAuthentication = false);

2.2 Response DoGetNetParam function, fill usWebPort and szWebUrl parameters

// Obtain network parameters, which are used when searching for devices.
// @ netParam: network parameters
virtual bool DoGetNetParam(TTXNetParam_S& netParam) { return false;}

// Network parameters
typedef struct _tagTTXNetParam_S
{
unsigned char cMac[6]; // MAC address
unsigned char cLanIP[4]; // LAN address
unsigned char cLanMask[4]; // subnet mask
unsigned char cLanGateway[4]; // Gateway address
int bAutoLogin; // Automatic login
char szServerIP[64]; // server address
unsigned short usServerPort; // server port
unsigned short usConnType; // Connection type, temporarily invalid
unsigned short usWebPort;
unsigned short usReserve; // parameter reserved
char szWebUrl[128]; // ip:port/szWebUrl
} TTXNetParam_S, * LPTTXNetParam_S;

usWebPort: web port
szWebUrl: return the url address
Example: usWebPort = 6066,szWebUrl = "808gps/login.html", the browser will directly access http:// ip:6066/808gps/login.html when returning
The ip uses the address of the other network in the data packet when searching.

2.3 real- time video, the device does not need to do additional work

Source help.cmsv7.com
839 documents · 213 videos · docs.alwaycare.com