Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
ALPACA
CASPER
katcp
Commits
b12eb5ee
Commit
b12eb5ee
authored
14 years ago
by
Adam Barta
Browse files
Options
Download
Email Patches
Plain Diff
sensors for roach pool
parent
eafdad11
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
kcs/kcs.h
+2
-0
kcs/kcs.h
kcs/roachpool.c
+5
-1
kcs/roachpool.c
kcs/statemachine.c
+9
-0
kcs/statemachine.c
with
16 additions
and
1 deletion
+16
-1
kcs/kcs.h
+
2
-
0
View file @
b12eb5ee
...
...
@@ -146,6 +146,8 @@ int add_roach_to_pool_kcs(struct katcp_dispatch *d, char *pool, char *url, char
struct
kcs_obj
*
roachpool_get_obj_by_name_kcs
(
struct
katcp_dispatch
*
d
,
char
*
name
);
int
mod_roach_to_new_pool
(
struct
kcs_obj
*
root
,
char
*
pool
,
char
*
hostname
);
int
roachpool_count_kcs
(
struct
katcp_dispatch
*
d
);
int
update_sensor_for_roach_kcs
(
struct
katcp_dispatch
*
d
,
struct
kcs_obj
*
ko
,
int
val
);
int
add_sensor_to_roach_kcs
(
struct
katcp_dispatch
*
d
,
struct
kcs_obj
*
ko
);
#define KCS_SM_PING_STOP 0
#define KCS_SM_PING_S1 1
...
...
This diff is collapsed.
Click to expand it.
kcs/roachpool.c
+
5
-
1
View file @
b12eb5ee
...
...
@@ -210,6 +210,7 @@ int add_new_roach_to_tree(struct kcs_obj *root, char *poolname, char *url, char
int
update_sensor_for_roach_kcs
(
struct
katcp_dispatch
*
d
,
struct
kcs_obj
*
ko
,
int
val
)
{
struct
kcs_roach
*
kr
;
struct
katcp_acquire
*
a
;
if
(
ko
==
NULL
)
return
KATCP_RESULT_FAIL
;
...
...
@@ -222,7 +223,10 @@ int update_sensor_for_roach_kcs( struct katcp_dispatch *d, struct kcs_obj *ko, i
if
(
kr
==
NULL
)
return
KATCP_RESULT_FAIL
;
a
=
kr
->
r_acquire
;
if
(
set_boolean_acquire_katcp
(
d
,
a
,
val
)
<
0
)
return
KATCP_RESULT_FAIL
;
return
KATCP_RESULT_OK
;
}
...
...
This diff is collapsed.
Click to expand it.
kcs/statemachine.c
+
9
-
0
View file @
b12eb5ee
...
...
@@ -267,6 +267,12 @@ int connect_sm_kcs(struct katcp_dispatch *d, struct katcp_notice *n, void *data)
}
log_message_katcp
(
d
,
KATCP_LEVEL_INFO
,
NULL
,
"Success: roach %s moved to pool %s"
,
kr
->
kurl
->
u_str
,
newpool
);
if
(
add_sensor_to_roach_kcs
(
d
,
ko
)
<
0
){
}
update_sensor_for_roach_kcs
(
d
,
ko
,
1
);
p
=
create_parse_katcl
();
if
(
p
==
NULL
){
...
...
@@ -321,6 +327,9 @@ int disconnect_sm_kcs(struct katcp_dispatch *d, struct katcp_notice *n, void *da
else
{
log_message_katcp
(
d
,
KATCP_LEVEL_INFO
,
NULL
,
"Success: roach %s moved to pool %s"
,
kr
->
kurl
->
u_str
,
newpool
);
}
update_sensor_for_roach_kcs
(
d
,
ko
,
0
);
/*if (kr->io_ksm){
destroy_ksm_kcs(kr->io_ksm);
kr->io_ksm = NULL;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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
Menu
Explore
Projects
Groups
Topics
Snippets