Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
5d392056
Commit
5d392056
authored
Apr 12, 2006
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
parent
873a860c
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
220 additions
and
89 deletions
+220
-89
ssabox/lib/rt/src/os_linux/rt_io_m_ai_ai32up.c
ssabox/lib/rt/src/os_linux/rt_io_m_ai_ai32up.c
+3
-6
ssabox/lib/rt/src/os_linux/rt_io_m_ai_hvai32.c
ssabox/lib/rt/src/os_linux/rt_io_m_ai_hvai32.c
+2
-6
ssabox/lib/rt/src/os_linux/rt_io_m_ao_hvao4.c
ssabox/lib/rt/src/os_linux/rt_io_m_ao_hvao4.c
+2
-6
ssabox/lib/rt/src/os_linux/rt_io_m_co_pi24bo.c
ssabox/lib/rt/src/os_linux/rt_io_m_co_pi24bo.c
+2
-6
ssabox/lib/rt/src/os_linux/rt_io_m_di_dix2.c
ssabox/lib/rt/src/os_linux/rt_io_m_di_dix2.c
+25
-12
ssabox/lib/rt/src/os_linux/rt_io_m_do_hvdo32.c
ssabox/lib/rt/src/os_linux/rt_io_m_do_hvdo32.c
+2
-6
ssabox/lib/rt/src/os_linux/rt_io_m_rack_ssab.c
ssabox/lib/rt/src/os_linux/rt_io_m_rack_ssab.c
+2
-6
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_aiup.c
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_aiup.c
+2
-6
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_aoup.c
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_aoup.c
+2
-6
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_co.c
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_co.c
+2
-6
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_di.c
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_di.c
+2
-5
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_do.c
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_do.c
+2
-6
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_locals.h
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_locals.h
+21
-0
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_remoterack.c
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_remoterack.c
+151
-12
No files found.
ssabox/lib/rt/src/os_linux/rt_io_m_ai_ai32up.c
View file @
5d392056
/*
* Proview $Id: rt_io_m_ai_ai32up.c,v 1.
1 2005-12-30 15:52:05
claes Exp $
* Proview $Id: rt_io_m_ai_ai32up.c,v 1.
2 2006-04-12 10:14:49
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -43,6 +43,8 @@
#include "rt_io_card_close.h"
#include "rt_io_card_read.h"
#include "qbus_io.h"
#include "rt_io_m_ssab_locals.h"
/*----------------------------------------------------------------------------*\
...
...
@@ -57,11 +59,6 @@ typedef struct {
int
ScanCount
[
IO_MAXCHAN
];
}
io_sLocal
;
typedef
struct
{
int
Qbus_fp
;
}
io_sRackLocal
;
static
pwr_tStatus
AiRangeToCoef
(
io_sChannel
*
chanp
)
{
...
...
ssabox/lib/rt/src/os_linux/rt_io_m_ai_hvai32.c
View file @
5d392056
/*
* Proview $Id: rt_io_m_ai_hvai32.c,v 1.
1 2005-12-30 15:52:05
claes Exp $
* Proview $Id: rt_io_m_ai_hvai32.c,v 1.
2 2006-04-12 10:14:49
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -42,6 +42,7 @@
#include "rt_io_card_close.h"
#include "rt_io_card_read.h"
#include "qbus_io.h"
#include "rt_io_m_ssab_locals.h"
/*----------------------------------------------------------------------------*\
...
...
@@ -59,11 +60,6 @@ typedef struct {
int
ScanCount
[
IO_MAXCHAN
];
}
io_sLocal
;
typedef
struct
{
int
Qbus_fp
;
}
io_sRackLocal
;
static
pwr_tStatus
AiRangeToCoef
(
io_sChannel
*
chanp
)
{
...
...
ssabox/lib/rt/src/os_linux/rt_io_m_ao_hvao4.c
View file @
5d392056
/*
* Proview $Id: rt_io_m_ao_hvao4.c,v 1.
1 2005-12-30 15:52:05
claes Exp $
* Proview $Id: rt_io_m_ao_hvao4.c,v 1.
2 2006-04-12 10:14:49
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -43,6 +43,7 @@
#include "rt_io_card_close.h"
#include "rt_io_card_write.h"
#include "qbus_io.h"
#include "rt_io_m_ssab_locals.h"
/*----------------------------------------------------------------------------*\
...
...
@@ -59,11 +60,6 @@ typedef struct {
int
WriteFirst
;
}
io_sLocal
;
typedef
struct
{
int
Qbus_fp
;
}
io_sRackLocal
;
static
pwr_tStatus
AoRangeToCoef
(
io_sChannel
*
chanp
)
{
...
...
ssabox/lib/rt/src/os_linux/rt_io_m_co_pi24bo.c
View file @
5d392056
/*
* Proview $Id: rt_io_m_co_pi24bo.c,v 1.
1 2005-12-30 15:52:05
claes Exp $
* Proview $Id: rt_io_m_co_pi24bo.c,v 1.
2 2006-04-12 10:14:49
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -40,6 +40,7 @@
#include "rt_io_card_close.h"
#include "rt_io_card_read.h"
#include "qbus_io.h"
#include "rt_io_m_ssab_locals.h"
#define IO_MAXCHAN 4
#define MIN16 -32767
...
...
@@ -61,11 +62,6 @@ typedef struct {
int
FirstScan
[
IO_MAXCHAN
];
}
io_sLocal
;
typedef
struct
{
int
Qbus_fp
;
}
io_sRackLocal
;
static
pwr_tStatus
IoCardInit
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
...
...
ssabox/lib/rt/src/os_linux/rt_io_m_di_dix2.c
View file @
5d392056
/*
* Proview $Id: rt_io_m_di_dix2.c,v 1.
1 2005-12-30 15:52:05
claes Exp $
* Proview $Id: rt_io_m_di_dix2.c,v 1.
2 2006-04-12 10:14:49
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -41,6 +41,7 @@
#include "rt_io_card_close.h"
#include "rt_io_card_read.h"
#include "qbus_io.h"
#include "rt_io_m_ssab_locals.h"
/*----------------------------------------------------------------------------*\
...
...
@@ -57,10 +58,6 @@ typedef struct {
}
Filter
[
2
];
}
io_sLocal
;
typedef
struct
{
int
Qbus_fp
;
}
io_sRackLocal
;
static
pwr_tStatus
IoCardInit
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
...
...
@@ -71,6 +68,7 @@ static pwr_tStatus IoCardInit (
pwr_sClass_Di_DIX2
*
op
;
io_sLocal
*
local
;
int
i
,
j
;
io_sRackLocal
*
r_local
=
(
io_sRackLocal
*
)(
rp
->
Local
);
op
=
(
pwr_sClass_Di_DIX2
*
)
cp
->
op
;
local
=
calloc
(
1
,
sizeof
(
*
local
));
...
...
@@ -80,7 +78,13 @@ static pwr_tStatus IoCardInit (
local
->
Address
[
0
]
=
op
->
RegAddress
;
local
->
Address
[
1
]
=
op
->
RegAddress
+
2
;
local
->
Qbus_fp
=
((
io_sRackLocal
*
)(
rp
->
Local
))
->
Qbus_fp
;
local
->
Qbus_fp
=
r_local
->
Qbus_fp
;
/* Set card address in racks local */
r_local
->
in
.
item
[
cp
->
offset
].
address
=
(
pwr_tUInt16
)
(
op
->
RegAddress
&
0xFFFF
);
r_local
->
in
.
item
[
cp
->
offset
+
1
].
address
=
(
pwr_tUInt16
)
((
op
->
RegAddress
+
2
)
&
0xFFFF
);
r_local
->
in
.
item
[
cp
->
offset
].
data
=
0
;
r_local
->
in
.
item
[
cp
->
offset
+
1
].
data
=
0
;
/* Init filter */
for
(
i
=
0
;
i
<
2
;
i
++
)
...
...
@@ -135,7 +139,8 @@ static pwr_tStatus IoCardRead (
io_sCard
*
cp
)
{
io_sLocal
*
local
;
io_sLocal
*
local
=
(
io_sLocal
*
)
cp
->
Local
;
io_sRackLocal
*
r_local
=
(
io_sRackLocal
*
)(
rp
->
Local
);
pwr_tUInt16
data
=
0
;
pwr_sClass_Di_DIX2
*
op
;
pwr_tUInt16
invmask
;
...
...
@@ -144,7 +149,6 @@ static pwr_tStatus IoCardRead (
int
sts
;
qbus_io_read
rb
;
local
=
(
io_sLocal
*
)
cp
->
Local
;
op
=
(
pwr_sClass_Di_DIX2
*
)
cp
->
op
;
for
(
i
=
0
;
i
<
2
;
i
++
)
...
...
@@ -164,10 +168,19 @@ static pwr_tStatus IoCardRead (
break
;
}
rb
.
Address
=
local
->
Address
[
i
];
sts
=
read
(
local
->
Qbus_fp
,
&
rb
,
sizeof
(
rb
));
data
=
(
unsigned
short
)
rb
.
Data
;
if
(
sts
==
-
1
)
if
(
r_local
->
Qbus_fp
!=
0
&&
r_local
->
s
==
0
)
{
/* Read from local Q-bus */
rb
.
Address
=
local
->
Address
[
i
];
sts
=
read
(
local
->
Qbus_fp
,
&
rb
,
sizeof
(
rb
));
data
=
(
unsigned
short
)
rb
.
Data
;
}
else
{
/* Read from remote Q-bus, I/O-area stored in rack's local */
data
=
r_local
->
in
.
item
[
cp
->
offset
+
i
].
data
;
sts
=
1
;
}
if
(
sts
<=
0
)
{
/* Increase error count and check error limits */
op
->
ErrorCount
++
;
...
...
ssabox/lib/rt/src/os_linux/rt_io_m_do_hvdo32.c
View file @
5d392056
/*
* Proview $Id: rt_io_m_do_hvdo32.c,v 1.
1 2005-12-30 15:52:05
claes Exp $
* Proview $Id: rt_io_m_do_hvdo32.c,v 1.
2 2006-04-12 10:14:49
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -41,6 +41,7 @@
#include "rt_io_card_close.h"
#include "rt_io_card_write.h"
#include "qbus_io.h"
#include "rt_io_m_ssab_locals.h"
/*----------------------------------------------------------------------------*\
...
...
@@ -57,11 +58,6 @@ typedef struct {
}
Filter
[
2
];
}
io_sLocal
;
typedef
struct
{
int
Qbus_fp
;
}
io_sRackLocal
;
static
pwr_tStatus
IoCardInit
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
...
...
ssabox/lib/rt/src/os_linux/rt_io_m_rack_ssab.c
View file @
5d392056
/*
* Proview $Id: rt_io_m_rack_ssab.c,v 1.
1 2005-12-30 15:52:05
claes Exp $
* Proview $Id: rt_io_m_rack_ssab.c,v 1.
2 2006-04-12 10:14:49
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -32,13 +32,9 @@
#include "rt_io_base.h"
#include "rt_errh.h"
#include "rt_io_rack_init.h"
#include "rt_io_m_ssab_locals.h"
#include "rt_io_msg.h"
typedef
struct
{
int
Qbus_fp
;
}
io_sRackLocal
;
/*----------------------------------------------------------------------------*\
...
...
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_aiup.c
View file @
5d392056
/*
* Proview $Id: rt_io_m_ssab_aiup.c,v 1.
1 2005-12-30 15:52:05
claes Exp $
* Proview $Id: rt_io_m_ssab_aiup.c,v 1.
2 2006-04-12 10:14:49
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -41,6 +41,7 @@
#include "rt_io_card_close.h"
#include "rt_io_card_read.h"
#include "qbus_io.h"
#include "rt_io_m_ssab_locals.h"
/*----------------------------------------------------------------------------*\
...
...
@@ -55,11 +56,6 @@ typedef struct {
int
ScanCount
[
IO_MAXCHAN
];
}
io_sLocal
;
typedef
struct
{
int
Qbus_fp
;
}
io_sRackLocal
;
static
pwr_tStatus
AiRangeToCoef
(
io_sChannel
*
chanp
)
{
...
...
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_aoup.c
View file @
5d392056
/*
* Proview $Id: rt_io_m_ssab_aoup.c,v 1.
1 2005-12-30 15:52:05
claes Exp $
* Proview $Id: rt_io_m_ssab_aoup.c,v 1.
2 2006-04-12 10:14:49
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -41,6 +41,7 @@
#include "rt_io_card_close.h"
#include "rt_io_card_write.h"
#include "qbus_io.h"
#include "rt_io_m_ssab_locals.h"
/*----------------------------------------------------------------------------*\
...
...
@@ -57,11 +58,6 @@ typedef struct {
int
WriteFirst
;
}
io_sLocal
;
typedef
struct
{
int
Qbus_fp
;
}
io_sRackLocal
;
static
pwr_tStatus
AoRangeToCoef
(
io_sChannel
*
chanp
)
{
...
...
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_co.c
View file @
5d392056
/*
* Proview $Id: rt_io_m_ssab_co.c,v 1.
1 2005-12-30 15:52:05
claes Exp $
* Proview $Id: rt_io_m_ssab_co.c,v 1.
2 2006-04-12 10:14:49
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -38,6 +38,7 @@
#include "rt_io_card_close.h"
#include "rt_io_card_read.h"
#include "qbus_io.h"
#include "rt_io_m_ssab_locals.h"
#define IO_MAXCHAN 4
#define MIN16 -32767
...
...
@@ -59,11 +60,6 @@ typedef struct {
int
FirstScan
[
IO_MAXCHAN
];
}
io_sLocal
;
typedef
struct
{
int
Qbus_fp
;
}
io_sRackLocal
;
static
pwr_tStatus
IoCardInit
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
...
...
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_di.c
View file @
5d392056
/*
* Proview $Id: rt_io_m_ssab_di.c,v 1.
1 2005-12-30 15:52:05
claes Exp $
* Proview $Id: rt_io_m_ssab_di.c,v 1.
2 2006-04-12 10:14:49
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -41,6 +41,7 @@
#include "rt_io_card_close.h"
#include "rt_io_card_read.h"
#include "qbus_io.h"
#include "rt_io_m_ssab_locals.h"
/*----------------------------------------------------------------------------*\
...
...
@@ -57,10 +58,6 @@ typedef struct {
}
Filter
[
2
];
}
io_sLocal
;
typedef
struct
{
int
Qbus_fp
;
}
io_sRackLocal
;
static
pwr_tStatus
IoCardInit
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
...
...
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_do.c
View file @
5d392056
/*
* Proview $Id: rt_io_m_ssab_do.c,v 1.
1 2005-12-30 15:52:05
claes Exp $
* Proview $Id: rt_io_m_ssab_do.c,v 1.
2 2006-04-12 10:14:49
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -41,6 +41,7 @@
#include "rt_io_card_close.h"
#include "rt_io_card_write.h"
#include "qbus_io.h"
#include "rt_io_m_ssab_locals.h"
/*----------------------------------------------------------------------------*\
...
...
@@ -57,11 +58,6 @@ typedef struct {
}
Filter
[
2
];
}
io_sLocal
;
typedef
struct
{
int
Qbus_fp
;
}
io_sRackLocal
;
static
pwr_tStatus
IoCardInit
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
...
...
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_locals.h
0 → 100644
View file @
5d392056
struct
bfb_item
{
pwr_tUInt16
address
;
pwr_tUInt16
data
;
};
struct
bfb_buf
{
pwr_tUInt16
service
;
pwr_tUInt16
length
;
struct
bfb_item
item
[
64
];
};
typedef
struct
{
int
Qbus_fp
;
/* File pointer for local qbus device */
int
s
;
/* Socket for remote qbus node */
struct
sockaddr_in
my_addr
;
struct
sockaddr_in
rem_addr
;
struct
bfb_buf
in
;
/* Data area for remote qbus node */
struct
bfb_buf
out
;
/* -"- */
int
in_items
;
int
out_items
;
}
io_sRackLocal
;
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_remoterack.c
View file @
5d392056
/*
* Proview $Id: rt_io_m_ssab_remoterack.c,v 1.
1 2006-02-10 14:32:36
claes Exp $
* Proview $Id: rt_io_m_ssab_remoterack.c,v 1.
2 2006-04-12 10:14:49
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -23,7 +23,9 @@
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include "pwr.h"
#include "pwr_baseclasses.h"
...
...
@@ -32,13 +34,9 @@
#include "rt_io_base.h"
#include "rt_errh.h"
#include "rt_io_rack_init.h"
#include "rt_io_m_ssab_locals.h"
#include "rt_io_msg.h"
typedef
struct
{
int
xxx
;
}
io_sRackLocal
;
/*----------------------------------------------------------------------------*\
...
...
@@ -50,8 +48,109 @@ static pwr_tStatus IoRackInit (
io_sRack
*
rp
)
{
errh_Info
(
"Init of IO remote rack %s"
,
rp
->
Name
);
return
1
;
io_sRackLocal
*
local
;
io_sCard
*
cardp
;
pwr_tCid
cid
;
pwr_sClass_Ssab_RemoteRack
*
op
;
int
sts
,
in_offset
,
out_offset
;
pwr_sClass_Di_DIX2
*
dicp
;
pwr_sClass_Do_HVDO32
*
docp
;
pwr_sClass_Ai_AI32uP
*
aicp
;
pwr_sClass_Co_PI24BO
*
cocp
;
op
=
(
pwr_sClass_Ssab_RemoteRack
*
)
rp
->
op
;
local
=
calloc
(
1
,
sizeof
(
*
local
));
rp
->
Local
=
local
;
/* Create socket, store in local struct */
local
->
s
=
socket
(
AF_INET
,
SOCK_DGRAM
,
0
);
if
(
local
->
s
<
0
)
{
errh_Error
(
"Error creating socket for IO remote rack %s, %d"
,
rp
->
Name
,
local
->
s
);
op
->
Status
=
IO__INITFAIL
;
return
IO__ERRINIDEVICE
;
}
/* Set local port same as remote port and bind the created socket */
local
->
my_addr
.
sin_family
=
AF_INET
;
local
->
my_addr
.
sin_port
=
htons
(
op
->
Port
);
sts
=
bind
(
local
->
s
,
(
struct
sockaddr
*
)
&
local
->
my_addr
,
sizeof
(
local
->
my_addr
));
if
(
sts
!=
0
)
{
errh_Error
(
"Error binding local socket for IO remote rack %s, %d"
,
rp
->
Name
,
sts
);
op
->
Status
=
IO__INITFAIL
;
return
IO__ERRINIDEVICE
;
}
/* Initialize remote address structure */
local
->
rem_addr
.
sin_family
=
AF_INET
;
local
->
rem_addr
.
sin_port
=
htons
(
op
->
Port
);
local
->
rem_addr
.
sin_addr
.
s_addr
=
inet_addr
((
char
*
)
&
(
op
->
Address
));
/* Connect to remote address */
sts
=
connect
(
local
->
s
,
(
struct
sockaddr
*
)
&
local
->
rem_addr
,
sizeof
(
local
->
rem_addr
));
if
(
sts
!=
0
)
{
errh_Error
(
"Error binding remote socket for IO remote rack %s, %d"
,
rp
->
Name
,
sts
);
op
->
Status
=
IO__INITFAIL
;
return
IO__ERRINIDEVICE
;
}
/* Loop all cards */
cardp
=
rp
->
cardlist
;
in_offset
=
0
;
out_offset
=
0
;
local
->
in_items
=
0
;
local
->
out_items
=
0
;
while
(
cardp
)
{
cid
=
cardp
->
Class
;
switch
(
cid
)
{
case
pwr_cClass_Di_DIX2
:
dicp
=
(
pwr_sClass_Di_DIX2
*
)
cardp
->
op
;
cardp
->
offset
=
in_offset
;
in_offset
+=
2
;
printf
(
"Di card found, address: %d
\n
"
,
dicp
->
RegAddress
);
break
;
case
pwr_cClass_Do_HVDO32
:
docp
=
(
pwr_sClass_Do_HVDO32
*
)
cardp
->
op
;
printf
(
"Do card found, address: %d
\n
"
,
docp
->
RegAddress
);
cardp
->
offset
=
out_offset
;
out_offset
+=
2
;
break
;
case
pwr_cClass_Ai_AI32uP
:
aicp
=
(
pwr_sClass_Ai_AI32uP
*
)
cardp
->
op
;
printf
(
"Ai card found, address: %d
\n
"
,
aicp
->
RegAddress
);
break
;
case
pwr_cClass_Co_PI24BO
:
cocp
=
(
pwr_sClass_Co_PI24BO
*
)
cardp
->
op
;
printf
(
"Co card found, address: %d
\n
"
,
cocp
->
RegAddress
);
break
;
}
cardp
=
cardp
->
next
;
}
local
->
in_items
=
in_offset
;
local
->
out_items
=
out_offset
;
local
->
in
.
service
=
1
;
local
->
in
.
length
=
local
->
in_items
*
4
+
4
;
op
->
RX_packets
=
0
;
op
->
TX_packets
=
0
;
/* Log initialization */
errh_Info
(
"Init of IO remote rack %s, %d/%s:%d"
,
rp
->
Name
,
ntohs
(
local
->
my_addr
.
sin_port
),
inet_ntoa
(
local
->
rem_addr
.
sin_addr
),
ntohs
(
local
->
rem_addr
.
sin_port
));
op
->
Status
=
IO__NORMAL
;
return
IO__SUCCESS
;
}
static
pwr_tStatus
IoRackClose
(
...
...
@@ -60,7 +159,8 @@ static pwr_tStatus IoRackClose (
io_sRack
*
rp
)
{
return
1
;
if
(
rp
->
Local
)
free
(
rp
->
Local
);
return
IO__SUCCESS
;
}
static
pwr_tStatus
IoRackRead
(
...
...
@@ -69,7 +169,26 @@ static pwr_tStatus IoRackRead (
io_sRack
*
rp
)
{
return
1
;
int
sts
;
fd_set
fds
;
struct
timeval
tv
;
io_sRackLocal
*
local
=
(
io_sRackLocal
*
)
rp
->
Local
;
pwr_sClass_Ssab_RemoteRack
*
op
=
(
pwr_sClass_Ssab_RemoteRack
*
)
rp
->
op
;
sts
=
1
;
while
(
sts
>
0
)
{
FD_ZERO
(
&
fds
);
FD_SET
(
local
->
s
,
&
fds
);
tv
.
tv_sec
=
0
;
tv
.
tv_usec
=
0
;
sts
=
select
(
32
,
&
fds
,
NULL
,
NULL
,
&
tv
);
if
(
sts
>
0
)
{
recv
(
local
->
s
,
&
local
->
in
,
sizeof
(
local
->
in
),
0
);
op
->
RX_packets
++
;
}
}
return
IO__SUCCESS
;
}
static
pwr_tStatus
IoRackWrite
(
...
...
@@ -78,7 +197,27 @@ static pwr_tStatus IoRackWrite (
io_sRack
*
rp
)
{
return
1
;
int
sts
;
io_sRackLocal
*
local
=
(
io_sRackLocal
*
)
rp
->
Local
;
pwr_sClass_Ssab_RemoteRack
*
op
=
(
pwr_sClass_Ssab_RemoteRack
*
)
rp
->
op
;
// Send write request
local
->
out
.
service
=
2
;
local
->
out
.
length
=
8
;
local
->
out
.
item
[
0
].
address
=
64512
;
local
->
out
.
item
[
0
].
data
=
0xffff
;
sts
=
send
(
local
->
s
,
&
local
->
out
,
local
->
out
.
length
,
0
);
op
->
TX_packets
++
;
// Send read request
sts
=
send
(
local
->
s
,
&
local
->
in
,
local
->
in
.
length
,
0
);
op
->
TX_packets
++
;
return
IO__SUCCESS
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment