Main program files:
- FormLog.cs : main form used for connecting, login and parsing telnet replies.
- FormDisplay.cs : form containing speed chart.
- FormOptions.cs : form used to change options.
- Tools directory : Tool classes (common to different projects).
How it works ?
This application open a telnet session to your ethernet modem, and then send the command "ip iflist" to the modem.
This command gives some informations for all modem interfaces.
=>ip iflist
Interface GRP MTU RX TX TX-DROP STATUS HWADDR
0 loop 1 1500 0 0 0 [UP]
1 eth0 2 1500 751823312 1224705594 0 [UP] 00:0e:50:54:da:c0
2 ETHoA_1 0 1500 0 0 0 [UP] 00:0e:50:54:da:c0
3 PPPoE_1 0 1492 1223685433 747353582 0 [UP]
=>
As you can see we can get RX and TX (number of incoming and outgoing bits transfered).
We parse this reply to extract RX and TX value corresponding to the wanted interface.
Next to get speed, we just need to send "ip filist" command in a timer, and we make the substraction between current RX/TX and previous RX/TX (retreived with the previous "ip iflist" sent).
What should be modify to work with other modem than Alcatel Speed Touch ?
As we just use a telnet connection, only command and reply parsing needs to be changed.
Default commands are defined in the ClassOptions.cs, so you just need to change there 'constant' name.
So only reply parsing code may needs to be changed. This code is located in the function called "parse_speed". |