www.purelink.de
20
Get IP Address
Function Description:
Command
Byte
Name
Value
Comment
0
Command Length
0x0a
1
Check Code 1
0x4d
2
Check Code 2
0x41
3
Check Code 3
0x52
4
Check Code 4
0x44
5
Check Code 5
0x43
6
Check Code 6
0x48
7
Check Code 7
0xff
8
Command ID
0x31
0x31:get IP address
0x33:get MASK address
0x35:get GATEWAY address
0x37:get DNS1 address
0x39:get DNS2 address
9
Check Sum
0xe9
BYTE CheckSum = 0;
for(int i =0; i<n; i++ )
Ch= Byte(i);
Acknowledgement character
0
ACK/NACK
0xaa/0x55
ACK: 0xaa
Command Value is right
NACK: 0x55
Command Value is error.
Receive
0
Receive Length
0x06
1
Receive Parameter 1
0xff
For example:192.168.1.1
Address 1(192)
2
Receive Parameter 2
0xff
Address 2(168)
3
Receive Parameter 3
0xff
Address 3(1)
4
Receive Parameter 4
0xff
Address 4(1)
5
Check Sum
BYTE CheckSum = 0;
for(int i =0; i<n; i++ )
Ch= Byte(i);
Example
Command: 0x0a 0x4d 0x41 0x52 0x44 0x43 0x48 0xff 0x31 0xe9