Rev 1035 | Rev 1305 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1035 | Rev 1080 | ||
|---|---|---|---|
| Line 272... | Line 272... | ||
| 272 | 272 | ||
| 273 | $udpCsocket = IO::Socket::INET->new(PeerPort => $udpport, Proto => 'udp', PeerAddr => $udpip) |
273 | $udpCsocket = IO::Socket::INET->new(PeerPort => $udpport, Proto => 'udp', PeerAddr => $udpip) |
| 274 | or die "socket: $@"; |
274 | or die "socket: $@"; |
| 275 | 275 | ||
| 276 | #här ska keep-alive/start-paket skickas till ipt enligt commandline-arg |
276 | #här ska keep-alive/start-paket skickas till ipt enligt commandline-arg |
| - | 277 | #just nu skickas bara ett initialiseringspaket |
|
| - | 278 | my $retstring; |
|
| - | 279 | &stringToc2s("PKT 00000000 1 0", $retstring); |
|
| - | 280 | if ($retstring) { |
|
| - | 281 | ### Send data ### |
|
| - | 282 | if (length($hardwareSendFunction) > 0) { |
|
| - | 283 | &{$hardwareSendFunction}($retstring); |
|
| - | 284 | } |
|
| - | 285 | } |
|
| 277 | 286 | ||
| 278 | ### create a connection between the hardware and the tcp-server ### |
287 | ### create a connection between the hardware and the tcp-server ### |
| 279 | &hardwareConnInit; |
288 | &hardwareConnInit; |
| 280 | $hardwareSendFunction = "udpServerSend"; ### set up callback for a 'send data' function |
289 | $hardwareSendFunction = "udpServerSend"; ### set up callback for a 'send data' function |
| 281 | $thr = threads->new(\&hardwareConnThread); |
290 | $thr = threads->new(\&hardwareConnThread); |